:root {
  --bg: #f5f7fb;
  --panel: #fff;
  --ink: #172033;
  --muted: #667085;
  --line: #dde3ee;
  --blue: #2267e8;
  --teal: #0d9488;
  --green: #13a461;
  --orange: #f08a24;
  --red: #dd3b4d;
  --shadow: 0 16px 44px rgba(22, 33, 55, .08);
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #eef4ff 0, #f8fafc 330px, var(--bg) 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 66px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(203, 213, 225, .75);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--teal));
}

.brand-mark svg, .icon-btn svg, .primary svg { width: 18px; height: 18px; stroke-width: 2; }

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.nav a {
  padding: 8px 12px;
  border-radius: 7px;
  color: #3f4a5f;
  font-size: 14px;
  white-space: nowrap;
}

.nav a.active {
  color: var(--blue);
  background: #eaf1ff;
  font-weight: 800;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search {
  width: 260px;
  max-width: 28vw;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #8a94a6;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.icon-btn, .primary, .ghost {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  color: #344054;
  white-space: nowrap;
}

.icon-btn { width: 38px; padding: 0; }
.primary { padding: 0 14px; border-color: var(--blue); background: var(--blue); color: #fff; font-weight: 800; }
.ghost { padding: 0 12px; }

.page {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px 28px 40px;
  display: grid;
  gap: 18px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: stretch;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 24px;
  background: linear-gradient(135deg, #fff 0%, #f9fbff 56%, #eef9f6 100%);
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: 30px; line-height: 1.18; letter-spacing: 0; }
h2 { font-size: 18px; margin-bottom: 4px; }
h3 { font-size: 15px; margin-bottom: 6px; }
p { color: var(--muted); line-height: 1.7; }

.filters, .actions { display: flex; flex-wrap: wrap; gap: 8px; }

.chip, .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

.chip {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: #42526b;
  font-size: 13px;
}

.chip.active { border-color: var(--blue); background: var(--blue); color: #fff; }
.tag { min-height: 22px; padding: 2px 8px; background: #eef2f7; color: #475467; font-size: 12px; }
.tag.good { background: #e8f7ef; color: #08784f; }
.tag.hot { background: #fff0e7; color: #bd3a13; }
.tag.ai { background: #e8f0ff; color: #2354c6; }

.grid-4, .grid-3, .grid-2 { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.metric, .card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.metric span { color: var(--muted); font-size: 12px; font-weight: 750; }
.metric strong { display: block; margin: 10px 0 8px; font-size: 26px; line-height: 1; }
.delta { color: var(--green); font-size: 12px; font-weight: 850; }
.delta.down { color: var(--red); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.section-body { padding: 18px; }

.table {
  display: grid;
}

.row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) .8fr .8fr .8fr .8fr;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 0 18px;
  border-bottom: 1px solid #edf1f7;
  font-size: 13px;
}

.row.header {
  min-height: 42px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 850;
}

.row:last-child { border-bottom: 0; }

.bar {
  height: 9px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.chart {
  position: relative;
  height: 260px;
  border: 1px solid #e4e9f2;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(#eef2f7 1px, transparent 1px) 0 0 / 100% 52px,
    linear-gradient(90deg, #eef2f7 1px, transparent 1px) 0 0 / 12.5% 100%,
    #fbfcff;
}

.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: #4b5567;
  font-size: 13px;
  font-weight: 800;
}

.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: 0;
}

.field textarea { min-height: 104px; resize: vertical; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
}

.result-box {
  min-height: 260px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  color: #3f4a5f;
  line-height: 1.75;
  white-space: pre-wrap;
}

@media (max-width: 1050px) {
  .hero, .split { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { display: none; }
}

@media (max-width: 720px) {
  .topbar { height: auto; padding: 12px; flex-wrap: wrap; }
  .brand { flex: 1; }
  .search { order: 4; width: 100%; max-width: none; }
  .page { padding: 14px 12px 30px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .row { grid-template-columns: minmax(140px, 1fr) 82px; }
  .row > :nth-child(n+3) { display: none; }
}
