/* ==================================================================
   工具箱 — Design tokens
   ================================================================== */
:root {
  color-scheme: light;

  /* 中性色（帶少少暖調，避免死白） */
  --bg:            #f6f7f9;
  --bg-elev:       #ffffff;
  --bg-sunken:     #eef0f4;
  --surface-hover: #fafbfc;

  --text:          #14161a;
  --text-2:        #4c525c;
  --text-3:        #858c98;

  --line:          #e6e8ee;
  --line-strong:   #d3d7e0;

  /* 品牌重點色 */
  --accent:        #4f46e5;
  --accent-hover:  #4338ca;
  --accent-soft:   #eeecfd;
  --accent-text:   #ffffff;

  /* 工具個別色調（對比度已驗證 ≥3:1；每個色調永遠配住工具名，唔會單靠顏色分辨） */
  --tone-link:     #4f46e5;
  --tone-link-bg:  #eeecfd;
  --tone-timer:    #e0574a;
  --tone-timer-bg: #fdeceb;
  --tone-qr:       #0f8f7e;
  --tone-qr-bg:    #e3f5f1;
  --tone-unit:     #c2740a;
  --tone-unit-bg:  #fdf0dd;
  --tone-fx:       #2a78d6;
  --tone-fx-bg:    #e6f0fc;
  --tone-zh:       #be3455;
  --tone-zh-bg:    #fdeaee;
  --tone-file:     #197d3f;
  --tone-file-bg:  #e4f4ea;

  --ok:            #15803d;
  --warn:          #b45309;
  --danger:        #cf222e;

  /* 柔和陰影 */
  --shadow-xs: 0 1px 2px rgba(16, 20, 30, .05);
  --shadow-sm: 0 1px 2px rgba(16, 20, 30, .04), 0 2px 6px rgba(16, 20, 30, .05);
  --shadow-md: 0 2px 4px rgba(16, 20, 30, .04), 0 10px 24px -6px rgba(16, 20, 30, .10);
  --shadow-lg: 0 4px 8px rgba(16, 20, 30, .04), 0 20px 44px -12px rgba(16, 20, 30, .16);
  --ring: 0 0 0 3px rgba(79, 70, 229, .18);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC",
          "PingFang TC", "Microsoft JhengHei", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", "IBM Plex Mono", Menlo, Consolas, monospace;

  --maxw: 1080px;
  --topbar-h: 58px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg:            #101114;
  --bg-elev:       #17191e;
  --bg-sunken:     #0b0c0e;
  --surface-hover: #1c1f25;

  --text:          #eceef2;
  --text-2:        #a5adba;
  --text-3:        #757d8b;

  --line:          #262a32;
  --line-strong:   #333944;

  --accent:        #8b85f5;
  --accent-hover:  #a09bf8;
  --accent-soft:   #23213a;
  --accent-text:   #14161a;

  --tone-link:     #8b85f5;
  --tone-link-bg:  #23213a;
  --tone-timer:    #e8705f;
  --tone-timer-bg: #33201d;
  --tone-qr:       #35a892;
  --tone-qr-bg:    #12302b;
  --tone-unit:     #cf8a1e;
  --tone-unit-bg:  #33270f;
  --tone-fx:       #3987e5;
  --tone-fx-bg:    #14243a;
  --tone-zh:       #e0637f;
  --tone-zh-bg:    #351a22;
  --tone-file:     #33a163;
  --tone-file-bg:  #122c1d;

  --ok:            #4ade80;
  --warn:          #fbbf24;
  --danger:        #f87171;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 6px rgba(0, 0, 0, .3);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, .35), 0 10px 24px -6px rgba(0, 0, 0, .5);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, .4), 0 20px 44px -12px rgba(0, 0, 0, .6);
  --ring: 0 0 0 3px rgba(139, 133, 245, .25);
}

/* ==================================================================
   Base
   ================================================================== */
*, *::before, *::after { box-sizing: border-box; }

/* class 上面嘅 display 會蓋過瀏覽器預設嘅 [hidden]，所以要強制 */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

h1, h2, h3, h4 { margin: 0; font-weight: 620; letter-spacing: -.015em; line-height: 1.25; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--bg-elev); padding: 8px 14px; border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
}
.skip-link:focus { left: 12px; }

/* ==================================================================
   Topbar
   ================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: var(--maxw); height: 100%; margin: 0 auto;
  padding: 0 20px; display: flex; align-items: center; gap: 16px;
}
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 640; letter-spacing: -.02em; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-text);
  box-shadow: var(--shadow-sm);
}
html[data-theme="dark"] .brand__mark { color: #0e0f13; }
.brand__text { font-size: 15.5px; }

.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-2); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--bg-elev); border-color: var(--line); color: var(--text); }
.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }

/* ==================================================================
   Layout
   ================================================================== */
.view { flex: 1 0 auto; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.footer {
  flex-shrink: 0;
  margin-top: 56px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--text-3);
}
.footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.dot-badge { display: inline-flex; align-items: center; gap: 6px; }
.dot-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent);
}
.dot-badge.is-off::before { background: var(--text-3); box-shadow: none; }

/* ==================================================================
   Hero（刻意細，重點喺工具卡）
   ================================================================== */
.hero { padding: 34px 0 20px; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 10px;
}
.hero__eyebrow::before {
  content: ""; width: 14px; height: 1.5px; background: var(--line-strong); border-radius: 2px;
}
.hero h1 { font-size: clamp(22px, 3.4vw, 28px); }
.hero p { margin-top: 7px; color: var(--text-2); font-size: 14.5px; max-width: 46ch; }

/* ==================================================================
   工具列（搜尋 + 分類）
   ================================================================== */
.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 6px 0 18px;
}
.search {
  position: relative; flex: 1 1 260px; max-width: 340px;
}
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 38px; padding: 0 12px 0 34px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-elev); box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.search input::placeholder { color: var(--text-3); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-elev);
  color: var(--text-2); font-size: 13px; cursor: pointer;
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg-elev); border-color: var(--text); }

/* ==================================================================
   工具卡片
   ================================================================== */
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}

.card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 20px; min-height: 172px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s, border-color .18s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card:active { transform: translateY(0); }

.card__top { display: flex; align-items: flex-start; justify-content: space-between; }
.card__icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--tone-bg, var(--accent-soft));
  color: var(--tone, var(--accent));
}
.card__arrow {
  color: var(--text-3); opacity: 0; transform: translateX(-4px);
  transition: opacity .18s, transform .18s;
}
.card:hover .card__arrow { opacity: 1; transform: translateX(0); }

.card h3 { font-size: 16px; }
.card__desc { margin-top: 4px; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.card__tags { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11.5px; padding: 2px 8px; border-radius: 999px;
  background: var(--bg-sunken); color: var(--text-3); border: 1px solid transparent;
}

.card--ghost {
  border-style: dashed; box-shadow: none; background: transparent;
  align-items: center; justify-content: center; text-align: center;
  color: var(--text-3); gap: 8px;
}
.card--ghost:hover { transform: none; box-shadow: none; border-color: var(--line-strong); }
.card--ghost strong { color: var(--text-2); font-weight: 560; font-size: 14px; }
.card--ghost span { font-size: 12.5px; }

.empty {
  padding: 44px 20px; text-align: center; color: var(--text-3);
  border: 1px dashed var(--line); border-radius: var(--r-lg);
}

/* ==================================================================
   工具頁
   ================================================================== */
.tool-head { padding: 26px 0 18px; }
.backlink {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--text-3); margin-bottom: 14px;
  transition: color .15s;
}
.backlink:hover { color: var(--text); }

.tool-head__row { display: flex; align-items: center; gap: 13px; }
.tool-head__icon {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: var(--tone-bg, var(--accent-soft)); color: var(--tone, var(--accent));
  flex-shrink: 0;
}
.tool-head h1 { font-size: 20px; }
.tool-head p { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: 24px;
}
.panel + .panel { margin-top: 14px; }
.panel__title {
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 14px;
}

/* ==================================================================
   表單元件
   ================================================================== */
.field { display: block; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field__label { display: block; font-size: 13px; font-weight: 550; margin-bottom: 6px; color: var(--text-2); }
.field__hint { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }

.input, .select, .textarea {
  width: 100%; padding: 10px 13px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input.is-error { border-color: var(--danger); }
.textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23858c98' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.mono { font-family: var(--mono); font-size: 13.5px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 0; min-width: 0; }
.row--tight { gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 18px; border-radius: 10px;
  border: 1px solid transparent; background: var(--accent); color: var(--accent-text);
  font-size: 14px; font-weight: 560; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: background .15s, border-color .15s, color .15s, transform .1s, opacity .15s;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn--secondary { background: var(--bg-elev); color: var(--text); border-color: var(--line-strong); }
.btn--secondary:hover { background: var(--surface-hover); border-color: var(--text-3); }
.btn--ghost { background: transparent; color: var(--text-2); border-color: var(--line); box-shadow: none; }
.btn--ghost:hover { background: var(--bg-elev); color: var(--text); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn--tone { background: var(--tone, var(--accent)); color: #fff; }
html[data-theme="dark"] .btn--tone { color: #14161a; }
/* 要重申 background，否則 .btn:hover（特異性較高）會蓋過工具色調 */
.btn--tone:hover { background: var(--tone, var(--accent)); filter: brightness(1.07); }

.btn .spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 13px; border-radius: 10px; font-size: 13px; line-height: 1.55;
  background: var(--bg-sunken); color: var(--text-2); border: 1px solid var(--line);
}
.note--warn { background: color-mix(in srgb, var(--warn) 10%, var(--bg-elev)); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.note--error { background: color-mix(in srgb, var(--danger) 9%, var(--bg-elev)); border-color: color-mix(in srgb, var(--danger) 28%, transparent); color: var(--danger); }
.note strong { color: var(--text); font-weight: 600; }
.note code { font-family: var(--mono); font-size: 12.5px; background: var(--bg-sunken); padding: 1px 5px; border-radius: 5px; }

/* 結果條 */
.result {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 12px 12px 15px; border-radius: 12px;
  background: var(--bg-sunken); border: 1px solid var(--line);
  animation: pop .25s cubic-bezier(.2,.8,.3,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(4px); } }
.result__url { flex: 1; min-width: 0; font-family: var(--mono); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result__url a { color: var(--tone, var(--accent)); }

.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* 歷史清單 */
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.history li {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-top: 1px solid var(--line);
}
.history li:first-child { border-top: 0; }
.history__main { flex: 1; min-width: 0; }
.history__short { font-family: var(--mono); font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history__long { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history__acts { display: flex; gap: 4px; flex-shrink: 0; }

/* ==================================================================
   番茄鐘
   ================================================================== */
.timer { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 8px 0 4px; }
.timer__modes {
  display: inline-flex; padding: 4px; gap: 4px;
  background: var(--bg-sunken); border-radius: 999px; border: 1px solid var(--line);
}
.timer__mode {
  height: 32px; padding: 0 18px; border-radius: 999px; border: 0; background: transparent;
  color: var(--text-2); font-size: 13.5px; font-weight: 550; cursor: pointer; transition: all .18s;
}
.timer__mode[aria-pressed="true"] { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-xs); }

.dial { position: relative; width: 248px; height: 248px; }
.dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial__track { fill: none; stroke: var(--bg-sunken); stroke-width: 10; }
.dial__prog {
  fill: none; stroke: var(--tone-timer); stroke-width: 10; stroke-linecap: round;
  transition: stroke-dashoffset .3s linear, stroke .3s;
}
.dial.is-break .dial__prog { stroke: var(--tone-qr); }
.dial__center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
}
.dial__time {
  font-family: var(--mono); font-size: 50px; font-weight: 500;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1;
}
.dial__label { font-size: 12.5px; color: var(--text-3); letter-spacing: .04em; }
.dial.is-running .dial__label { color: var(--tone-timer); }
.dial.is-running.is-break .dial__label { color: var(--tone-qr); }

.timer__controls { display: flex; gap: 10px; align-items: center; }
.timer__controls .btn { min-width: 108px; }

.timer__stats { display: flex; gap: 26px; color: var(--text-3); font-size: 13px; }
.timer__stats b { display: block; color: var(--text); font-family: var(--mono); font-size: 19px; font-weight: 500; text-align: center; }

.settings-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.stepper { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.stepper__ctrl { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--bg-elev); }
.stepper button {
  width: 28px; height: 30px; border: 0; background: transparent; color: var(--text-2);
  cursor: pointer; font-size: 15px; line-height: 1;
}
.stepper button:hover { background: var(--bg-sunken); color: var(--text); }
.stepper output { min-width: 34px; text-align: center; font-family: var(--mono); font-size: 13.5px; }

/* ==================================================================
   QR Code
   ================================================================== */
.qr-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
@media (max-width: 720px) { .qr-layout { grid-template-columns: 1fr; } }

.qr-preview {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 22px; border-radius: var(--r-lg);
  background: var(--bg-sunken); border: 1px solid var(--line);
}
.qr-canvas-box {
  background: #fff; padding: 12px; border-radius: 12px; box-shadow: var(--shadow-sm);
  line-height: 0;
}
.qr-canvas-box canvas { display: block; border-radius: 4px; }
.qr-preview__meta { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.qr-preview.is-empty .qr-canvas-box { background: var(--bg-elev); }
.qr-empty { width: 232px; height: 232px; display: grid; place-items: center; color: var(--text-3); font-size: 13px; font-family: var(--sans); }

.swatches { display: flex; gap: 8px; align-items: center; }
.swatch {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-strong);
  cursor: pointer; padding: 0; background: none;
}
.swatch[aria-pressed="true"] { box-shadow: var(--ring); border-color: var(--accent); }
input[type="color"].swatch-input { width: 44px; height: 30px; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: none; cursor: pointer; }

/* ==================================================================
   換算共用（單位 / 匯率）
   ================================================================== */
.conv {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end;
}
@media (max-width: 620px) {
  .conv { grid-template-columns: 1fr; }
  .conv__swap { justify-self: center; margin: -2px 0; }
  .conv__swap svg { transform: rotate(90deg); }
}
.conv__swap {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--bg-elev);
  color: var(--text-2); cursor: pointer; display: grid; place-items: center;
  transition: background .15s, color .15s, transform .2s;
}
.conv__swap:hover { background: var(--bg-sunken); color: var(--text); }
.conv__swap:active { transform: rotate(180deg); }

.bigval {
  margin-top: 16px; padding: 18px 20px; border-radius: var(--r-lg);
  background: var(--bg-sunken); border: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.bigval__num {
  font-family: var(--mono); font-size: clamp(26px, 5vw, 34px); font-weight: 500;
  letter-spacing: -.02em; color: var(--tone, var(--accent)); word-break: break-all;
}
.bigval__unit { font-size: 15px; color: var(--text-2); }
.bigval__sub { width: 100%; font-size: 12.5px; color: var(--text-3); font-family: var(--mono); }

.conv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.conv-table th {
  text-align: left; font-weight: 550; color: var(--text-3); font-size: 12px;
  text-transform: uppercase; letter-spacing: .05em; padding: 0 10px 8px 0;
}
.conv-table td { padding: 8px 10px 8px 0; border-top: 1px solid var(--line); }
.conv-table td:last-child, .conv-table th:last-child { text-align: right; padding-right: 0; }
.conv-table .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.conv-table tr.is-active td { background: var(--tone-bg, var(--accent-soft)); }
.conv-table tr.is-active td:first-child { border-radius: 7px 0 0 7px; padding-left: 8px; }
.conv-table tr.is-active td:last-child { border-radius: 0 7px 7px 0; padding-right: 8px; }
.table-scroll { overflow-x: auto; }

/* ==================================================================
   匯率走勢圖
   ================================================================== */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__axis { fill: var(--text-3); font-size: 10.5px; font-family: var(--mono); }
.chart__line { fill: none; stroke: var(--tone-fx); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart__area { fill: var(--tone-fx); opacity: .07; }
.chart__crosshair { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart__dot { fill: var(--tone-fx); stroke: var(--bg-elev); stroke-width: 2; }
.chart__endlabel { fill: var(--text); font-size: 11.5px; font-family: var(--mono); font-weight: 500; }
.chart__hit { fill: transparent; cursor: crosshair; }

.chart-tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--text); color: var(--bg-elev);
  padding: 6px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap;
  box-shadow: var(--shadow-md); transform: translate(-50%, -130%);
  opacity: 0; transition: opacity .12s;
}
.chart-tip.is-on { opacity: 1; }
.chart-tip b { font-family: var(--mono); font-weight: 600; }

.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.chart-stats { display: flex; gap: 18px; font-size: 12.5px; color: var(--text-3); }
.chart-stats b { font-family: var(--mono); color: var(--text-2); font-weight: 500; }
.delta-up { color: var(--ok); }
.delta-down { color: var(--danger); }

/* ==================================================================
   檔案轉換
   ================================================================== */
.drop {
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg);
  padding: 30px 20px; text-align: center; cursor: pointer;
  background: var(--bg-sunken); transition: border-color .15s, background .15s;
}
.drop:hover, .drop.is-over { border-color: var(--tone, var(--accent)); background: var(--tone-bg, var(--accent-soft)); }
.drop__icon { color: var(--text-3); margin-bottom: 8px; }
.drop.is-over .drop__icon, .drop:hover .drop__icon { color: var(--tone, var(--accent)); }
.drop strong { display: block; font-size: 14.5px; font-weight: 560; }
.drop span { font-size: 12.5px; color: var(--text-3); }

.filelist { list-style: none; margin: 14px 0 0; padding: 0; }
.filelist li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-elev); margin-bottom: 8px;
}
.filelist__icon { color: var(--tone, var(--accent)); flex-shrink: 0; }
.filelist__main { flex: 1; min-width: 0; }
.filelist__name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist__meta { font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }
.filelist__ord { display: flex; flex-direction: column; gap: 1px; }
.filelist__ord button {
  width: 22px; height: 15px; border: 0; background: transparent; color: var(--text-3);
  cursor: pointer; line-height: 1; font-size: 10px; padding: 0;
}
.filelist__ord button:hover { color: var(--text); }

.progress { height: 5px; border-radius: 999px; background: var(--bg-sunken); overflow: hidden; margin-top: 14px; }
.progress__bar { height: 100%; background: var(--tone, var(--accent)); border-radius: 999px; transition: width .2s; }

.outgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.outcard {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--bg-elev); display: flex; flex-direction: column;
}
.outcard img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--bg-sunken); display: block; }
.outcard__foot { padding: 7px 9px; display: flex; align-items: center; gap: 6px; }
.outcard__name { flex: 1; min-width: 0; font-size: 11.5px; color: var(--text-3); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==================================================================
   繁簡互換
   ================================================================== */
.zh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .zh-grid { grid-template-columns: 1fr; } }
.zh-pane { display: flex; flex-direction: column; }
.zh-pane .textarea { min-height: 190px; font-size: 15px; line-height: 1.75; font-family: var(--sans); }
.zh-pane__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; min-height: 30px; }
.zh-pane__label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.badge {
  font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  background: var(--tone-bg, var(--accent-soft)); color: var(--tone, var(--accent)); font-weight: 550;
}
.badge--muted { background: var(--bg-sunken); color: var(--text-3); }

/* ==================================================================
   Toast
   ================================================================== */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  padding: 10px 18px; border-radius: 999px;
  background: var(--text); color: var(--bg-elev);
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; z-index: 90;
  transition: opacity .2s, transform .2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ==================================================================
   Misc
   ================================================================== */
@media (max-width: 560px) {
  .hero { padding: 26px 0 16px; }
  .panel { padding: 18px; border-radius: var(--r-lg); }
  .chips { margin-left: 0; }
  .dial { width: 214px; height: 214px; }
  .dial__time { font-size: 43px; }
  .timer__controls .btn { min-width: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print { .topbar, .footer, .toast { display: none; } }
