/* RedoBuddy 試卷助手 官網樣式。和 App 同一套設計語言：
   淺紫白底＋紫藍粉光暈、毛玻璃卡片、細體大字、編號小節標題、深墨色主按鈕。顏色取自 mobile/src/theme.ts。 */
:root {
  --bg: #f3f2fb;
  --ink: #16142b;
  --sub: #625f7a;
  --faint: #a09db8;
  --line: rgba(22, 20, 43, 0.08);
  --accent: #5b4beb;
  --accent-mid: #3f32b8;
  --accent-soft: rgba(91, 75, 235, 0.11);
  --gold: #e9ae45;
  --right: #10a27a;
  --wrong: #e2474c;
  --card: rgba(255, 255, 255, 0.62);
  --card-solid: #fff;
  --glass-border: rgba(255, 255, 255, 0.95);
  --shadow: 0 10px 30px rgba(74, 63, 163, 0.12);
  --shadow-lg: 0 24px 60px rgba(74, 63, 163, 0.16);
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 32px;
  --max: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang HK", "PingFang TC", "PingFang SC", "Hiragino Sans", "Noto Sans CJK TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
}
:lang(zh-CN) { --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 17px; line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid rgba(91, 75, 235, 0.45); outline-offset: 2px; border-radius: 6px; }

/* 極光背景：固定在後面的幾團光暈 */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.75; }
.aurora i:nth-child(1) { width: 620px; height: 620px; background: #cbc3ff; top: -220px; left: -160px; }
.aurora i:nth-child(2) { width: 560px; height: 560px; background: #f7cde8; top: -120px; right: -200px; }
.aurora i:nth-child(3) { width: 520px; height: 520px; background: #c2d9fc; top: 520px; left: 30%; opacity: 0.55; }
.aurora i:nth-child(4) { width: 460px; height: 460px; background: #e2d5ff; bottom: -180px; right: -120px; opacity: 0.6; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

/* 頂欄 */
.top { position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px); background: rgba(243, 242, 251, 0.72); border-bottom: 1px solid rgba(255, 255, 255, 0.7); }
.top .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; letter-spacing: 0.2px; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 4px 12px rgba(68, 50, 214, 0.25); }
.logo small { font-weight: 400; color: var(--sub); font-size: 14px; }
.links { display: flex; gap: 26px; margin-left: auto; align-items: center; }
.links a { color: var(--ink); font-size: 15px; }
.links a.on { color: var(--accent); }
.links a.btn-ink { color: #fff; }
.lang { position: relative; }
.lang button { font: inherit; font-size: 14px; color: var(--sub); background: rgba(255, 255, 255, 0.6); border: 1px solid var(--glass-border); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.lang ul { display: none; position: absolute; right: 0; top: 42px; list-style: none; margin: 0; padding: 8px; min-width: 150px; background: var(--card-solid); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); }
.lang.open ul { display: block; }
.lang li a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink); font-size: 15px; }
.lang li a:hover { background: var(--accent-soft); text-decoration: none; }
.lang li a[aria-current] { color: var(--accent); font-weight: 600; }
.menu-btn { display: none; margin-left: auto; font: inherit; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink); }

/* 按鈕 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 54px; padding: 0 28px; border-radius: 999px; font-size: 16px; font-weight: 600; border: 0; cursor: pointer; font-family: inherit; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn-ink { color: #fff; background: linear-gradient(180deg, #322e55, #131127); box-shadow: 0 10px 24px rgba(19, 17, 39, 0.28); }
.btn-glass { color: var(--ink); background: var(--card); border: 1px solid var(--glass-border); box-shadow: var(--shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.btn-sm { height: 42px; padding: 0 20px; font-size: 15px; }

/* 玻璃卡片 */
.glass { background: var(--card); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--shadow); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); }

/* 文字 */
h1, h2, h3 { margin: 0; line-height: 1.25; }
.display { text-wrap: balance; font-size: clamp(36px, 5.4vw, 64px); font-weight: 300; letter-spacing: -0.5px; line-height: 1.12; white-space: pre-line; }
.title { text-wrap: balance; font-size: clamp(30px, 4vw, 44px); font-weight: 300; letter-spacing: -0.2px; }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--sub); max-width: 640px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--accent); letter-spacing: 0.4px; background: var(--accent-soft); padding: 6px 14px; border-radius: 999px; }
.num { display: flex; align-items: baseline; gap: 12px; font-size: 13px; font-weight: 600; color: var(--faint); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 14px; }
.num b { color: var(--accent); font-weight: 600; }

section { padding: 72px 0; }
.sec-head { margin-bottom: 36px; }
.sec-head p { color: var(--sub); margin: 12px 0 0; max-width: 620px; }

/* 首頁主視覺 */
.hero { padding: 64px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero .lead { margin: 22px 0 32px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero .soon { margin-top: 18px; font-size: 14px; color: var(--faint); }

/* 試卷「變身」動畫：上層是寫過的卷，掃描線由上而下把它抹走，露出下面的空白卷 */
.morph { position: relative; padding: 26px; border-radius: var(--r-xl); }
.morph .stage { position: relative; aspect-ratio: 210 / 280; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 18px 40px rgba(22, 20, 43, 0.14); }
.morph .stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.morph .used { position: absolute; inset: 0; clip-path: inset(0 0 0 0); animation: wipe 7s ease-in-out infinite; }
.morph .scan { position: absolute; left: -4%; right: -4%; height: 3px; top: 0; background: linear-gradient(90deg, transparent, #8273fa 20%, #d06ae8 80%, transparent); box-shadow: 0 0 18px 4px rgba(130, 115, 250, 0.45); animation: scan 7s ease-in-out infinite; }
.morph .tags { display: flex; justify-content: space-between; margin-top: 16px; font-size: 14px; color: var(--sub); }
.morph .tags span { display: inline-flex; align-items: center; gap: 6px; }
.morph .tags i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
/* 先看寫過的卷 → 掃描線由上而下抹走筆跡 → 停在空白卷 → 淡入回到寫過的卷，再來一次 */
@keyframes wipe { 0%, 26% { clip-path: inset(0 0 0 0); opacity: 1; } 56% { clip-path: inset(100% 0 0 0); opacity: 1; } 86% { clip-path: inset(100% 0 0 0); opacity: 0; } 87% { clip-path: inset(0 0 0 0); opacity: 0; } 100% { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes scan { 0%, 24% { top: 0; opacity: 0; } 27% { opacity: 1; } 56% { top: 100%; opacity: 1; } 59%, 100% { top: 100%; opacity: 0; } }

/* 步驟 */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.step { padding: 28px; }
.step .n { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 600; color: #fff; background: linear-gradient(135deg, #8273fa, #4432d6); margin-bottom: 18px; }
.step h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.step p { margin: 0; color: var(--sub); font-size: 16px; }

/* 功能卡：第一張最大 */
.feats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feat { position: relative; padding: 26px; color: var(--ink); display: flex; flex-direction: column; gap: 10px; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.feat:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feat.big { grid-column: span 2; grid-row: span 2; padding: 34px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.85), rgba(235, 231, 255, 0.75)); }
.feat .ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.feat.big .ic { width: 60px; height: 60px; border-radius: 18px; background: linear-gradient(135deg, #8273fa, #4432d6); color: #fff; }
.feat h3 { font-size: 19px; font-weight: 600; }
.feat.big h3 { font-size: 28px; font-weight: 400; }
.feat p { margin: 0; color: var(--sub); font-size: 15.5px; }
.feat.big p { font-size: 17px; max-width: 380px; }
.feat .tag { position: absolute; top: 22px; right: 22px; font-size: 12px; font-weight: 600; color: #8a5a0b; background: rgba(233, 174, 69, 0.2); padding: 4px 10px; border-radius: 999px; }
.feat .more { margin-top: auto; font-size: 15px; color: var(--accent); font-weight: 600; }
.feat .pair { display: flex; align-items: center; gap: 14px; margin: 18px 0 6px; }
.feat .pair .sheet { flex: 1; max-width: 170px; aspect-ratio: 210 / 280; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 10px 24px rgba(22, 20, 43, 0.12); }
.feat .pair .arrow { color: var(--accent); font-size: 22px; }

/* 為甚麼 */
.why { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.why > div { padding: 26px; }
.why h3 { font-size: 18px; font-weight: 600; margin: 14px 0 6px; }
.why p { margin: 0; color: var(--sub); font-size: 15.5px; }
.why .ic { color: var(--accent); }

/* 收費 */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.plan { padding: 32px; }
.plan h3 { font-size: 24px; font-weight: 400; margin-bottom: 16px; }
.plan ul { list-style: none; margin: 0; padding: 0; }
.plan li { padding: 9px 0 9px 30px; position: relative; color: var(--ink); border-top: 1px solid var(--line); }
.plan li:first-child { border-top: 0; }
.plan li::before { content: ""; position: absolute; left: 2px; top: 17px; width: 14px; height: 8px; border-left: 2px solid var(--right); border-bottom: 2px solid var(--right); transform: rotate(-45deg); }
.plan.pro { background: linear-gradient(160deg, #322e55, #131127); color: #fff; border-color: rgba(255, 255, 255, 0.12); }
.plan.pro li { color: rgba(255, 255, 255, 0.9); border-color: rgba(255, 255, 255, 0.1); }
.plan.pro li::before { border-color: var(--gold); }
.note { color: var(--faint); font-size: 14px; margin-top: 16px; }

/* 常見問題 */
.faq { display: grid; gap: 12px; }
.faq details { padding: 0; }
.faq summary { list-style: none; cursor: pointer; padding: 20px 56px 20px 24px; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 26px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--sub); border-bottom: 2px solid var(--sub); transform: translateY(-70%) rotate(45deg); transition: transform 0.2s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { margin: 0; padding: 0 24px 22px; color: var(--sub); }

/* 結尾呼籲 */
.final { text-align: center; padding: 56px 32px; }
.final p { color: var(--sub); margin: 12px 0 26px; }

/* 內頁 */
.page-head { padding: 64px 0 24px; }
.page-head .lead { margin-top: 18px; }
.crumbs { font-size: 14px; color: var(--faint); margin-bottom: 18px; }
.crumbs a { color: var(--sub); }
.prose { padding: 36px 40px; }
.prose h2 { font-size: 24px; font-weight: 600; margin: 36px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 19px; font-weight: 600; margin: 26px 0 8px; }
.prose p, .prose li { color: #3d3b55; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 24px; margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose table { width: 100%; border-collapse: collapse; margin: 10px 0 20px; font-size: 15.5px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--ink); font-weight: 600; background: rgba(91, 75, 235, 0.05); }
.prose blockquote { margin: 0 0 16px; padding: 10px 18px; border-left: 3px solid var(--accent); color: var(--sub); background: rgba(91, 75, 235, 0.04); border-radius: 0 10px 10px 0; }
.two-col { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.aside { padding: 26px; position: sticky; top: 92px; }
.aside h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.aside p { color: var(--sub); font-size: 15px; margin: 0 0 16px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.pills a { font-size: 14px; padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.7); border: 1px solid var(--glass-border); color: var(--ink); }
.pills a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 文章列表 */
.posts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.post { padding: 28px; color: var(--ink); display: flex; flex-direction: column; gap: 10px; transition: transform 0.2s, box-shadow 0.2s; }
.post:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.post h2, .post h3 { font-size: 21px; font-weight: 600; line-height: 1.4; }
.post p { margin: 0; color: var(--sub); font-size: 15.5px; }
.post time { font-size: 13px; color: var(--faint); }
.meta-line { color: var(--faint); font-size: 14px; margin-top: 14px; }

/* 下載 */
.stores { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 8px; }
.store { display: inline-flex; align-items: center; gap: 12px; height: 60px; padding: 0 22px; border-radius: 16px; background: linear-gradient(180deg, #322e55, #131127); color: #fff; }
.store:hover { text-decoration: none; }
.store small { display: block; font-size: 12px; opacity: 0.7; line-height: 1.2; }
.store b { display: block; font-size: 18px; font-weight: 600; line-height: 1.2; }
.store.soon { opacity: 0.55; cursor: default; }
form.notify { display: grid; gap: 14px; margin-top: 8px; }
form.notify label { font-size: 14px; color: var(--sub); }
form.notify input[type="email"] { width: 100%; height: 54px; border-radius: 14px; border: 1px solid rgba(22, 20, 43, 0.12); background: #fff; padding: 0 16px; font: inherit; font-size: 17px; color: var(--ink); }
form.notify .row { display: flex; gap: 10px; flex-wrap: wrap; }
form.notify .row label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.7); border: 1px solid var(--glass-border); cursor: pointer; color: var(--ink); font-size: 15px; }
form.notify .msg { font-size: 15px; min-height: 24px; margin: 0; }
form.notify .msg.ok { color: var(--right); }
form.notify .msg.err { color: var(--wrong); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* 頁尾 */
footer { margin-top: 48px; padding: 56px 0 40px; border-top: 1px solid rgba(22, 20, 43, 0.06); }
footer .grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
footer h4 { margin: 0 0 12px; font-size: 13px; letter-spacing: 1px; color: var(--faint); font-weight: 600; text-transform: uppercase; }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 8px; }
footer li a { color: var(--sub); font-size: 15px; }
footer .tag { color: var(--sub); font-size: 15px; margin: 14px 0 0; max-width: 300px; }
footer .copy { margin-top: 40px; font-size: 13px; color: var(--faint); }

/* 捲動時淡入 */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* 語言選單：語言多，排成兩欄 */
.lang ul { columns: 2; column-gap: 4px; min-width: 300px; }
.lang li { break-inside: avoid; }

/* 阿拉伯文：由右至左 */
[dir="rtl"] .links { margin-left: 0; margin-right: auto; }
[dir="rtl"] .lang ul { right: auto; left: 0; }
[dir="rtl"] .plan li { padding: 9px 30px 9px 0; }
[dir="rtl"] .plan li::before { left: auto; right: 2px; }
[dir="rtl"] .faq summary { padding: 20px 24px 20px 56px; }
[dir="rtl"] .faq summary::after { right: auto; left: 26px; }
[dir="rtl"] .feat .tag { right: auto; left: 22px; }
[dir="rtl"] .prose ul, [dir="rtl"] .prose ol { padding-left: 0; padding-right: 24px; }
[dir="rtl"] .prose th, [dir="rtl"] .prose td { text-align: right; }
[dir="rtl"] .prose blockquote { border-left: 0; border-right: 3px solid var(--accent); border-radius: 10px 0 0 10px; }
[dir="rtl"] .feat .more, [dir="rtl"] .pair .arrow { transform: scaleX(-1); display: inline-block; }
[dir="rtl"] .menu-btn { margin-left: 0; margin-right: auto; }

@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .morph { max-width: 420px; margin: 0 auto; }
  .feats { grid-template-columns: 1fr 1fr; }
  .feat.big { grid-column: span 2; grid-row: auto; }
  .why { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .aside { position: static; }
  footer .grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  section { padding: 52px 0; }
  .wrap { padding: 0 18px; }
  .links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 18px 18px; background: rgba(243, 242, 251, 0.97); border-bottom: 1px solid var(--line); }
  .links.open { display: flex; }
  .links a { padding: 12px 4px; font-size: 17px; border-bottom: 1px solid var(--line); }
  .links .lang { margin-top: 12px; }
  .lang ul { position: static; box-shadow: none; }
  .menu-btn { display: block; }
  .logo small { display: none; }
  .steps, .plans, .posts { grid-template-columns: 1fr; }
  .feats, .why { grid-template-columns: 1fr; }
  .feat.big { grid-column: auto; }
  .prose { padding: 26px 22px; }
  footer .grid { grid-template-columns: 1fr; }
  .btn { height: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .morph .used { clip-path: inset(0 0 0 50%); }
}
