:root {
  --ink: #183033;
  --ink-soft: #375154;
  --muted: #748486;
  --line: #deddd6;
  --line-soft: #ebe9e1;
  --paper: #fffdf8;
  --canvas: #efede6;
  --surface-warm: #f7f3e9;
  --navy: #14393d;
  --navy-deep: #0d2d30;
  --accent: #ed6847;
  --accent-deep: #d75133;
  --accent-soft: #ffede5;
  --green: #167d6c;
  --green-soft: #e5f4ef;
  --red: #c9504f;
  --red-soft: #faeae7;
  --gold: #b47b24;
  --gold-soft: #faefd8;
  --purple: var(--accent);
  --purple-soft: var(--accent-soft);
  --radius: 20px;
  --shadow: 0 12px 34px rgba(28, 47, 48, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Noto Sans TC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(237, 104, 71, .24);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  background:
    linear-gradient(rgba(20, 57, 61, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 57, 61, .025) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(32px, calc((100vw - 1320px) / 2));
  border-bottom: 1px solid rgba(222, 221, 214, .88);
  background: rgba(255, 253, 248, .9);
  backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand-copy { align-self: center; }
.brand-mark {
  width: 39px;
  height: 39px;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 9px 8px;
  border-radius: 12px 12px 12px 4px;
  background: var(--accent);
  box-shadow: 0 7px 18px rgba(215, 81, 51, .2);
}
.brand-mark span {
  width: 4px;
  border-radius: 3px 3px 1px 1px;
  background: #fffaf5;
}
.brand-mark span:nth-child(1) { height: 9px; }
.brand-mark span:nth-child(2) { height: 15px; }
.brand-mark span:nth-child(3) { height: 21px; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 17px; letter-spacing: -.6px; }
.brand-copy small {
  color: var(--muted);
  font: 700 8px "Manrope", sans-serif;
  letter-spacing: 1.45px;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-policy-link { color: var(--ink-soft); font-size: 12px; text-decoration: none; margin-right: 10px; }
.topbar-policy-link:hover { text-decoration: underline; }
.today {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.today i {
  display: block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px var(--green-soft);
}
.guest-home .topbar { display: flex; align-items: center; justify-content: center; gap: clamp(24px, 5vw, 64px); }
.guest-home .brand { flex: none; align-items: center; }
.guest-home .brand-mark { flex: none; }
.guest-home .brand-copy { display: flex; flex-direction: column; justify-content: center; }
.guest-home .topbar-actions { display: flex; align-items: center; justify-content: center; height: 44px; padding-left: 24px; border-left: 1px solid var(--line); }
.guest-home .topbar-actions > :not(.today) { display: none !important; }
.guest-home .today { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin: 0; }
.guest-home .today span { display: none; }

.button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.button-primary {
  color: white;
  background: var(--accent);
  box-shadow: 0 7px 18px rgba(215, 81, 51, .18);
}
.button-primary:hover { background: var(--accent-deep); }
.button-quiet {
  color: var(--ink-soft);
  border-color: var(--line);
  background: rgba(255, 255, 255, .72);
}
.button-quiet:hover { border-color: #c9c7be; background: #fff; }
.button-record { color: white; background: var(--navy); }
.button-record:hover { background: var(--navy-deep); }
.button-record span { padding-left: 9px; }
.button-small { min-height: 35px; padding: 0 12px; font-size: 12px; }
.button-import { color: var(--accent-deep); border-color: #efc1b3; background: var(--accent-soft); }
.button-import:hover { border-color: #eaa58f; background: #ffe4da; }
.account-area {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 3px;
  padding: 4px 5px 4px 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.72);
}
.account-area[hidden] { display: none; }
.account-area img, .account-area::before {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
}
.account-area img { object-fit: cover; }
.account-area > span { display: grid; min-width: 0; line-height: 1.15; }
.account-area strong { max-width: 105px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.account-area small {
  max-width: 128px;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: .1px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-area button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
}
.account-area button:hover { color: var(--red); background: var(--red-soft); }

.auth-gate {
  min-height: calc(100vh - 78px);
  display: grid;
  place-items: center;
  padding: 44px 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(237,104,71,.14), transparent 28%),
    radial-gradient(circle at 82% 72%, rgba(22,125,108,.12), transparent 30%);
}
.auth-gate[hidden] { display: none; }
.auth-card {
  width: min(720px, 100%);
  padding: 56px;
  border: 1px solid var(--line);
  border-radius: 28px 28px 28px 8px;
  background: rgba(255,253,248,.94);
  box-shadow: 0 26px 80px rgba(13,45,48,.12);
  text-align: center;
}
.auth-mark {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  margin-bottom: 22px;
  padding: 13px;
  border-radius: 18px 18px 18px 5px;
  background: var(--accent);
  box-shadow: 0 13px 28px rgba(215,81,51,.2);
}
.auth-mark i { width: 6px; border-radius: 4px; background: white; }
.auth-mark i:nth-child(1) { height: 13px; }
.auth-mark i:nth-child(2) { height: 22px; }
.auth-mark i:nth-child(3) { height: 31px; }
.auth-card h1 { margin: 0; font-family: "Noto Serif TC"; font-size: 36px; line-height: 1.4; letter-spacing: -1.5px; }
.auth-card > p:not(.eyebrow) { margin: 19px auto 27px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.google-login {
  width: min(420px, 100%);
  min-height: 48px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #cfd4d0;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 7px 18px rgba(28,47,48,.06);
  text-decoration: none;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}
.google-login:hover { border-color: #aeb8b3; transform: translateY(-1px); }
.google-login span { color: #4285f4; font: 800 18px "Manrope"; }
.google-login:disabled { cursor: not-allowed; opacity: .45; }
.auth-consent-form { display: grid; gap: 14px; }
.auth-consent { display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--ink-soft); text-align: center; font-size: 13px; font-weight: 700; line-height: 1.65; }
.auth-consent input { flex: none; margin: 0; accent-color: var(--green); }
.auth-consent a { color: var(--green); font-weight: 700; text-underline-offset: 2px; }
.auth-card > small { display: block; margin-top: 17px; color: #8c9899; font-size: 12px; line-height: 1.7; }
.auth-legal-links { display: block; margin-top: 4px; }
.auth-legal-links a { color: var(--accent-deep); font-weight: 700; text-underline-offset: 2px; }

.legal-shell { min-height: 100vh; }
.legal-topbar { position: relative; }
.legal-top-links a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: rgba(255,255,255,.7); font-size: 12px; font-weight: 700; text-decoration: none; transition: border-color .18s, color .18s, background .18s; }
.legal-top-links a:hover { border-color: #b8d4cb; color: var(--green); background: #fff; }
.legal-top-links span { color: var(--accent); font: 800 14px "Manrope", sans-serif; }
.legal-main { width: min(1120px, calc(100% - 64px)); margin: 0 auto; padding: 0 0 36px; }
.legal-hero { position: relative; overflow: hidden; margin: 34px 0 36px; padding: clamp(30px, 5vw, 58px) clamp(28px, 5vw, 64px) 33px; border: 1px solid #d7e1da; border-radius: 26px 26px 26px 7px; background: radial-gradient(circle at 90% 10%, rgba(237,104,71,.12), transparent 32%), linear-gradient(135deg, #f4f7ef, #fffdf8 72%); box-shadow: 0 14px 42px rgba(20,57,61,.055); }
.legal-hero::after { content: ""; position: absolute; right: -36px; bottom: -84px; width: 260px; height: 260px; border: 1px solid rgba(22,125,108,.14); border-radius: 50%; box-shadow: 0 0 0 40px rgba(22,125,108,.025), 0 0 0 82px rgba(22,125,108,.02); pointer-events: none; }
.legal-back { position: relative; z-index: 1; display: inline-block; margin-bottom: 43px; color: var(--green); font-size: 12px; font-weight: 700; text-decoration: none; }
.legal-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.legal-kicker { position: relative; z-index: 1; margin: 0 0 12px; color: var(--accent-deep); font: 800 11px "Manrope", "Noto Sans TC", sans-serif; letter-spacing: 2px; }
.legal-hero h1 { position: relative; z-index: 1; margin: 0; font: 700 clamp(37px, 5.4vw, 62px)/1.3 "Noto Serif TC", serif; letter-spacing: -.065em; }
.legal-title-mark { color: var(--accent); font-family: "Manrope", sans-serif; }
.legal-lead { position: relative; z-index: 1; max-width: 660px; margin: 17px 0 0; color: var(--ink-soft); font-size: 16px; line-height: 1.9; letter-spacing: .015em; }
.legal-meta { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px 30px; margin-top: 38px; padding-top: 20px; border-top: 1px solid rgba(20,57,61,.12); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.legal-meta strong { margin-left: 7px; color: var(--ink-soft); font: 700 11px "Manrope", "Noto Sans TC", sans-serif; letter-spacing: 0; }
.legal-layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); align-items: start; gap: clamp(24px, 4vw, 50px); }
.legal-sidebar { position: sticky; top: 28px; }
.legal-toc { padding: 18px 12px 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.85); box-shadow: 0 8px 22px rgba(28,47,48,.035); }
.legal-toc p { display: flex; justify-content: space-between; margin: 0 8px 13px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink); font-size: 12px; font-weight: 700; }
.legal-toc p span { color: #9aa5a2; font: 800 9px "Manrope", sans-serif; letter-spacing: 1.5px; }
.legal-toc a { display: flex; align-items: baseline; gap: 12px; padding: 10px 9px; border-radius: 9px; color: var(--ink-soft); font-size: 12px; font-weight: 600; line-height: 1.45; text-decoration: none; transition: color .18s, background .18s; }
.legal-toc a:hover { color: var(--green); background: var(--green-soft); }
.legal-toc b { color: var(--accent-deep); font: 800 10px "Manrope", sans-serif; }
.legal-side-note { display: grid; gap: 4px; margin: 14px 4px 0; padding: 13px 15px; border-left: 2px solid var(--accent); color: var(--muted); font-size: 11px; line-height: 1.6; }
.legal-side-note a { color: var(--green); font-weight: 700; text-decoration: none; }
.legal-side-note a:hover { text-decoration: underline; text-underline-offset: 3px; }
.legal-article { min-width: 0; padding: 8px 0 0; }
.legal-intro { margin: 0 0 14px; padding: 0 0 28px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 16px; font-weight: 500; line-height: 1.95; }
.legal-section { padding: 31px 0 33px; border-bottom: 1px solid var(--line-soft); scroll-margin-top: 24px; }
.legal-section h2 { margin: 0 0 15px; color: var(--ink); font: 700 clamp(21px, 2.3vw, 25px)/1.5 "Noto Serif TC", serif; letter-spacing: -.045em; }
.legal-section p, .legal-section li { color: var(--ink-soft); font-size: 15px; font-weight: 400; line-height: 2.05; letter-spacing: .015em; }
.legal-section p { margin: 0; }
.legal-section p + p { margin-top: 14px; }
.legal-section ul { display: grid; gap: 12px; margin: 0; padding-left: 21px; }
.legal-section li { padding-left: 4px; }
.legal-section li::marker { color: var(--accent); }
.legal-section strong { color: var(--ink); font-weight: 700; }
.legal-article a { color: var(--green); font-weight: 600; text-decoration-color: #a6cdc1; text-underline-offset: 4px; overflow-wrap: anywhere; }
.legal-article a:hover { color: var(--accent-deep); text-decoration-color: currentColor; }
.legal-contact { margin-top: 28px; padding: 25px 28px 27px; border: 1px solid #d9e8df; border-radius: 16px 16px 16px 5px; background: #f5faf5; }
.legal-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 62px; padding: 22px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.legal-footer a { color: var(--ink-soft); font-weight: 700; text-decoration: none; }
.legal-footer a:hover { color: var(--green); }

main {
  width: min(1320px, calc(100% - 64px));
  margin: 0 auto;
  padding: 0 0 64px;
}

.admin-entry:not([hidden]) { display: inline-flex; align-items: center; text-decoration: none; }
.admin-shell { min-height: 100vh; }
.admin-home-link { color: var(--ink-soft); font-size: 12px; font-weight: 700; text-decoration: none; }
.admin-home-link:hover { color: var(--green); }
.admin-home-link span { margin-left: 3px; color: var(--accent); font: 800 14px "Manrope", sans-serif; }
.admin-main { width: min(930px, calc(100% - 64px)); margin: 0 auto; padding: 60px 0 90px; }
.admin-page-heading .eyebrow { margin-bottom: 12px; }
.admin-page-heading h1 { margin: 0; font: 700 clamp(38px, 5vw, 56px)/1.3 "Noto Serif TC", serif; letter-spacing: -.06em; }
.admin-page-heading h1 span { color: var(--accent); font-family: "Manrope", sans-serif; }
.admin-page-heading > p:last-child { margin: 13px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.8; }
.admin-panel { margin-top: 30px; padding: 28px; }
.admin-panel[hidden] { display: none; }
.admin-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-panel-heading h2 { margin: 4px 0 0; font-family: "Noto Serif TC"; font-size: 23px; }
.admin-stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.admin-stat { display: grid; gap: 6px; padding: 20px; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--paper); }
.admin-stat span { color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.admin-stat strong { color: var(--navy); font: 800 32px "Manrope", sans-serif; }
.admin-stat small, .admin-status { color: var(--muted); font-size: 11px; line-height: 1.6; }
.admin-status { margin: 14px 0 0; }
.admin-page-note { margin: 17px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.admin-account-sections { display: grid; gap: 18px; margin-top: 18px; }
.admin-account-panel { padding: 0; }
.admin-account-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 26px 19px; }
.admin-account-heading .eyebrow { margin-bottom: 6px; }
.admin-account-heading h2 { margin: 0; font: 700 21px "Noto Serif TC", serif; letter-spacing: -.04em; }
.admin-account-heading > span { padding: 7px 11px; border-radius: 999px; color: var(--green); background: var(--green-soft); font: 800 12px "Manrope", sans-serif; }
.admin-table-wrap { overflow-x: auto; }
.admin-account-table { min-width: 600px; }
.admin-account-table th { height: 42px; font-size: 11px; }
.admin-account-table th:first-child, .admin-account-table td:first-child { width: 35%; padding-left: 26px; }
.admin-account-table th:last-child, .admin-account-table td:last-child { width: auto; padding-right: 26px; }
.admin-account-table td { height: 72px; padding: 12px 10px; color: var(--ink-soft); font-size: 12px; font-weight: 500; white-space: nowrap; }
.admin-account-table td strong { display: block; color: var(--ink); font-size: 13px; }
.admin-account-table td small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 500; }
.admin-account-table .admin-empty-row { color: var(--muted); text-align: center; }
@media (max-width: 660px) {
  .admin-main { width: calc(100% - 28px); padding: 38px 0 60px; }
  .admin-panel { padding: 18px; }
  .admin-panel-heading h2 { font-size: 20px; }
  .admin-stats-grid { grid-template-columns: 1fr; }
  .admin-topbar .brand-copy small { display: none; }
  .admin-account-heading { padding: 20px 18px 15px; }
  .admin-account-heading h2 { font-size: 18px; }
}

.setup-progress {
  margin-top: 20px;
  padding: 18px 21px 19px;
  border: 1px solid #d8dfda;
  border-radius: 17px 17px 17px 5px;
  background: linear-gradient(120deg, #f8fbf8, #fff9f3);
  box-shadow: 0 9px 25px rgba(28,47,48,.04);
}
.setup-progress[hidden] { display: none; }
.setup-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.setup-progress .eyebrow { margin-bottom: 5px; }
.setup-progress h2 { margin: 0; color: var(--ink); font-size: 18px; letter-spacing: -.55px; }
.setup-progress-heading > div:first-child > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.setup-progress-actions { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.setup-progress-count { padding: 5px 8px; border-radius: 999px; color: var(--accent-deep); background: var(--accent-soft); font: 800 10px "Manrope", sans-serif; }
.setup-progress.is-complete .setup-progress-count { color: var(--green); background: var(--green-soft); }
.setup-checklist { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.setup-checklist li { min-width: 0; display: grid; grid-template-columns: 25px minmax(0, 1fr); column-gap: 8px; align-items: start; padding: 11px 10px; border: 1px solid var(--line-soft); border-radius: 11px 11px 11px 4px; background: rgba(255,255,255,.72); }
.setup-step-indicator { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #dbc9bf; border-radius: 50%; color: var(--accent-deep); background: #fff8f4; font: 800 9px "Manrope", sans-serif; }
.setup-checklist li.complete .setup-step-indicator { border-color: #bcded4; color: var(--green); background: var(--green-soft); }
.setup-checklist li > div { min-width: 0; display: grid; gap: 2px; }
.setup-checklist strong { color: var(--ink); font-size: 11px; line-height: 1.4; }
.setup-checklist small { color: var(--muted); font-size: 9px; line-height: 1.55; }
.setup-checklist .setup-action { grid-column: 2; justify-self: start; margin-top: 5px; padding: 1px 0; font-size: 9px; }
.setup-progress.is-collapsed { padding-top: 14px; padding-bottom: 14px; }
.setup-progress.is-collapsed .setup-checklist { display: none; }

.hero {
  position: relative;
  min-height: 348px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(390px, .75fr);
  align-items: center;
  gap: 44px;
  overflow: hidden;
  margin-top: 28px;
  padding: 50px 56px;
  border-radius: 28px 28px 28px 8px;
  color: #f9f6ed;
  background:
    radial-gradient(circle at 86% 12%, rgba(237, 104, 71, .32), transparent 30%),
    radial-gradient(circle at 12% 110%, rgba(77, 164, 149, .2), transparent 36%),
    var(--navy);
  box-shadow: 0 22px 55px rgba(13, 45, 48, .13);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  background-image: radial-gradient(rgba(255,255,255,.7) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(90deg, transparent 35%, #000 100%);
}
.hero-copy-wrap { position: relative; z-index: 1; }
.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font: 800 9px "Manrope", sans-serif;
  letter-spacing: 1.65px;
}
.hero .eyebrow { color: #ff9c7e; font-size: 13px; }
.hero h1 {
  margin: 0;
  font-family: "Noto Serif TC", serif;
  font-size: clamp(36px, 4vw, 55px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -2.5px;
}
.hero h1 em { color: #ffab8e; font-style: normal; }
.hero-copy {
  max-width: 600px;
  margin: 17px 0 0;
  color: rgba(249, 246, 237, .72);
  font-size: 15px;
  line-height: 1.9;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 23px; }
.hero-tags span {
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: rgba(255,255,255,.74);
  background: rgba(255,255,255,.055);
  font-size: 10px;
  font-weight: 600;
}
.hero-tags b { margin-right: 3px; color: #ffad91; font: 800 9px "Manrope", sans-serif; }
.hero-art {
  position: relative;
  z-index: 1;
  height: 300px;
}
.signal-card {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(100%, 400px);
  padding: 20px 21px 17px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px 20px 20px 6px;
  background: linear-gradient(145deg, rgba(255,255,255,.14), rgba(255,255,255,.07));
  box-shadow: 0 24px 50px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.08);
  backdrop-filter: blur(15px);
}
.signal-heading, .signal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255,255,255,.64);
  font: 700 11px "Manrope", sans-serif;
  letter-spacing: .5px;
}
.signal-heading span { display: flex; align-items: center; gap: 8px; }
.signal-heading i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #78d3ad;
  box-shadow: 0 0 0 4px rgba(120, 211, 173, .13);
}
.signal-heading b { color: #ffad91; font-size: 11px; }
.signal-title { display: grid; gap: 5px; margin-top: 14px; }
.signal-title strong { color: rgba(255,255,255,.96); font: 700 25px/1.25 "Noto Serif TC", serif; letter-spacing: -1.1px; }
.signal-title strong em { color: #ffae91; font-style: normal; }
.signal-title span { color: rgba(255,255,255,.66); font-size: 11px; line-height: 1.6; }
.signal-trend { margin-top: 14px; padding: 10px 12px 5px; border: 1px solid rgba(255,255,255,.055); border-radius: 12px; background: rgba(8, 27, 31, .24); }
.signal-trend > div { display: flex; align-items: center; justify-content: space-between; color: rgba(255,255,255,.76); font: 700 11px "Noto Sans TC", sans-serif; letter-spacing: 0; }
.signal-trend small { color: rgba(255,255,255,.46); font-size: 9px; letter-spacing: 0; }
.signal-trend svg { display: block; width: 100%; height: 47px; margin: 2px 0 -3px; overflow: visible; }
.signal-card .area { fill: rgba(237,104,71,.17); }
.signal-card .line {
  fill: none;
  stroke: #ff8c6b;
  stroke-width: 3;
  stroke-linecap: round;
}
.signal-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.signal-steps > div { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 5px; align-items: start; min-width: 0; padding: 8px 7px; border: 1px solid rgba(255,255,255,.075); border-radius: 9px; background: rgba(255,255,255,.045); }
.signal-steps b { color: #ffad91; font: 800 11px "Manrope", sans-serif; }
.signal-steps span { display: grid; gap: 3px; min-width: 0; }
.signal-steps strong { color: rgba(255,255,255,.92); font-size: 11px; line-height: 1.2; white-space: nowrap; }
.signal-steps small { color: rgba(255,255,255,.55); font-size: 9px; line-height: 1.35; }
.signal-footer { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.12); }
.signal-footer strong { color: rgba(255,255,255,.9); font-family: "Noto Sans TC"; font-size: 11px; letter-spacing: 0; }
.signal-orbit {
  position: absolute;
  width: 86px;
  height: 86px;
  right: -26px;
  bottom: -19px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
}
.signal-orbit span {
  position: absolute;
  width: 10px;
  height: 10px;
  left: 8px;
  top: 7px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: #ff9b79;
}

.controls {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--line);
  border-radius: 15px 15px 15px 5px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 8px 24px rgba(28,47,48,.035);
}
.date-control { display: flex; align-items: center; gap: 10px; padding-right: 18px; border-right: 1px solid var(--line); }
.date-control label, .history-toolbar > label { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.date-control input, select {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--paper);
  font-size: 12px;
  font-weight: 600;
}
.control-note { flex: 1; color: var(--muted); font-size: 12px; line-height: 1.55; }

.sync-center {
  margin-top: 18px;
  padding: 20px 22px;
  border: 1px solid #d8dfda;
  border-radius: 16px 16px 16px 5px;
  background: linear-gradient(135deg, #f8fbf8, #fffaf5);
  box-shadow: 0 8px 24px rgba(28,47,48,.035);
}
.sync-center-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sync-center h2 { margin: 3px 0 0; font-size: 18px; letter-spacing: -.5px; }
.sync-center .eyebrow { margin: 0; }
.sync-badge {
  padding: 6px 9px;
  border-radius: 999px;
  color: #687778;
  background: #eceae3;
  font-size: 10px;
  font-weight: 800;
}
.sync-badge.running { color: var(--accent-deep); background: var(--accent-soft); }
.sync-badge.success { color: var(--green); background: var(--green-soft); }
.sync-badge.warning { color: #986312; background: var(--gold-soft); }
.sync-center-copy { margin: 8px 0 15px; color: var(--muted); font-size: 11px; }
.sync-phase-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sync-phase { padding: 13px 14px; border: 1px solid var(--line-soft); border-radius: 11px 11px 11px 4px; background: rgba(255,255,255,.72); }
.sync-phase-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.sync-phase-title > span { color: var(--accent-deep); font: 800 9px "Manrope"; }
.sync-phase-title strong { font-size: 11px; }
.sync-phase-title small { overflow: hidden; margin-left: auto; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.sync-progress { height: 6px; overflow: hidden; margin: 11px 0 8px; border-radius: 999px; background: #e9e7df; }
.sync-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .25s ease; }
.sync-phase:nth-child(2) .sync-progress i { background: var(--green); }
.sync-phase p { min-height: 17px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.sync-phase-timestamp { display: block; margin-top: 7px; color: var(--ink-soft); font-size: 9px; font-weight: 700; line-height: 1.45; }
.video-unavailable { margin-top: 9px; border: 1px solid #e6ded1; border-radius: 8px; background: #fffaf1; }
.video-unavailable summary { padding: 7px 9px; color: #85611d; cursor: pointer; font-size: 9px; font-weight: 700; line-height: 1.45; }
.video-unavailable ul { display: grid; gap: 4px; margin: 0; padding: 0 10px 9px 25px; color: var(--ink-soft); font-size: 9px; line-height: 1.45; }
.video-unavailable a { color: var(--ink-soft); text-decoration: underline; text-decoration-color: #cfc2aa; text-underline-offset: 2px; }
.video-unavailable a:hover { color: var(--accent-deep); }
.sync-phase-actions { display: grid; gap: 6px; align-items: start; margin-top: 11px; }
.sync-phase-actions .button { justify-self: start; }
.sync-phase-actions small { color: var(--muted); font-size: 8px; line-height: 1.45; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 22px 0 26px; }
.metric-card {
  position: relative;
  min-height: 128px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  overflow: hidden;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 17px 17px 17px 5px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 8px 28px rgba(28,47,48,.035);
}
.metric-card::after {
  content: "";
  position: absolute;
  width: 58px;
  height: 3px;
  left: 21px;
  bottom: 0;
  border-radius: 5px 5px 0 0;
  background: var(--line);
}
.metric-card:nth-child(2)::after { background: var(--green); }
.metric-card:nth-child(3)::after { background: var(--gold); }
.metric-card:nth-child(4)::after { background: var(--accent); }
.metric-card.emphasis { border-color: #edc5b7; background: #fff8f3; }
.metric-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 800 9px "Manrope", sans-serif;
  letter-spacing: .4px;
}
.metric-icon.purple { color: var(--ink-soft); background: #edf1ef; }
.metric-icon.green { color: var(--green); background: var(--green-soft); }
.metric-icon.red { color: var(--red); background: var(--red-soft); }
.metric-icon.gold { color: var(--gold); background: var(--gold-soft); }
.metric-icon.ink { color: var(--accent-deep); background: var(--accent-soft); }
.metric-card p { margin: 0 0 5px; color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-card strong {
  display: block;
  font: 800 27px "Manrope", sans-serif;
  line-height: 1.2;
  letter-spacing: -1.2px;
}
.metric-card .metric-channel-name { overflow: hidden; color: var(--ink); font: 700 17px/1.45 "Noto Sans TC", sans-serif; letter-spacing: -.45px; text-overflow: ellipsis; white-space: nowrap; }
.metric-card small { color: #849193; font-size: 10px; font-weight: 500; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }

.main-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(330px, .8fr); gap: 18px; align-items: start; }
.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) var(--radius) 7px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
}
.ranking-panel { min-height: 420px; }
.section-heading {
  min-height: 91px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 16px;
}
.section-heading.compact { min-height: 91px; }
.section-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.7px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.ranking-controls { display: flex; align-items: center; gap: 8px; }
.segmented { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line-soft); border-radius: 10px; background: #f3f2ed; }
.segmented button {
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}
.segmented button.active { color: var(--ink); background: #fff; box-shadow: 0 2px 6px rgba(28,47,48,.08); }
.daily-sort-controls[hidden] { display: none; }
.channel-browser {
  display: flex;
  align-items: end;
  gap: 11px;
  padding: 0 24px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(250,249,244,.55);
}
.channel-search, .page-size-control { display: grid; gap: 5px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.channel-search { flex: 1; }
.channel-search input { width: 100%; min-height: 35px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font: 600 12px "Noto Sans TC"; }
.page-size-control select { min-width: 74px; min-height: 35px; }
.channel-browser p { margin: 0 0 8px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.channel-pagination { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 13px; padding: 10px 18px; border-top: 1px solid var(--line-soft); background: rgba(250,249,244,.55); }
.channel-pagination span { min-width: 106px; color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; }
.channel-browser[hidden], .channel-pagination[hidden] { display: none; }

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 660px; border-collapse: collapse; }
th {
  height: 41px;
  padding: 0 8px;
  color: #899496;
  background: var(--surface-warm);
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .35px;
  white-space: nowrap;
}
td {
  height: 74px;
  padding: 0 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fffcf7; }
th:first-child, td:first-child { width: 65px; padding-left: 24px; }
th:last-child, td:last-child { width: 84px; padding-right: 20px; }
.rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: #fff;
  font: 800 10px "Manrope";
}
.rank.top { color: #986312; border-color: #ecd69e; background: var(--gold-soft); }
.channel-cell { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
  font: 800 11px "Manrope";
}
.channel-name, .channel-id, .upload-note, .upload-new { display: block; max-width: 175px; overflow: hidden; text-overflow: ellipsis; }
.channel-name { font-size: 12px; }
.channel-link { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; }
.channel-link:hover { color: var(--accent-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.channel-link span { color: var(--accent); font: 800 10px "Manrope", sans-serif; }
.channel-id { margin-top: 2px; color: #97a1a2; font-size: 9px; font-weight: 500; }
.number { font-family: "Manrope", sans-serif; font-weight: 700; }
.gain, .net-positive { color: var(--green); }
.loss, .net-negative { color: var(--red); }
.channel-actions { display: flex; gap: 5px; }
.detail-button, .delete-button {
  width: 29px;
  height: 29px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}
.detail-button:hover { color: var(--accent-deep); border-color: #efb7a7; background: var(--accent-soft); }
.delete-button { font-size: 17px; line-height: 1; }
.delete-button:hover { color: var(--red); border-color: #edc4c0; background: var(--red-soft); }
.upload-note { margin-top: 4px; color: #6f8081; font-size: 9px; font-weight: 600; text-decoration: none; }
.upload-note:hover { color: var(--accent-deep); text-decoration: underline; }
.upload-note.short { color: var(--gold); }
.upload-note.muted { color: #9aa4a5; font-weight: 400; }
.upload-new { margin-top: 3px; color: var(--green); font-size: 9px; font-weight: 700; }

.empty-state { min-height: 275px; display: none; padding: 48px 20px; text-align: center; }
.empty-state.visible { display: block; }
.empty-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
  border: 1px solid #efc3b4;
  border-radius: 50%;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-size: 24px;
}
.empty-state h3 { margin: 0; font-size: 15px; }
.empty-state p { max-width: 360px; margin: 8px auto 12px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.text-button { padding: 5px; border: 0; color: var(--accent-deep); background: transparent; font-size: 12px; font-weight: 700; }

.pulse-panel { padding-bottom: 9px; background: var(--surface-warm); }
.topic-panel { padding-bottom: 12px; background: var(--surface-warm); }
.topic-panel-intro { margin: -3px 18px 10px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.topic-list { padding: 0 17px; }
.topic-item {
  margin-bottom: 9px;
  padding: 14px 13px;
  border: 1px solid #e6e0d4;
  border-radius: 13px 13px 13px 4px;
  background: rgba(255,255,255,.78);
}
.topic-item-heading { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.topic-item-heading > strong { overflow: hidden; color: var(--ink); font: 800 14px "Manrope", "Noto Sans TC", sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.topic-status { flex: 0 0 auto; padding: 4px 6px; border-radius: 6px; font: 800 9px "Noto Sans TC", sans-serif; }
.topic-status.accelerating { color: var(--green); background: var(--green-soft); }
.topic-status.watching { color: var(--accent-deep); background: var(--accent-soft); }
.topic-status.collecting { color: #748082; background: #eceae3; }
.topic-item > p { margin: 8px 0 3px; color: var(--ink-soft); font-size: 10px; line-height: 1.65; }
.topic-detail { display: block; color: var(--muted); font-size: 9px; line-height: 1.55; }
.topic-videos { display: grid; gap: 5px; margin-top: 10px; }
.topic-video {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 6px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}
.topic-video:hover { background: #fff9f3; }
.topic-video .avatar { width: 24px; height: 24px; font-size: 8px; }
.topic-video span:last-child { min-width: 0; }
.topic-video strong, .topic-video small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-video strong { color: var(--ink); font-size: 12px; }
.topic-video small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.topic-action { padding-top: 8px; border-top: 1px solid #eee9df; color: #718081 !important; font-size: 9px !important; }
.live-dot {
  padding: 5px 8px;
  border: 1px solid #bcded4;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 9px;
  font-weight: 700;
}
.live-dot::before {
  content: "";
  width: 5px;
  height: 5px;
  display: inline-block;
  margin: 0 5px 1px 0;
  border-radius: 50%;
  background: currentColor;
}
.pulse-list { padding: 0 17px; }
.pulse-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  margin-bottom: 7px;
  padding: 13px 12px;
  border: 1px solid #e6e0d4;
  border-radius: 13px 13px 13px 4px;
  color: var(--ink);
  background: rgba(255,255,255,.78);
  text-decoration: none;
  transition: transform .15s, border-color .15s, background .15s;
}
.pulse-item:hover { transform: translateY(-1px); border-color: #d6cabe; background: #fff; }
.pulse-copy { min-width: 0; }
.pulse-item p { overflow: hidden; margin: 0; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.pulse-item small { display: block; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.pulse-item strong { display: block; margin-top: 6px; color: var(--green); font: 800 14px "Manrope", sans-serif; }
.pulse-item strong.pending-speed { color: #7e898a; font: 700 11px "Noto Sans TC"; }
.pulse-milestones { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.pulse-milestones span { padding: 3px 5px; border-radius: 5px; color: #687778; background: #eeece5; font: 700 8px "Manrope"; }
.pulse-tag { padding: 5px 7px; border-radius: 6px; font: 800 9px "Manrope"; }
.pulse-tag.good { color: var(--green); background: var(--green-soft); }
.pulse-tag.bad { color: var(--red); background: var(--red-soft); }
.pulse-tag.neutral, .pulse-tag.pending { color: #748082; background: #eceae3; }
.pulse-tag.hot { color: var(--accent-deep); background: var(--accent-soft); }
.empty-pulse { padding: 32px 22px 40px; color: var(--muted); font-size: 11px; line-height: 1.75; text-align: center; }

.recent-uploads-panel, .upload-inbox-panel { margin-top: 18px; }
.upload-inbox-heading { min-height: 82px; }
.upload-inbox-actions { display: flex; align-items: center; gap: 9px; }
.inbox-unread-badge {
  padding: 5px 8px;
  border: 1px solid #bcded4;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font: 800 9px "Manrope", sans-serif;
}
.upload-inbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 10px 24px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-warm);
}
.upload-inbox-toolbar .muted { margin: 0; text-align: right; }
.upload-inbox-footer { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--line-soft); }
.upload-inbox-footer:has([hidden]) { display: none; }
.uploads-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); }
.upload-inbox-toolbar + .uploads-list { border-top: 0; }
.upload-card {
  position: relative;
  min-width: 0;
  min-height: 150px;
  display: block;
  padding: 19px 20px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  background: rgba(255,255,255,.46);
  text-decoration: none;
  transition: background .15s;
}
.upload-card:nth-child(3n) { border-right: 0; }
.upload-card:nth-last-child(-n + 3) { border-bottom: 0; }
.upload-card:hover { background: #fff9f3; }
.upload-card.is-new::before, .upload-card.is-unread::before {
  content: "";
  position: absolute;
  width: 4px;
  inset: 0 auto 0 0;
  background: var(--green);
}
.inbox-card-link { display: block; color: inherit; text-decoration: none; }
.inbox-card-link:hover h3 { color: var(--accent-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.inbox-read-button {
  margin-top: 11px;
  padding: 0;
  border: 0;
  color: var(--accent-deep);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}
.inbox-read-button:hover { color: var(--ink); text-decoration: underline; }
.inbox-read-label { display: block; margin-top: 11px; color: #98a3a3; font-size: 10px; font-weight: 600; }
.upload-card-top { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.upload-card-top .avatar { width: 25px; height: 25px; font-size: 9px; }
.upload-card-top > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-card-new { flex: 0 0 auto; margin-left: auto; color: var(--green); font-size: 8px; }
.upload-card h3 {
  min-height: 43px;
  display: -webkit-box;
  overflow: hidden;
  margin: 12px 0 7px;
  font-size: 13px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.upload-card p { overflow: hidden; margin: 0; color: #859293; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.upload-kind { color: var(--ink-soft); font-weight: 700; }
.upload-kind.short { color: var(--gold); }

.history-panel { margin-top: 18px; }
.muted { color: var(--muted); font-size: 11px; }
.history-toolbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-warm);
}
.history-toolbar select { min-width: 210px; }
.history-toolbar .button { margin-left: auto; }
.history-content { min-height: 190px; padding: 22px 24px 26px; }
.centered { padding: 46px 0; text-align: center; }
.trend-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 34px; align-items: center; }
.chart-wrap { height: 170px; }
.chart-wrap svg { width: 100%; height: 100%; overflow: visible; }
.grid-line { stroke: #ebe8df; stroke-width: 1; }
.trend-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.trend-area { fill: rgba(237,104,71,.09); }
.chart-labels { display: flex; justify-content: space-between; margin-top: 6px; color: #97a1a2; font: 700 9px "Manrope"; }
.trend-summary { padding-left: 28px; border-left: 1px solid var(--line); }
.trend-summary p { margin: 0 0 5px; color: var(--muted); font-size: 11px; }
.trend-summary > strong { display: block; font: 800 29px "Manrope"; letter-spacing: -1.2px; }
.trend-summary .summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.summary-grid strong { display: block; margin-top: 2px; font: 800 15px "Manrope"; }
.summary-grid small { color: var(--muted); font-size: 9px; }
.history-table { width: 100%; min-width: 0; margin-top: 10px; }
.history-table th { padding: 0 8px; }
.history-table th:first-child, .history-table td:first-child { width: auto; padding-left: 0; }
.history-table td { height: 44px; padding: 0 8px; }

.api-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 18px 0 0;
  padding: 15px 17px;
  border: 1px solid #e0ddd3;
  border-radius: 13px 13px 13px 4px;
  color: #687778;
  background: #f3f0e8;
  font-size: 10px;
  line-height: 1.8;
}
.api-note p { margin: 0; }
.api-note-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #899596;
  border-radius: 50%;
  font: 800 9px "Manrope";
}

.modal { width: min(540px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 0; background: transparent; }
.modal::backdrop { background: rgba(13,45,48,.62); backdrop-filter: blur(5px); }
.modal-card {
  position: relative;
  overflow: auto;
  max-height: calc(100vh - 28px);
  padding: 34px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 22px 22px 22px 7px;
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(0,0,0,.24);
}
.modal-card h2 { margin: 0; font-family: "Noto Serif TC"; font-size: 25px; letter-spacing: -1px; }
.modal-copy { margin: 8px 0 24px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.modal-close {
  position: absolute;
  right: 17px;
  top: 15px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: #fff;
  font-size: 20px;
  line-height: 1;
}
.modal-card > label, .record-row label { display: block; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.modal-card > label + label { margin-top: 17px; }
.modal-card label span { color: #98a1a2; font-weight: 400; }
.modal-card input {
  width: 100%;
  margin-top: 7px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline-color: var(--accent);
  color: var(--ink);
  background: #fff;
  font-size: 13px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 28px; }
.button-danger { color: #fff; border-color: var(--red); background: var(--red); }
.button-danger:hover:not(:disabled) { border-color: #ad3f3e; background: #ad3f3e; }
.button-danger:disabled { opacity: .45; cursor: not-allowed; }
.delete-account-card { border-top: 4px solid var(--red); }
.delete-account-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 15px 16px 15px 33px;
  border-radius: 12px;
  color: #704340;
  background: var(--red-soft);
  font-size: 12px;
  line-height: 1.6;
}
.delete-account-note { margin: 15px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.delete-account-confirm { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.delete-account-confirm input { width: 100%; margin-top: 7px; }
.delete-account-error { margin: 12px 0 -8px; color: var(--red); font-size: 11px; font-weight: 700; }
.onboarding-modal { width: min(590px, calc(100vw - 28px)); }
.onboarding-card { overflow: hidden; padding: 38px 38px 34px; }
.onboarding-card::before {
  content: "";
  position: absolute;
  width: 250px;
  height: 250px;
  right: -128px;
  top: -138px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(237,104,71,.16), rgba(237,104,71,0) 68%);
  pointer-events: none;
}
.onboarding-card > * { position: relative; }
.onboarding-card h2 { font-size: 29px; line-height: 1.35; }
.onboarding-steps { display: grid; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; }
.onboarding-steps li { display: grid; grid-template-columns: 35px minmax(0, 1fr); gap: 11px; align-items: center; padding: 11px 13px; border: 1px solid var(--line-soft); border-radius: 12px 12px 12px 4px; background: rgba(255,255,255,.7); }
.onboarding-steps b { color: var(--accent-deep); font: 800 12px "Manrope", sans-serif; }
.onboarding-steps span { display: grid; gap: 2px; }
.onboarding-steps strong { color: var(--ink); font-size: 13px; }
.onboarding-steps small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.onboarding-note { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.onboarding-note span { width: 16px; height: 16px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #aeb8b3; border-radius: 50%; color: var(--ink-soft); font: 800 9px "Manrope", sans-serif; }
.onboarding-actions { margin-top: 21px; }
.record-date { margin: 8px 0 18px; color: var(--accent-deep); font: 700 12px "Manrope"; }
.record-fields { display: grid; gap: 13px; }
.record-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 9px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.record-row legend { padding: 0 4px; font-size: 12px; font-weight: 800; }
.record-row label { font-size: 9px; }
.record-row input { margin-top: 4px; padding: 8px; font-size: 12px; }

.import-modal { width: min(720px, calc(100vw - 28px)); }
.import-card { display: flex; flex-direction: column; }
.import-toolbar { display: flex; align-items: center; gap: 10px; }
.import-toolbar input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
}
.import-summary { margin: 13px 2px 8px; color: var(--muted); font-size: 10px; }
.import-summary strong { color: var(--accent-deep); font: 800 13px "Manrope"; }
.import-summary span { margin-left: 6px; }
.import-list {
  min-height: 110px;
  max-height: 34vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 13px 13px 13px 4px;
  background: #fff;
}
.import-row {
  display: grid;
  grid-template-columns: 22px 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.import-row:last-child { border-bottom: 0; }
.import-row:hover { background: #fffaf5; }
.import-row.is-tracked { cursor: default; opacity: .62; background: #f5f3ed; }
.import-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.import-row img, .import-fallback {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-warm);
  object-fit: cover;
  font-size: 11px;
  font-weight: 800;
}
.import-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.import-row small { color: var(--muted); font-size: 9px; }
.subscription-diff-section { margin-top: 15px; }
.subscription-diff-heading { display: flex; align-items: center; gap: 8px; margin: 0 2px 7px; }
.subscription-diff-heading strong { font-size: 11px; }
.subscription-diff-heading small { color: var(--muted); font-size: 9px; }
.subscription-diff-heading .text-button { margin-left: auto; }
.unsubscribe-section .import-list { border-color: #eadcc5; background: #fffdf8; }
.import-row.is-unsubscribed:hover { background: #fff8ed; }

@media (max-width: 1050px) {
  .topbar { padding-left: 28px; padding-right: 28px; }
  main { width: min(100% - 56px, 1320px); }
  .setup-checklist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr) 330px; padding: 44px 42px; }
  .main-grid { grid-template-columns: 1fr; }
  .pulse-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-bottom: 8px; }
  .pulse-item { margin-bottom: 0; }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-art { display: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .uploads-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-inbox-toolbar { align-items: flex-start; flex-direction: column; }
  .upload-inbox-toolbar .muted { text-align: left; }
  .upload-card:nth-child(3n) { border-right: 1px solid var(--line-soft); }
  .upload-card:nth-child(2n) { border-right: 0; }
  .upload-card:nth-last-child(-n + 3) { border-bottom: 1px solid var(--line-soft); }
  .upload-card:nth-last-child(-n + 2) { border-bottom: 0; }
  .trend-layout { grid-template-columns: 1fr; gap: 18px; }
  .trend-summary { padding: 17px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .sync-phase-grid { grid-template-columns: 1fr; }
}

@media (max-width: 660px) {
  .topbar { height: 68px; padding: 0 16px; }
  .brand-mark { width: 34px; height: 34px; padding: 8px 7px; }
  .brand-copy strong { font-size: 15px; }
  .brand-copy small, .today, .topbar .button-quiet { display: none; }
  .topbar #setupGuideButton {
    width: 34px;
    min-height: 37px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border-radius: 10px;
    font-size: 0;
  }
  .topbar #setupGuideButton::after { content: "?"; color: var(--ink-soft); font: 800 15px "Manrope", sans-serif; }
  .topbar-actions { gap: 0; }
  .topbar .button-primary { min-height: 37px; padding: 0 11px; font-size: 11px; }
  .topbar .button-import { min-height: 37px; padding: 0 9px; font-size: 10px; }
  .account-area { padding-left: 5px; }
  .account-area > span, .account-area img { display: none !important; }
  main { width: calc(100% - 28px); padding-bottom: 38px; }
  .setup-progress { margin-top: 14px; padding: 15px; }
  .setup-progress-heading { align-items: flex-start; }
  .setup-progress h2 { font-size: 16px; }
  .setup-progress-actions { flex-wrap: wrap; justify-content: flex-end; gap: 3px 6px; }
  .setup-progress-count { font-size: 9px; }
  .setup-checklist { grid-template-columns: 1fr; margin-top: 13px; }
  .hero { margin-top: 14px; padding: 35px 25px 32px; border-radius: 21px 21px 21px 7px; }
  .hero h1 { font-size: 33px; letter-spacing: -1.8px; }
  .hero-copy { font-size: 13px; }
  .hero-tags { margin-top: 18px; }
  .onboarding-card { padding: 32px 22px 24px; }
  .onboarding-card h2 { font-size: 25px; }
  .onboarding-steps li { padding: 10px; }
  .onboarding-actions { flex-direction: column-reverse; }
  .onboarding-actions .button { width: 100%; }
  .controls { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .date-control { flex: 1; border-right: 0; padding-right: 0; }
  .date-control input { flex: 1; min-width: 0; }
  .control-note { min-width: 100%; order: 3; padding: 3px 2px 0; font-size: 10px; }
  .button-record { margin-left: auto; min-height: 36px; padding: 0 11px; font-size: 11px; }
  .sync-center { padding: 16px; }
  .sync-center h2 { font-size: 16px; }
  .sync-center-copy { font-size: 10px; }
  .metrics { gap: 9px; padding: 14px 0 18px; }
  .metric-card { min-height: 113px; gap: 9px; padding: 16px 13px; }
  .metric-card::after { left: 13px; }
  .metric-icon { width: 28px; height: 28px; font-size: 8px; }
  .metric-card strong { font-size: 21px; }
  .metric-card p { font-size: 9px; }
  .metric-card small { font-size: 8px; }
  .section-heading { min-height: 82px; align-items: flex-start; padding: 18px 15px 13px; }
  .section-heading h2 { font-size: 17px; }
  .upload-inbox-heading { flex-wrap: wrap; gap: 10px; }
  .upload-inbox-actions { width: 100%; justify-content: space-between; }
  .upload-inbox-toolbar { gap: 10px; padding: 12px 15px; }
  .ranking-controls { flex-direction: column; align-items: flex-end; gap: 4px; }
  .segmented button { padding: 5px 7px; font-size: 9px; }
  .channel-browser { flex-wrap: wrap; gap: 8px; padding: 0 15px 13px; }
  .channel-search { min-width: 100%; }
  .channel-browser p { flex: 1; margin-bottom: 0; white-space: normal; }
  .channel-pagination { gap: 8px; padding: 9px; }
  .channel-pagination .button { padding: 0 8px; font-size: 10px; }
  .channel-pagination span { min-width: 72px; font-size: 10px; }
  .pulse-list { grid-template-columns: 1fr; padding: 0 10px 5px; }
  .topic-list { padding: 0 10px; }
  .topic-panel-intro { margin-left: 15px; margin-right: 15px; }
  .uploads-list { grid-template-columns: 1fr; }
  .upload-card, .upload-card:nth-child(2n), .upload-card:nth-child(3n) { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .upload-card:last-child { border-bottom: 0; }
  .history-toolbar, .history-content { padding-left: 15px; padding-right: 15px; }
  .history-toolbar select { min-width: 0; flex: 1; }
  .history-toolbar .button { padding: 0 8px; }
  .history-table { min-width: 520px; }
  .history-content { overflow-x: auto; }
  .api-note { font-size: 9px; }
  .record-row { grid-template-columns: 1fr; }
  .auth-card { padding: 35px 23px; }
  .auth-card h1 { font-size: 28px; }
  .import-card { padding: 26px 18px; }
  .import-toolbar { align-items: stretch; flex-direction: column; }
  .import-toolbar .text-button { align-self: flex-start; }
}

@media (max-width: 820px) {
  .legal-main { width: min(720px, calc(100% - 48px)); }
  .legal-layout { grid-template-columns: 1fr; gap: 28px; }
  .legal-sidebar { position: static; }
  .legal-toc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; }
  .legal-toc p { grid-column: 1 / -1; }
  .legal-side-note { display: none; }
  .legal-article { padding-top: 0; }
}

@media (max-width: 660px) {
  .legal-topbar .brand-copy small { display: block; font-size: 7px; letter-spacing: 1px; }
  .legal-top-links a { padding: 8px 10px; font-size: 11px; }
  .legal-main { width: calc(100% - 28px); padding-bottom: 28px; }
  .legal-hero { margin: 16px 0 22px; padding: 28px 23px 24px; border-radius: 21px 21px 21px 6px; }
  .legal-hero::after { width: 160px; height: 160px; right: -62px; bottom: -50px; }
  .legal-back { margin-bottom: 29px; }
  .legal-kicker { font-size: 9px; letter-spacing: 1.5px; }
  .legal-hero h1 { font-size: clamp(29px, 8.1vw, 39px); line-height: 1.35; }
  .legal-lead { margin-top: 13px; font-size: 13px; line-height: 1.85; }
  .legal-meta { gap: 5px 14px; margin-top: 24px; padding-top: 15px; font-size: 10px; }
  .legal-meta strong { margin-left: 4px; font-size: 10px; }
  .legal-layout { gap: 21px; }
  .legal-toc { padding: 13px 10px; }
  .legal-toc p { margin-bottom: 7px; }
  .legal-toc a { gap: 7px; padding: 9px 6px; font-size: 11px; }
  .legal-toc b { font-size: 9px; }
  .legal-intro { padding-bottom: 23px; font-size: 14px; }
  .legal-section { padding: 27px 0 29px; }
  .legal-section h2 { font-size: 20px; }
  .legal-section p, .legal-section li { font-size: 14px; line-height: 1.95; }
  .legal-contact { margin-top: 23px; padding: 21px 19px; }
  .legal-footer { margin-top: 42px; }
}

@media (max-width: 390px) {
  .legal-topbar .brand-copy small { display: none; }
}

@media (max-width: 660px) {
  .topbar #adminStatsButton:not([hidden]) {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 12;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-color: var(--green);
    border-radius: 999px;
    color: white;
    background: var(--navy);
    box-shadow: 0 8px 24px rgba(13,45,48,.22);
    font-size: 12px;
  }
}
