:root {
  --bg: #f7f9fc;
  --bg-soft: #eef2f8;
  --card: #ffffff;
  --card-border: #c5ced9;
  --accent: #0a6e63;
  --accent-2: #1f4fc4;
  --danger: #c8233f;
  --warn: #946200;
  --good: #157a45;
  --text: #1a2233;
  --text-dim: #3d4a5c;
  --radius: 18px;
  --bottom-nav-h: 72px;
  --touch-min: 52px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 118%;
}

html[data-font-size="normal"] {
  font-size: 100%;
}

html[data-font-size="large"] {
  font-size: 118%;
}

html[data-font-size="xlarge"] {
  font-size: 135%;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  letter-spacing: 0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

/* ---------- ACCESSIBILITY BAR (COLLAPSIBLE) ---------- */
.access-bar {
  overflow: hidden;
  max-height: 0;
  padding: 0 5%;
  opacity: 0;
  transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.35s ease;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--text-dim);
}

.access-bar.open {
  max-height: 120px;
  padding: 10px 5%;
  opacity: 1;
}

.access-btn {
  border: 2px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  min-width: 48px;
  min-height: 44px;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
}

.access-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---------- TOP NAV (DESKTOP) ---------- */
header.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 5%;
  background: rgba(247, 249, 252, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: clamp(1.1rem, 4vw, 1.3rem);
}

.logo .mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
}

nav.links {
  display: flex;
  gap: 24px;
  font-size: 1rem;
  font-weight: 500;
}

nav.links a {
  color: var(--text-dim);
  transition: color 0.2s;
  white-space: nowrap;
  padding: 8px 4px;
}

nav.links a:hover,
nav.links a.active {
  color: var(--accent);
  font-weight: 700;
}

.nav-cta {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
}

.access-toggle {
  border: none;
  background: rgba(10, 110, 99, 0.08);
  color: var(--accent);
  border-radius: 8px;
  min-width: 40px;
  min-height: 32px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  letter-spacing: 0;
  font-family: inherit;
}

.access-toggle:hover {
  background: rgba(10, 110, 99, 0.16);
  transform: scale(1.05);
}

.access-toggle[aria-expanded="true"] {
  background: var(--accent);
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.domain-badge {
  display: inline-block;
  font-size: 0.7rem;
  background: var(--bg-soft);
  padding: 1px 8px;
  border-radius: 4px;
  color: var(--text-dim);
  vertical-align: middle;
}

@media (max-width: 880px) {
  nav.links,
  .header-actions > .nav-cta {
    display: none;
  }
}

/* ---------- BOTTOM NAV (MOBILE) ---------- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--bottom-nav-h);
  background: var(--card);
  border-top: 2px solid var(--card-border);
  box-shadow: 0 -4px 20px rgba(20, 30, 50, 0.08);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}

.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  height: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 2px;
  border-radius: 12px;
  min-width: 0;
}

.bottom-nav a .nav-icon {
  font-size: 1.45rem;
  line-height: 1;
}

.bottom-nav a.active {
  color: var(--accent);
}

.bottom-nav a.active .nav-icon {
  transform: scale(1.05);
}

@media (max-width: 880px) {
  .bottom-nav {
    display: block;
  }

  body {
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  }

  footer {
    padding-bottom: 24px;
  }
}

/* ---------- HERO ---------- */
section.hero {
  padding: 60px 5% 50px;
  text-align: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(10, 110, 99, 0.08), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(31, 79, 196, 0.08), transparent 50%);
}

@media (max-width: 640px) {
  section.hero {
    padding: 40px 5% 36px;
  }
}

.badge {
  display: inline-block;
  padding: 8px 18px;
  border: 2px solid var(--card-border);
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--accent);
  background: rgba(10, 110, 99, 0.07);
  margin-bottom: 20px;
  font-weight: 600;
}

h1.hero-title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 900;
  margin: 0 0 18px;
  line-height: 1.35;
}

h1.hero-title span {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  max-width: 640px;
  margin: 0 auto 30px;
  color: var(--text-dim);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 15px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.02rem;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  transition: transform 0.15s, box-shadow 0.15s;
  text-align: center;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 24px rgba(10, 110, 99, 0.22);
}

.btn-outline {
  background: var(--card);
  border: 2px solid var(--card-border);
  color: var(--text);
}

.btn-secondary {
  background: var(--bg-soft);
  border: 2px solid var(--card-border);
  color: var(--text);
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }
}

.stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin-top: 44px;
  flex-wrap: wrap;
}

.stat b {
  display: block;
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: var(--accent);
}

.stat span {
  color: var(--text-dim);
  font-size: 0.92rem;
}

/* ---------- PAGE MENU CARDS (HOME) ---------- */
.page-menu {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, 1fr);
  max-width: 720px;
  margin: 0 auto;
}

@media (max-width: 520px) {
  .page-menu {
    grid-template-columns: 1fr;
  }
}

.menu-card {
  background: var(--card);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.menu-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.menu-card .menu-icon {
  font-size: 2.2rem;
}

.menu-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.menu-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ---------- SECTION SHELL ---------- */
section {
  padding: 60px 5%;
  max-width: 1180px;
  margin: 0 auto;
}

.page-section {
  padding-top: 36px;
  padding-bottom: 40px;
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 40px;
}

.section-tag {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.5px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  margin: 10px 0 14px;
  font-weight: 900;
  line-height: 1.35;
}

.section-head p {
  color: var(--text-dim);
  font-size: 1.05rem;
}

/* ---------- TACTICS GRID ---------- */
.grid {
  display: grid;
  gap: 20px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
}

.card .icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(10, 110, 99, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 14px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  line-height: 1.4;
}

.card p {
  color: var(--text-dim);
  font-size: 1rem;
  margin: 0 0 12px;
}

.flags {
  list-style: none;
  margin: 0;
  padding: 0;
}

.flags li {
  font-size: 0.95rem;
  color: var(--warn);
  margin-bottom: 8px;
  padding-left: 26px;
  position: relative;
  font-weight: 500;
}

.flags li::before {
  content: "⚠";
  position: absolute;
  left: 0;
}

/* ---------- CASES ---------- */
.soft-section {
  background: var(--bg-soft);
  border-radius: 28px;
  max-width: calc(1180px + 10%);
  margin-left: auto;
  margin-right: auto;
}

.case {
  background: var(--card);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 640px) {
  .case {
    grid-template-columns: 1fr;
  }
}

.case .tag {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(200, 35, 63, 0.12), rgba(148, 98, 0, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.case h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.case .scenario {
  color: var(--text-dim);
  margin-bottom: 14px;
  font-size: 1rem;
}

.case .lesson {
  background: rgba(21, 122, 69, 0.08);
  border-left: 4px solid var(--good);
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 1rem;
}

.case .lesson b {
  color: var(--good);
}

/* ---------- APP PROMO ---------- */
.app-promo {
  background: linear-gradient(135deg, rgba(10, 110, 99, 0.06), rgba(31, 79, 196, 0.06));
  border: 2px solid var(--card-border);
  border-radius: 24px;
  padding: 40px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
  align-items: center;
}

@media (max-width: 880px) {
  .app-promo {
    grid-template-columns: 1fr;
    padding: 28px;
  }
}

.app-promo h2 {
  font-size: 1.75rem;
  margin: 0 0 14px;
  font-weight: 900;
}

.app-promo p {
  color: var(--text-dim);
  margin-bottom: 18px;
  font-size: 1.05rem;
}

.app-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.app-features li {
  padding: 12px 0 12px 32px;
  position: relative;
  font-size: 1rem;
  border-bottom: 1px solid var(--card-border);
}

.app-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 900;
  font-size: 1.1rem;
}

.app-mock {
  background: var(--bg-soft);
  border: 2px solid var(--card-border);
  border-radius: 20px;
  padding: 26px;
  text-align: center;
}

.app-mock .phone {
  font-size: 3rem;
  margin-bottom: 10px;
}

.app-mock h4 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.app-mock p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.store-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.store-btn {
  border: 2px solid var(--card-border);
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.98rem;
  background: var(--card);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch-min);
  font-weight: 700;
}

.store-btn:hover {
  border-color: var(--accent);
}

@media (max-width: 480px) {
  .store-row {
    flex-direction: column;
  }

  .store-btn {
    width: 100%;
  }
}

/* ---------- QUIZ (ONE QUESTION AT A TIME) ---------- */
.quiz-wrap {
  background: var(--card);
  border: 2px solid var(--card-border);
  border-radius: 24px;
  padding: 32px 24px;
  max-width: 720px;
  margin: 0 auto;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-weight: 700;
  color: var(--text-dim);
  font-size: 1rem;
}

.quiz-progress-bar {
  height: 10px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 28px;
}

.quiz-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transition: width 0.3s;
}

.q-block {
  min-height: 220px;
}

.q-block.review {
  min-height: 0;
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--card-border);
}

.q-block.review:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.q-block .q-title {
  font-weight: 700;
  margin-bottom: 20px;
  font-size: 1.15rem;
  line-height: 1.5;
}

.q-num {
  color: var(--accent);
  margin-right: 6px;
}

.options {
  display: grid;
  gap: 12px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 2px solid var(--card-border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 1.02rem;
  min-height: var(--touch-min);
}

.option:hover {
  border-color: var(--accent-2);
}

.option input {
  accent-color: var(--accent);
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 4px;
}

.option span {
  flex: 1;
}

.option.correct {
  border-color: var(--good);
  background: rgba(21, 122, 69, 0.08);
}

.option.wrong {
  border-color: var(--danger);
  background: rgba(200, 35, 63, 0.08);
}

.explain {
  margin-top: 18px;
  font-size: 0.98rem;
  color: var(--text-dim);
  background: var(--bg-soft);
  padding: 14px 16px;
  border-radius: 12px;
  display: none;
  line-height: 1.6;
}

.explain.show {
  display: block;
}

.quiz-nav {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.quiz-nav .btn {
  flex: 1;
  min-width: 120px;
}

.quiz-actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.quiz-result {
  margin-top: 24px;
  padding: 28px 20px;
  border-radius: 18px;
  text-align: center;
  display: none;
  background: var(--bg-soft);
  border: 2px solid var(--card-border);
}

.quiz-result.show {
  display: block;
}

.quiz-result .score-num {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--accent);
}

.quiz-result .tier {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 8px 0 14px;
}

.quiz-result p {
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 auto 18px;
  font-size: 1.05rem;
}

.quiz-result .btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

@media (max-width: 480px) {
  .quiz-nav .btn,
  .quiz-actions .btn,
  .quiz-result .btn {
    width: 100%;
    flex: none;
  }

  .quiz-result .btn-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---------- FOOTER ---------- */
footer {
  border-top: 2px solid var(--card-border);
  padding: 36px 5%;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.95rem;
}

footer .foot-links {
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
}

footer .foot-links a {
  color: var(--text-dim);
  padding: 6px 4px;
}

footer .foot-links a:hover {
  color: var(--accent);
}

.hotline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(200, 35, 63, 0.08);
  border: 2px solid rgba(200, 35, 63, 0.35);
  color: var(--danger);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  margin-top: 16px;
}

.visit-counter {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 8px rgba(10, 110, 99, 0.2); }
  50% { box-shadow: 0 0 24px rgba(10, 110, 99, 0.4); }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.6); }
  60% { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.anim-fade-in {
  animation: fadeIn 0.8s ease forwards;
}

.anim-fade-in-up {
  animation: fadeInUp 0.7s ease forwards;
}

.anim-slide-left {
  animation: slideInLeft 0.6s ease forwards;
}

.anim-slide-right {
  animation: slideInRight 0.6s ease forwards;
}

.anim-bounce-in {
  animation: bounceIn 0.6s ease forwards;
}

.anim-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.anim-glow {
  animation: glow 2s ease-in-out infinite;
}

.anim-float {
  animation: float 3s ease-in-out infinite;
}

.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }
.anim-delay-5 { animation-delay: 0.5s; }
.anim-delay-6 { animation-delay: 0.6s; }
.anim-delay-7 { animation-delay: 0.7s; }

.hero {
  animation: fadeInUp 0.8s ease forwards;
}

.badge {
  animation: bounceIn 0.6s ease forwards;
}

.hero-title {
  animation: fadeInUp 0.7s ease 0.1s both;
}

.hero p.lead {
  animation: fadeInUp 0.7s ease 0.2s both;
}

.hero-actions {
  animation: fadeInUp 0.7s ease 0.3s both;
}

.stats {
  animation: fadeIn 0.8s ease 0.4s both;
}

.menu-card {
  animation: fadeInUp 0.6s ease both;
}

.menu-card:nth-child(1) { animation-delay: 0.1s; }
.menu-card:nth-child(2) { animation-delay: 0.2s; }
.menu-card:nth-child(3) { animation-delay: 0.3s; }
.menu-card:nth-child(4) { animation-delay: 0.4s; }

.card {
  animation: fadeInUp 0.6s ease both;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.4s; }

.case {
  animation: fadeInUp 0.6s ease both;
}

.case:nth-child(1) { animation-delay: 0.1s; }
.case:nth-child(2) { animation-delay: 0.2s; }
.case:nth-child(3) { animation-delay: 0.3s; }
.case:nth-child(4) { animation-delay: 0.4s; }

.section-head {
  animation: fadeInUp 0.7s ease both;
}

.quiz-wrap {
  animation: fadeInUp 0.7s ease 0.2s both;
}

.app-promo {
  animation: fadeInUp 0.7s ease both;
}

.app-mock .phone {
  animation: float 3s ease-in-out infinite;
}

.logo .mark {
  animation: pulse 3s ease-in-out infinite;
}

.nav-cta {
  animation: glow 2s ease-in-out infinite;
}

.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

.hotline {
  animation: pulse 2s ease-in-out infinite;
}

/* ===== APP GRID (TOOLS) ===== */
.app-grid {
  max-width: 960px;
  margin: 0 auto;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeInUp 0.7s ease both;
}

.app-card:nth-child(1) { animation-delay: 0.1s; }
.app-card:nth-child(2) { animation-delay: 0.2s; }
.app-card:nth-child(3) { animation-delay: 0.3s; }

.app-card .card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-card .card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(10, 110, 99, 0.12), rgba(31, 79, 196, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.app-card .card-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.app-desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.6;
}

.app-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}

.app-bullets li {
  font-size: 0.92rem;
  color: var(--text);
  padding: 6px 0 6px 24px;
  position: relative;
}

.app-bullets li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 900;
}

.app-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.app-links .store-btn {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-size: 0.88rem;
}

.tutorial-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--accent-2);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 0;
  transition: opacity 0.2s;
}

.tutorial-link:hover {
  opacity: 0.7;
}

.store-btn {
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.store-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(10, 110, 99, 0.12);
}

/* ===== MORE ANIMATIONS ===== */
@keyframes tilt {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(2deg); }
  75% { transform: rotate(-2deg); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes colorCycle {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes ripple {
  0% { box-shadow: 0 0 0 0 rgba(10, 110, 99, 0.3); }
  100% { box-shadow: 0 0 0 20px rgba(10, 110, 99, 0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.anim-scale-in {
  animation: scaleIn 0.5s ease forwards;
}

.anim-slide-down {
  animation: slideDown 0.5s ease forwards;
}

.anim-tilt {
  animation: tilt 3s ease-in-out infinite;
}

.anim-ripple {
  animation: ripple 1.5s ease-out infinite;
}

.anim-shake {
  animation: shake 0.5s ease;
}

.badge:hover {
  animation: shake 0.5s ease;
}

.card:hover .icon {
  animation: tilt 0.5s ease;
}

.menu-card:hover .menu-icon {
  animation: tilt 0.5s ease;
}

.case .tag {
  transition: transform 0.3s ease;
}

.case:hover .tag {
  transform: scale(1.1) rotate(5deg);
}

.app-promo {
  position: relative;
  overflow: hidden;
}

.app-promo::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(10, 110, 99, 0.03), transparent 60%);
  animation: spin 20s linear infinite;
  pointer-events: none;
}

.quiz-progress-fill {
  position: relative;
  overflow: hidden;
}

.quiz-progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s ease-in-out infinite;
}

.store-btn {
  position: relative;
  overflow: hidden;
}

.store-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  background-size: 200% 100%;
  animation: shimmer 4s ease-in-out infinite;
  pointer-events: none;
}

.option:hover {
  transform: translateX(4px);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(10, 110, 99, 0.3);
}

.btn-outline:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(10, 110, 99, 0.04);
}

.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(20, 30, 50, 0.1);
}

.menu-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.menu-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(20, 30, 50, 0.1);
}

.case {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.case:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(20, 30, 50, 0.08);
}

.hotline {
  transition: transform 0.2s ease;
}

.hotline:hover {
  transform: scale(1.05);
}

/* ---------- ANIMATED BACKGROUND ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(10,110,99,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 30%, rgba(31,79,196,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 70% 40% at 50% 80%, rgba(10,110,99,0.04) 0%, transparent 50%);
  animation: bgDrift 30s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes bgDrift {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(2%, 1%) scale(1.02); }
  66% { transform: translate(-1%, -1%) scale(0.98); }
  100% { transform: translate(1%, 2%) scale(1.01); }
}

/* ---------- FLOATING PARTICLES ---------- */
.particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: particleFloat var(--dur, 18s) ease-in-out infinite alternate;
}

@keyframes particleFloat {
  0% { transform: translateY(0) translateX(0) scale(1); opacity: 0.04; }
  100% { transform: translateY(-120px) translateX(40px) scale(1.3); opacity: 0.10; }
}

/* ---------- LOGO SHIELD PULSE ---------- */
.logo .mark {
  display: inline-flex;
  animation: shieldPulse 3s ease-in-out infinite;
  will-change: transform;
}

@keyframes shieldPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ---------- SPLASH SCREEN ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  opacity: 1;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.splash.fade {
  opacity: 0;
}

.splash .splash-icon {
  font-size: 3rem;
  animation: splashBounce 1s ease-in-out infinite alternate;
}

@keyframes splashBounce {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-16px) scale(1.1); }
}

.splash .splash-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.splash .splash-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--card-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- HERO ENHANCEMENT ---------- */
section.hero {
  animation: heroPulse 8s ease-in-out infinite alternate;
  will-change: background-position;
}

@keyframes heroPulse {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------- GLOW EFFECTS ---------- */
.btn-primary {
  animation: btnGlow 3s ease-in-out infinite alternate;
  will-change: box-shadow;
}

@keyframes btnGlow {
  0% { box-shadow: 0 4px 16px rgba(10, 110, 99, 0.2); }
  100% { box-shadow: 0 4px 24px rgba(10, 110, 99, 0.4); }
}

.store-btn {
  animation: storePulse 4s ease-in-out infinite;
  will-change: box-shadow;
}

@keyframes storePulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(10, 110, 99, 0.1); }
  50% { box-shadow: 0 2px 16px rgba(10, 110, 99, 0.25); }
}

/* ---------- STAGGERED ENTRY ANIMATIONS ---------- */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.grid-3 .card:nth-child(1) { animation: fadeSlideUp 0.5s ease both; }
.grid-3 .card:nth-child(2) { animation: fadeSlideUp 0.5s ease 0.1s both; }
.grid-3 .card:nth-child(3) { animation: fadeSlideUp 0.5s ease 0.2s both; }

/* ---------- INSTALL POPUP ---------- */
.install-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.install-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.install-banner {
  background: var(--card);
  border-radius: 20px;
  padding: 32px 28px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.35s ease;
  position: relative;
}

.install-overlay.show .install-banner {
  transform: scale(1) translateY(0);
}

.install-dismiss {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: var(--bg-soft);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.install-icon {
  font-size: 3.2rem;
  margin-bottom: 8px;
}

.install-banner h3 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  color: var(--text);
}

.install-banner p {
  margin: 0 0 18px;
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.install-benefits {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.install-benefits span {
  background: var(--bg-soft);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.install-btn {
  width: 100%;
  font-size: 1.05rem;
  padding: 14px;
}

.install-skip {
  margin: 12px 0 0 !important;
  font-size: 0.85rem !important;
  color: var(--text-dim) !important;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.install-skip:hover {
  color: var(--accent) !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
