:root {
  color-scheme: light;
  --ink: #1d2b31;
  --muted: #66767c;
  --line: #d9e5e8;
  --canvas: #f3f8fa;
  --surface: #fffefd;
  --teal: #17848e;
  --teal-soft: #d9f1f2;
  --coral: #d84f4a;
  --orange: #e59a2e;
  --gray: #9aa1a4;
  --blue: #357a9b;
  --radius: 8px;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); font-size: 14px; }
button, select, input { font: inherit; }
button { color: inherit; cursor: pointer; }

.login-screen { display: grid; min-height: 100dvh; place-items: center; background: radial-gradient(circle at top left, #dcefeb 0, transparent 32%), var(--canvas); padding: 24px; }
.login-card { width: min(390px, 100%); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 18px 50px rgba(31, 43, 41, 0.12); padding: 30px; }
.login-brand { margin-bottom: 18px; }
.login-card h1 { margin-bottom: 10px; font-size: 25px; }
.login-note { margin-bottom: 22px; color: var(--muted); line-height: 1.6; }
.login-card label { display: grid; gap: 7px; margin-bottom: 14px; color: var(--muted); font-size: 12px; font-weight: 700; }
.login-card input { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcf9; color: var(--ink); padding: 0 11px; font-size: 14px; }
.login-card input:focus { outline: 2px solid var(--teal-soft); border-color: #8cc5bc; }
.login-error { margin: 0 0 14px; border-radius: 6px; background: #f5dddd; padding: 9px 10px; color: var(--coral); font-size: 12px; }
.login-button { width: 100%; min-height: 42px; border: 0; border-radius: 7px; background: var(--teal); color: #fff; font-weight: 800; }
.login-button:disabled { cursor: wait; opacity: 0.72; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 8; display: flex; width: 84px; flex-direction: column; align-items: center; gap: 10px; border-right: 1px solid var(--line); background: #fdfcf7; padding: 18px 10px; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 8px; background: #f16b58; color: #fff; font-size: 20px; font-weight: 800; }
.nav-button { display: grid; width: 58px; min-height: 54px; place-items: center; gap: 2px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); padding: 6px 0; }
.nav-button.is-active, .nav-button:hover { background: var(--teal-soft); color: var(--teal); }
.logout-button:hover { background: #f5dddd; color: var(--coral); }
.nav-icon { font-size: 19px; line-height: 1; }
.app-icon { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-icon .app-icon { margin: 0 auto; }
.nav-label { font-size: 11px; font-weight: 700; line-height: 1; }
.nav-spacer { flex: 1; }
.mobile-nav { display: none; }
.workspace { margin-left: 84px; }
.topbar { display: flex; min-height: 92px; align-items: center; justify-content: space-between; padding: 18px 30px 12px; }
.eyebrow, .section-kicker { margin: 0 0 5px; color: var(--teal); font-size: 12px; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 25px; line-height: 1.2; }
h2 { margin-bottom: 0; font-size: 16px; line-height: 1.25; }
.as-of { padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #fbfcf9; }
.as-of strong { color: var(--ink); }

.filter-bar { position: sticky; top: 0; z-index: 1600; display: flex; min-height: 62px; align-items: center; flex-wrap: wrap; gap: 10px 18px; border-block: 1px solid var(--line); background: rgba(253, 252, 247, 0.96); padding: 10px 30px; backdrop-filter: blur(8px); }
.filter-group { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.filter-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.channel-group { flex-wrap: nowrap; }
.location-filter { position: relative; }
.location-trigger { display: inline-flex; min-height: 31px; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); padding: 0 9px; }
.location-trigger strong { max-width: 150px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.location-trigger > span:last-child { color: var(--muted); font-size: 16px; line-height: 1; }
.location-scrim { display: none; }
.location-popover { position: absolute; z-index: 1700; top: calc(100% + 8px); left: 0; overflow: hidden; width: min(620px, calc(100vw - 128px)); border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 12px 28px rgba(31, 43, 41, 0.14); }
.location-popover-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.location-popover-heading div { display: grid; gap: 3px; }
.location-popover-heading span { color: var(--muted); font-size: 11px; }
.location-close { display: grid; width: 24px; height: 24px; place-items: center; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 19px; line-height: 1; }
.location-close:hover { background: #eef2ef; color: var(--ink); }
.location-tools { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 12px 14px 10px; }
.location-tools label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.location-tools select, .location-tools input { width: 100%; min-width: 0; }
.location-picker { display: grid; grid-template-columns: 122px minmax(0, 1fr); min-height: 302px; max-height: 390px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.location-city-list { overflow: auto; border-right: 1px solid var(--line); background: #fbfcf9; padding: 7px; }
.location-city { display: flex; width: 100%; min-height: 30px; align-items: center; justify-content: space-between; gap: 8px; border: 0; border-radius: 5px; background: transparent; padding: 0 8px; color: #4f5858; text-align: left; }
.location-city:hover { background: #eef2ef; }
.location-city.is-selected { background: var(--teal-soft); color: var(--teal); font-weight: 800; }
.location-city span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.location-city small { color: var(--muted); font-size: 11px; }
.location-store-list { overflow: auto; background: var(--surface); padding: 7px 10px; }
.location-store-option { display: grid; width: 100%; min-height: 38px; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 0 8px; border: 0; border-radius: 5px; background: transparent; padding: 6px 8px; text-align: left; }
.location-store-option[hidden], .location-empty[hidden] { display: none; }
.location-store-option:hover { background: #f6f9f7; }
.location-store-option.is-selected { background: #f5fbf9; }
.location-store-option strong { min-width: 0; overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.location-store-option small { grid-column: 2; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.location-check { display: grid; width: 14px; height: 14px; place-items: center; border: 1px solid #cfd7d3; border-radius: 3px; color: transparent; font-size: 10px; font-weight: 800; line-height: 1; }
.location-store-option.is-selected .location-check { border-color: var(--teal); background: var(--teal); color: #fff; }
.location-store-count { padding: 7px 8px; color: var(--muted); font-size: 11px; }
.location-empty { margin: 38px 0; color: var(--muted); text-align: center; font-size: 12px; }
.location-actions { display: flex; min-height: 44px; align-items: center; justify-content: flex-end; gap: 9px; background: var(--surface); padding: 8px 14px; }
.location-reset, .location-done { min-width: 64px; min-height: 30px; border: 1px solid var(--line); border-radius: 5px; background: #f7f8f5; padding: 0 12px; font-size: 12px; font-weight: 800; }
.location-reset { color: var(--coral); }
.location-done { border-color: var(--teal); background: var(--teal); color: #fff; }
.segmented { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.segmented-button { min-height: 30px; border: 0; border-right: 1px solid var(--line); background: transparent; padding: 0 10px; font-size: 12px; }
.segmented-button:last-child { border-right: 0; }
.segmented-button.is-selected { background: var(--teal); color: #fff; font-weight: 700; }
select, input[type="date"] { min-height: 31px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); padding: 0 8px; }
.custom-range { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }

.dashboard { max-width: 1700px; margin: 0 auto 0 84px; padding: 18px 30px 36px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gray); }
.kpi-grid { display: grid; grid-template-columns: repeat(7, minmax(118px, 1fr)); gap: 1px; overflow: hidden; margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.kpi { min-width: 0; background: var(--surface); padding: 14px; }
.kpi p { overflow: hidden; margin-bottom: 9px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.kpi strong { display: block; overflow: hidden; margin-bottom: 9px; font-size: 22px; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.kpi span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.kpi--positive strong { color: var(--teal); }
.kpi--negative strong { color: var(--coral); }

.primary-grid, .secondary-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(290px, 0.85fr); gap: 16px; margin-top: 16px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel-heading { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-heading.compact { min-height: 56px; }
.panel-heading > span { color: var(--muted); font-size: 12px; }
.map-layers { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; }
.map-layer { border: 0; border-right: 1px solid var(--line); background: #fffefa; padding: 7px 9px; color: var(--muted); font-size: 12px; }
.map-layer:last-child { border-right: 0; }
.map-layer.is-selected { background: var(--teal-soft); color: var(--teal); font-weight: 700; }
.mobile-map-summary { display: none; }
.map-panel-toggle { min-height: 34px; border: 1px solid #a9cec7; border-radius: 999px; background: var(--teal-soft); padding: 0 12px; color: var(--teal); font-size: 12px; font-weight: 800; }
.map-shell { height: 390px; background: #e8efed; }
#store-map { width: 100%; height: 100%; }
.map-fallback { margin: 0; padding: 160px 24px; color: var(--muted); text-align: center; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend em { margin-left: auto; font-style: normal; }
.legend-dot.green { background: var(--teal); }.legend-dot.orange { background: var(--orange); }.legend-dot.red { background: var(--coral); }.legend-dot.gray { background: var(--gray); }
.map-store-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px 14px; }
.map-store-chip { border: 1px solid var(--line); border-radius: 5px; background: #fffefa; padding: 5px 8px; color: #55605e; font-size: 12px; }
.map-store-chip.is-red { border-color: #e6b0aa; color: var(--coral); }.map-store-chip.is-orange { border-color: #e8c391; color: #a86418; }.map-store-chip.is-gray { border-color: #c9cfd0; color: #697272; }
.map-store-toggle { border: 1px solid #a9cec7; border-radius: 5px; background: var(--teal-soft); padding: 5px 9px; color: var(--teal); font-size: 12px; font-weight: 800; }
.map-store-toggle:hover { background: #cce6e0; }

.anomaly-panel { min-width: 0; }
.risk-list { padding: 6px 0; }
.risk-row { display: grid; width: 100%; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 9px; border: 0; border-bottom: 1px solid #edf0ed; background: transparent; padding: 13px 14px; text-align: left; }
.risk-row:last-child { border-bottom: 0; }.risk-row:hover { background: #f6f9f7; }
.risk-status { grid-row: span 2; border-radius: 4px; background: #f5dddd; padding: 4px 5px; color: var(--coral); font-size: 10px; font-weight: 700; }.risk-row.is-orange .risk-status { background: #f9eddb; color: #a86418; }.risk-row.is-gray .risk-status { background: #eaedec; color: #687170; }
.risk-row strong { min-width: 0; font-size: 13px; }.risk-row p { grid-column: 2 / 4; overflow: hidden; margin: 4px 0 0; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.risk-row b { color: var(--ink); font-size: 12px; }
.risk-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 10px 14px; color: var(--muted); font-size: 12px; }
.page-button { min-height: 28px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); padding: 0 9px; color: var(--ink); font-size: 12px; }
.page-button:hover:not(:disabled) { border-color: #a9cec7; background: var(--teal-soft); color: var(--teal); }
.page-button:disabled { cursor: not-allowed; opacity: 0.45; }
.empty-note { padding: 18px; color: var(--muted); text-align: center; }

.trend-chart { display: flex; height: 182px; align-items: end; gap: 4px; padding: 18px 16px 0; background: repeating-linear-gradient(to bottom, transparent, transparent 44px, #edf1ef 45px); }
.trend-bar { min-width: 3px; flex: 1; background: var(--teal); opacity: 0.88; }.trend-bar:hover { background: #e65e47; opacity: 1; }
.chart-axis { display: flex; justify-content: space-between; padding: 8px 16px 14px; color: var(--muted); font-size: 11px; }.trend-delta { color: var(--teal); }
.channel-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; }.channel-card { display: grid; min-width: 0; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 9px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px; text-align: left; }.channel-card:hover { border-color: #a9cec7; background: #f5fbf9; }.channel-card > strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }.channel-card > div { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-top: 3px; }.channel-card > div > span { display: grid; gap: 4px; min-width: 0; }.channel-card small { color: var(--muted); font-size: 11px; }.channel-card b { overflow: hidden; color: var(--ink); font-size: 18px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }.channel-badge { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 5px; color: #fff; font-size: 12px; font-weight: 800; }.coral { background: #e65e47; }.yellow { background: #d89c27; }.pink { background: #c9587b; }.blue { background: var(--blue); }

.bottom-grid { grid-template-columns: minmax(0, 1.45fr) minmax(270px, 0.55fr); }.table-head, .growth-row { display: grid; grid-template-columns: 1.2fr 0.8fr 0.6fr 0.8fr; gap: 12px; align-items: center; }.table-head { padding: 9px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }.growth-row { width: 100%; border: 0; border-bottom: 1px solid #edf0ed; background: transparent; padding: 12px 16px; text-align: left; }.growth-row:hover { background: #f6f9f7; }.growth-row span { color: var(--muted); font-size: 12px; }.growth-row b { font-size: 12px; }.up { color: var(--teal); }.down { color: var(--coral); }
.review-panel { padding-bottom: 16px; }.review-metrics { display: grid; grid-template-columns: repeat(3, 1fr); padding: 18px 16px 10px; }.review-metrics div { display: grid; gap: 5px; }.review-metrics span, .review-panel p { color: var(--muted); font-size: 12px; }.review-metrics b { font-size: 20px; }.review-track { display: flex; height: 8px; overflow: hidden; margin: 8px 16px 12px; border-radius: 8px; background: #edf0ed; }.review-track i:nth-child(1) { background: var(--teal); }.review-track i:nth-child(2) { background: var(--orange); }.review-track i:nth-child(3) { background: var(--coral); }.review-panel p { margin: 0 16px; line-height: 1.5; }
.rank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }.ranking-head, .ranking-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 76px 88px; align-items: center; gap: 10px; }.ranking-head { border-bottom: 1px solid var(--line); padding: 9px 16px; color: var(--muted); font-size: 11px; }.ranking-row { width: 100%; border: 0; border-bottom: 1px solid #edf0ed; background: transparent; padding: 12px 16px; text-align: left; }.ranking-row:hover { background: #f6f9f7; }.ranking-position { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: #edf3f1; color: var(--teal); font-size: 11px; font-weight: 800; }.ranking-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.ranking-row b { color: var(--ink); text-align: right; font-size: 12px; }.ranking-row em { color: var(--muted); text-align: right; font-size: 12px; font-style: normal; }

.stats-hero { margin-bottom: 16px; }
.stats-hero .panel-heading { align-items: start; }
.stats-controls { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.stats-periods { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.stats-period-button { min-height: 32px; border: 0; border-right: 1px solid var(--line); background: transparent; padding: 0 12px; color: var(--muted); font-size: 12px; }
.stats-period-button:last-child { border-right: 0; }
.stats-period-button.is-selected { background: var(--teal-soft); color: var(--teal); font-weight: 800; }
.stats-switch { display: inline-flex; min-height: 34px; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 0 12px 0 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.stats-switch span { display: block; width: 23px; height: 23px; border-radius: 50%; background: #cbd3d0; transition: transform 0.18s ease, background 0.18s ease; }
.stats-switch.is-on { border-color: #8cc5bc; background: var(--teal-soft); color: var(--teal); }
.stats-switch.is-on span { background: var(--teal); transform: translateX(5px); }
.stats-hero .stats-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; border-width: 1px 0 0; border-radius: 0; }
.stats-platform-kpi { display: grid; gap: 10px; }
.stats-platform-kpi strong { margin-bottom: 0; }
.stats-platform-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid #edf0ed; border-radius: 6px; background: #edf0ed; }
.stats-platform-split span { display: grid; min-width: 0; gap: 4px; background: #fbfcf9; padding: 8px; color: var(--muted); }
.stats-platform-split small { overflow: hidden; font-size: 11px; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.stats-platform-split b { overflow: hidden; color: var(--ink); font-size: 13px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.stats-list-panel { overflow: hidden; margin-top: 16px; }
.stats-table-scroll { overflow: auto; }
.stats-list { display: grid; }
.stats-row { display: grid; min-width: 940px; grid-template-columns: minmax(104px, 0.95fr) repeat(5, minmax(132px, 1fr)); align-items: center; gap: 12px; padding: 14px 18px; }
.stats-row--store { min-width: 1080px; grid-template-columns: minmax(260px, 1.6fr) 108px repeat(5, minmax(118px, 1fr)); }
.stats-row--head { border-bottom: 1px solid var(--line); background: #f8faf7; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.02em; }
.stats-row:not(.stats-row--head) { width: 100%; min-height: 82px; appearance: none; border: 0; border-bottom: 1px solid #e8eeee; background: var(--surface); text-align: left; transition: background 0.15s ease, box-shadow 0.15s ease; }
.stats-row:not(.stats-row--head):nth-child(even) { background: #fbfcfa; }
.stats-row:not(.stats-row--head):hover { background: #f0f8f6; box-shadow: inset 3px 0 0 var(--teal); }
.stats-row > strong, .stats-row > b, .stats-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-row strong { font-size: 13px; }
.stats-row b { color: var(--ink); font-size: 12px; }
.stats-row span { color: var(--muted); font-size: 12px; }
.stats-row--head span { line-height: 1.35; }
.stats-row--head small { color: var(--muted); font-size: 10px; font-weight: 700; }
.stats-row:not(.stats-row--store) > :nth-child(n+2), .stats-row--store > :nth-child(n+3) { justify-self: end; text-align: right; }
.stats-metric-cell { display: grid; min-width: 0; line-height: 1.2; }
.stats-metric-values { display: grid; min-width: 0; gap: 5px; }
.stats-metric-total { display: flex; min-width: 0; align-items: baseline; justify-content: flex-end; gap: 7px; border-bottom: 1px solid #edf0ed; padding-bottom: 5px; color: var(--ink); }
.stats-metric-total small, .stats-metric-number small { color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1; }
.stats-metric-total strong { overflow: hidden; font-size: 14px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.stats-metric-platforms { display: flex; min-width: 0; align-items: baseline; justify-content: flex-end; gap: 8px; }
.stats-metric-number { display: inline-flex; min-width: 0; align-items: baseline; gap: 3px; overflow: hidden; font-style: normal; white-space: nowrap; }
.stats-metric-number strong { overflow: hidden; font-size: 11px; font-weight: 800; text-overflow: ellipsis; }
.stats-metric-meituan strong { color: var(--teal); }
.stats-metric-douyin strong { color: var(--blue); }
.stats-metric-pos strong { color: #597c91; }
.stats-row:not(.stats-row--head) > :first-child { color: var(--ink); font-weight: 800; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 1990; background: rgba(26, 34, 33, 0.26); }.store-drawer { position: fixed; z-index: 2000; top: 0; right: 0; bottom: 0; display: flex; width: min(510px, 92vw); flex-direction: column; border-left: 1px solid var(--line); background: #fffefa; box-shadow: -18px 0 50px rgba(31, 43, 41, 0.12); }.drawer-header { display: flex; align-items: start; justify-content: space-between; padding: 26px 24px 16px; }.drawer-header h2 { margin-bottom: 7px; font-size: 22px; }.drawer-header span { color: var(--muted); font-size: 12px; }.close-button { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: transparent; font-size: 23px; line-height: 1; }.close-button:hover { background: #f0f3f1; }
.master-dashboard { display: grid; gap: 16px; }
.master-intro { margin: 0; }
.master-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); padding: 0 16px; }
.master-tab { display: inline-flex; min-width: 106px; min-height: 46px; align-items: center; justify-content: center; gap: 6px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; font-weight: 800; }
.master-tab small { border-radius: 10px; background: #edf0ed; padding: 2px 6px; color: var(--muted); font-size: 10px; }
.master-tab.is-selected { border-bottom-color: var(--teal); color: var(--teal); }
.master-tab.is-selected small { background: var(--teal-soft); color: var(--teal); }
.master-notice { margin: 14px 16px 0; border: 1px solid #a9cec7; border-radius: 5px; background: var(--teal-soft); padding: 9px 10px; color: var(--teal); font-size: 12px; font-weight: 700; }
.master-workflow { display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--line); margin-top: 14px; padding: 12px 16px 14px; color: var(--muted); font-size: 11px; }
.master-workflow-step.is-active { color: var(--teal); font-weight: 800; }
.master-workflow-arrow { color: #a5b0ad; }
.master-mapping-panel { overflow: hidden; }
.master-table-wrap { overflow: auto; }
.master-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.master-table th, .master-table td { border-bottom: 1px solid #edf0ed; padding: 11px 16px; text-align: left; vertical-align: middle; }
.master-table th { background: #f8faf7; color: var(--muted); font-size: 11px; }
.master-table td { font-size: 12px; }
.master-mapping-select { width: 250px; min-height: 30px; }
.master-save-button { min-height: 30px; border: 1px solid var(--teal); border-radius: 5px; background: var(--teal); padding: 0 12px; color: #fff; font-size: 12px; font-weight: 800; white-space: nowrap; }
.master-save-button:disabled { cursor: wait; opacity: 0.6; }
.master-note { color: var(--muted); font-size: 11px; }
.master-empty { padding: 36px !important; color: var(--muted); text-align: center !important; }
.master-table td strong, .master-table td small { display: block; }
.master-table td small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.master-status { display: inline-block; border-radius: 4px; padding: 4px 6px; font-size: 11px; }
.master-status--auto { background: var(--teal-soft); color: var(--teal); }
.master-status--manual { background: #fff0d8; color: #a46500; }
.master-status--unmatched { background: #f0f2f1; color: var(--muted); }
.drawer-kpis { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 24px; border-block: 1px solid var(--line); }.drawer-kpis span { display: grid; gap: 4px; padding: 12px 10px 12px 0; color: var(--muted); font-size: 11px; }.drawer-kpis b { color: var(--ink); font-size: 16px; }.drawer-tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 16px; }.drawer-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 14px 8px 11px; color: var(--muted); font-size: 12px; }.drawer-tab.is-selected { border-bottom-color: var(--teal); color: var(--teal); font-weight: 700; }.drawer-content { overflow: auto; padding: 22px 24px; }.detail-summary { padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: #f8faf7; }.detail-summary p { margin-bottom: 7px; color: var(--muted); font-size: 12px; }.detail-summary h3 { margin-bottom: 8px; font-size: 22px; }.detail-summary span { color: var(--muted); font-size: 13px; line-height: 1.6; }.mini-bars { display: grid; gap: 16px; margin-top: 28px; }.mini-bars div { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 10px; }.mini-bars span { color: var(--muted); font-size: 12px; }.mini-bars i { display: block; height: 7px; border-radius: 7px; background: var(--teal); }.mini-bars b { font-size: 12px; }.detail-table, .drawer-channel-list, .review-detail-list { display: grid; gap: 10px; }.detail-table div, .drawer-channel-list div, .review-detail-list article { display: grid; gap: 4px; border-bottom: 1px solid var(--line); padding: 12px 0; }.detail-table span, .drawer-channel-list span, .review-detail-list p { color: var(--muted); font-size: 12px; }.detail-table b, .detail-table em, .drawer-channel-list b, .review-detail-list em { color: var(--teal); font-size: 12px; font-style: normal; }.score { display: inline-grid; width: max-content; border-radius: 4px; padding: 3px 5px; color: #fff; font-size: 11px; }.score-1, .score-2 { background: var(--coral); }.score-3 { background: var(--orange); }.score-4, .score-5 { background: var(--teal); }

@media (max-width: 1160px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }.primary-grid, .secondary-grid, .bottom-grid, .rank-grid { grid-template-columns: 1fr; }.anomaly-panel { max-height: 330px; overflow: auto; } }
@media (max-width: 760px) { .sidebar { display: none; }.workspace { margin-left: 0; }.topbar { min-height: auto; align-items: start; padding: 18px 16px 12px; }.topbar h1 { font-size: 20px; }.as-of { font-size: 11px; }.filter-bar { align-items: start; flex-wrap: wrap; gap: 9px 16px; padding: 10px 16px; }.range-group { width: 100%; align-items: start; flex-wrap: wrap; }.location-popover { position: fixed; top: 126px; right: 16px; left: 16px; width: auto; }.location-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }.segmented-button { padding: 0 8px; }.dashboard { margin-left: 0; padding: 14px 16px 24px; }.kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.kpi:last-child { grid-column: span 2; }.kpi strong { font-size: 20px; }.channel-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }.channel-card { padding: 12px; }.channel-card b { font-size: 16px; }.map-layers { width: 100%; }.map-layer { flex: 1; padding: 7px 4px; }.map-shell { height: 310px; }.map-legend em { width: 100%; margin-left: 0; }.table-head, .growth-row { grid-template-columns: 1.2fr 0.9fr 0.7fr; }.table-head span:last-child, .growth-row span:last-child { display: none; }.ranking-head, .ranking-row { grid-template-columns: 32px minmax(0, 1fr) 58px 64px; gap: 5px; padding-inline: 12px; }.ranking-head { font-size: 10px; }.ranking-row em { font-size: 11px; }.drawer-tab { flex: 1; padding-inline: 4px; font-size: 11px; }.drawer-header, .drawer-content { padding-inline: 18px; }.drawer-kpis { margin-inline: 18px; } }
@media (max-width: 760px) { .stats-hero .stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }.stats-controls { width: 100%; justify-content: flex-start; }.stats-row { min-width: 760px; } }

@media (max-width: 760px) { .master-tabs { padding-inline: 8px; }.master-tab { flex: 1; min-width: 0; }.master-workflow { align-items: start; flex-wrap: wrap; gap: 6px; }.master-workflow-arrow { display: none; }.master-table th, .master-table td { padding-inline: 10px; } }

@media (max-width: 760px) {
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); background: #f4f3ee; font-size: 15px; }
  button, select, input { min-height: 44px; }
  .login-screen { align-items: start; padding: 48px 18px 24px; }
  .login-card { padding: 24px 20px; box-shadow: 0 12px 34px rgba(31, 43, 41, 0.1); }
  .login-card input, .login-button { min-height: 46px; font-size: 16px; }

  .mobile-nav {
    position: fixed;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 1100;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    border: 1px solid rgba(221, 229, 225, 0.92);
    border-radius: 18px;
    background: rgba(253, 252, 247, 0.96);
    padding: 7px;
    box-shadow: 0 14px 34px rgba(31, 43, 41, 0.16);
    backdrop-filter: blur(12px);
  }
  .mobile-nav-button {
    display: grid;
    min-height: 52px;
    place-items: center;
    gap: 3px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }
  .mobile-nav-button span { font-size: 18px; line-height: 1; }
  .mobile-nav-button .app-icon { width: 19px; height: 19px; }
  .mobile-nav-button.is-active { background: var(--teal); color: #fff; }
  .mobile-nav-button.logout-button:hover, .mobile-nav-button.logout-button { color: var(--coral); }

  .topbar {
    padding: 16px 16px 10px;
    gap: 12px;
  }
  .topbar .eyebrow { margin-bottom: 3px; }
  .topbar h1 { font-size: 21px; }
  .as-of {
    align-self: center;
    max-width: none;
    padding: 7px 9px;
    text-align: right;
    line-height: 1.35;
  }
  .as-of strong { display: block; white-space: nowrap; }

  .filter-bar {
    top: 0;
    z-index: 1200;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: 0;
    padding: 10px 16px 12px;
    backdrop-filter: none;
  }
  .filter-group { min-width: 0; white-space: normal; }
  .range-group { display: grid; gap: 8px; width: 100%; }
  .range-group > .filter-label { display: none; }
  .segmented {
    width: 100%;
    overflow-x: auto;
    border-radius: 999px;
    scrollbar-width: none;
  }
  .segmented::-webkit-scrollbar { display: none; }
  .channel-group {
    display: grid;
    gap: 8px;
    width: 100%;
  }
  .channel-group > .filter-label { display: none; }
  .channel-segmented {
    width: 100%;
    overflow-x: auto;
    border-radius: 999px;
    scrollbar-width: none;
  }
  .channel-segmented::-webkit-scrollbar { display: none; }
  .segmented-button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 13px;
    font-size: 12px;
  }
  .channel-segmented .segmented-button { padding: 0 13px; }
  .custom-range {
    width: 100%;
    flex-wrap: wrap;
  }
  .custom-range input { flex: 1 1 132px; min-width: 0; font-size: 16px; }
  .location-filter { width: 100%; }
  .location-trigger {
    width: 100%;
    justify-content: space-between;
    min-height: 44px;
    border-radius: 999px;
    padding: 0 13px;
  }
  .location-trigger strong { max-width: 210px; font-size: 13px; }
  .location-scrim {
    position: fixed;
    inset: 0;
    z-index: 1880;
    display: block;
    width: 100vw;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    background: rgba(26, 34, 33, 0.3);
    padding: 0;
  }
  .location-popover {
    position: fixed;
    top: 7dvh;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1900;
    display: flex;
    height: calc(100dvh - 7dvh);
    width: auto;
    max-height: none;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: contain;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 42px rgba(31, 43, 41, 0.18);
  }
  @supports (height: 100svh) {
    .location-popover {
      top: 7svh;
      height: calc(100svh - 7svh);
    }
  }
  .location-popover-heading { flex: 0 0 auto; min-height: 54px; padding: 10px 16px 9px 18px; }
  .location-popover-heading span { font-size: 12px; }
  .location-close { width: 40px; height: 40px; }
  .location-tools { flex: 0 0 auto; grid-template-columns: 1fr; gap: 10px; padding: 12px 18px; }
  .location-tools label { gap: 6px; }
  .location-tools select, .location-tools input {
    min-height: 44px;
    width: 100%;
    font-size: 16px;
  }
  .location-picker {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }
  .location-city-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .location-city-list::-webkit-scrollbar { display: none; }
  .location-city {
    flex: 0 0 auto;
    width: auto;
    min-width: 74px;
    min-height: 40px;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    padding-inline: 12px;
  }
  .location-city small { display: none; }
  .location-store-list {
    min-height: 0;
    overflow: auto;
    padding: 8px 12px 12px;
    -webkit-overflow-scrolling: touch;
  }
  .location-store-count {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0 -12px 4px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    padding: 10px 12px;
    font-size: 12px;
  }
  .location-store-option {
    min-height: 58px;
    grid-template-columns: 30px minmax(0, 1fr);
    border-radius: 9px;
    padding: 9px 10px;
    touch-action: manipulation;
  }
  .location-store-option strong {
    font-size: 13px;
    line-height: 1.35;
    white-space: normal;
  }
  .location-store-option small { font-size: 12px; }
  .location-check { width: 20px; height: 20px; border-radius: 5px; font-size: 12px; }
  .location-actions {
    flex: 0 0 auto;
    min-height: 64px;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  }
  .location-reset, .location-done { flex: 1; min-height: 44px; border-radius: 8px; font-size: 14px; }
  .dashboard { padding: 14px 12px 18px; }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 12px 0;
    border-radius: 12px;
  }
  .kpi { min-height: 108px; padding: 13px 12px; }
  .kpi p { white-space: normal; }
  .kpi strong { font-size: 21px; white-space: normal; }
  .kpi span { font-size: 11px; }
  .kpi:nth-child(n+5) { min-height: 86px; }
  .kpi:last-child { grid-column: auto; }

  .channel-cards { grid-template-columns: 1fr; gap: 9px; margin-top: 12px; }
  .channel-card {
    min-height: 72px;
    grid-template-columns: auto 1fr auto;
    padding: 12px;
  }
  .channel-card > div { grid-column: 3; grid-template-columns: repeat(2, minmax(70px, auto)); padding-top: 0; }

  .primary-grid, .secondary-grid, .bottom-grid, .rank-grid {
    gap: 12px;
    margin-top: 12px;
  }
  .panel { border-radius: 12px; }
  .panel-heading {
    min-height: 58px;
    align-items: start;
    padding: 13px 14px;
  }
  .panel-heading h2 { font-size: 15px; }

  .map-panel .panel-heading {
    display: grid;
    grid-template-columns: 1fr;
  }
  .map-layers {
    width: 100%;
    overflow-x: auto;
    border-radius: 999px;
    scrollbar-width: none;
  }
  .map-layers::-webkit-scrollbar { display: none; }
  .map-layer {
    flex: 1 0 auto;
    min-height: 38px;
    padding: 0 10px;
  }
  .mobile-map-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }
  .mobile-map-summary span {
    display: grid;
    gap: 2px;
    color: var(--muted);
    font-size: 11px;
  }
  .mobile-map-summary b { color: var(--ink); font-size: 18px; }
  .map-panel-toggle { min-height: 40px; }
  .map-shell { height: 286px; }
  .map-store-list { max-height: 116px; overflow: auto; padding: 10px 14px 14px; }
  .map-store-chip, .map-store-toggle {
    min-height: 34px;
    border-radius: 999px;
    padding-inline: 10px;
  }

  .anomaly-panel { max-height: none; overflow: hidden; }
  .risk-row {
    min-height: 72px;
    grid-template-columns: auto 1fr;
    gap: 6px 9px;
    padding: 13px 14px;
  }
  .risk-row p { grid-column: 2; white-space: normal; }
  .risk-row b { grid-column: 2; justify-self: start; }
  .risk-status { align-self: start; min-width: 46px; text-align: center; }
  .page-button { min-height: 38px; }

  .trend-chart { height: 150px; }
  .table-head { display: none; }
  .growth-row {
    grid-template-columns: 1fr auto;
    gap: 7px 12px;
    padding: 13px 14px;
  }
  .growth-row strong { grid-column: 1 / -1; }
  .growth-row span:last-child { display: block; grid-column: 1 / -1; }

  .review-metrics { padding-top: 14px; }
  .ranking-head { display: none; }
  .ranking-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 62px;
    padding: 13px 14px;
  }
  .ranking-row strong { white-space: normal; }
  .ranking-row em { grid-column: 2 / -1; justify-self: start; }

  .stats-hero .panel-heading {
    display: grid;
    grid-template-columns: 1fr;
  }
  .stats-controls {
    width: 100%;
    justify-content: space-between;
  }
  .stats-periods { flex: 1; border-radius: 999px; }
  .stats-period-button { flex: 1; min-height: 40px; }
  .stats-switch { min-height: 40px; padding-right: 14px; }
  .stats-hero .stats-kpis { grid-template-columns: 1fr; }
  .stats-hero .stats-platform-kpi {
    grid-template-columns: minmax(72px, 0.55fr) minmax(0, 1fr);
    grid-template-areas:
      "label split"
      "total split";
    align-items: center;
    gap: 4px 10px;
    min-height: 76px;
    padding: 11px 12px;
  }
  .stats-hero .stats-platform-kpi p { grid-area: label; margin-bottom: 0; }
  .stats-hero .stats-platform-kpi > strong { grid-area: total; font-size: 20px; }
  .stats-hero .stats-platform-split { grid-area: split; }
  .stats-hero .stats-platform-split span { padding: 7px 8px; }
  .stats-list-panel { overflow: visible; margin-top: calc(96px + env(safe-area-inset-bottom)); }
  .stats-table-scroll { overflow: visible; }
  .stats-row--head { display: none; }
  .stats-list {
    display: grid;
    gap: 10px;
    padding: 12px;
  }
  .stats-row, .stats-row--store {
    display: grid;
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fffefa;
    padding: 0;
  }
  .stats-row:not(.stats-row--store) > :nth-child(n+2), .stats-row--store > :nth-child(n+3) {
    justify-self: stretch;
    text-align: left;
  }
  .stats-row > * {
    min-width: 0;
    white-space: normal;
  }
  .stats-row > *::before {
    display: none;
  }
  .stats-row > :first-child {
    grid-column: 1 / -1;
    overflow: hidden;
    padding: 12px 14px;
    background: #f8faf7;
    color: var(--ink);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    text-overflow: ellipsis;
  }
  .stats-row > :first-child::before, .stats-row--store > :nth-child(2)::before {
    content: attr(data-label);
    display: inline;
    margin-right: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }
  .stats-row--store > :nth-child(2) {
    grid-column: 1 / -1;
    padding: 0 14px 11px;
    background: #f8faf7;
    color: var(--muted);
    font-size: 12px;
  }
  .stats-metric-cell {
    grid-column: 1 / -1;
    grid-template-columns: 66px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border-top: 1px solid #edf0ed;
    padding: 10px 14px;
  }
  .stats-metric-cell::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }
  .stats-metric-values {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    justify-content: stretch;
    gap: 6px;
  }
  .stats-metric-number {
    display: grid;
    min-width: 0;
    justify-items: end;
    gap: 3px;
    font-size: 13px;
    line-height: 1.2;
  }
  .stats-metric-total { grid-column: auto; }
  .stats-metric-meituan::after { content: none; }
  .stats-metric-number::before {
    content: attr(data-platform);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
  }
  .stats-metric-total { font-size: 13px; }
  .stats-row.stats-row--head { display: none; }

  .drawer-backdrop { z-index: 2100; }
  .store-drawer {
    inset: 0;
    z-index: 2200;
    width: 100vw;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .drawer-header {
    position: sticky;
    top: 0;
    z-index: 1;
    align-items: start;
    background: #fffefa;
    padding: 18px 16px 12px;
  }
  .drawer-header h2 {
    font-size: 19px;
    line-height: 1.28;
  }
  .close-button {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
  }
  .drawer-kpis {
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0 16px;
  }
  .drawer-kpis span {
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: 44px;
    padding: 9px 0;
  }
  .drawer-kpis b { justify-self: end; font-size: 17px; }
  .drawer-tabs {
    overflow-x: auto;
    padding: 0 10px;
    scrollbar-width: none;
  }
  .drawer-tabs::-webkit-scrollbar { display: none; }
  .drawer-tab {
    flex: 0 0 auto;
    min-height: 46px;
    min-width: 88px;
    padding-inline: 10px;
    font-size: 12px;
  }
  .drawer-content {
    padding: 16px 16px calc(92px + env(safe-area-inset-bottom));
  }
  .detail-summary h3 {
    overflow-wrap: anywhere;
    font-size: 20px;
    line-height: 1.28;
  }
  .mini-bars div { grid-template-columns: 64px 1fr; }
  .mini-bars b { grid-column: 2; }
}

@media (max-width: 760px) {
  .stats-metric-values { display: grid; gap: 7px; }
  .stats-metric-total { justify-content: space-between; padding-bottom: 6px; }
  .stats-metric-total strong { font-size: 14px; }
  .stats-metric-platforms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; justify-content: stretch; }
  .stats-metric-number { display: flex; justify-content: space-between; gap: 6px; }
  .stats-metric-number small { font-size: 10px; }
  .stats-metric-number strong { font-size: 12px; }
  .stats-metric-number::before { content: none; }
}
