:root {
  --ink-dark: #0F2C2A;
  --ink-dark-2: #163C39;
  --paper-bg: #FAF7F2;
  --paper-card: #FFFFFF;
  --emerald: #1B7F6E;
  --emerald-soft: #E6F4F1;
  --gold: #C89B54;
  --gold-soft: #FBF4E6;
  --danger: #C0483E;
  --danger-soft: #FCECEB;
  --text-main: #1A2421;
  --text-muted: #62706B;
  --border: #E6E1D8;
  --shadow: 0 8px 28px rgba(15, 44, 42, 0.06);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--paper-bg);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* 整体布局（电脑端大屏） */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--ink-dark);
  color: #E8F0EE;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}
.brand-box {
  padding: 6px 10px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 18px;
}
.brand-badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--gold);
  background: rgba(200,155,84,0.14);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.brand-title { font-size: 19px; font-weight: 700; color: #FFFFFF; }
.brand-sub { font-size: 12px; color: rgba(232,240,238,0.68); margin-top: 3px; }

.nav-list { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  color: rgba(232,240,238,0.82);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.18s ease;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #FFFFFF; }
.nav-item.active { background: var(--emerald); color: #FFFFFF; box-shadow: 0 4px 12px rgba(27,127,110,0.35); }

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-logout {
  width: 100%;
  background: rgba(255,255,255,0.08);
  color: #D7E5E1;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}
.btn-logout:hover { background: rgba(255,255,255,0.15); }

.main-area { flex: 1; padding: 28px 34px 48px; max-width: 1440px; width: 100%; margin: 0 auto; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.page-title { font-size: 24px; font-weight: 700; color: var(--ink-dark); }
.page-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.pill:hover { border-color: var(--emerald); color: var(--emerald); }
.pill.active { background: var(--ink-dark); color: #FFFFFF; border-color: var(--ink-dark); }

/* 卡片与网格 */
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 22px; }
.card {
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-dark);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kpi-label { font-size: 13px; color: var(--text-muted); }
.kpi-value { font-size: 30px; font-weight: 800; color: var(--ink-dark); margin: 6px 0 4px; }
.kpi-sub { font-size: 12px; color: var(--emerald); }

/* 徽章与按钮 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-emerald { background: var(--emerald-soft); color: var(--emerald); }
.badge-gold { background: var(--gold-soft); color: #9C7129; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-dark { background: #EAEFED; color: var(--ink-dark); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--emerald); color: #FFFFFF; }
.btn-dark { background: var(--ink-dark); color: #FFFFFF; }
.btn-gold { background: var(--gold); color: #FFFFFF; }
.btn-outline { background: #FFFFFF; color: var(--ink-dark); border: 1px solid var(--border); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* 条形图 / 漏斗 */
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; font-size: 13px; }
.bar-label { width: 124px; color: var(--text-main); flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 11px; background: #EFECE6; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ink-dark), var(--emerald)); transition: width 0.35s ease; }
.bar-fill.danger { background: linear-gradient(90deg, #C0483E, #E07A6E); }
.bar-fill.gold { background: linear-gradient(90deg, #B98739, #DFB36B); }
.bar-num { width: 42px; text-align: right; font-weight: 700; color: var(--ink-dark); }

/* 列表与时间线 */
.split-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.list-item {
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.list-item:hover { border-color: var(--emerald); }
.list-item.active { border-color: var(--ink-dark); background: #F4F9F8; box-shadow: 0 4px 12px rgba(15,44,42,0.08); }

.timeline { border-left: 2px solid #D9E5E2; padding-left: 16px; margin-top: 10px; }
.timeline-item { position: relative; margin-bottom: 14px; background: #FAF8F4; border-radius: 10px; padding: 11px 14px; border: 1px solid #ECE7DD; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -23px;
  top: 15px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--emerald);
  border: 2px solid var(--paper-card);
}

.script-box {
  background: #F4F8F7;
  border: 1px dashed var(--emerald);
  border-radius: 12px;
  padding: 14px 16px;
  white-space: pre-wrap;
  font-size: 13.5px;
  color: var(--ink-dark);
}

/* 输入框 */
.input, .select, .textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #FFFFFF;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(27,127,110,0.12); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink-dark);
  color: #FFFFFF;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: 0 10px 28px rgba(15,44,42,0.28);
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .split-layout { grid-template-columns: 1fr; }
  .sidebar { width: 200px; }
}
@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; padding: 16px; }
  .nav-list { flex-direction: row; overflow-x: auto; }
  .main-area { padding: 18px 16px 36px; }
}
