:root {
  color-scheme: light;
  font-family: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --page: #f5f8f7;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --ink: #14201c;
  --ink-soft: #34453f;
  --muted: #66766f;
  --subtle: #87958f;
  --line: #dce6e2;
  --line-strong: #c8d6d1;
  --green: #0d806a;
  --green-strong: #086752;
  --green-soft: #e8f6f2;
  --coral: #cf5938;
  --coral-soft: #fff0eb;
  --blue: #356da8;
  --blue-soft: #edf4fb;
  --amber: #98701f;
  --amber-soft: #fff7df;
  --danger: #b93d4c;
  --shadow: 0 10px 30px rgba(26, 54, 44, .07);
  --focus: 0 0 0 3px rgba(13, 128, 106, .22);
  --sidebar-width: 244px;
  --topbar-height: 72px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body { min-height: 100dvh; margin: 0; overflow-x: hidden; background: var(--page); color: var(--ink); font-size: 15px; line-height: 1.5; }
button, a { font: inherit; -webkit-tap-highlight-color: transparent; }
button, a { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button { border: 0; }
h1, h2, h3, p, dl, dd, dt { margin: 0; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: none; box-shadow: var(--focus); }
.skip-link { position: fixed; top: -56px; left: 16px; z-index: 100; padding: 10px 14px; border-radius: 6px; background: var(--ink); color: #fff; transition: top .18s ease; }
.skip-link:focus { top: 12px; }

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: var(--sidebar-width); border-right: 1px solid var(--line); background: var(--surface); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; min-height: var(--topbar-height); padding: 0 18px; border-bottom: 1px solid var(--line); }
.sidebar-brand img { display: block; width: 102px; height: 32px; object-fit: contain; filter: brightness(.3); }
.sidebar-brand > span { display: grid; min-width: 0; padding-left: 10px; border-left: 1px solid var(--line-strong); }
.sidebar-brand strong { font-size: 13px; line-height: 1.3; white-space: nowrap; }
.sidebar-brand small { margin-top: 2px; color: var(--subtle); font-size: 8px; font-weight: 700; line-height: 1.2; letter-spacing: .06em; white-space: nowrap; }
.sidebar-nav { overflow-y: auto; padding: 18px 12px; overscroll-behavior: contain; }
.nav-group-label { padding: 16px 12px 8px; color: var(--subtle); font-size: 10px; font-weight: 800; line-height: 1.3; }
.nav-group-label:first-child { padding-top: 0; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 0 12px; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 650; transition: color .18s ease, background .18s ease; }
.nav-item + .nav-item { margin-top: 3px; }
.nav-item:hover { color: var(--ink); background: var(--surface-soft); }
.nav-item.is-active { color: var(--green-strong); background: var(--green-soft); }
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.8; }
.sidebar-footer { padding: 16px 16px 18px; border-top: 1px solid var(--line); }
.extension-note { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 60px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.extension-note > svg { width: 18px; height: 18px; margin-left: 7px; color: var(--green); stroke-width: 1.8; }
.extension-note div { display: grid; }
.extension-note strong { font-size: 12px; }
.extension-note span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.sidebar-footer > p { margin-top: 14px; color: #9ca7a2; font-size: 8px; font-weight: 700; text-align: center; letter-spacing: .08em; }
.sidebar-backdrop { display: none; }

.workspace-view { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: var(--topbar-height); padding: 0 clamp(20px, 3vw, 42px); border-bottom: 1px solid rgba(220, 230, 226, .94); background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); }
.topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title > div { display: grid; }
.topbar-title strong { font-size: 18px; line-height: 1.3; }
.topbar-title span { margin-top: 1px; color: var(--muted); font-size: 11px; }
.menu-button, .icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface); transition: color .18s ease, border-color .18s ease, background .18s ease, transform .12s ease; }
.menu-button { display: none; }
.menu-button:hover, .icon-button:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-soft); }
.menu-button:active, .icon-button:active { transform: translateY(1px); }
.menu-button svg, .icon-button svg { width: 18px; height: 18px; stroke-width: 1.9; }
.icon-button.is-loading svg { animation: spin .8s linear infinite; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-actions time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.service-status { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface-soft); font-size: 11px; white-space: nowrap; }
.status-dot, .platform-state > i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.service-status.is-ready .status-dot, .platform-state.is-ready > i { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.service-status.is-error .status-dot, .platform-state.is-error > i { background: var(--danger); box-shadow: 0 0 0 4px #fdecef; }

.main-content { width: min(100% - clamp(32px, 5vw, 72px), 1460px); margin: 0 auto; padding: 28px 0 52px; }
.overview-band { display: grid; grid-template-columns: minmax(260px, .78fr) minmax(560px, 1.22fr); align-items: center; gap: 34px; min-height: 154px; padding: 26px 30px; border: 1px solid #cfe5dd; border-radius: 8px; background: #edf8f4; }
.eyebrow, .section-index { color: var(--green); font-size: 9px; font-weight: 850; line-height: 1.4; letter-spacing: .08em; }
.overview-copy h1 { margin-top: 7px; font-size: 30px; line-height: 1.15; letter-spacing: 0; }
.overview-copy > p:last-child { margin-top: 7px; color: var(--ink-soft); font-size: 13px; }
.overview-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.overview-metrics > div { min-width: 0; padding: 5px 20px; border-left: 1px solid #cfe1db; }
.overview-metrics dt { color: var(--muted); font-size: 10px; white-space: nowrap; }
.overview-metrics dd { display: flex; align-items: baseline; gap: 4px; margin-top: 5px; }
.overview-metrics strong { overflow-wrap: anywhere; font-size: 27px; line-height: 1; font-variant-numeric: tabular-nums; }
.overview-metrics span { color: var(--muted); font-size: 10px; }

.platform-section, .activity-section { padding-top: 34px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-heading h2 { margin-top: 4px; font-size: 21px; line-height: 1.25; }
.section-heading > span { color: var(--muted); font-size: 11px; }
.platform-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.platform-card { --card-accent: var(--green); --card-soft: var(--green-soft); display: grid; grid-template-rows: auto auto 132px auto; min-width: 0; min-height: 414px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 2px 8px rgba(26, 54, 44, .03); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.platform-card:hover { border-color: color-mix(in srgb, var(--card-accent) 38%, var(--line)); box-shadow: var(--shadow); transform: translateY(-2px); }
.platform-card:active { transform: translateY(0); }
.video-card { --card-accent: var(--coral); --card-soft: var(--coral-soft); }
.gmv-card { --card-accent: var(--blue); --card-soft: var(--blue-soft); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.platform-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 7px; color: var(--card-accent); background: var(--card-soft); }
.platform-icon svg { width: 20px; height: 20px; stroke-width: 1.8; }
.platform-state { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 8px; color: var(--muted); font-size: 10px; }
.platform-state > i { box-shadow: none; }
.card-copy { padding: 18px 0 16px; }
.card-copy p { color: var(--card-accent); font-size: 9px; font-weight: 850; letter-spacing: .05em; }
.card-copy h3 { margin-top: 5px; font-size: 19px; line-height: 1.3; }
.card-copy > span { display: block; min-height: 42px; margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.card-preview { position: relative; height: 132px; overflow: hidden; border-radius: 6px; background: var(--card-soft); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; min-height: 56px; padding-top: 14px; }
.card-foot > span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.card-foot strong { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; color: var(--card-accent); font-size: 11px; }
.card-foot svg { width: 15px; height: 15px; stroke-width: 2; transition: transform .18s ease; }
.platform-card:hover .card-foot svg { transform: translateX(3px); }

.weekly-preview { padding: 16px; background: #edf7f3; }
.preview-toolbar { display: flex; align-items: center; gap: 5px; height: 18px; }
.preview-toolbar i { width: 5px; height: 5px; border-radius: 50%; background: #b7cec5; }
.preview-toolbar span { width: 32%; height: 5px; margin-left: 5px; border-radius: 3px; background: #94b9aa; }
.preview-columns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.preview-columns > div { display: grid; gap: 7px; }
.preview-columns span { height: 20px; border: 1px solid #cee1da; border-radius: 4px; background: rgba(255, 255, 255, .8); }
.preview-columns div:first-child span:first-child, .preview-columns div:last-child span:nth-child(2) { border-left: 3px solid var(--green); }
.video-preview { display: grid; grid-template-columns: .86fr 1.14fr; gap: 12px; padding: 14px; background: #fff2ed; }
.video-frame { display: grid; place-items: center; border-radius: 5px; background: #29343a; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.play-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; background: var(--coral); }
.play-mark svg { width: 14px; height: 14px; fill: currentColor; stroke-width: 1.5; }
.script-lines { display: grid; align-content: center; gap: 10px; }
.script-lines span { height: 7px; border-radius: 4px; background: #e2bfb3; }
.script-lines span:nth-child(2) { width: 82%; }
.script-lines span:nth-child(3) { width: 92%; }
.script-lines span:nth-child(4) { width: 58%; background: var(--coral); opacity: .7; }
.gmv-preview { padding: 14px 16px 20px; background: #eef5fb; }
.chart-bars { position: relative; display: flex; align-items: end; justify-content: space-around; height: 86px; border-bottom: 1px solid #bed1e4; }
.chart-bars i { width: 11%; border-radius: 3px 3px 0 0; background: #9ebddd; }
.chart-bars i:nth-child(1) { height: 26%; }
.chart-bars i:nth-child(2) { height: 44%; }
.chart-bars i:nth-child(3) { height: 36%; }
.chart-bars i:nth-child(4) { height: 65%; }
.chart-bars i:nth-child(5) { height: 58%; }
.chart-bars i:nth-child(6) { height: 82%; background: var(--blue); }
.chart-bars span { position: absolute; inset: 36% 0 auto; border-top: 2px dashed #d08b6c; }
.chart-axis { display: flex; justify-content: space-around; gap: 10px; margin-top: 8px; }
.chart-axis span { width: 20%; height: 4px; border-radius: 2px; background: #c8d9e8; }

.compact-heading { margin-bottom: 10px; }
.activity-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.activity-list > a { display: grid; grid-template-columns: 38px minmax(0, 1fr) 20px; align-items: center; gap: 11px; min-height: 76px; padding: 12px 16px; transition: background .18s ease; }
.activity-list > a + a { border-left: 1px solid var(--line); }
.activity-list > a:hover { background: var(--surface-soft); }
.activity-list > a > span:nth-child(2) { display: grid; min-width: 0; }
.activity-list strong { font-size: 12px; }
.activity-list small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.activity-list > a > svg { width: 16px; height: 16px; color: var(--subtle); }
.activity-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; }
.activity-icon svg { width: 17px; height: 17px; stroke-width: 1.8; }
.weekly-tone { color: var(--green); background: var(--green-soft); }
.video-tone { color: var(--coral); background: var(--coral-soft); }
.gmv-tone { color: var(--blue); background: var(--blue-soft); }

@media (max-width: 1180px) {
  .overview-band { grid-template-columns: 1fr; gap: 20px; }
  .overview-metrics > div:first-child { border-left: 0; padding-left: 0; }
  .platform-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gmv-card { grid-column: 1 / -1; }
  .gmv-card .card-preview { max-width: 560px; width: 100%; }
}

@media (max-width: 860px) {
  :root { --topbar-height: 64px; }
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .24s ease; }
  body.is-nav-open { overflow: hidden; }
  body.is-nav-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; display: block; visibility: hidden; background: rgba(20, 32, 28, .42); opacity: 0; transition: visibility .24s ease, opacity .24s ease; }
  body.is-nav-open .sidebar-backdrop { visibility: visible; opacity: 1; }
  .workspace-view { grid-column: auto; }
  .menu-button { display: inline-grid; }
  .main-content { width: min(100% - 32px, 760px); }
  .topbar { padding: 0 16px; }
  .topbar-actions time { display: none; }
  .activity-list { grid-template-columns: 1fr; }
  .activity-list > a + a { border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 620px) {
  .topbar-title span, .service-status { display: none; }
  .topbar-title strong { font-size: 16px; }
  .topbar-actions { gap: 8px; }
  .main-content { width: min(100% - 24px, 520px); padding-top: 18px; }
  .overview-band { min-height: 0; padding: 21px 18px; }
  .overview-copy h1 { font-size: 25px; }
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 0; }
  .overview-metrics > div { padding: 0 14px; }
  .overview-metrics > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .overview-metrics strong { font-size: 24px; }
  .platform-section, .activity-section { padding-top: 28px; }
  .platform-grid { grid-template-columns: 1fr; }
  .gmv-card { grid-column: auto; }
  .platform-card { min-height: 396px; padding: 17px; }
  .section-heading { align-items: start; }
  .section-heading > span { max-width: 140px; padding-top: 3px; text-align: right; }
}

@media (max-width: 380px) {
  .main-content { width: min(100% - 20px, 360px); }
  .topbar { padding: 0 10px; }
  .overview-band { padding: 18px 14px; }
  .platform-card { padding: 15px; }
  .card-foot strong { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@keyframes spin { to { transform: rotate(360deg); } }
