:root {
  --bg: #f3f8fc;
  --panel: #ffffff;
  --ink: #18334a;
  --muted: #647b8c;
  --line: #d7e5ed;
  --orange: #178f7a;
  --orange-soft: #e7f7f3;
  --green: #2a9d73;
  --green-soft: #e6f6ef;
  --yellow: #efb445;
  --blue: #3f82bd;
  --danger: #c45656;
  --shadow: 0 16px 40px rgba(46, 102, 138, .09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button, input { font: inherit; letter-spacing: 0; }
button { color: inherit; }
a { color: inherit; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 22px;
  background: #eaf4f8;
  color: var(--ink);
  border-right: 1px solid #cfe1e9;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; color: inherit; text-decoration: none; }
.brand strong { display: block; font-size: 17px; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.brand-mark { width: 36px; height: 36px; display: flex; align-items: flex-end; gap: 3px; padding: 8px; background: var(--orange); border-radius: 6px; }
.brand-mark span { display: block; width: 5px; background: #fff; border-radius: 1px 1px 0 0; }
.brand-mark span:nth-child(1) { height: 8px; }
.brand-mark span:nth-child(2) { height: 14px; }
.brand-mark span:nth-child(3) { height: 20px; }

.nav { display: grid; gap: 8px; overflow-y: auto; scrollbar-width: thin; }
.nav-group { padding: 5px; border: 1px solid rgba(85, 113, 132, .14); border-radius: 6px; background: rgba(255,255,255,.28); }
.nav-group-title { min-height: 34px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 0 5px; color: #385b70; }
.nav-group-title > span { color: #7390a0; font: 700 10px Consolas, monospace; }
.nav-group-title strong { font-size: 11px; }
.nav-group-title b { min-width: 23px; padding: 3px 6px; border-radius: 10px; background: #cfe4eb; font-size: 10px; text-align: center; }
.nav-item {
  width: 100%; height: 48px; border: 0; border-radius: 6px; padding: 0 10px;
  display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px;
  background: transparent; color: #557184; text-align: left; cursor: pointer;
}
.nav-item.nav-child { height: 36px; grid-template-columns: 18px 1fr auto; padding-left: 12px; font-size: 11px; }
.nav-dot { width: 5px; height: 5px; border-radius: 50%; background: #9ab3c1; }
.nav-item.active .nav-dot { background: var(--orange); box-shadow: 0 0 0 3px rgba(23,143,122,.12); }
.nav-item:hover { background: #dcecf2; color: var(--ink); }
.nav-item.active { background: #d8f0e9; color: #146b5d; box-shadow: inset 3px 0 var(--orange); }
.nav-icon { color: #7390a0; font-family: Consolas, monospace; font-size: 11px; }
.nav-item.active .nav-icon { color: var(--orange); }
.nav-item b { min-width: 23px; padding: 3px 6px; border-radius: 10px; background: #cfe4eb; font-size: 10px; text-align: center; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 16px 9px 0; border-top: 1px solid #cfe1e9; }
.sidebar-foot small, .sidebar-foot strong { display: block; }
.sidebar-foot small { color: var(--muted); font-size: 10px; }
.sidebar-foot strong { margin-top: 2px; font-size: 12px; font-weight: 600; }
.live-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #55c795; box-shadow: 0 0 0 4px rgba(85, 199, 149, .12); }

.main { min-width: 0; padding: 0 34px 64px; }
.topbar { min-height: 112px; display: flex; justify-content: space-between; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); }
.eyebrow, .section-heading p { margin: 0 0 6px; color: var(--orange); font: 700 10px/1.2 Consolas, monospace; text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: 28px; line-height: 1.2; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.search-box { width: min(320px, 32vw); height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.search-box span { color: var(--muted); font-size: 22px; transform: rotate(-15deg); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 13px; }
.logout-button { height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--muted); cursor: pointer; font-size: 11px; }
.logout-button:hover, .outline-button:hover { border-color: var(--orange); color: var(--orange); }

.status-strip { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--line); }
.status-copy, .status-metrics, .status-metrics span { display: flex; align-items: center; }
.status-copy { gap: 10px; }
.status-badge { padding: 4px 8px; color: var(--green); background: var(--green-soft); border-radius: 3px; font-weight: 700; }
.status-badge.stale { color: var(--danger); background: #f9e8e5; }
.status-metrics { gap: 18px; }
.status-metrics span { gap: 6px; }
.status-metrics i { width: 5px; height: 5px; border-radius: 50%; background: var(--orange); }
.status-metrics strong { color: var(--ink); }

.view { display: none; padding-top: 28px; animation: reveal .25s ease; }
.view.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.kpi { min-height: 112px; padding: 20px; background: var(--panel); }
.kpi-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.kpi-top b { color: var(--green); }
.kpi-value { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.kpi-value strong { font: 700 29px/1 Consolas, monospace; }
.kpi-value span { color: var(--muted); font-size: 11px; }
.kpi-track { height: 3px; margin-top: 14px; background: #e6eff3; overflow: hidden; }
.kpi-track i { display: block; height: 100%; background: var(--orange); }

.section-heading { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-heading > div:first-child { display: flex; align-items: center; gap: 14px; }
.section-index { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--ink); border-radius: 50%; font: 700 11px Consolas, monospace; }
.section-heading h2 { margin: 0; font-size: 19px; }
.section-heading p { margin-bottom: 3px; }

.segmented { display: flex; padding: 3px; background: #e5eef3; border-radius: 5px; }
.segmented button { min-height: 31px; padding: 0 12px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.segmented button.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 5px rgba(0,0,0,.07); }

.news-layout { display: grid; grid-template-columns: minmax(300px, .82fr) minmax(440px, 1.18fr); gap: 18px; }
.lead-story { min-height: 440px; padding: 28px; display: flex; flex-direction: column; justify-content: space-between; background: #e7f2f8; color: var(--ink); border: 1px solid #cfe2ec; border-radius: 6px; overflow: hidden; position: relative; }
.lead-story::before { content: ""; position: absolute; inset: 0; border-top: 5px solid #73b9cd; pointer-events: none; }
.lead-visual { position: relative; height: 132px; display: flex; align-items: flex-end; gap: 8px; }
.lead-visual span { flex: 1; max-width: 34px; background: var(--orange); transform-origin: bottom; border-radius: 2px 2px 0 0; }
.lead-content { position: relative; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 3px; background: var(--orange-soft); color: #146b5d; font-size: 10px; font-weight: 700; }
.lead-story .tag { background: #d3ebe6; color: #146b5d; }
.lead-story h3 { margin: 16px 0 10px; max-width: 560px; font-size: 26px; line-height: 1.35; }
.lead-story p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.story-meta { margin-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 10px; }
.source-link { text-decoration: none; font-weight: 700; }
.source-link:hover { color: var(--orange); }

.news-list { background: var(--panel); border: 1px solid var(--line); }
.news-item { min-height: 88px; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: 0; }
.news-number { color: #a4a7a5; font: 700 18px Consolas, monospace; }
.news-copy { min-width: 0; }
.news-copy h3 { margin: 0 0 5px; font-size: 13px; line-height: 1.45; }
.news-copy p { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-side { text-align: right; }
.news-side time, .news-side a { display: block; }
.news-side time { margin-bottom: 7px; color: var(--muted); font-size: 9px; }
.news-side a { color: var(--orange); font-size: 10px; text-decoration: none; }
.news-side a:hover { text-decoration: underline; }

.data-note { text-align: right; }
.data-note strong, .data-note span { display: block; }
.data-note strong { font-size: 11px; }
.data-note span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.radar-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 18px; background: var(--line); border: 1px solid var(--line); }
.radar-metric { padding: 18px; background: var(--panel); }
.radar-metric span { display: block; color: var(--muted); font-size: 10px; }
.radar-metric strong { display: block; margin-top: 8px; font: 700 21px Consolas, monospace; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.product-card { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.product-visual { height: 170px; position: relative; display: grid; place-items: center; overflow: hidden; background: #edf5f8; }
.product-visual img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; padding: 12px; }
.product-visual .fallback-shape { width: 86px; height: 86px; border: 14px solid #dadcd5; border-radius: 50%; position: relative; }
.product-visual .fallback-shape::after { content: ""; position: absolute; width: 58px; height: 12px; left: 57px; top: 24px; background: var(--orange); transform: rotate(-25deg); }
.trend-chip { position: absolute; top: 12px; right: 12px; padding: 5px 8px; border-radius: 3px; background: var(--green); color: #fff; font: 700 10px Consolas, monospace; }
.product-body { padding: 17px; }
.product-category { color: var(--orange); font: 700 9px Consolas, monospace; text-transform: uppercase; }
.product-body h3 { min-height: 42px; margin: 7px 0 13px; font-size: 15px; line-height: 1.45; }
.product-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.product-stats span { display: block; color: var(--muted); font-size: 9px; }
.product-stats strong { display: block; margin-top: 4px; font: 700 13px Consolas, monospace; }
.sparkline { width: 100%; height: 42px; margin-top: 12px; display: block; }
.sparkline .grid { stroke: #e6e7e2; stroke-width: 1; }
.sparkline .area { fill: rgba(231,109,36,.1); }
.sparkline .line { fill: none; stroke: var(--orange); stroke-width: 2; vector-effect: non-scaling-stroke; }
.product-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 9px; }
.product-footer a { color: var(--orange); text-decoration: none; font-weight: 700; }

.outline-button { min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); cursor: pointer; font-size: 11px; }
.pick-intro { display: grid; grid-template-columns: 1fr minmax(280px, .55fr); gap: 28px; align-items: center; padding: 18px 20px; margin-bottom: 15px; background: #e7f2f8; color: var(--ink); border-left: 4px solid var(--orange); }
.pick-intro strong, .pick-intro span { display: block; }
.pick-intro strong { font-size: 12px; }
.pick-intro span, .pick-intro p { color: var(--muted); font-size: 10px; line-height: 1.6; }
.pick-intro span { margin-top: 5px; }
.pick-intro p { margin: 0; }
.pick-list { display: grid; gap: 10px; }
.pick-card { display: grid; grid-template-columns: 74px minmax(170px, .8fr) minmax(270px, 1.2fr) minmax(220px, .9fr); gap: 18px; align-items: center; padding: 17px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.pick-rank { display: grid; place-items: center; align-self: stretch; border-right: 1px solid var(--line); }
.pick-rank strong { font: 700 28px Consolas, monospace; }
.pick-rank span { color: var(--muted); font-size: 9px; }
.pick-title h3 { margin: 6px 0 7px; font-size: 15px; }
.pick-title p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.score-badge { display: inline-flex; padding: 4px 7px; color: var(--green); background: var(--green-soft); border-radius: 3px; font: 700 9px Consolas, monospace; }
.pick-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pick-metric { padding: 10px; background: #eef5f8; border-radius: 4px; }
.pick-metric span, .pick-metric strong { display: block; }
.pick-metric span { color: var(--muted); font-size: 9px; }
.pick-metric strong { margin-top: 5px; font: 700 12px Consolas, monospace; }
.pick-verdict { min-width: 0; }
.risk-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.risk { padding: 4px 6px; border-radius: 3px; font-size: 9px; font-weight: 700; }
.risk.low { background: var(--green-soft); color: var(--green); }
.risk.mid { background: #fbf2d8; color: #87630d; }
.risk.high { background: #f9e8e5; color: var(--danger); }
.pick-verdict p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.pick-link { display: inline-block; margin-top: 8px; color: var(--orange); font-size: 10px; text-decoration: none; font-weight: 700; }

.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.method-card { padding: 22px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--orange); }
.method-card .method-no { color: var(--orange); font: 700 11px Consolas, monospace; }
.method-card h3 { margin: 12px 0 8px; font-size: 15px; }
.method-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.source-table-wrap { margin-top: 18px; overflow-x: auto; background: var(--panel); border: 1px solid var(--line); }
.source-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.source-table th, .source-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.source-table th { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.source-table tr:last-child td { border-bottom: 0; }
.source-table a { color: var(--orange); text-decoration: none; }

dialog { width: min(680px, calc(100vw - 30px)); border: 0; border-radius: 7px; padding: 0; color: var(--ink); background: var(--panel); box-shadow: 0 30px 100px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(12,15,16,.62); }
dialog form { padding: 28px; }
dialog h2 { margin: 0 0 20px; }
.dialog-close { position: absolute; right: 16px; top: 14px; width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer; font-size: 24px; }
.criteria-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.criterion { min-height: 72px; padding: 13px; background: var(--panel); }
.criterion strong { display: block; font-size: 11px; }
.criterion span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.dialog-note { margin: 18px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: 340px; padding: 12px 14px; border-radius: 5px; background: #2f76a4; color: #fff; font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s; }
.toast.show { opacity: 1; transform: none; }
.empty-state { padding: 50px 20px; color: var(--muted); text-align: center; background: var(--panel); border: 1px solid var(--line); }

.product-banner {
  min-height: 126px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 24px 28px; margin-bottom: 14px; background: #e5f3f5; color: var(--ink); border: 1px solid #cce4e8; border-left: 4px solid var(--orange);
}
.product-identity { display: flex; align-items: center; gap: 18px; }
.product-monogram { width: 66px; height: 66px; display: grid; place-items: center; flex: 0 0 auto; background: var(--orange); border-radius: 6px; font: 700 18px Consolas, monospace; }
.product-identity h2 { margin: 0; font-size: 22px; }
.product-links { display: flex; gap: 14px; margin-top: 9px; }
.product-links a { color: #39738d; font-size: 10px; text-decoration: none; }
.product-links a:hover { color: var(--orange); }
.rank-panel { min-width: 230px; padding-left: 24px; border-left: 1px solid #bad5dc; }
.rank-panel span, .rank-panel strong, .rank-panel small { display: block; }
.rank-panel span { color: var(--muted); font-size: 10px; }
.rank-panel strong { margin: 7px 0 5px; font: 700 24px Consolas, monospace; }
.rank-panel small { color: #70899a; font-size: 9px; }
.overview-toolbar { display: grid; grid-template-columns: 145px 145px auto minmax(190px, 1fr); align-items: end; gap: 12px; padding: 13px 16px; margin-bottom: 14px; background: var(--panel); border: 1px solid var(--line); }
.overview-toolbar label { min-width: 0; }
.overview-toolbar label span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 700; }
.overview-toolbar input { width: 100%; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px; background: #f8fbfd; color: var(--ink); }
.overview-toolbar > div strong, .overview-toolbar > div span { display: block; }
.overview-toolbar > div strong { font-size: 12px; }
.overview-toolbar > div span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.range-presets { display: flex; gap: 3px; padding: 3px; align-self: end; background: #e9f1f5; border-radius: 5px; }
.range-presets button { min-height: 30px; padding: 0 9px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); cursor: pointer; font-size: 9px; white-space: nowrap; }
.range-presets button.active { background: var(--panel); color: #146b5d; box-shadow: 0 1px 4px rgba(46,102,138,.12); font-weight: 700; }
.ops-kpis { margin-bottom: 18px; }
.cost-panel { margin-bottom: 14px; }
.cost-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cost-item { min-width: 0; padding: 13px; background: #fafdfe; }
.cost-item span, .cost-item strong, .cost-item small { display: block; }
.cost-item span { color: var(--muted); font-size: 8px; }
.cost-item strong { margin-top: 6px; font: 700 14px Consolas, monospace; }
.cost-item small { margin-top: 5px; min-height: 22px; color: #7a91a0; font-size: 8px; line-height: 1.35; }
.cost-item.total { background: #ddf2ed; color: #146b5d; }
.cost-note { margin: 12px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.ops-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 14px; }
.lower-grid { grid-template-columns: repeat(2, 1fr); margin-bottom: 14px; }
.analysis-panel { min-width: 0; padding: 20px; background: var(--panel); border: 1px solid var(--line); }
.wide-panel { min-height: 350px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.panel-head p { margin: 0 0 4px; color: var(--orange); font: 700 9px Consolas, monospace; }
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-head > span { color: var(--muted); font-size: 9px; }
.business-chart { min-height: 270px; display: grid; align-items: end; }
.chart-svg { width: 100%; height: 270px; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-units { fill: none; stroke: var(--orange); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-spend { fill: rgba(51,108,141,.13); stroke: var(--blue); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.chart-profit { fill: rgba(23,107,82,.14); stroke: var(--green); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.chart-label { fill: var(--muted); font-size: 8px; font-family: Consolas, monospace; }
.chart-legend { display: flex; gap: 16px; margin-top: 8px; color: var(--muted); font-size: 9px; }
.chart-legend i { display: inline-block; width: 14px; height: 2px; margin-right: 5px; vertical-align: middle; }
.rank-history { min-height: 280px; }
.rank-empty { height: 250px; display: grid; place-items: center; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.7; border: 1px dashed var(--line); }
.rank-point-list { display: grid; gap: 8px; }
.rank-point { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rank-point span { color: var(--muted); font-size: 10px; }
.rank-point strong { font: 700 13px Consolas, monospace; }
.compact-heading { min-height: 78px; }
.insight-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.insight-card { min-height: 150px; padding: 17px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--blue); }
.insight-card.good { border-top-color: var(--green); }
.insight-card.warning { border-top-color: var(--yellow); }
.insight-card h3 { margin: 11px 0 7px; font-size: 13px; }
.insight-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.insight-level { color: var(--muted); font: 700 9px Consolas, monospace; }
.phase-list, .campaign-list { display: grid; gap: 2px; }
.phase-row { display: grid; grid-template-columns: minmax(120px, 1fr) 74px 74px 86px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.phase-row:last-child { border-bottom: 0; }
.phase-row h3 { margin: 0; font-size: 11px; }
.phase-row h3 small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 400; }
.phase-cell span, .phase-cell strong { display: block; }
.phase-cell span { color: var(--muted); font-size: 8px; }
.phase-cell strong { margin-top: 3px; font: 700 11px Consolas, monospace; }
.campaign-row { display: grid; grid-template-columns: minmax(120px, 1fr) repeat(3, 70px); gap: 10px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.campaign-row:last-child { border-bottom: 0; }
.campaign-row h3 { margin: 0; font-size: 11px; }
.campaign-row h3 small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; font-weight: 400; }
.portfolio-panel { margin-top: 14px; }
.portfolio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.portfolio-item { padding: 17px; background: var(--panel); }
.portfolio-item h3 { margin: 0 0 13px; font-size: 12px; }
.portfolio-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.portfolio-stat span, .portfolio-stat strong { display: block; }
.portfolio-stat span { color: var(--muted); font-size: 8px; }
.portfolio-stat strong { margin-top: 4px; font: 700 12px Consolas, monospace; }

.primary-button { min-height: 36px; padding: 0 14px; border: 1px solid var(--orange); border-radius: 5px; background: var(--orange); color: #fff; cursor: pointer; font-size: 11px; font-weight: 700; }
.primary-button:hover { background: #127765; border-color: #127765; }
.query-toolbar { display: grid; grid-template-columns: minmax(440px, 1.35fr) 105px minmax(180px, .55fr) 125px 125px minmax(160px, .55fr); gap: 10px; align-items: end; padding: 14px; background: var(--panel); border: 1px solid var(--line); }
.detail-tabs { overflow-x: auto; }
.query-toolbar label, .record-form-grid label { display: block; }
.query-toolbar label span, .record-form-grid label span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 700; }
.query-toolbar input, .query-toolbar select, .log-toolbar input, .log-toolbar select, .record-form-grid input, .record-form-grid select, .record-form-grid textarea {
  width: 100%; min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--ink); outline: none; font-size: 10px;
}
.record-form-grid textarea { resize: vertical; min-height: 84px; }
.query-toolbar input:focus, .log-toolbar input:focus, .record-form-grid input:focus, .record-form-grid textarea:focus { border-color: var(--orange); }
.query-toolbar select:disabled { background: #eef3f6; color: #9aadb8; cursor: not-allowed; }
[hidden] { display: none !important; }
.query-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; margin: 12px 0; background: var(--line); border: 1px solid var(--line); }
.query-stat { padding: 12px; background: var(--panel); }
.query-stat span, .query-stat strong { display: block; }
.query-stat span { color: var(--muted); font-size: 8px; }
.query-stat strong { margin-top: 5px; font: 700 13px Consolas, monospace; }
.data-table-wrap { max-height: 610px; overflow: auto; background: var(--panel); border: 1px solid var(--line); }
.data-table { width: 100%; min-width: 1040px; border-collapse: collapse; font-size: 10px; }
.data-table th { position: sticky; top: 0; z-index: 2; padding: 10px; background: #337dad; color: #fff; text-align: left; white-space: nowrap; cursor: pointer; }
.data-table td { max-width: 340px; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.45; }
.data-table tbody tr:hover { background: var(--orange-soft); }
.data-table .num { text-align: right; font-family: Consolas, monospace; white-space: nowrap; }
.table-foot { display: flex; justify-content: space-between; padding: 9px 2px; color: var(--muted); font-size: 9px; }

.log-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 12px; background: var(--line); border: 1px solid var(--line); }
.log-kpi { padding: 15px; background: var(--panel); }
.log-kpi span, .log-kpi strong { display: block; }
.log-kpi span { color: var(--muted); font-size: 9px; }
.log-kpi strong { margin-top: 6px; font: 700 18px Consolas, monospace; }
.log-toolbar { display: grid; grid-template-columns: 150px 190px 130px 130px 1fr; gap: 8px; margin-bottom: 12px; }
.log-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 14px; }
.log-list { min-height: 480px; background: var(--panel); border: 1px solid var(--line); }
.log-entry { display: grid; grid-template-columns: 86px minmax(150px, .45fr) minmax(230px, 1fr) auto; gap: 12px; align-items: start; padding: 14px; border-bottom: 1px solid var(--line); }
.log-entry:last-child { border-bottom: 0; }
.log-date { font: 700 10px Consolas, monospace; }
.log-module strong { display: block; font-size: 10px; }
.log-module span { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.log-change h3 { margin: 0 0 5px; font-size: 11px; }
.log-change p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.change-line { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; font: 700 10px Consolas, monospace; }
.change-line i { color: var(--orange); font-style: normal; }
.delete-log { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--danger); cursor: pointer; }
.node-timeline { padding: 18px; background: #e7f2f8; color: var(--ink); border: 1px solid #cfe2ec; }
.node-timeline h3 { margin: 0 0 18px; font-size: 13px; }
.node-item { position: relative; padding: 0 0 17px 18px; border-left: 1px solid #9fc3d3; }
.node-item::before { content: ""; position: absolute; left: -4px; top: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.node-item time { color: #668596; font: 700 8px Consolas, monospace; }
.node-item strong { display: block; margin: 5px 0; font-size: 10px; }
.node-item p { margin: 0; color: var(--muted); font-size: 8.5px; line-height: 1.55; }
.record-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.record-form-grid .form-wide { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.login-page { min-height: 100vh; background: #edf6fa; }
.login-shell { width: min(980px, calc(100vw - 36px)); min-height: 560px; margin: max(24px, calc((100vh - 560px) / 2)) auto 24px; display: grid; grid-template-columns: 1.1fr .9fr; overflow: hidden; border: 1px solid #cfe1e9; background: var(--panel); box-shadow: var(--shadow); }
.login-brand { min-width: 0; padding: 64px; display: flex; flex-direction: column; justify-content: center; background: #dff1f4; border-right: 1px solid #c6e0e5; }
.login-mark { width: 52px; height: 52px; padding: 11px; }
.login-brand > p { margin: 24px 0 8px; color: var(--orange); font: 700 12px Consolas, monospace; }
.login-brand h1 { max-width: 360px; margin: 0; font-size: 38px; line-height: 1.25; }
.login-signal { height: 120px; margin-top: 54px; display: flex; align-items: flex-end; gap: 12px; }
.login-signal i { width: 28px; background: #73b9cd; border-radius: 3px 3px 0 0; }
.login-signal i:nth-child(1) { height: 38%; }
.login-signal i:nth-child(2) { height: 56%; background: #4ba58f; }
.login-signal i:nth-child(3) { height: 48%; }
.login-signal i:nth-child(4) { height: 72%; background: #4ba58f; }
.login-signal i:nth-child(5) { height: 65%; }
.login-signal i:nth-child(6) { height: 92%; background: #258f7b; }
.login-panel { padding: 54px; display: grid; place-items: center; }
.login-panel form { width: min(100%, 330px); }
.login-panel h2 { margin: 0 0 30px; font-size: 24px; }
.login-panel label { display: block; margin-top: 16px; }
.login-panel label span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.login-panel input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; background: #f8fbfd; color: var(--ink); outline: none; }
.login-panel input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(23,143,122,.1); }
.login-error { min-height: 18px; margin: 10px 0 0; color: var(--danger); font-size: 10px; }
.login-submit { width: 100%; height: 44px; margin-top: 8px; border: 0; border-radius: 5px; background: var(--orange); color: #fff; cursor: pointer; font-weight: 700; }
.login-submit:hover { background: #127765; }
.login-submit:disabled { opacity: .65; cursor: wait; }
.login-panel small { display: block; margin-top: 16px; color: var(--muted); text-align: center; font-size: 9px; }


@media (max-width: 1100px) {
  .main { padding-inline: 24px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .news-layout { grid-template-columns: 1fr; }
  .lead-story { min-height: 340px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .pick-card { grid-template-columns: 62px minmax(180px, .8fr) 1.2fr; }
  .pick-verdict { grid-column: 2 / -1; padding-top: 12px; border-top: 1px solid var(--line); }
  .insight-grid { grid-template-columns: repeat(2, 1fr); }
  .cost-grid { grid-template-columns: repeat(4, 1fr); }
  .query-toolbar { grid-template-columns: 1fr 1fr 1fr; }
  .detail-tabs { grid-column: 1 / -1; }
  .log-layout { grid-template-columns: 1fr; }
  .node-timeline { max-height: 480px; overflow-y: auto; }
}

@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: sticky; z-index: 10; width: 100%; height: auto; padding: 10px 14px; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid #cfe1e9; }
  .brand { padding: 0; }
  .brand small, .sidebar-foot, .nav-item .nav-icon, .nav-item b { display: none; }
  .brand-mark { width: 31px; height: 31px; }
  .nav { margin-left: auto; display: flex; }
  .nav-group { display: contents; }
  .nav-group-title { display: none; }
  .nav-item { width: auto; height: 36px; display: block; flex: 0 0 auto; padding: 0 9px; font-size: 11px; }
  .nav-item.nav-child { height: 36px; display: block; padding-left: 9px; }
  .nav-dot { display: none; }
  .main { padding: 0 14px 44px; }
  .topbar { min-height: 92px; align-items: flex-start; padding-top: 18px; }
  .topbar h1 { font-size: 22px; }
  .top-actions { gap: 6px; }
  .search-box { width: 42px; padding: 0 10px; transition: width .2s; }
  .search-box:focus-within { position: absolute; right: 64px; width: calc(100vw - 96px); z-index: 4; }
  .search-box input { opacity: 0; }
  .search-box:focus-within input { opacity: 1; }
  .status-strip { align-items: flex-start; padding: 10px 0; }
  .status-copy { align-items: flex-start; flex-direction: column; gap: 4px; }
  .status-metrics { gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
  .kpi-grid, .radar-summary, .method-grid { grid-template-columns: 1fr 1fr; }
  .section-heading { align-items: flex-start; padding: 22px 0 16px; flex-direction: column; }
  .segmented { width: 100%; overflow-x: auto; }
  .segmented button { flex: 1; }
  .news-item { grid-template-columns: 34px 1fr; }
  .news-side { grid-column: 2; display: flex; justify-content: space-between; text-align: left; }
  .product-grid { grid-template-columns: 1fr; }
  .pick-intro { grid-template-columns: 1fr; gap: 10px; }
  .pick-card { grid-template-columns: 52px 1fr; gap: 13px; }
  .pick-rank { grid-row: 1 / 3; }
  .pick-metrics, .pick-verdict { grid-column: 2; }
  .method-grid { grid-template-columns: 1fr; }
  .nav { max-width: calc(100vw - 70px); overflow-x: auto; }
  .product-banner { align-items: flex-start; flex-direction: column; }
  .rank-panel { width: 100%; padding: 14px 0 0; border-left: 0; border-top: 1px solid #bad5dc; }
  .overview-toolbar { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .overview-toolbar label { min-width: 0; }
  .range-presets, .overview-toolbar > div:last-child { grid-column: 1 / -1; }
  .ops-grid, .lower-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .query-toolbar { grid-template-columns: 1fr 1fr; }
  .detail-tabs, .query-search { grid-column: 1 / -1; }
  .query-summary { grid-template-columns: repeat(2, 1fr); }
  .log-toolbar { grid-template-columns: 1fr 1fr; }
  .log-toolbar input[type="search"] { grid-column: 1 / -1; }
  .log-entry { grid-template-columns: 72px 1fr auto; }
  .log-change { grid-column: 2 / -1; }
}

@media (max-width: 600px) {
  .brand strong { display: none; }
  .nav-item { padding-inline: 7px; font-size: 10px; }
  .status-strip { flex-direction: column; align-items: stretch; gap: 8px; }
  .status-metrics { justify-content: flex-start; }
  .kpi-grid, .radar-summary { grid-template-columns: 1fr; }
  .cost-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-toolbar { grid-template-columns: 1fr; }
  .range-presets, .overview-toolbar > div:last-child { grid-column: 1; }
  .lead-story { padding: 21px; }
  .lead-story h3 { font-size: 21px; }
  .pick-card { grid-template-columns: 1fr; }
  .pick-rank { grid-row: auto; border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
  .pick-metrics, .pick-verdict { grid-column: 1; }
  .criteria-grid { grid-template-columns: 1fr; }
  .insight-grid, .log-kpis { grid-template-columns: 1fr; }
  .phase-row { grid-template-columns: 1fr 1fr; }
  .campaign-row { grid-template-columns: 1fr 1fr; }
  .query-toolbar, .log-toolbar, .record-form-grid { grid-template-columns: 1fr; }
  .detail-tabs, .query-search, .log-toolbar input[type="search"], .record-form-grid .form-wide { grid-column: 1; }
  .log-entry { grid-template-columns: 1fr auto; }
  .log-module, .log-change { grid-column: 1 / -1; }
  .login-shell { width: min(100% - 24px, 460px); min-height: 0; margin: 12px auto; grid-template-columns: 1fr; }
  .login-brand { padding: 30px; border-right: 0; border-bottom: 1px solid #c6e0e5; }
  .login-brand h1 { font-size: 27px; }
  .login-signal { height: 50px; margin-top: 24px; }
  .login-panel { padding: 32px 26px; }
}

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