:root {
  --green: #16a34a;
  --green-d: #15803d;
  --green-s: #dcfce7;
  --navy: #16a34a;
  --navy-2: #14532d;
  --gold: #86efac;
  --paper: #f3f6f4;
  --card: #ffffff;
  --ink: #14241b;
  --muted: #6b7c72;
  --line: #e4ece6;
  --clay: #16a34a;
  --shadow: 0 10px 30px rgba(20, 36, 27, 0.06);
  --radius: 16px;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
.serif { font-family: "Noto Sans SC", sans-serif; font-weight: 650; letter-spacing: -0.02em; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 12% -10%, #bbf7d0 0%, transparent 55%),
    radial-gradient(700px 380px at 110% 20%, #86efac 0%, transparent 50%),
    linear-gradient(180deg, #ecfdf3, #f8faf9 58%, #eef6f1);
}
.login-wrap {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: #fff;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(20, 83, 45, 0.14);
}
.login-hero {
  padding: 42px 40px;
  color: #fff;
  background:
    linear-gradient(160deg, rgba(20, 83, 45, .28), rgba(22, 163, 74, .08)),
    linear-gradient(180deg, #166534, #15803d 55%, #16a34a);
}
.login-hero .mark {
  width: auto; min-width: 52px; height: 48px; padding: 0 10px; border-radius: 14px;
  background: rgba(255,255,255,.16); border: 0; color: #fff;
  font-size: 16px;
}
.login-hero h2 { margin: 28px 0 10px; font-size: 30px; line-height: 1.3; }
.login-hero p { margin: 0; color: #dcfce7; line-height: 1.7; }
.login-hero ul { margin: 28px 0 0; padding: 0; list-style: none; color: #e8fcec; font-size: 14px; }
.login-hero li { margin: 10px 0; }
.login-card {
  width: auto;
  background: #fff;
  padding: 48px 42px 36px;
}
.login-card .eyebrow { letter-spacing: 0.22em; color: var(--green); font-size: 12px; margin: 0; font-weight: 600; }
.login-card h1 { margin: 10px 0 8px; font-size: 28px; }
.login-card .hint { color: var(--muted); font-size: 13px; margin: 0 0 24px; line-height: 1.6; }
.login-card label { display: block; font-size: 13px; margin: 14px 0 6px; color: #3f5a4a; font-weight: 600; }
.login-card input {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line);
  background: #f8fbf9; border-radius: 12px;
}
.login-card input:focus { outline: 2px solid #bbf7d0; border-color: var(--green); background: #fff; }
.login-card button {
  width: 100%; margin-top: 22px; height: 46px; background: var(--green); color: #fff;
  border: 0; cursor: pointer; border-radius: 12px; font-weight: 600; font-size: 15px;
}
.login-card button:hover { background: var(--green-d); }
.login-card .err { color: #dc2626; font-size: 13px; min-height: 18px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.side {
  background: #10241b;
  color: #e8f5ee;
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 6px 10px 18px; }
.mark {
  min-width: 44px; height: 40px; padding: 0 8px; border-radius: 12px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, #22c55e, #15803d);
  font-family: "Noto Serif SC", serif; font-size: 14px; font-weight: 600;
  letter-spacing: .04em; white-space: nowrap; border: 0;
  box-shadow: 0 8px 16px rgba(22, 163, 74, .28);
}
.brand strong { display: block; font-size: 17px; font-weight: 600; color: #fff; line-height: 1.3; letter-spacing: .02em; }
.nav-label {
  margin: 14px 12px 6px; font-size: 11px; letter-spacing: .14em;
  color: #7d9a8a; text-transform: uppercase;
}
.side nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; color: #c5d9cc; margin-bottom: 4px;
}
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.active {
  background: linear-gradient(90deg, #16a34a, #22c55e);
  color: #fff; font-weight: 600;
  box-shadow: 0 8px 18px rgba(22, 163, 74, .28);
}
.nav-ico { width: 20px; text-align: center; font-size: 15px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  min-height: 72px; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: rgba(255,255,255,.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 5;
}
.crumb { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.page-title { font-size: 22px; }
.top .who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--green-s); color: var(--green-d);
  display: grid; place-items: center; font-weight: 700;
}
.who-meta { line-height: 1.25; }
.who-meta b { display: block; color: var(--ink); font-size: 13px; }
.top button { background: none; border: 0; cursor: pointer; color: var(--navy); }
.body { padding: 24px 28px 48px; }
.page-sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; line-height: 1.6; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); padding: 18px;
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; gap: 14px; align-items: center;
}
.card small { color: var(--muted); font-size: 13px; }
.card strong { display: block; margin-top: 6px; font-size: 26px; letter-spacing: -0.03em; }
.card-ico {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--green-s); font-size: 20px; flex-shrink: 0;
}
.card.c2 .card-ico { background: #dbeafe; }
.card.c3 .card-ico { background: #fef3c7; }
.card.c4 .card-ico { background: #ffe4e6; }
.grid-2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; }
.box {
  background: var(--card); border: 1px solid var(--line); padding: 18px 18px 8px;
  margin-bottom: 16px; border-radius: var(--radius); box-shadow: var(--shadow);
}
.box h3 { margin: 0 0 14px; font-size: 15px; }

.toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input[type="text"], input[type="number"], input[type="datetime-local"], input[type="color"], select, textarea {
  height: 40px; padding: 0 12px; border: 1px solid var(--line); background: #fff;
  border-radius: 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bbf7d0; border-color: var(--green); }
textarea { height: auto; padding: 10px 12px; width: 100%; }
.btn {
  height: 40px; padding: 0 16px; border: 0; cursor: pointer;
  background: var(--green); color: #fff; border-radius: 12px; font-weight: 600;
}
.btn:hover { background: var(--green-d); }
.btn.ghost { background: #fff; color: #14532d; border: 1px solid var(--line); }
.btn.ghost:hover { background: #f3faf5; }
.btn.danger { background: #e11d48; }
.btn.danger:hover { background: #be123c; }
.btn.small { height: 30px; font-size: 12px; padding: 0 10px; border-radius: 9px; }

table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
th { color: #6b7c72; font-weight: 600; font-size: 12px; background: #f8fbf9; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover, tbody tr:hover { background: #f4fbf6; }
.pager { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--green-s); color: var(--green-d);
}
.tag.off { background: #f1f5f4; color: #6b7c72; }
.mono { font-family: ui-monospace, Consolas, "Courier New", monospace; letter-spacing: 0.08em; }

dialog {
  border: 0; background: var(--card); padding: 0; width: min(560px, 92vw);
  border-radius: 20px; box-shadow: 0 24px 80px rgba(20, 36, 27, .18);
}
dialog::backdrop { background: rgba(16, 36, 27, .45); }
dialog form, .dialog-body { padding: 18px 20px; }
dialog h3 { margin: 0; padding: 18px 20px; border-bottom: 1px solid var(--line); font-size: 16px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 13px; margin-bottom: 6px; color: #3f5a4a; font-weight: 600; }
.form-row input, .form-row select, .form-row textarea { width: 100%; }
.dialog-body .err { color: #dc2626; font-size: 13px; min-height: 18px; margin: 4px 0 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }

.board { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; }
.col { background: #eef6f1; min-height: 480px; padding: 12px; border-radius: 16px; }
.col header { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 10px; font-weight: 650; }
.lead {
  background: var(--card); border: 1px solid var(--line); padding: 12px;
  margin-bottom: 10px; cursor: grab; border-radius: 14px; box-shadow: var(--shadow);
}
.lead h4 { margin: 0 0 6px; font-size: 14px; }
.lead p, .lead .meta { margin: 0; color: var(--muted); font-size: 12px; }
.lead .meta { display: flex; justify-content: space-between; margin-top: 8px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline small { color: var(--muted); }

.funnel { display: flex; flex-direction: column; gap: 12px; padding-bottom: 10px; }
.bar-row { display: grid; grid-template-columns: 64px 1fr 28px; gap: 10px; align-items: center; font-size: 13px; }
.track { height: 10px; background: #e8f5ee; border-radius: 99px; overflow: hidden; }
.fill { height: 100%; background: linear-gradient(90deg, #16a34a, #4ade80); }

.prod { display: flex; gap: 10px; align-items: center; }
.prod img { width: 48px; height: 48px; object-fit: cover; background: #e8f5ee; border-radius: 12px; }
.muted { color: var(--muted); }
.head-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; gap: 12px; }
.head-row h2 { margin: 0 0 6px; }
.ban-preview {
  min-width: 260px; max-width: 380px; border-radius: 14px; padding: 20px 22px; color: #fff;
  box-shadow: 0 10px 24px rgba(21, 128, 61, .22);
}
.ban-preview b { display: block; font-size: 18px; }
.ban-preview span { display: block; margin-top: 6px; font-size: 13px; opacity: .92; }
.upload-box { display: flex; align-items: center; gap: 14px; }
.upload-preview {
  width: 96px; height: 72px; object-fit: cover; border-radius: 10px;
  background: #eef6f1; border: 1px dashed var(--line); display: none;
}
.upload-tip { margin-top: 6px; font-size: 12px; }

.seg {
  display: inline-flex; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 4px; box-shadow: var(--shadow);
}
.seg button {
  height: 36px; padding: 0 18px; border: 0; background: transparent;
  border-radius: 10px; cursor: pointer; color: var(--muted); font-weight: 600;
}
.seg button.on { background: var(--green); color: #fff; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.kpi {
  background: #fff; border-radius: 18px; padding: 18px 18px 16px;
  border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi::after {
  content: ''; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px;
  border-radius: 50%; opacity: .85;
}
.kpi-a::after { background: #dcfce7; }
.kpi-b::after { background: #fef3c7; }
.kpi-c::after { background: #dbeafe; }
.kpi-d::after { background: #ccfbf1; }
.kpi small { color: var(--muted); font-size: 13px; }
.kpi .val { display: block; font-size: 28px; font-weight: 750; margin: 8px 0 6px; letter-spacing: -0.03em; }
.kpi-a .val { color: #15803d; }
.kpi-b .val { color: #b45309; }
.kpi-c .val { color: #1d4ed8; }
.kpi-d .val { color: #0f766e; }
.delta { font-size: 12px; font-weight: 700; }
.delta.up { color: #16a34a; }
.delta.down { color: #e11d48; }
.insight-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; }
.insight {
  background: linear-gradient(180deg, #ecfdf3, #fff);
  border: 1px solid #bbf7d0; border-radius: 16px; padding: 14px 16px; font-size: 13px; line-height: 1.7;
}
.insight b { display: block; margin-bottom: 6px; font-size: 14px; }
.insight.warn { background: linear-gradient(180deg, #fff7ed, #fff); border-color: #fed7aa; }
.insight.info { background: linear-gradient(180deg, #eff6ff, #fff); border-color: #bfdbfe; }
.funnel-lite { display: flex; flex-direction: column; gap: 10px; }
.funnel-lite .row { display: grid; grid-template-columns: 76px 1fr 40px; gap: 8px; align-items: center; font-size: 13px; }
.funnel-lite .bar { height: 12px; background: #eef6f1; border-radius: 99px; overflow: hidden; }
.funnel-lite .bar > i { display: block; height: 100%; border-radius: 99px; }
.rank { display: flex; flex-direction: column; gap: 12px; }
.rank .item { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; }
.rank .no {
  width: 28px; height: 28px; border-radius: 8px; background: #ecfdf3; color: #15803d;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.rank .no.hot { background: #16a34a; color: #fff; }
.rank .meta b { display: block; font-size: 14px; }
.rank .meta span { color: var(--muted); font-size: 12px; }
.rank .track { height: 6px; background: #eef6f1; border-radius: 99px; margin-top: 6px; overflow: hidden; }
.rank .track > i { display: block; height: 100%; background: linear-gradient(90deg, #86efac, #16a34a); }
.rank .amt { font-weight: 700; color: #14532d; }
.chart-box { height: 280px; position: relative; }
.chart-empty {
  height: 280px; display: grid; place-items: center; color: var(--muted); font-size: 13px;
}
@media (max-width: 960px) {
  .kpi-grid, .insight-row { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .cards, .grid-2, .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}
