* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0D0F18; --surface: #13151F; --surface2: #1A1D2E;
  --border: #252840; --border2: #2F3350;
  --text: #E8EAF2; --muted: #8890AB; --dim: #444965;
  --blue: #ffde59; --blue-light: rgba(255,222,89,.16);
  --brand: #ffde59; --brand-light: rgba(255,222,89,.16);
  --on-brand: #0a0a0a;
  --green: #2ECC71; --green-light: rgba(46,204,113,.1);
  --orange: #E67E22; --red: #E74C3C;
  --content-max: min(1200px, calc(100vw - 48px));
}
html { font-size: 18px; }
html, body { background: var(--bg); color: var(--text); font-family: 'DM Sans','Noto Sans TC',sans-serif; line-height: 1.6; -webkit-font-smoothing: antialiased; }
.wrap { max-width: var(--content-max); margin: 0 auto; padding: 0 24px; }

/* NAV — 三欄 grid 讓中間導覽連結真正置中（不受左右區塊寬度影響） */
nav { border-bottom: 1px solid var(--border); position: sticky; top: 0; background: rgba(13,15,24,.94); backdrop-filter: blur(12px); z-index: 20; padding: 0; }
.nav-inner { max-width: var(--content-max); margin: 0 auto; padding: 14px 24px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px 20px; }
.logo { font-size: 22px; font-weight: 700; color: #fff; cursor: pointer; justify-self: start; }
.logo b { color: var(--blue); font-weight: 700; }
.nav-links { display: flex; gap: 4px; justify-self: center; }
.nav-link { font-size: 17px; color: var(--muted); padding: 6px 12px; border-radius: 7px; cursor: pointer; transition: all .15s; user-select: none; }
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link.on { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 10px; justify-self: end; }
.free-pill { display: flex; align-items: center; gap: 5px; font-size: 16px; font-weight: 600; color: var(--green); background: var(--green-light); border: 1px solid rgba(46,204,113,.2); border-radius: 20px; padding: 4px 11px; }
.free-pill::before { content: '●'; font-size: 9px; animation: blink 2s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }
.nbtn { padding: 7px 14px; border-radius: 8px; font-size: 17px; font-weight: 600; cursor: pointer; transition: all .15s; border: none; user-select: none; }
.nbtn.ghost { background: transparent; border: 1px solid var(--border2); color: var(--muted); }
.nbtn.ghost:hover { border-color: var(--blue); color: var(--blue); }
.nbtn.solid { background: var(--blue); color: var(--on-brand); }
.nbtn.solid:hover { background: #ffe680; }
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--blue-light); border: 1px solid rgba(255,222,89,.4); color: var(--blue); font-size: 17px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.nav-avatar:hover { background: var(--blue); color: var(--on-brand); }

/* PAGE SWITCH */
.page { display: none; }
.page.on { display: block; }
@keyframes configPulse {
  0%,100% { border-color: rgba(230,126,34,.5); box-shadow: none; }
  50% { border-color: rgba(230,126,34,.9); box-shadow: 0 0 0 3px rgba(230,126,34,.1); }
}

/* ── TOOL PAGE ── */
.hero-tool { padding: 40px 0 0; }
.hero-headline { text-align: center; margin-bottom: 32px; }
.hero-headline h1 { font-size: 42px; font-weight: 700; color: #fff; letter-spacing: -.8px; line-height: 1.2; margin-bottom: 10px; }
.hero-headline h1 em { font-style: normal; color: var(--blue); }
.hero-headline p { color: var(--muted); font-size: 19px; max-width: min(560px, 92vw); margin: 0 auto; }
.free-note { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; color: var(--green); font-weight: 600; margin-bottom: 10px; }
.free-note::before { content: '✓'; }
.tool-card { background: var(--surface); border: none; border-radius: 16px; overflow: visible; box-shadow: 0 18px 60px rgba(0,0,0,.38); }
.upload-area {
  padding: 32px 24px;
  text-align: center;
  border: 2px dashed var(--border2);
  border-radius: 16px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
  margin: 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 240px;
}
.upload-area:hover, .upload-area.dragover { border-color: var(--blue); background: rgba(255,222,89,.10); }
.upload-area input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-icon { color: var(--blue); margin: 0 auto 12px; display: block; }
.upload-area h2 { font-size: 21px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.upload-area p { font-size: 17px; color: var(--muted); }
.upload-cta { margin-top: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--blue); color: var(--on-brand); padding: 10px 20px; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; }
.upload-drag-note { margin-top: 8px; font-size: 13px; color: var(--dim); }
.upload-area .hint { display: inline-block; margin-top: 16px; font-size: 14px; color: var(--muted); background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 10px 16px; line-height: 1.85; text-align: left; }
.upload-area:hover .hint, .upload-area.dragover .hint { color: var(--text); background: rgba(0,0,0,.55); border-color: rgba(255,255,255,.12); }
.upload-area:hover p,
.upload-area.dragover p { color: rgba(255,255,255,.82); }
.upload-area:hover .upload-drag-note,
.upload-area.dragover .upload-drag-note { color: rgba(255,255,255,.70); }

/* 上傳區下方的限制說明（不會被 upload-area hover 影響） */
.limit-notice { margin: 20px 24px 20px; display: grid; gap: 8px; font-size: 14px; }
.limit-notice .limit-row { display: flex; align-items: center; gap: 10px; color: var(--muted); line-height: 1.55; }
.limit-notice .limit-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: 0.5px; flex-shrink: 0; }
.limit-notice .limit-tag.free { background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid rgba(255,255,255,.1); }
.limit-notice .limit-tag.pro { background: rgba(255,222,89,.18); color: #ffde59; border: 1px solid rgba(255,222,89,.4); }
.file-loaded { display: none; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: none; background: rgba(46,204,113,.05); }
.file-loaded.on { display: flex; }
.file-loaded .fname { font-size: 17px; font-weight: 600; color: var(--green); flex: 1; }
.file-loaded .fmeta { font-size: 16px; color: var(--muted); }
.file-loaded .fremove { color: var(--muted); cursor: pointer; font-size: 20px; padding: 4px 8px; border-radius: 4px; }
.file-loaded .fremove:hover { color: var(--red); }
.inst-panel { padding: 24px; border-bottom: none; display: none; }
.inst-panel.on { display: block; }
.inst-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.inst-label span { font-size: 17px; font-weight: 600; color: var(--text); }
.inst-label small { font-size: 15px; color: var(--dim); }
textarea.inst-input { width: 100%; background: rgba(255,255,255,.03); border: none; border-radius: 12px; padding: 14px 16px; color: var(--text); font-size: 17px; font-family: inherit; line-height: 1.75; resize: vertical; min-height: 110px; max-height: 280px; transition: box-shadow .2s; outline: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
textarea.inst-input:focus { box-shadow: inset 0 0 0 1px rgba(255,222,89,.45), 0 0 0 3px rgba(255,222,89,.10); }
textarea.inst-input::placeholder { color: var(--dim); }
.inst-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.chip { background: rgba(255,255,255,.03); border: none; color: var(--muted); font-size: 15px; padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: all .15s; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.chip:hover { color: rgba(255,255,255,.92); box-shadow: inset 0 0 0 1px rgba(255,222,89,.40); background: rgba(255,222,89,.06); }
.chip.active { color: rgba(255,255,255,.95); background: rgba(255,222,89,.18); box-shadow: inset 0 0 0 1px rgba(255,222,89,.55); }
.brand-box { background: rgba(255,255,255,.02); border-radius: 12px; padding: 10px 12px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
textarea.brand-mini { width: 100%; background: rgba(255,255,255,.03); border: none; border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 15px; font-family: inherit; line-height: 1.6; resize: vertical; min-height: 74px; max-height: 180px; outline: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
textarea.brand-mini:focus { box-shadow: inset 0 0 0 1px rgba(255,222,89,.45), 0 0 0 3px rgba(255,222,89,.10); }
textarea.brand-mini::placeholder { color: var(--dim); }
.brand-memory-panel { margin-top: 0; padding: 14px; border-radius: 14px; background: rgba(255,222,89,.06); box-shadow: inset 0 0 0 1px rgba(255,222,89,.18); }
.brand-memory-head { display:flex; justify-content:space-between; align-items:flex-start; gap: 12px; flex-wrap: wrap; }
.brand-memory-title { font-size: 16px; font-weight: 800; color: rgba(255,255,255,.94); }
.brand-memory-sub { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.brand-memory-upload, .brand-doc-clear { font-size: 13px; font-weight: 800; border: none; border-radius: 10px; padding: 9px 12px; cursor: pointer; font-family: inherit; }
.brand-memory-upload { color: #0a0a0a; background: rgba(255,222,89,.95); }
.brand-memory-upload:hover { background: #ffe680; }
.brand-doc-clear { color: var(--muted); background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); margin-top: 8px; }
.brand-doc-meta { font-size: 13px; color: var(--dim); margin-top: 10px; line-height: 1.45; }
.license-panel { display: none; padding: 14px 24px; border-bottom: 1px solid var(--border); background: rgba(230,126,34,.04); }
.license-panel.on { display: block; }
.license-panel p { font-size: 16px; color: var(--muted); margin-bottom: 8px; }
.license-row { display: flex; gap: 8px; }
input.license-input { flex: 1; background: rgba(255,255,255,.03); border: none; border-radius: 10px; padding: 9px 12px; color: var(--text); font-size: 16px; font-family: inherit; outline: none; transition: box-shadow .2s; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
input.license-input:focus { box-shadow: inset 0 0 0 1px rgba(255,222,89,.45), 0 0 0 3px rgba(255,222,89,.10); }
.buy-link { font-size: 15px; color: var(--muted); margin-top: 6px; }
.buy-link a { color: var(--blue); text-decoration: none; }
.run-bar { display: none; padding: 16px 24px; border-bottom: none; align-items: center; gap: 12px; }
.run-bar.on { display: flex; }
.run-info { flex: 1; font-size: 16px; color: var(--muted); }
.btn-run { background: var(--blue); color: var(--on-brand); border: none; padding: 11px 24px; border-radius: 10px; font-size: 18px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: all .2s; }
.btn-run:hover:not(:disabled) { background: #ffe680; }
.btn-run:disabled { opacity: .5; cursor: not-allowed; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: none; }
.btn-run.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.pbar-wrap { display: none; padding: 0 24px 14px; }
.pbar-wrap.on { display: block; }
.pbar-top { display:flex; align-items:flex-end; justify-content:space-between; gap: 14px; margin-bottom: 10px; }
.pbar-pct { font-size: 42px; font-weight: 900; letter-spacing: -1px; line-height: 1; color: #fff; min-width: 88px; text-align: left; }
.pbar-sub { font-size: 14px; color: var(--dim); margin-top: 2px; line-height: 1.4; }
.pbar-bg { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.pbar-fill { height: 100%; background: var(--blue); border-radius: 2px; transition: width .4s ease; width: 0%; }
.pbar-label { font-size: 15px; color: var(--muted); margin-top: 5px; }
.pbar-steps { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 10px; }
.pstep { display: flex; align-items: flex-start; gap: 8px; color: var(--dim); font-size: 14px; line-height: 1.35; }
.pstep .dot { width: 10px; height: 10px; border-radius: 99px; margin-top: 3px; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16); flex: 0 0 auto; }
.pstep.done { color: rgba(46,204,113,.92); }
.pstep.done .dot { background: rgba(46,204,113,.8); border-color: rgba(46,204,113,1); }
.pstep.active { color: rgba(255,255,255,.9); }
.pstep.active .dot { background: rgba(255,222,89,.95); border-color: rgba(255,222,89,1); box-shadow: 0 0 0 3px rgba(255,222,89,.18); }
.pstep .meta { color: var(--muted); }
.error-bar { display: none; padding: 10px 24px; font-size: 17px; color: var(--red); background: rgba(231,76,60,.06); border-top: none; }
.error-bar.on { display: block; }
.diff-panel { display: none; }
.diff-panel.on { display: block; }
.diff-header { padding: 16px 24px; border-top: none; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.diff-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.dstat { font-size: 15px; font-weight: 700; padding: 3px 9px; border-radius: 6px; }
.dstat { cursor: pointer; user-select: none; }
.dstat:hover { filter: brightness(1.08); }
.dstat:active { transform: translateY(1px); }
.dstat.f { background: rgba(46,204,113,.14); color: rgba(46,204,113,.95); border: none; }
.dstat.c { background: rgba(255,222,89,.20); color: var(--blue); }
.dstat.s { background: rgba(230,126,34,.15); color: var(--orange); }
.dstat.u { background: rgba(68,73,101,.2); color: var(--muted); }
.diff-bulk { display: flex; gap: 6px; }
.dbtn { font-size: 15px; font-weight: 700; padding: 7px 12px; border-radius: 10px; border: none; background: rgba(255,255,255,.03); color: rgba(255,255,255,.86); cursor: pointer; transition: all .15s; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.dbtn:hover { background: rgba(255,222,89,.08); box-shadow: inset 0 0 0 1px rgba(255,222,89,.40); color: var(--text); }
.dbtn.p { background: rgba(255,222,89,.95); color: #0a0a0a; box-shadow: none; }
.dbtn.p:hover { background: #ffe680; color: #0a0a0a; }
.diff-list { max-height: min(560px, 55vh); overflow-y: auto; border-top: none; }
.diff-list::-webkit-scrollbar { width: 5px; }
.diff-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
.drow { display: grid; grid-template-columns: 44px 1fr; border-bottom: 1px solid rgba(255,255,255,.05); }
.drow.diff-hidden { display: none !important; }
.correction-summary { display: none; padding: 16px 24px; border-top: none; background: rgba(255,255,255,.02); border-bottom: none; }
.correction-summary.on { display: block; }
.correction-summary .sum-top { display:flex; align-items:flex-start; justify-content:space-between; gap: 12px; flex-wrap: wrap; }
.correction-summary .sum-title { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 8px; line-height: 1.45; }
.correction-summary .sum-detail { font-size: 16px; color: var(--muted); line-height: 1.6; margin-bottom: 10px; }
.correction-summary .sum-credits { font-size: 15px; color: var(--orange); margin-bottom: 14px; line-height: 1.55; padding: 10px 14px; background: rgba(230,126,34,.10); border-radius: 12px; border: none; }
.correction-summary .sum-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.correction-summary .kbd { font-size: 14px; padding: 2px 8px; border-radius: 999px; border: none; background: rgba(255,255,255,.05); color: rgba(255,255,255,.70); font-family: inherit; }
.iconbar { display:flex; align-items:center; gap: 8px; }
.iconbtn { width: 40px; height: 36px; border-radius: 12px; border: none; background: rgba(255,255,255,.03); color: rgba(255,255,255,.88); display:flex; align-items:center; justify-content:center; cursor:pointer; transition: all .15s; position: relative; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.iconbtn:hover { border-color: rgba(255,222,89,.55); background: rgba(255,222,89,.08); color: #fff; }
.iconbtn.primary { background: rgba(46,204,113,.12); border-color: rgba(46,204,113,.35); color: rgba(46,204,113,.95); }
.iconbtn.primary:hover { background: rgba(46,204,113,.18); border-color: rgba(46,204,113,.6); color: #fff; }
.iconbtn svg { width: 18px; height: 18px; }
.tip { position:absolute; left:50%; top: calc(100% + 8px); transform: translateX(-50%); padding: 6px 10px; border-radius: 10px; background: rgba(0,0,0,.78); border: 1px solid rgba(255,255,255,.16); color: #fff; font-size: 13px; white-space: nowrap; pointer-events:none; opacity:0; transition: opacity .12s ease; }
.iconbtn:hover .tip { opacity: 1; }
.moremenu { position: relative; }
.menu { display:none; position:absolute; right:0; top: calc(100% + 10px); width: min(320px, 78vw); background: rgba(18,20,26,.96); border: none; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.55); padding: 10px; z-index: 10; }
.menu.on { display:block; }
.menu .mitem { display:flex; gap: 10px; align-items:flex-start; padding: 10px; border-radius: 12px; cursor:pointer; color: rgba(255,255,255,.88); }
.menu .mitem:hover { background: rgba(255,255,255,.06); }
.menu .mitem > div:first-child { white-space: nowrap; }
.menu { max-height: min(420px, calc(100vh - 160px)); overflow: auto; }
.menu .mitem .sub { color: var(--muted); font-size: 13px; margin-top: 2px; line-height: 1.3; }
.menu .divider { height: 1px; background: rgba(255,255,255,.08); margin: 8px 6px; }
.menu .danger { color: rgba(231,76,60,.95); }
.diff-panel.compact .diff-search-wrap,
.diff-panel.compact .diff-list,
.diff-panel.compact .dl-bar { display: none; }

/* ── Contact modal (avoid exposing email in HTML) ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display:none; align-items:center; justify-content:center; padding: 22px; z-index: 50; }
.modal-overlay.on { display:flex; }
.modal-overlay#final-modal { z-index: 60; }
.modal-overlay#replace-modal { z-index: 80; }
.modal-overlay#rating-modal { z-index: 70; }
.modal { width: min(520px, 100%); background: rgba(18,20,26,.96); border: none; border-radius: 18px; box-shadow: 0 22px 80px rgba(0,0,0,.62); padding: 18px 18px 14px; }
.modal.wide { width: min(860px, 100%); }
.modal h3 { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.modal p { font-size: 15px; color: var(--muted); line-height: 1.65; }
.modal .row { display:flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.modal .pill { flex:1; min-width: 220px; padding: 10px 12px; border-radius: 12px; border: none; background: rgba(255,255,255,.04); color: rgba(255,255,255,.86); font-family: inherit; font-size: 14px; }
.modal .x { margin-left:auto; border: none; background: rgba(255,255,255,.04); color: rgba(255,255,255,.72); border-radius: 12px; padding: 7px 10px; cursor:pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.modal .x:hover { border-color: rgba(231,76,60,.35); color: rgba(231,76,60,.95); }

/* ── Rating ── */
.rating-stars, .dlrate-stars { display:flex; gap: 10px; align-items:center; justify-content:center; padding: 6px 0 2px; }
.rating-stars .star, .dlrate-stars .star {
  appearance: none;
  border: none;
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.22);
  width: 52px;
  height: 52px;
  border-radius: 12px;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease, color .12s ease;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.rating-stars .star:hover, .dlrate-stars .star:hover { transform: translateY(-1px); border-color: rgba(230,126,34,.35); color: rgba(230,126,34,.75); background: rgba(230,126,34,.06); }
.rating-stars .star.on, .dlrate-stars .star.on { border-color: rgba(230,126,34,.45); color: rgba(230,126,34,.95); background: rgba(230,126,34,.10); }
.rating-meta { text-align: center; font-size: 14px; color: var(--muted); margin-top: 6px; }
.diff-search-wrap { padding: 12px 24px; border-bottom: none; background: rgba(255,255,255,.02); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.diff-search-wrap label { font-size: 15px; font-weight: 600; color: var(--muted); }
.diff-search-wrap input[type="search"] { flex: 1; min-width: 200px; background: rgba(255,255,255,.03); border: none; border-radius: 12px; padding: 10px 14px; color: var(--text); font-size: 17px; outline: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.diff-search-wrap input[type="search"]:focus { box-shadow: inset 0 0 0 1px rgba(255,222,89,.45), 0 0 0 3px rgba(255,222,89,.10); }
.diff-search-wrap .hint { font-size: 14px; color: var(--dim); }
.drow-actions .keyword-save { font-size: 15px !important; padding: 6px 10px !important; color: var(--blue) !important; border-color: rgba(255,222,89,.45) !important; }
.drow-actions .keyword-save:hover { background: rgba(255,222,89,.18) !important; border-color: var(--blue) !important; }
.drow:last-child { border-bottom: none; }
.drow.is-changed { background: rgba(255,222,89,.03); }
.drow.is-suspect { background: rgba(230,126,34,.04); }
.drow.is-accepted { background: rgba(46,204,113,.04); }
.drow.is-rejected { opacity: .5; }
.dlnum { padding: 12px 0; text-align: center; font-size: 14px; color: var(--dim); font-family: inherit; border-right: none; user-select: none; }
.dcell { padding: 9px 14px; }
.drow-text, .dcell {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  cursor: text;
}
.doriginal { font-size: 15px; color: var(--dim); margin-bottom: 4px; line-height: 1.5; }
.doriginal .del { background: rgba(231,76,60,.15); color: #e74c3c; border-radius: 2px; padding: 0 2px; text-decoration: line-through; }
.dfixed { font-size: 17px; color: var(--text); line-height: 1.6; }
.dfixed .ins { background: rgba(46,204,113,.15); color: var(--green); border-radius: 2px; padding: 0 2px; }
.dsuspect-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; color: var(--orange); background: rgba(230,126,34,.1); border-radius: 4px; padding: 2px 6px; margin-top: 4px; font-weight: 600; }
.drow-actions { display: flex; gap: 5px; margin-top: 6px; }
.drow-actions button { font-size: 15px; padding: 4px 10px; border-radius: 10px; border: none; cursor: pointer; background: rgba(255,255,255,.03); transition: all .12s; font-weight: 700; color: rgba(255,255,255,.82); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.abtn { color: var(--green); border-color: rgba(46,204,113,.25); }
.abtn:hover, .abtn.on { background: rgba(46,204,113,.12); border-color: var(--green); }
.rbtn { color: var(--red); border-color: rgba(231,76,60,.25); }
.rbtn:hover, .rbtn.on { background: rgba(231,76,60,.1); border-color: var(--red); }
.dunchanged { font-size: 17px; color: var(--dim); }
.dl-bar { padding: 16px 24px; border-top: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-dl { background: var(--green); color: #fff; border: none; padding: 11px 22px; border-radius: 10px; font-size: 18px; font-weight: 600; cursor: pointer; transition: all .2s; }
.btn-dl:hover { background: #2ecc71; transform: translateY(-1px); }
.dl-note { font-size: 16px; color: var(--muted); }
.upsell-banner { display: none; margin: 16px 0 0; background: linear-gradient(135deg, rgba(255,222,89,.18), rgba(255,222,89,.06)); border: none; border-radius: 14px; padding: 18px 22px; align-items: center; gap: 16px; flex-wrap: wrap; box-shadow: 0 18px 70px rgba(0,0,0,.18); }
.upsell-banner.on { display: flex; }
.upsell-text strong { display: block; font-size: 18px; color: #fff; margin-bottom: 3px; }
.upsell-text span { font-size: 16px; color: var(--muted); }
.btn-upsell { background: var(--blue); color: var(--on-brand); border: none; padding: 10px 20px; border-radius: 8px; font-size: 17px; font-weight: 600; cursor: pointer; }

/* sections below tool */
.how, .features, .honest { padding: 50px 0; border-top: none; margin-top: 40px; }
.sec-h { text-align: center; font-size: 29px; font-weight: 700; color: #fff; margin-bottom: 8px; letter-spacing: -.5px; }
.sec-sub { text-align: center; color: var(--muted); font-size: 18px; margin-bottom: 32px; }
.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.step-block { background: var(--surface); border: none; border-radius: 14px; padding: 22px; box-shadow: 0 18px 60px rgba(0,0,0,.22); }
.step-block .snum { width: 28px; height: 28px; border-radius: 50%; background: var(--blue-light); border: 1px solid rgba(255,222,89,.4); color: var(--blue); font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.step-block h3 { font-size: 18px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.step-block p { font-size: 16px; color: var(--muted); line-height: 1.65; }
.feat-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.feat-card { background: var(--surface); border: none; border-radius: 14px; padding: 20px 22px; box-shadow: 0 18px 60px rgba(0,0,0,.20); }
.feat-card h3 { font-size: 18px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.feat-card p { font-size: 16px; color: var(--muted); line-height: 1.65; }
.honest-box { max-width: min(720px, 100%); margin: 0 auto; background: var(--surface); border: none; border-radius: 16px; padding: 30px 34px; box-shadow: 0 22px 80px rgba(0,0,0,.22); }
.honest-box h2 { font-size: 23px; font-weight: 700; color: #fff; margin-bottom: 14px; }
.honest-box p { color: var(--text); font-size: 18px; line-height: 1.85; margin-bottom: 12px; }
.honest-box .sig { color: var(--muted); font-size: 16px; font-style: italic; margin-top: 14px; }

/* ── PRICING PAGE ── */
.pricing-hero { padding: 60px 0 50px; text-align: center; }
.pricing-hero h1 { font-size: 40px; font-weight: 700; color: #fff; letter-spacing: -.8px; margin-bottom: 10px; }
.pricing-hero p { color: var(--muted); font-size: 19px; max-width: 440px; margin: 0 auto; }
.plans { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; padding-bottom: 60px; }
.plan-card { background: var(--surface); border: 1px solid var(--border2); border-radius: 16px; padding: 28px 24px; display: flex; flex-direction: column; position: relative; transition: border-color .2s; }
.plan-card:hover { border-color: var(--blue); }
.plan-card.featured { border-color: var(--blue); background: linear-gradient(160deg,rgba(255,222,89,.08) 0%,var(--surface) 60%); }
.plan-card.selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(255,222,89,.18); }
.plan-card { border: none; border-radius: 18px; transition: transform .2s, box-shadow .2s; box-shadow: 0 18px 70px rgba(0,0,0,.22); }
.plan-card:hover { border-color: transparent; transform: translateY(-1px); box-shadow: 0 22px 80px rgba(0,0,0,.26); }
.plan-card.selected { border-color: transparent; box-shadow: 0 22px 90px rgba(0,0,0,.26), 0 0 0 3px rgba(255,222,89,.14); }

.calc-box.fade-in { animation: fadeInCalc .2s ease-out; }
@keyframes fadeInCalc { from { opacity: 0; } to { opacity: 1; } }

.calc-table { width: 100%; border-collapse: collapse; }
.calc-table th, .calc-table td { padding: 10px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.calc-table th { font-size: 14px; letter-spacing: .2px; color: var(--dim); font-weight: 700; }
.calc-table td { font-size: 16px; color: var(--text); }
.calc-table td.cost { color: var(--green); font-weight: 800; white-space: nowrap; }
.calc-table td.total { color: var(--muted); font-weight: 700; white-space: nowrap; text-align: right; }
.calc-note.free { color: var(--orange); background: rgba(230,126,34,.08); border: 1px solid rgba(230,126,34,.25); }
.calc-note.paid { color: var(--muted); background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.08); }
.calc-note.free { border: none; background: rgba(230,126,34,.10); }
.calc-note.paid { border: none; background: rgba(255,255,255,.03); }
.calc-note { margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-size: 15px; line-height: 1.6; }
.popular-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--blue); color: var(--on-brand); font-size: 15px; font-weight: 700; padding: 3px 12px; border-radius: 20px; white-space: nowrap; }
.plan-name { font-size: 17px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 14px; }
.plan-amount { font-size: 50px; font-weight: 700; color: #fff; letter-spacing: -2px; line-height: 1; display:flex; align-items:flex-start; gap: 10px; }
.plan-amount .curr { font-size: 22px; color: var(--muted); margin-top: 8px; display: inline-block; letter-spacing: .3px; }
.plan-amount .amt { font-size: 50px; line-height: 1; letter-spacing: -1.5px; }
.plan-amount.free { font-size: 42px; color: var(--green); }
.plan-desc { font-size: 17px; color: var(--muted); margin: 10px 0 22px; min-height: 38px; }
.plan-btn { display: block; width: 100%; padding: 11px; border-radius: 10px; font-size: 18px; font-weight: 600; text-align: center; cursor: pointer; border: none; transition: all .2s; margin-bottom: 22px; }
.plan-btn.ghost { background: transparent; border: 1px solid var(--border2); color: var(--muted); }
.plan-btn.ghost:hover { border-color: var(--blue); color: var(--blue); }
.plan-btn.ghost { background: rgba(255,255,255,.03); border: none; color: rgba(255,255,255,.82); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.plan-btn.ghost:hover { background: rgba(255,222,89,.08); box-shadow: inset 0 0 0 1px rgba(255,222,89,.40); color: #fff; }
.plan-btn.solid { background: var(--blue); color: var(--on-brand); }
.plan-btn.solid:hover { background: #ffe680; transform: translateY(-1px); }
.plan-features { flex: 1; }
.plan-features li { list-style: none; font-size: 17px; color: var(--text); padding: 5px 0; display: flex; gap: 9px; }
.plan-features li::before { content: '✓'; color: var(--green); font-weight: 700; flex-shrink: 0; }
.plan-features li.no { color: var(--dim); }
.plan-features li.no::before { content: '—'; color: var(--dim); }
.calc-section { padding: 50px 0; border-top: none; }
.calc-box { background: var(--surface); border: 1px solid var(--border2); border-radius: 14px; padding: 28px 32px; max-width: 600px; margin: 0 auto; }
.calc-box { border: none; border-radius: 16px; box-shadow: 0 22px 90px rgba(0,0,0,.22); }
.calc-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; text-align: center; }
.calc-item .clabel { font-size: 16px; color: var(--muted); margin-bottom: 6px; }
.calc-item .cval { font-size: 26px; font-weight: 700; color: var(--green); }
.calc-divider { height: 1px; background: var(--border); margin: 20px 0; }
.calc-note { font-size: 16px; color: var(--dim); text-align: center; }
.pfaq { padding: 50px 0; border-top: none; }
.pfaq h2 { text-align: center; font-size: 26px; font-weight: 700; color: #fff; margin-bottom: 28px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; margin-bottom: 8px; }
.faq-item { border: none; border-radius: 14px; margin-bottom: 10px; box-shadow: 0 16px 60px rgba(0,0,0,.18); }
.faq-item h4 { font-size: 18px; font-weight: 600; color: #fff; margin-bottom: 5px; }
.faq-item p { font-size: 16px; color: var(--muted); line-height: 1.7; }

/* ── AUTH PAGE ── */
.auth-wrap { display: flex; align-items: center; justify-content: center; padding: 60px 24px; min-height: calc(100vh - 57px); }
.auth-card { background: var(--surface); border: none; border-radius: 18px; padding: 40px 36px; width: 100%; max-width: 400px; box-shadow: 0 22px 90px rgba(0,0,0,.26); }
.auth-card h1 { font-size: 26px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.auth-card > p { font-size: 18px; color: var(--muted); margin-bottom: 28px; }
.btn-google { width: 100%; padding: 12px; border-radius: 10px; background: #fff; color: #1a1a1a; border: none; font-size: 18px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: all .15s; }
.btn-google:hover { background: #f5f5f5; transform: translateY(-1px); }
.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.divider span { font-size: 16px; color: var(--dim); white-space: nowrap; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
input.email-input { width: 100%; background: rgba(255,255,255,.03); border: none; border-radius: 12px; padding: 12px 14px; color: var(--text); font-size: 18px; font-family: inherit; outline: none; transition: box-shadow .2s; margin-bottom: 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
input.email-input:focus { box-shadow: inset 0 0 0 1px rgba(255,222,89,.45), 0 0 0 3px rgba(255,222,89,.10); }
input.email-input::placeholder { color: var(--dim); }
.btn-magic { width: 100%; padding: 12px; border-radius: 10px; background: var(--blue); color: var(--on-brand); border: none; font-size: 18px; font-weight: 600; cursor: pointer; transition: all .15s; }
.btn-magic:hover { background: #ffe680; }
.btn-magic:disabled { opacity: .5; cursor: not-allowed; }
.auth-msg { margin-top: 14px; padding: 12px 14px; border-radius: 8px; font-size: 17px; display: none; }
.auth-msg.ok { background: rgba(46,204,113,.10); color: var(--green); border: none; display: block; }
.auth-msg.err { background: rgba(231,76,60,.08); color: var(--red); border: none; display: block; }
.terms { font-size: 15px; color: var(--dim); text-align: center; margin-top: 20px; line-height: 1.6; }
.terms a { color: var(--muted); text-decoration: none; }

/* ── DASHBOARD PAGE ── */
.dash-body { padding: 36px 0 60px; }
.dash-grid { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 14px; }
.profile-card, .credits-card, .activate-card { background: var(--surface); border: none; border-radius: 16px; padding: 22px; box-shadow: 0 18px 70px rgba(0,0,0,.22); }
.avatar-lg { width: 52px; height: 52px; border-radius: 50%; background: var(--blue-light); border: 2px solid rgba(255,222,89,.4); color: var(--blue); font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.profile-email { font-size: 17px; color: var(--text); font-weight: 600; margin-bottom: 4px; word-break: break-all; }
.plan-badge { display: inline-block; font-size: 15px; font-weight: 700; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .5px; }
.plan-badge.free { background: rgba(139,144,171,.1); color: var(--muted); }
.plan-badge.starter { background: rgba(230,126,34,.12); color: var(--orange); }
.plan-badge.standard { background: var(--blue-light); color: var(--blue); }
.credits-card h3, .activate-card h3 { font-size: 17px; font-weight: 600; color: var(--muted); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .5px; }
.credit-bar-bg { height: 6px; background: var(--border2); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.credit-bar-fill { height: 100%; background: var(--blue); border-radius: 3px; transition: width .6s ease; }
.credit-numbers { display: flex; justify-content: space-between; font-size: 16px; }
.credit-numbers .cleft { color: var(--text); font-weight: 600; }
.credit-numbers .cused { color: var(--muted); }
.btn-buy-more { display: block; width: 100%; margin-top: 14px; padding: 9px; background: var(--blue); color: var(--on-brand); border: none; border-radius: 8px; font-size: 17px; font-weight: 600; text-align: center; cursor: pointer; transition: all .15s; }
.btn-buy-more:hover { background: #ffe680; }
.activate-row { display: flex; gap: 8px; }
input.act-input { flex: 1; background: rgba(255,255,255,.03); border: none; border-radius: 10px; padding: 9px 11px; color: var(--text); font-size: 16px; font-family: inherit; outline: none; transition: box-shadow .2s; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
input.act-input:focus { box-shadow: inset 0 0 0 1px rgba(255,222,89,.45), 0 0 0 3px rgba(255,222,89,.10); }
input.act-input::placeholder { color: var(--dim); font-family: inherit; }
.btn-activate { background: var(--blue); color: var(--on-brand); border: none; padding: 9px 14px; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.activate-msg { font-size: 15px; margin-top: 6px; display: none; }
.activate-msg.ok { color: var(--green); display: block; }
.activate-msg.err { color: var(--red); display: block; }
.main-content { display: flex; flex-direction: column; gap: 20px; }
.section-card { background: var(--surface); border: none; border-radius: 16px; overflow: hidden; box-shadow: 0 18px 70px rgba(0,0,0,.22); }
.section-header { padding: 18px 22px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.section-header h2 { font-size: 19px; font-weight: 700; color: #fff; }
.section-header span { font-size: 16px; color: var(--muted); }
.vocab-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--border); }
.vocab-item:last-child { border-bottom: none; }
.vocab-item:hover { background: var(--surface2); }
.vocab-name { font-size: 18px; font-weight: 600; color: var(--text); }
.vocab-preview { font-size: 16px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px; }
.vocab-actions { display: flex; gap: 6px; }
.vbtn { font-size: 15px; padding: 6px 11px; border-radius: 10px; border: none; background: rgba(255,255,255,.03); cursor: pointer; transition: all .15s; font-weight: 700; color: rgba(255,255,255,.82); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.vbtn.edit:hover { border-color: var(--blue); color: var(--blue); }
.vbtn.del:hover { border-color: var(--red); color: var(--red); }
.vocab-empty, .vocab-locked { padding: 28px; text-align: center; color: var(--dim); font-size: 17px; }
.vocab-add-form { padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface2); }
.vocab-add-form h4 { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
input.vocab-name-input, textarea.vocab-content-input { width: 100%; background: rgba(255,255,255,.03); border: none; border-radius: 12px; padding: 9px 12px; color: var(--text); font-size: 17px; font-family: inherit; outline: none; transition: box-shadow .2s; margin-bottom: 8px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
input.vocab-name-input:focus, textarea.vocab-content-input:focus { box-shadow: inset 0 0 0 1px rgba(255,222,89,.45), 0 0 0 3px rgba(255,222,89,.10); }
textarea.vocab-content-input { resize: vertical; min-height: 90px; line-height: 1.7; }
input.vocab-name-input::placeholder, textarea.vocab-content-input::placeholder { color: var(--dim); }
.vocab-form-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn-save { background: var(--blue); color: var(--on-brand); border: none; padding: 9px 18px; border-radius: 8px; font-size: 17px; font-weight: 600; cursor: pointer; }
.btn-cancel { background: transparent; border: 1px solid var(--border2); color: var(--muted); padding: 9px 14px; border-radius: 8px; font-size: 17px; cursor: pointer; }
.log-list { padding: 0; max-height: 320px; overflow-y: auto; }
.log-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 16px; padding: 12px 22px; border-bottom: 1px solid var(--border); font-size: 17px; }
.log-row:last-child { border-bottom: none; }
.log-date { color: var(--muted); font-size: 15px; }
.log-credits { color: var(--orange); font-weight: 600; font-size: 16px; }
.log-empty { padding: 28px; text-align: center; color: var(--dim); font-size: 17px; }
.loading-state { padding: 40px; text-align: center; color: var(--muted); }
.spin { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border2); border-top-color: var(--blue); border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.btn-logout { background: transparent; border: 1px solid var(--border2); color: var(--muted); padding: 6px 13px; border-radius: 7px; font-size: 16px; cursor: pointer; transition: all .15s; }
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* FOOTER */
footer { border-top: none; padding: 28px 0; text-align: center; color: var(--dim); font-size: 16px; margin-top: 50px; }
footer a { color: var(--muted); text-decoration: none; }

@media (max-width: 768px) {
  /* ── Navigation ── */
  .nav-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    gap: 8px;
  }
  .logo { flex-shrink: 0; }
  .nav-links { display: none !important; }
  .nav-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  /* 免費試用徽章隱藏，避免佔空間 */
  .nav-free-badge { display: none !important; }
  #free-pill { display: none; }

  .nbtn {
    font-size: 13px;
    padding: 6px 12px;
    white-space: nowrap;
  }
  #nav-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border2);
    background: rgba(255,255,255,.02);
    color: rgba(255,255,255,.9);
    font-size: 18px;
    cursor: pointer;
    user-select: none;
  }
  #nav-hamburger:hover { border-color: rgba(255,222,89,.55); background: rgba(255,222,89,.08); }
  #nav-hamburger:active { transform: translateY(1px); }

  #nav-mobile-menu {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    top: 52px;
    background: var(--surface);
    border-bottom: 1px solid var(--border2);
    box-shadow: 0 18px 60px rgba(0,0,0,.55);
    transform: translateY(-10px);
    opacity: 0;
    transition: transform .18s ease, opacity .18s ease;
    z-index: 999;
    padding: 12px 0;
  }
  #nav-mobile-menu.on {
    display: block;
    transform: translateY(0);
    opacity: 1;
  }
  #nav-mobile-menu .mm-inner { padding: 10px 16px 14px; display: grid; gap: 8px; }
  #nav-mobile-menu .mm-free-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--green);
    background: rgba(46,204,113,.10);
    border: 1px solid rgba(46,204,113,.22);
    border-radius: 999px;
    padding: 6px 12px;
    width: fit-content;
  }
  #nav-mobile-menu .mm-item {
    width: 100%;
    text-align: left;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.02);
    color: rgba(255,255,255,.92);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
  }
  #nav-mobile-menu .mm-item:hover { border-color: rgba(255,222,89,.55); background: rgba(255,222,89,.08); }

  /* ── Wrap padding ── */
  .wrap { padding: 0 16px; }

  /* ── Hero ── */
  .hero-tool { padding: 20px 0 0; }
  .hero-headline h1 { font-size: 28px; letter-spacing: -.4px; line-height: 1.25; }
  .hero-headline p { font-size: 15px; }
  .free-note { font-size: 14px; }

  /* ── Upload area ── */
  .upload-area { padding: 28px 16px; margin: 12px; }
  .upload-area h2 { font-size: 17px; }
  .upload-area p { font-size: 14px; }
  .upload-cta { width: 100%; }

  /* ── Instructions / chips ── */
  .inst-panel { padding: 14px 16px; }
  .inst-chips { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .chip { font-size: 13px; padding: 6px 10px; }
  .inst-label span { font-size: 14px; }
  .brand-memory-panel { padding: 12px; }
  .brand-memory-head { gap: 10px; }
  .brand-memory-upload, .brand-doc-clear { width: 100%; text-align: center; }

  /* ── Run bar ── */
  .run-bar { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .run-info { font-size: 13px; }
  .btn-run { font-size: 14px; padding: 10px 18px; width: 100%; }

  /* ── File loaded bar ── */
  .file-loaded { padding: 10px 16px; }
  .file-loaded .fname { font-size: 14px; }
  .file-loaded .fmeta { font-size: 13px; }

  /* ── Diff panel ── */
  .diff-panel > * {
    margin-top: 0;
    margin-bottom: 0;
  }
  .diff-header {
    padding: 0;
    margin: 0;
    gap: 0;
    align-items: stretch;
  }
  .diff-stats {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding: 10px 14px;
    margin: 0;
    white-space: nowrap;
  }
  .diff-stats::-webkit-scrollbar { display: none; }
  .dstat { font-size: 13px; flex-shrink: 0; }
  .diff-bulk,
  .diff-actions {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding: 10px 14px;
    margin: 0;
    border-top: 1px solid var(--border);
    white-space: nowrap;
  }
  .diff-bulk::-webkit-scrollbar,
  .diff-actions::-webkit-scrollbar { display: none; }
  .diff-bulk .dbtn,
  .diff-bulk button,
  .diff-actions .dbtn,
  .diff-actions button { flex-shrink: 0; white-space: nowrap; }
  .dbtn { font-size: 13px; padding: 6px 10px; }
  .diff-toolbar { flex-wrap: wrap; gap: 6px; padding: 10px 14px; margin: 0; border-top: 1px solid var(--border); }
  .diff-search-wrap { padding: 10px 14px; margin: 0; border-top: 1px solid var(--border); }
  .diff-search-wrap input { font-size: 14px; }
  .drow { font-size: 14px; }
  .drow-text, .dcell {
    -webkit-user-select: text;
    user-select: text;
    touch-action: auto;
  }
  .dlnum { min-width: 28px; font-size: 11px; }
  .dl-bar { padding: 12px 14px; margin: 0; border-top: 1px solid var(--border); }
  .btn-dl { font-size: 14px; padding: 11px 16px; }

  /* ── Result header (iconbar + credits box) ── */
  .correction-summary,
  .diff-summary {
    padding: 0;
    margin: 0;
    border-top: 1px solid var(--border);
  }
  .correction-summary .sum-top {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
  }
  .correction-summary .sum-top > div:first-child {
    padding: 12px 14px;
    margin: 0;
  }
  .correction-summary .sum-title { margin-bottom: 8px; }
  .correction-summary .sum-detail { margin-bottom: 0; }
  .correction-summary .sum-actions {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 14px;
    margin: 0;
    border-top: 1px solid var(--border);
  }
  .iconbar {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 14px;
    margin: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .iconbtn { width: 38px; height: 34px; border-radius: 12px; }
  .correction-summary .sum-credits,
  .diff-credit-note {
    width: auto;
    margin: 12px 14px;
    padding: 10px 14px;
    border-radius: 10px;
  }

  /* ── Upsell banner ── */
  .upsell-banner { padding: 16px; }
  .upsell-banner .buy-title { font-size: 16px; }
  .upsell-banner .buy-sub { font-size: 13px; }

  /* ── Steps section ── */
  .steps-section { padding: 40px 0; }
  .steps-section h2 { font-size: 22px; }
  .step-card { padding: 20px 16px; }

  /* ── Pricing ── */
  .pricing-hero h1 { font-size: 26px; }
  .pricing-hero p { font-size: 15px; }
  .plan-card { padding: 20px 16px; }
  .plan-price { font-size: 36px; }
  .calc-box { padding: 20px 16px; }

  /* ── Auth ── */
  .auth-card { padding: 28px 20px; }

  /* ── Dashboard ── */
  .dash-grid { gap: 16px; }
  .section-card { padding: 20px 16px; }

  /* existing grid fallbacks (kept) */
  .steps { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .calc-row { grid-template-columns: 1fr; }

  /* 防止孤字換行：所有大標題縮小字體並允許自動換行 */
  .hero-headline h1 {
    font-size: 26px;
    word-break: keep-all;
    overflow-wrap: break-word;
    line-height: 1.3;
  }

  .pricing-hero h1,
  .calc-section h2,
  .sec-h,
  .honest-box h2 {
    font-size: 22px;
    word-break: keep-all;
    overflow-wrap: break-word;
    line-height: 1.35;
  }

  /* 所有 section 的副標題 */
  .hero-headline p,
  .sec-sub,
  .pricing-hero p {
    font-size: 14px;
    word-break: keep-all;
  }

  /* Step card 和其他卡片內的標題 */
  .step-block h3,
  .feat-card h3,
  .plan-card .plan-name {
    word-break: keep-all;
  }
}

@media (min-width: 769px) {
  /* Desktop protection: ensure full nav, hide mobile UI */
  .nav-hamburger, #nav-hamburger { display: none !important; }
  .nav-mobile-menu, #nav-mobile-menu { display: none !important; }
  .nav-links { display: flex !important; }
  .nav-right { display: flex !important; }
  .nav-free-badge, #free-pill { display: inline-flex !important; }
}

/* Brand form row — responsive grid */
.bf-row { display: grid; grid-template-columns: 1fr 2fr 36px; gap: 8px; align-items: center; }
@media (max-width: 540px) {
  .bf-row { grid-template-columns: 1fr 36px; grid-template-rows: auto auto; }
  .bf-row input:nth-child(2) { grid-column: 1 / 2; grid-row: 2; }
  .bf-row button { grid-column: 2; grid-row: 1; }
}
