/* Columbia 美語 · AI 搜尋陪跑作戰室 — 主題樣式 */
:root {
  --gold: #E8A21C;
  --gold-dark: #C7860C;
  --gold-soft: #FBF3E1;
  --gold-line: #F0D9A8;
  --ink: #23262B;
  --muted: #6B7280;
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --line: #E6E8EC;
  --ok: #3FA66A;
  --wip: #E08A2B;
  --todo: #9AA1AB;
  --na: #C3C8CF;
  --high: #D9534F;
  --mid: #E08A2B;
  --low: #8B93A0;
  --geo: #C0567E;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(20,20,40,.06), 0 6px 18px rgba(20,20,40,.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; }
h1 { font-size: 1.55rem; }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 .6em; }
a { color: var(--gold-dark); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }

/* ── Header & Nav ── */
.app-header {
  background: linear-gradient(120deg, #2A2D34 0%, #3A3E47 100%);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.app-header-inner { max-width: 1120px; margin: 0 auto; padding: 14px 20px 6px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #2A2D34; font-weight: 800; font-size: 1.5rem;
  display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(232,162,28,.4);
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 1.08rem; letter-spacing: .2px; }
.brand-sub { font-size: .78rem; color: #C7CBD3; }
.nav {
  max-width: 1120px; margin: 0 auto; padding: 6px 12px 10px;
  display: flex; gap: 6px; flex-wrap: wrap; overflow-x: auto;
}
.nav-btn {
  appearance: none; border: 0; cursor: pointer;
  background: rgba(255,255,255,.08); color: #E8EAEE;
  padding: 8px 14px; border-radius: 999px; font-size: .9rem; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; transition: .15s;
}
.nav-btn:hover { background: rgba(255,255,255,.18); }
.nav-btn.active { background: var(--gold); color: #2A2D34; font-weight: 700; }
.nav-ico { font-size: .95rem; }

/* ── Layout ── */
.container { max-width: 1120px; margin: 0 auto; padding: 22px 20px 40px; }
.page-head { margin-bottom: 16px; }
.page-head h1 { color: var(--ink); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-head h3 { margin: 0; }
.callout { background: var(--gold-soft); border-color: var(--gold-line); }
.numbered ol { padding-left: 1.2em; }
.numbered li { margin-bottom: .5em; }
.numbered li.warn { background: #FDECEA; border-left: 3px solid var(--high); padding: 8px 10px; border-radius: 6px; list-style-position: inside; }

/* ── Buttons ── */
.btn {
  appearance: none; cursor: pointer; font-size: .9rem;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 8px 14px; border-radius: 9px; transition: .15s; font-family: inherit;
}
.btn:hover { border-color: var(--gold); background: var(--gold-soft); }
.btn-primary { background: var(--gold); border-color: var(--gold-dark); color: #2A2D34; font-weight: 700; }
.btn-primary:hover { background: var(--gold-dark); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { background: #fff; border-color: var(--high); color: var(--high); }
.btn-danger:hover { background: var(--high); color: #fff; }
.btn-mini { padding: 4px 9px; font-size: .78rem; border-radius: 7px; }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* ── Tags & badges ── */
.tag { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 999px; margin-left: 6px; white-space: nowrap; vertical-align: middle; }
.tag-high { background: #FBE5E4; color: var(--high); }
.tag-mid  { background: #FCEFDD; color: var(--mid); }
.tag-low  { background: #EEF0F2; color: var(--low); }
.tag-section { background: #EAF1FA; color: #4670B0; }
.tag-effort { background: #EEF0F2; color: #6B7280; }
.tag-chapter { background: #ECE7F7; color: #7A5CC0; }
.tag-phase2 { background: var(--gold-soft); color: var(--gold-dark); border: 1px solid var(--gold-line); }
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.badge-stage { background: var(--gold); color: #2A2D34; }

/* ── Dashboard: score hero ── */
.score-hero { display: flex; align-items: center; gap: 20px; }
.score-ring {
  width: 132px; height: 132px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; position: relative;
}
.score-ring::after { content: ""; position: absolute; inset: 12px; background: #fff; border-radius: 50%; }
.score-num { position: relative; z-index: 1; text-align: center; line-height: 1; }
.score-num .big { font-size: 2.6rem; font-weight: 800; color: var(--ink); }
.score-num .pct { font-size: .9rem; color: var(--muted); margin-left: 2px; }
.score-meta { flex: 1; min-width: 0; }
.score-meta p { margin: 8px 0; }

.mini-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.mini-stats.wide { gap: 22px; }
.mini-stat { text-align: center; min-width: 56px; }
.ms-val { font-size: 1.4rem; font-weight: 700; }
.mini-stat.ok .ms-val { color: var(--ok); }
.mini-stat.wip .ms-val { color: var(--wip); }
.mini-stat.todo .ms-val { color: var(--todo); }
.mini-stat.na .ms-val { color: var(--na); }
.ms-label { font-size: .78rem; }

/* ── Pillar bars / radar ── */
.radar { width: 100%; height: auto; max-width: 340px; display: block; margin: 0 auto 6px; }
.radar-grid { fill: none; stroke: #EAECEF; stroke-width: 1; }
.radar-axis { stroke: #E1E4E8; stroke-width: 1; }
.radar-label { font-size: 10.5px; fill: var(--muted); font-weight: 600; }
.radar-data { fill: rgba(232,162,28,.22); stroke: var(--gold); stroke-width: 2; }
.pillar-bars { display: grid; gap: 10px; margin-top: 8px; }
.pbar-top { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.pbar-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.pbar-label { font-weight: 600; }
.pbar-pct { margin-left: auto; font-weight: 700; }
.pbar-track { height: 8px; background: #EEF0F2; border-radius: 999px; overflow: hidden; margin: 4px 0 2px; }
.pbar-fill { height: 100%; border-radius: 999px; transition: width .3s; }
.pbar-sub { font-size: .76rem; }

/* ── Action list ── */
.action-list { display: grid; gap: 12px; }
.action-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.rank { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; background: var(--gold); color: #2A2D34; font-weight: 800; display: grid; place-items: center; font-size: .9rem; }
.action-title { font-weight: 600; }
.action-body { min-width: 0; }

/* ── Scorecard ── */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { appearance: none; cursor: pointer; border: 1px solid var(--line); background: #fff; padding: 6px 14px; border-radius: 999px; font-size: .86rem; font-family: inherit; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.filter-summary { margin-left: auto; font-size: .85rem; }

details.section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; box-shadow: var(--shadow); overflow: hidden; }
.section-head { cursor: pointer; list-style: none; padding: 14px 18px; display: flex; align-items: center; gap: 16px; }
.section-head::-webkit-details-marker { display: none; }
.section-head-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-key { width: 26px; height: 26px; border-radius: 7px; background: var(--gold-soft); color: var(--gold-dark); font-weight: 800; display: grid; place-items: center; }
.section-title { font-weight: 700; font-size: 1.05rem; }
.section-prog { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 130px; }
.prog-track { width: 90px; height: 8px; background: #EEF0F2; border-radius: 999px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--gold); border-radius: 999px; }
.prog-text { font-size: .82rem; white-space: nowrap; }
.section-desc { padding: 0 18px; margin-top: -4px; }

.item { border-top: 1px solid var(--line); padding: 14px 18px; border-left: 3px solid transparent; }
.item-ok { border-left-color: var(--ok); }
.item-wip { border-left-color: var(--wip); }
.item-todo { border-left-color: var(--todo); }
.item-na { border-left-color: var(--na); opacity: .72; }
.item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.dot-ok { background: var(--ok); } .dot-wip { background: var(--wip); } .dot-todo { background: var(--todo); } .dot-na { background: var(--na); }
.item-title { font-weight: 600; flex: 1; min-width: 180px; }
.status-select { margin-left: auto; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); font-family: inherit; font-size: .85rem; cursor: pointer; }
.status-ok { border-color: var(--ok); color: var(--ok); }
.status-wip { border-color: var(--wip); color: var(--wip); }
.status-na { color: var(--na); }
.item-why { margin: 8px 0 4px; font-size: .9rem; }
.item-why strong, .item-how strong { color: var(--ink); }
.item-more { margin-top: 6px; }
.item-more summary { cursor: pointer; font-size: .85rem; color: var(--gold-dark); }
.item-how { font-size: .88rem; margin: 8px 0; color: #444; }
.notes { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-family: inherit; font-size: .88rem; resize: vertical; }
.notes:focus, .status-select:focus { outline: 2px solid var(--gold-line); }

/* ── Roadmap ── */
.phase { border-left: 5px solid var(--gold); }
.phase.p1 { border-left-color: var(--high); }
.phase.p2 { border-left-color: var(--wip); }
.phase.p3 { border-left-color: #5B7FE0; }
.phase-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.phase-count { background: var(--gold-soft); color: var(--gold-dark); padding: 3px 12px; border-radius: 999px; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.phase-list { padding-left: 1.3em; margin: 6px 0 0; }
.phase-list li { margin-bottom: 12px; }
.phase-item-title { font-weight: 600; }

/* ── Generators ── */
.subtab { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 2px solid var(--line); }
.subtab-btn { appearance: none; cursor: pointer; border: 0; background: transparent; padding: 9px 16px; font-size: .92rem; font-family: inherit; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.subtab-btn.active { color: var(--gold-dark); border-bottom-color: var(--gold); font-weight: 700; }
.tip { background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: .9rem; }
.tip ul { margin: 6px 0 0; padding-left: 1.2em; }
.tip li { margin-bottom: 3px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field-label { font-weight: 600; font-size: .88rem; }
.field input[type=text], .field input[type=url], .field input[type=date], .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-family: inherit; font-size: .92rem; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold-line); border-color: var(--gold); }
.field-hint { font-size: .78rem; }
.field input.err { border-color: var(--high); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 16px; }
.chk-wrap { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; padding-top: 4px; }
textarea.output, .output { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-family: "SFMono-Regular", Consolas, "Courier New", monospace; font-size: .82rem; background: #FAFBFC; resize: vertical; white-space: pre; }
.output-wrap { margin: 16px 0; }
.output-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.output-head h4 { margin: 0; }
.output-actions { display: flex; gap: 8px; }

/* ── GEO lab ── */
.platform-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 8px; }
.scenario-h { margin-top: 16px; color: var(--gold-dark); border-left: 3px solid var(--gold); padding-left: 8px; }
.comp-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -6px 0 14px; }
.prompt-list { display: grid; gap: 8px; }
.prompt-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; }
.prompt-text { flex: 1; font-size: .9rem; }
.prompt-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.table-scroll { overflow-x: auto; }
.log-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.log-table th, .log-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.log-table th { color: var(--muted); font-weight: 600; }
.cell-prompt { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yn { font-weight: 700; } .yn.yes { color: var(--ok); } .yn.no { color: var(--na); }
.sent { padding: 2px 8px; border-radius: 999px; font-size: .78rem; }
.sent-pos { background: #E4F3EA; color: var(--ok); }
.sent-neg { background: #FBE5E4; color: var(--high); }
.sent-neu { background: #EEF0F2; color: var(--muted); }
.sent-na  { background: #F4F5F7; color: var(--na); }
.sent-select { padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); font-family: inherit; font-size: .8rem; cursor: pointer; background: #fff; }
.sent-select.sent-pos { color: var(--ok); border-color: var(--ok); }
.sent-select.sent-neg { color: var(--high); border-color: var(--high); }
.sent-select.sent-neu { color: var(--muted); }

/* ── Resources ── */
.res-section-head { margin: 18px 0 10px; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 8px; }
.res-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.res-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.res-card-head h4 { margin: 0; }
.res-columbia { font-size: .85rem; background: var(--gold-soft); border-radius: 8px; padding: 8px 10px; margin: 8px 0 0; }
.res-link { margin-top: 10px; font-size: .86rem; font-weight: 600; text-decoration: none; }

/* ── Data IO ── */
.io-msg { margin-top: 10px; font-size: .9rem; min-height: 1.2em; }
.io-msg.ok { color: var(--ok); }
.io-msg.err { color: var(--high); }
.danger-zone { border-color: #F3C9C7; background: #FEF7F6; }
.danger-zone h3 { color: var(--high); }

/* ── Footer ── */
.footer { max-width: 1120px; margin: 0 auto; padding: 18px 20px 30px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); }

/* ── Print ── */
@media print {
  .app-header, .nav, .footer, .filter-bar, .btn, .actions-row, .status-select { display: none !important; }
  body { background: #fff; }
  .card, details.section { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  details.section, .item-more { }
}

@media (max-width: 560px) {
  .score-hero { flex-direction: column; text-align: center; }
  .section-prog { min-width: 0; }
  .brand-sub { display: none; }
}
