:root {
  --bg: #f7f7fb;
  --bg-alt: #eeeef6;
  --surface: #ffffff;
  --text: #16161d;
  --muted: #5d5d6e;
  --border: #dcdce8;
  --accent: #e5484d;
  --accent-hover: #cf3a40;
  --on-accent: #ffffff;
  --accent-soft: #fde8e8;
  --mock-bg: #1e1f24;
  --mock-embed: #2a2b31;
  --mock-text: #e6e6eb;
  --mock-muted: #a0a1ab;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 20, 40, .08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111116;
    --bg-alt: #17171e;
    --surface: #1c1c24;
    --text: #ececf2;
    --muted: #a0a0b2;
    --border: #2c2c38;
    --accent: #f05a5f;
    --accent-hover: #ff7277;
    --on-accent: #ffffff;
    --accent-soft: #3a1c1f;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #111116;
  --bg-alt: #17171e;
  --surface: #1c1c24;
  --text: #ececf2;
  --muted: #a0a0b2;
  --border: #2c2c38;
  --accent: #f05a5f;
  --accent-hover: #ff7277;
  --on-accent: #ffffff;
  --accent-soft: #3a1c1f;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans TC", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
code, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 760px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5em; padding: .8em 1.4em; border-radius: 10px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; transition: background .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--text); }
.btn-sm { padding: .5em 1em; font-size: .9rem; }
.btn-block { width: 100%; }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.1rem; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--accent); }
.nav-links { display: none; gap: 24px; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-account { margin-left: auto; text-decoration: none; font-weight: 500; color: var(--muted); white-space: nowrap; }
.nav-account:hover { color: var(--text); }
@media (min-width: 760px) {
  .nav-links { display: flex; }
  .nav-account { margin-left: 0; }
}
@media (max-width: 400px) { .nav-inner { gap: 14px; } }

/* Hero */
.hero { padding: 56px 0 64px; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) { .hero { padding: 96px 0; } .hero-grid { grid-template-columns: 1.05fr 1fr; } }
.eyebrow { color: var(--accent); font-weight: 700; margin: 0 0 12px; letter-spacing: .05em; }
.hero h1 { font-size: clamp(2rem, 8.5vw, 3.6rem); font-weight: 900; letter-spacing: -.01em; }
@media (min-width: 960px) { .hero h1 { font-size: clamp(2.6rem, 4.2vw, 3.6rem); } }
.nowrap { white-space: nowrap; }
.lead { font-size: 1.15rem; color: var(--muted); margin: 20px 0 28px; max-width: 34em; }
.lead strong { color: var(--text); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { color: var(--muted); font-size: .9rem; margin: 16px 0 0; }

/* Mock scan result */
.mock {
  margin: 0; background: var(--mock-bg); color: var(--mock-text);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  font-size: .92rem; min-width: 0;
}
.mock-cmd { color: var(--mock-muted); margin-bottom: 14px; overflow-wrap: anywhere; }
.slash { color: #8ea1ff; font-weight: 700; }
.mock-embed {
  background: var(--mock-embed); border-left: 4px solid #f0a33a;
  border-radius: 6px; padding: 14px 16px;
}
.mock-embed p { margin: 0 0 4px; }
.mock-title { font-weight: 700; font-size: 1rem; margin-bottom: 8px !important; }
.mock-total { margin-top: 8px !important; }
.mock-list { list-style: none; padding: 0; margin: 12px 0; border-top: 1px solid #3a3b42; }
.mock-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid #3a3b42; }
.mock-list li span:last-child { color: var(--mock-muted); white-space: nowrap; }
.mock-foot { color: var(--mock-muted); font-size: .8rem; }

/* Sections */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 900; margin-bottom: 12px; }
.section-sub { color: var(--muted); margin: 0 0 32px; }
.section .section-title + .feature-grid,
.section .section-title + .steps { margin-top: 32px; }

/* Compare */
.compare { padding: 56px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.compare-grid { display: grid; gap: 20px; margin-top: 28px; }
@media (min-width: 760px) { .compare-grid { grid-template-columns: repeat(3, 1fr); } }
.compare-label { margin: 0; color: var(--muted); font-size: .95rem; }
.compare-value { margin: 2px 0 10px; font-size: 1.8rem; font-weight: 900; color: var(--muted); }
.is-us .compare-value { color: var(--accent); }
.is-us .compare-label { color: var(--text); font-weight: 700; }
.bar { height: 10px; border-radius: 99px; background: var(--bg-alt); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--muted); border-radius: 99px; opacity: .5; }
.bar-7 { width: 4%; }
.bar-14 { width: 8%; }
.bar-all { width: 100%; }
.is-us .bar span { background: var(--accent); opacity: 1; }

/* Features */
.feature-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.feature h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature p { margin: 0; color: var(--muted); }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.step-no {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-weight: 900; margin-bottom: 12px;
}
.step > code { display: block; font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); }
.step p code { color: var(--text); }

.uses { margin-top: 48px; }
.uses h3 { font-size: 1.2rem; margin-bottom: 12px; }
.uses ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
@media (min-width: 760px) { .uses ul { grid-template-columns: repeat(2, 1fr); } }
.uses li { padding-left: 28px; position: relative; }
.uses li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: 14px; height: 8px;
  border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg);
}

/* Pricing */
.price-grid { display: grid; gap: 16px; align-items: stretch; }
@media (min-width: 640px) { .price-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) {
  .price-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .price-grid .plan { padding: 24px 20px; }
  .price-grid .plan-badge { left: 20px; }
  .price-grid .amount { font-size: 2rem; }
  .price-grid .plan-list li { font-size: .92rem; }
}
.plan {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.plan-featured { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.plan-badge {
  position: absolute; top: -13px; left: 28px; margin: 0;
  background: var(--accent); color: var(--on-accent);
  font-size: .8rem; font-weight: 700; padding: 2px 12px; border-radius: 99px;
}
.plan h3 { font-size: 1.2rem; }
.price { margin: 10px 0 18px; }
.amount { font-size: 2.4rem; font-weight: 900; }
.per { color: var(--muted); margin-left: 4px; white-space: nowrap; }
.plan-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; flex: 1; }
.plan-list li { padding-left: 24px; position: relative; color: var(--muted); }
.plan-list li strong { color: var(--text); }
.plan-list li::before {
  content: ""; position: absolute; left: 2px; top: .6em; width: 11px; height: 6px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.price-note { color: var(--muted); font-size: .9rem; margin: 20px 0 0; }

/* FAQ */
details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 0 20px; margin-bottom: 10px;
}
summary {
  cursor: pointer; list-style: none; padding: 16px 28px 16px 0;
  font-weight: 700; position: relative;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; color: var(--muted); font-weight: 400;
}
details[open] summary::after { content: "−"; }
details p { margin: 0 0 18px; color: var(--muted); }
.section-alt details + details { margin-top: 0; }
#faq .section-title { margin-bottom: 28px; }

/* CTA */
.cta { padding: 72px 0; }
.cta-inner {
  display: flex; flex-direction: column; align-items: flex-start; gap: 20px;
}
.cta h2 { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 900; }
@media (min-width: 760px) { .cta-inner { flex-direction: row; align-items: center; justify-content: space-between; } }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.footer p { margin: 0; }
.muted { color: var(--muted); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px); background: var(--text); color: var(--bg);
  padding: 12px 20px; border-radius: 10px; box-shadow: var(--shadow); z-index: 20;
}

/* Footer links & contact */
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 10px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-contact { color: var(--muted); margin-bottom: 14px !important; overflow-wrap: anywhere; }
.footer-contact span { margin: 0 .4em; }
.footer-contact a { color: inherit; }

/* Legal pages */
.legal { padding-top: 48px; padding-bottom: 72px; }
.legal h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 900; margin-bottom: 8px; }
.legal h2 { font-size: 1.2rem; font-weight: 700; margin: 36px 0 10px; }
.legal p, .legal ul, .legal ol { margin: 0 0 12px; }
.legal ul, .legal ol { padding-left: 1.4em; }
.legal li + li { margin-top: 6px; }
.legal a { color: var(--accent); }
.legal-meta { color: var(--muted); font-size: .9rem; margin-bottom: 28px !important; }
.legal-table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: .92rem; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 10px 12px; border: 1px solid var(--border); }
.legal-table th { background: var(--bg-alt); font-weight: 700; }
.legal-table td { background: var(--surface); }
@media (max-width: 600px) {
  .legal-table thead { display: none; }
  .legal-table tr { display: block; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
  .legal-table td { display: block; border: 0; border-top: 1px solid var(--border); }
  .legal-table td:first-child { border-top: 0; background: var(--bg-alt); font-weight: 700; }
}
.contact-list { margin: 24px 0 8px; display: grid; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.contact-list > div { display: grid; grid-template-columns: 7em 1fr; gap: 12px; padding: 14px 18px; }
.contact-list > div + div { border-top: 1px solid var(--border); }
.contact-list dt { color: var(--muted); }
.contact-list dd { margin: 0; overflow-wrap: anywhere; }
