:root {
  --brown-950: #34221d;
  --brown-900: #412b24;
  --brown-800: #4b332c;
  --brown-700: #62443a;
  --cream: #f7f1e8;
  --cream-strong: #f1e6d7;
  --card: #fffdfb;
  --card-warm: #fff8ed;
  --gold: #e7b95b;
  --gold-pale: #fbefc9;
  --orange: #c86e36;
  --orange-dark: #a85228;
  --green: #527a60;
  --green-pale: #e4eee6;
  --blue-pale: #e9f0f5;
  --red: #b85a3b;
  --red-pale: #f7e5df;
  --muted: #8d7d72;
  --faint: #b2a49b;
  --line: #eadfd3;
  --line-strong: #dfcdbd;
  --shadow: 0 8px 24px rgba(75, 51, 44, .06);
  --shadow-strong: 0 18px 42px rgba(75, 51, 44, .12);
  --radius: 14px;
  --sidebar: 238px;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--brown-800);
  background: var(--cream);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--cream); }
body { margin: 0; min-width: 320px; background: var(--cream); color: var(--brown-800); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(200, 110, 54, .25); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 40; display: flex; flex-direction: column; padding: 24px 15px 17px; background: var(--brown-950); color: #f7eee4; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 21px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 11px; color: var(--brown-950); background: var(--gold); font-size: 20px; font-weight: 900; }
.brand-name { font-size: 15px; font-weight: 900; letter-spacing: .02em; }
.brand-sub { margin-top: 3px; color: #cab6a8; font-size: 8px; letter-spacing: .19em; }
.workspace-switch { margin: 20px 3px 22px; padding: 13px 12px; border: 1px solid rgba(255,255,255,.13); border-radius: 12px; background: rgba(255,255,255,.055); }
.workspace-label { color: #d7b987; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.workspace-switch select { width: 100%; height: 35px; margin: 8px 0 9px; padding: 0 9px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; color: #fff8ef; background: rgba(255,255,255,.08); font-size: 12px; }
.workspace-switch option { color: var(--brown-800); }
.workspace-note { color: #bca99b; font-size: 10px; line-height: 1.55; }
.workspace-actions { display: flex; gap: 6px; margin-top: 9px; }
.nav-section-title { margin: 0 9px 8px; color: #a98e7c; font-size: 9px; font-weight: 900; letter-spacing: .18em; }
.nav-list { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 10px; border: 0; border-radius: 10px; color: #d9c4b6; background: transparent; text-align: left; font-size: 12px; transition: background .18s, color .18s; }
.nav-item:hover { color: #fff8ef; background: rgba(255,255,255,.08); }
.nav-item.active { color: var(--brown-950); background: var(--orange); box-shadow: inset 4px 0 var(--gold); font-weight: 900; }
.nav-icon { display: grid; place-items: center; width: 22px; color: var(--gold); font-size: 16px; }
.nav-item.active .nav-icon { color: var(--brown-950); }
.nav-count { margin-left: auto; min-width: 20px; color: #d8b7a5; font-size: 10px; text-align: right; }
.nav-item.active .nav-count { color: var(--brown-950); }
.sidebar-footer { margin-top: auto; padding: 13px 8px 0; border-top: 1px solid rgba(255,255,255,.12); color: #bda99a; font-size: 9px; line-height: 1.65; }
.sidebar-footer strong { color: var(--gold); }

.main-shell { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; min-height: 68px; padding: 0 33px; border-bottom: 1px solid var(--line); background: rgba(247,241,232,.94); backdrop-filter: blur(14px); }
.crumbs { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.crumbs strong { overflow: hidden; color: var(--brown-800); font-size: 12px; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.demo-flag { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid #cddcca; border-radius: 8px; color: var(--green); background: #f1f6f0; font-size: 10px; white-space: nowrap; }
.demo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.top-action { min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--brown-700); background: var(--card); font-size: 11px; }
.top-action:hover { border-color: var(--orange); color: var(--orange-dark); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--brown-950); background: var(--gold); font-size: 11px; font-weight: 900; }
.mobile-menu { display: none; }

.page-wrap { width: min(100%, 1430px); margin: 0 auto; padding: 33px 34px 70px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 23px; }
.eyebrow { color: var(--orange); font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.page-title { margin: 7px 0 6px; color: var(--brown-800); font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(27px, 3vw, 39px); font-weight: 700; letter-spacing: -.04em; line-height: 1.15; }
.page-desc { max-width: 760px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.page-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 39px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; font-size: 11px; font-weight: 800; transition: transform .16s, box-shadow .16s, border-color .16s, background .16s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff8ef; background: var(--orange); box-shadow: 0 6px 14px rgba(200,110,54,.18); }
.button-primary:hover { background: var(--orange-dark); }
.button-secondary { border-color: var(--line-strong); color: var(--brown-700); background: var(--card); }
.button-secondary:hover { border-color: var(--orange); color: var(--orange-dark); }
.button-quiet { min-height: 32px; padding: 0 10px; border-color: transparent; color: var(--orange-dark); background: transparent; }
.button-small { min-height: 29px; padding: 0 9px; border-radius: 7px; font-size: 10px; }
.button-danger { color: var(--red); background: var(--red-pale); }

.notice { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 12px 14px; border: 1px solid #eed5a2; border-radius: 11px; color: #805d2d; background: #fff8e4; font-size: 11px; line-height: 1.6; }
.notice b { color: var(--orange-dark); }
.notice-icon { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; color: var(--brown-950); background: var(--gold); font-weight: 900; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric-card { min-width: 0; padding: 16px 17px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); text-align: left; }
.metric-card.clickable { width: 100%; cursor: pointer; transition: transform .16s, border-color .16s, box-shadow .16s; }
.metric-card.clickable:hover { border-color: var(--orange); box-shadow: var(--shadow-strong); transform: translateY(-2px); }
.metric-label { color: var(--muted); font-size: 10px; }
.metric-value { display: block; margin: 8px 0 5px; color: var(--brown-800); font-family: Georgia, "Noto Serif SC", serif; font-size: 29px; font-weight: 700; letter-spacing: -.04em; }
.metric-value.orange { color: var(--orange-dark); }
.metric-value.green { color: var(--green); }
.metric-meta { color: var(--faint); font-size: 9px; line-height: 1.45; }
.metric-link { display: block; margin-top: 9px; color: var(--orange-dark); font-size: 9px; font-weight: 800; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr); gap: 16px; margin-bottom: 16px; }
.grid-2-equal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.panel { min-width: 0; padding: 19px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.panel-warm { background: var(--card-warm); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.panel-head h2 { margin: 4px 0 4px; color: var(--brown-800); font-family: Georgia, "Noto Serif SC", serif; font-size: 20px; letter-spacing: -.03em; }
.panel-head p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.panel-link { color: var(--orange-dark); font-size: 10px; font-weight: 800; white-space: nowrap; }
.panel-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.section-title { margin: 0 0 12px; color: var(--brown-800); font-size: 13px; font-weight: 900; }

.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #eee5dd; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--orange); }
.progress-fill.gold { background: var(--gold); }
.progress-fill.green { background: var(--green); }
.goal-panel { padding: 21px 22px; color: #fff7ef; background: var(--brown-900); }
.goal-panel .eyebrow { color: var(--gold); }
.goal-panel h2 { margin: 9px 0 5px; color: #fff7ef; font-family: Georgia, "Noto Serif SC", serif; font-size: 22px; }
.goal-panel p { margin: 0 0 17px; color: #d9c7ba; font-size: 10px; }
.goal-line { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; color: #d7c4b6; font-size: 10px; }
.goal-line strong { color: var(--gold); font-family: Georgia, serif; font-size: 25px; }
.goal-panel .progress-track { background: rgba(255,255,255,.18); }
.goal-panel .progress-fill { background: var(--gold); }

.chart-box { min-height: 180px; }
.chart-svg { display: block; width: 100%; height: 164px; }
.chart-grid-line { stroke: #eee2d7; stroke-width: 1; }
.chart-area { fill: rgba(200,110,54,.12); }
.chart-line { fill: none; stroke: var(--orange); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: var(--card); stroke: var(--orange); stroke-width: 2; }
.chart-label { fill: var(--faint); font-size: 9px; }
.legend { display: flex; gap: 15px; margin-top: 6px; color: var(--muted); font-size: 9px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.legend i.gold { background: var(--gold); }

.funnel-list { display: grid; gap: 12px; }
.funnel-row { display: grid; grid-template-columns: 62px minmax(0,1fr) 38px; align-items: center; gap: 10px; }
.funnel-row label { color: var(--muted); font-size: 10px; }
.funnel-row strong { color: var(--brown-800); font-size: 12px; text-align: right; }
.funnel-row .bar { height: 10px; overflow: hidden; border-radius: 99px; background: #eee8e0; }
.funnel-row .bar i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.funnel-row:nth-child(4) .bar i { background: var(--orange); }
.funnel-row:nth-child(5) .bar i { background: var(--gold); }
.funnel-summary { display: flex; justify-content: space-between; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.funnel-summary strong { color: var(--orange-dark); font-family: Georgia, serif; font-size: 19px; }

.rank-list { display: grid; gap: 0; }
.rank-row { display: grid; grid-template-columns: 27px minmax(0,1fr) 54px 64px; align-items: center; gap: 9px; min-height: 50px; border-bottom: 1px solid #f0e7df; }
.rank-row:last-child { border-bottom: 0; }
.rank-no { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--brown-700); background: var(--cream-strong); font-size: 10px; font-weight: 900; }
.rank-title { min-width: 0; }
.rank-title b, .rank-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-title b { color: var(--brown-800); font-size: 11px; }
.rank-title small { margin-top: 3px; color: var(--faint); font-size: 9px; }
.rank-number { color: var(--orange-dark); font-family: Georgia, serif; font-size: 18px; font-weight: 700; text-align: right; }
.rank-caption { color: var(--muted); font-size: 9px; text-align: right; }

.action-list { display: grid; gap: 0; }
.action-row { display: grid; grid-template-columns: 26px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 57px; border-bottom: 1px solid #f0e7df; }
.action-row:last-child { border-bottom: 0; }
.action-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--brown-800); background: var(--gold-pale); font-size: 10px; font-weight: 900; }
.action-icon.red { color: var(--red); background: var(--red-pale); }
.action-main { min-width: 0; }
.action-main b, .action-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-main b { color: var(--brown-800); font-size: 11px; }
.action-main small { margin-top: 4px; color: var(--faint); font-size: 9px; }
.action-date { color: var(--muted); font-size: 9px; white-space: nowrap; }

.alert-list { display: grid; gap: 9px; }
.alert { display: flex; gap: 10px; padding: 10px; border-radius: 9px; background: #fbf4e8; }
.alert .alert-mark { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; color: var(--orange-dark); background: #f6d9bd; font-size: 11px; font-weight: 900; }
.alert.alert-risk { background: #fcf0ec; }
.alert.alert-risk .alert-mark { color: var(--red); background: #f3cec4; }
.alert b { display: block; margin-bottom: 3px; color: var(--brown-800); font-size: 10px; }
.alert p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

.tabs { display: flex; align-items: center; gap: 4px; margin: 0 0 16px; padding-bottom: 1px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tab { position: relative; min-height: 37px; padding: 0 12px; border: 0; color: var(--muted); background: transparent; font-size: 11px; white-space: nowrap; }
.tab.active { color: var(--orange-dark); font-weight: 900; }
.tab.active::after { position: absolute; right: 10px; bottom: -1px; left: 10px; height: 3px; border-radius: 3px 3px 0 0; background: var(--orange); content: ""; }
.tab-count { margin-left: 4px; color: var(--faint); font-size: 9px; }

.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; }
.search { flex: 1 1 210px; min-width: 180px; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--brown-800); background: var(--card); font-size: 11px; }
.select { height: 36px; min-width: 125px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--brown-700); background: var(--card); font-size: 10px; }
.toolbar-note { color: var(--muted); font-size: 10px; }

.topic-board { display: grid; grid-template-columns: repeat(5, minmax(190px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 5px; }
.board-column { min-width: 190px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fbf6ef; }
.board-column-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; color: var(--brown-800); font-size: 11px; font-weight: 900; }
.board-column-head span { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 6px; color: var(--orange-dark); background: var(--gold-pale); font-size: 9px; }
.topic-stack { display: grid; gap: 8px; }
.topic-card { padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); box-shadow: 0 3px 10px rgba(75,51,44,.04); cursor: pointer; }
.topic-card:hover { border-color: var(--orange); box-shadow: var(--shadow); }
.topic-card-top { display: flex; justify-content: space-between; gap: 8px; }
.topic-card h3 { margin: 0; color: var(--brown-800); font-size: 11px; line-height: 1.45; }
.topic-card p { display: -webkit-box; overflow: hidden; margin: 8px 0; color: var(--muted); font-size: 9px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.topic-card-foot { display: flex; align-items: center; justify-content: space-between; color: var(--faint); font-size: 9px; }

.badge { display: inline-flex; align-items: center; min-height: 21px; padding: 0 7px; border-radius: 5px; color: var(--brown-700); background: var(--cream-strong); font-size: 9px; font-weight: 800; white-space: nowrap; }
.badge-high { color: #9e4e25; background: #f8dcc5; }
.badge-medium { color: #7e642b; background: var(--gold-pale); }
.badge-low { color: var(--green); background: var(--green-pale); }
.badge-green { color: var(--green); background: var(--green-pale); }
.badge-blue { color: #4b6d83; background: var(--blue-pale); }
.badge-red { color: var(--red); background: var(--red-pale); }
.badge-dark { color: #fff8ef; background: var(--brown-700); }

.data-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.data-table { width: 100%; min-width: 840px; border-collapse: collapse; background: var(--card); }
.data-table th { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--faint); background: #fbf6ef; font-size: 9px; font-weight: 900; text-align: left; white-space: nowrap; }
.data-table td { padding: 12px; border-bottom: 1px solid #f0e7df; color: var(--brown-700); font-size: 10px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; transition: background .16s; }
.data-table tbody tr:hover { background: #fff8ee; }
.data-table td strong { color: var(--brown-800); font-size: 11px; }
.data-table td small { display: block; margin-top: 4px; color: var(--faint); font-size: 9px; }
.table-actions { display: flex; gap: 4px; }
.icon-btn { display: inline-grid; place-items: center; width: 27px; height: 27px; padding: 0; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--card); font-size: 12px; }
.icon-btn:hover { border-color: var(--orange); color: var(--orange-dark); }
.icon-btn.danger:hover { border-color: var(--red); color: var(--red); background: var(--red-pale); }

.lead-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.lead-card { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); cursor: pointer; transition: border-color .16s, box-shadow .16s; }
.lead-card:hover { border-color: var(--orange); box-shadow: var(--shadow); }
.lead-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.lead-id { display: flex; align-items: center; gap: 9px; }
.lead-avatar { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 9px; color: var(--brown-800); background: var(--gold-pale); font-size: 10px; font-weight: 900; }
.lead-card h3 { margin: 0; color: var(--brown-800); font-size: 13px; }
.lead-card small { display: block; margin-top: 4px; color: var(--faint); font-size: 9px; }
.lead-need { margin: 14px 0 12px; padding: 10px; border-radius: 8px; color: var(--brown-700); background: #fbf5ec; font-size: 10px; line-height: 1.55; }
.lead-card-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid #f0e7df; color: var(--muted); font-size: 9px; }

.source-bars { display: grid; gap: 11px; }
.source-row { display: grid; grid-template-columns: 72px minmax(0,1fr) 28px; align-items: center; gap: 8px; }
.source-row label { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.source-row .bar { height: 9px; overflow: hidden; border-radius: 99px; background: #eee8e0; }
.source-row .bar i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.source-row strong { color: var(--brown-800); font-size: 11px; text-align: right; }

.timeline { position: relative; display: grid; gap: 0; margin-top: 6px; padding-left: 18px; }
.timeline::before { position: absolute; top: 8px; bottom: 8px; left: 5px; width: 1px; background: var(--line-strong); content: ""; }
.timeline-item { position: relative; padding: 0 0 18px 13px; }
.timeline-item::before { position: absolute; top: 4px; left: -17px; width: 9px; height: 9px; border: 2px solid var(--card); border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 1px var(--orange); content: ""; }
.timeline-meta { display: flex; gap: 9px; color: var(--faint); font-size: 9px; }
.timeline-item h4 { margin: 7px 0 4px; color: var(--brown-800); font-size: 11px; }
.timeline-item p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.timeline-next { margin-top: 7px; color: var(--orange-dark); font-size: 9px; font-weight: 800; }

.ai-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ai-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.ai-card-head { display: flex; align-items: flex-start; gap: 11px; }
.ai-icon { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px; color: var(--brown-950); background: var(--gold); font-size: 17px; font-weight: 900; }
.ai-card:nth-child(2) .ai-icon, .ai-card:nth-child(5) .ai-icon { color: var(--green); background: var(--green-pale); }
.ai-card:nth-child(3) .ai-icon, .ai-card:nth-child(6) .ai-icon { color: var(--orange-dark); background: #f7dfd0; }
.ai-card h2 { margin: 1px 0 4px; color: var(--brown-800); font-family: Georgia, "Noto Serif SC", serif; font-size: 19px; }
.ai-card-head p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.ai-status { margin-left: auto; }
.ai-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.ai-detail-box { padding: 10px; border-radius: 8px; background: #fbf6ef; }
.ai-detail-box b { display: block; margin-bottom: 6px; color: var(--orange-dark); font-size: 9px; letter-spacing: .08em; }
.ai-detail-box p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.prompt-box { padding: 12px; border: 1px dashed var(--line-strong); border-radius: 9px; background: #fffbf6; }
.prompt-box small { display: block; margin-bottom: 6px; color: var(--faint); font-size: 9px; }
.prompt-box p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--brown-700); font-size: 10px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.ai-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; color: var(--muted); font-size: 9px; }

.method-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.method-card { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); }
.method-card h3 { margin: 9px 0 6px; color: var(--brown-800); font-family: Georgia, serif; font-size: 16px; }
.method-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.step-list { display: grid; gap: 7px; margin-top: 13px; }
.step-list span { display: flex; gap: 7px; color: var(--brown-700); font-size: 10px; }
.step-list i { display: grid; place-items: center; flex: 0 0 18px; width: 18px; height: 18px; border-radius: 5px; color: var(--brown-950); background: var(--gold-pale); font-size: 9px; font-style: normal; font-weight: 900; }

.empty-state { padding: 36px 18px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--brown-700); font-family: Georgia, serif; font-size: 18px; }
.empty-state p { margin: 0; font-size: 10px; }
.muted-note { color: var(--muted); font-size: 10px; line-height: 1.6; }
.inline-link { color: var(--orange-dark); font-weight: 800; }
.inline-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(52,34,29,.42); backdrop-filter: blur(5px); }
.modal { width: min(680px, 100%); max-height: min(780px, 92vh); overflow: auto; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-strong); }
.modal.modal-wide { width: min(900px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.modal-head h2 { margin: 4px 0 5px; color: var(--brown-800); font-family: Georgia, "Noto Serif SC", serif; font-size: 23px; }
.modal-head p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.close-btn { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--card); font-size: 18px; }
.close-btn:hover { color: var(--orange-dark); border-color: var(--orange); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.form-field { display: grid; gap: 6px; min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: var(--brown-700); font-size: 10px; font-weight: 900; }
.form-field label em { color: var(--orange-dark); font-style: normal; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 36px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--brown-800); background: #fffdfa; font-size: 11px; }
.form-field textarea { min-height: 78px; resize: vertical; line-height: 1.55; }
.form-hint { color: var(--faint); font-size: 9px; line-height: 1.4; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); }
.detail-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 18px; }
.detail-section { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fffbf6; }
.detail-section + .detail-section { margin-top: 11px; }
.detail-section h3 { margin: 0 0 11px; color: var(--brown-800); font-size: 12px; }
.detail-list { display: grid; gap: 9px; }
.detail-row { display: grid; grid-template-columns: 80px minmax(0,1fr); gap: 8px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.detail-row b { color: var(--faint); font-size: 9px; font-weight: 700; }
.related-list { display: grid; gap: 7px; }
.related-item { display: flex; justify-content: space-between; gap: 8px; padding: 9px; border-radius: 8px; background: var(--cream); cursor: pointer; }
.related-item:hover { background: var(--cream-strong); }
.related-item b { overflow: hidden; color: var(--brown-800); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.related-item small { color: var(--muted); font-size: 9px; white-space: nowrap; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 200; max-width: 340px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 9px; color: #fff8ef; background: var(--brown-900); box-shadow: var(--shadow-strong); font-size: 11px; }
.toast.success { background: var(--green); }
.toast.warn { background: var(--orange-dark); }

@media (max-width: 1180px) {
  :root { --sidebar: 218px; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .topic-board { grid-template-columns: repeat(5, 205px); }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); height: 100vh; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-strong); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 35; display: block; background: rgba(52,34,29,.35); }
  .topbar { padding: 0 16px; }
  .mobile-menu { display: inline-grid; place-items: center; width: 36px; height: 36px; margin-right: 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--brown-800); background: var(--card); font-size: 18px; }
  .topbar-left { display: flex; align-items: center; min-width: 0; }
  .demo-flag { display: none; }
  .page-wrap { padding: 24px 18px 55px; }
  .grid-2, .grid-2-equal { grid-template-columns: 1fr; }
  .ai-grid { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .topbar { min-height: 60px; }
  .crumbs { font-size: 8px; }
  .crumbs strong { font-size: 11px; }
  .top-action.hide-mobile { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 13px; }
  .page-title { font-size: 28px; }
  .page-head-actions { justify-content: flex-start; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  .metric-card { padding: 13px; }
  .metric-value { font-size: 24px; }
  .panel { padding: 15px; }
  .panel-head h2 { font-size: 18px; }
  .rank-row { grid-template-columns: 24px minmax(0,1fr) 44px; }
  .rank-caption { display: none; }
  .lead-grid { grid-template-columns: 1fr; }
  .form-grid, .detail-layout { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { max-height: 94vh; border-radius: 16px 16px 0 0; padding: 18px 15px 22px; }
  .data-table { min-width: 780px; }
  .toast { right: 14px; bottom: 14px; left: 14px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
