/* GEO366 守望台 · 产品雏形
   Reuses official visual tokens. Original console chrome — not a competitor skin. */

:root {
  --teal: #5fbfbb;
  --teal-dark: #089e9a;
  --teal-soft: #7cd6d2;
  --teal-wash: rgba(95, 191, 187, 0.08);
  --teal-wash-2: rgba(95, 191, 187, 0.16);
  --yellow: #ffd932;
  --yellow-deep: #e6c21c;
  --white: #ffffff;
  --gray: #f0f2f5;
  --ink: #1a1a2e;
  --text: #1a1a2e;
  --text-2: #4a5568;
  --muted: #9ca3af;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --danger: #c23b32;
  --ok: #0f766e;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --font: "Manrope", "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --sidebar-w: 232px;
  --banner-h: 40px;
  --topbar-h: 60px;
  --radius: 0.5rem;
  --radius-l: 0.85rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--gray);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-dark); }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--teal-dark); outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 80;
  padding: 0.4rem 0.7rem;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
}
.skip-link:focus { top: 0.5rem; }

/* Shared buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  background: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.btn-primary:hover { background: var(--yellow-deep); color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-outline { background: transparent; color: var(--teal-dark); border-color: var(--teal); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--line-strong); }

/* Gate
   ------------------------------------------------------------------ */
.gate-body { background: var(--white); min-height: 100vh; display: flex; flex-direction: column; }

.gate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.gate-brand, .app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
}
.brand-mark { width: 28px; height: 28px; border-radius: 8px; display: block; }
.gate-header a:not(.gate-brand) { text-decoration: none; color: var(--text-2); font-weight: 500; }

.gate-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 3rem 1.5rem 4rem;
}
.gate-card { width: min(560px, 100%); }
.gate-kicker {
  margin: 0 0 0.7rem;
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}
.gate-card h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.gate-card .lede { color: var(--text-2); margin: 0 0 1.5rem; }
.gate-form { display: grid; gap: 0.7rem; margin: 0 0 1rem; }
.gate-form label { font-weight: 600; font-size: 0.88rem; }
.gate-form .btn { justify-self: start; min-width: 10rem; }
.gate-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  background: #fff;
}
.gate-note { color: var(--text-2); font-size: 0.88rem; margin: 0 0 1.25rem; }
.demo-pill {
  display: inline-block;
  background: var(--yellow);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  margin-left: 0.35rem;
}

/* Banner + app shell
   ------------------------------------------------------------------ */
.demo-banner {
  height: var(--banner-h);
  background: #1a1a2e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0 1rem;
  text-align: center;
}
.demo-banner strong { color: var(--yellow); font-weight: 700; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--banner-h));
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 1.1rem 0.85rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.sidebar-title {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.45rem;
}
.sidebar-title .product {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
}
.sidebar-title .sub { color: var(--muted); font-size: 0.78rem; }

.side-nav { display: grid; gap: 0.15rem; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.92rem;
}
.side-nav a:hover { background: var(--teal-wash); color: var(--ink); }
.side-nav a.is-active { background: var(--teal-wash-2); color: var(--ink); }
.side-nav svg { width: 16px; height: 16px; flex: 0 0 auto; }

.sidebar-foot { margin-top: auto; padding: 0 0.45rem; }
.sidebar-foot a { color: var(--text-2); text-decoration: none; font-size: 0.85rem; font-weight: 500; }
.sidebar-foot a:hover { color: var(--teal-dark); }

.workspace { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.35rem;
}
.topbar-left { display: flex; align-items: baseline; gap: 0.8rem; min-width: 0; }
.topbar-left h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}
.period-label { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.brand-switch select {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  padding: 0 0.6rem;
  font-weight: 600;
}
.user-chip {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--gray);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}
.menu-toggle-app {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.menu-toggle-app span,
.menu-toggle-app span::before,
.menu-toggle-app span::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  margin: 0 auto;
  position: relative;
}
.menu-toggle-app span::before,
.menu-toggle-app span::after { content: ""; position: absolute; left: 0; }
.menu-toggle-app span::before { top: -6px; }
.menu-toggle-app span::after { top: 6px; }

.content { padding: 1.35rem 1.35rem 2.5rem; }

/* Cards, grids, tables
   ------------------------------------------------------------------ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.1rem;
}
.kpi-card .label {
  margin: 0;
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 600;
}
.kpi-card .value {
  margin: 0.35rem 0 0.2rem;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--teal-dark);
  line-height: 1.1;
}
.kpi-card .meta { margin: 0; font-size: 0.78rem; color: var(--muted); }
.delta-up { color: var(--ok); }
.delta-down { color: var(--danger); }
.demo-flag {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #8a6a00;
  background: #fff4c2;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  vertical-align: 0.15em;
}

.panel { margin-bottom: 1.1rem; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.panel-head h2 { margin: 0; font-size: 1rem; font-weight: 800; }
.panel-head p { margin: 0; color: var(--muted); font-size: 0.82rem; }

.chart { width: 100%; height: 280px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-2);
}
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: 1px;
}

.split-2 {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 0.85rem;
}

.table-wrap { overflow: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.data th, table.data td {
  text-align: left;
  padding: 0.7rem 0.65rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th {
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #fafafa;
  white-space: nowrap;
}
table.data tbody tr:hover { background: var(--teal-wash); }
.rank { font-weight: 800; color: var(--ink); }
.excerpt { color: var(--text-2); max-width: 28rem; }

.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--gray);
  color: var(--text-2);
}
.tag-brand { background: #e8f7f6; color: var(--teal-dark); }
.tag-category { background: #eef2ff; color: #3730a3; }
.tag-competitor { background: #fff4d6; color: #8a6a00; }
.tag-yes { background: #e8f7f6; color: var(--ok); }
.tag-no { background: #f3f4f6; color: var(--muted); }
.tag-pos { background: #e8f7f6; color: var(--ok); }
.tag-neu { background: var(--gray); color: var(--text-2); }
.tag-neg { background: #fde8e6; color: var(--danger); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.filters label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-2);
}
.filters select {
  min-height: 36px;
  min-width: 10rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  padding: 0 0.5rem;
  font-weight: 500;
  color: var(--ink);
}

.bar-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr 3.2rem;
  gap: 0.6rem;
  align-items: center;
  margin: 0.45rem 0;
  font-size: 0.85rem;
}
.bar-track {
  height: 8px;
  background: var(--gray);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill { height: 100%; background: var(--teal); border-radius: 99px; }
.bar-fill.self { background: var(--ink); }
.bar-val { font-weight: 700; text-align: right; }

.sentiment-legend { display: grid; gap: 0.45rem; margin-top: 0.8rem; font-size: 0.88rem; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 1.5rem 0; text-align: center; }

.settings-form { display: grid; gap: 1rem; max-width: 36rem; }
.settings-form .field { display: grid; gap: 0.35rem; }
.settings-form label { font-weight: 700; font-size: 0.88rem; }
.settings-form input[type="text"] {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.4rem 0.7rem;
}
.check-grid { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.check-grid label { font-weight: 500; display: inline-flex; gap: 0.35rem; align-items: center; }
.settings-note { color: var(--text-2); font-size: 0.88rem; margin: 0; }
.settings-ok { color: var(--ok); font-weight: 600; display: none; }

.donut-wrap {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  align-items: center;
}

@media (max-width: 1100px) {
  .kpi-grid, .split-2, .donut-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 40;
    inset: calc(var(--banner-h)) auto 0 0;
    width: min(80vw, 260px);
    transform: translateX(-105%);
    transition: transform 0.25s var(--ease);
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  .menu-toggle-app { display: inline-flex; align-items: center; justify-content: center; }
  .period-label { display: none; }
  .content { padding: 1rem; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
