@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&family=ZCOOL+XiaoWei&display=swap');

:root {
  --ink: #142428;
  --ink-soft: #3a4f54;
  --mute: #6b7f84;
  --line: rgba(20, 36, 40, 0.08);
  --line-strong: rgba(20, 36, 40, 0.14);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --bg0: #e8eef0;
  --bg1: #d5e4e2;
  --teal: #0f5c4c;
  --teal-deep: #0a3d34;
  --teal-mid: #1a7a66;
  --teal-soft: #d7ebe4;
  --amber: #c47a12;
  --amber-soft: #f8e7c8;
  --rose: #b54545;
  --rose-soft: #f5d6d6;
  --sky: #2a6f7a;
  --shadow: 0 18px 50px rgba(15, 50, 45, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --nav-w: 248px;
  --font: 'Noto Sans SC', system-ui, sans-serif;
  --display: 'ZCOOL XiaoWei', 'Noto Sans SC', serif;
}

* { box-sizing: border-box; }
html, body, #root { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #cfe8e0 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #c5d9e4 0%, transparent 50%),
    radial-gradient(800px 500px at 80% 100%, #e4dcc8 0%, transparent 45%),
    linear-gradient(160deg, var(--bg0), var(--bg1));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.app-shell {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  min-height: 100vh;
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, rgba(10, 61, 52, 0.96), rgba(15, 92, 76, 0.92));
  color: #e8f4ef;
  box-shadow: 8px 0 40px rgba(10, 40, 35, 0.18);
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 12px;
}
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #f0c56d, #7ed0b0);
  color: var(--teal-deep);
  font-family: var(--display);
  font-size: 22px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}
.brand-text h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.brand-text p {
  margin: 2px 0 0;
  font-size: 11px;
  opacity: 0.7;
}

.nav-group { margin-top: 10px; }
.nav-group-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.45;
  padding: 8px 12px 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(255,255,255,0.78);
  transition: background .2s, color .2s, transform .2s;
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-link.active {
  background: rgba(255,255,255,0.14);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.nav-user {
  margin-top: auto;
  padding: 14px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-user strong { font-size: 14px; }
.nav-user span { font-size: 12px; opacity: 0.7; }

.main {
  padding: 28px 32px 48px;
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  animation: rise .45s ease both;
}
.page-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.page-head p {
  margin: 6px 0 0;
  color: var(--mute);
  font-size: 14px;
  max-width: 560px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--teal);
  color: #fff;
  font-weight: 500;
  transition: transform .15s, box-shadow .15s, background .15s;
  box-shadow: 0 8px 20px rgba(15, 92, 76, 0.22);
}
.btn:hover { background: var(--teal-mid); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.secondary {
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid var(--line-strong);
}
.btn.ghost {
  background: transparent;
  color: #e8f4ef;
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 8px 12px;
  font-size: 12px;
}
.btn.danger { background: var(--rose); box-shadow: 0 8px 20px rgba(181,69,69,.22); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.grid-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise .5s ease both;
}
.stat-card:nth-child(2) { animation-delay: .05s; }
.stat-card:nth-child(3) { animation-delay: .1s; }
.stat-card:nth-child(4) { animation-delay: .15s; }
.stat-card .label { color: var(--mute); font-size: 13px; }
.stat-card .value {
  margin-top: 8px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.stat-card .hint { margin-top: 6px; font-size: 12px; color: var(--mute); }
.stat-card .glow {
  position: absolute; right: -20px; top: -20px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(26,122,102,.25), transparent 70%);
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  animation: rise .55s ease both;
}
.panel + .panel { margin-top: 16px; }
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.table-wrap { overflow: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th {
  text-align: left;
  color: var(--mute);
  font-weight: 500;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
table.data td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data tr:hover td { background: rgba(15, 92, 76, 0.03); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--teal-soft);
  color: var(--teal-deep);
}
.badge.warn { background: var(--amber-soft); color: #7a4a08; }
.badge.danger { background: var(--rose-soft); color: #7a2424; }
.badge.mute { background: #e8ecee; color: var(--ink-soft); }
.badge.sky { background: #d5e8ec; color: #1a4f5a; }

.pill-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.field label { font-size: 13px; color: var(--mute); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--teal-mid);
  box-shadow: 0 0 0 3px rgba(26,122,102,.15);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  position: relative;
  padding-bottom: 16px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 7px; top: 14px; bottom: 0;
  width: 2px;
  background: var(--line-strong);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-soft);
  margin-top: 2px;
}
.timeline-body strong { display: block; font-size: 14px; }
.timeline-body span { color: var(--mute); font-size: 12px; }

.scene-card {
  padding: 18px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  animation: rise .5s ease both;
}
.scene-card:hover { transform: translateY(-3px); box-shadow: 0 22px 50px rgba(15,50,45,.12); }
.scene-card .bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
}
.scene-card h4 { margin: 0 0 6px; font-size: 17px; }
.scene-card p { margin: 0; color: var(--mute); font-size: 13px; line-height: 1.55; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f0f4f3;
  color: var(--ink-soft);
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}
.login-hero {
  position: relative;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #f4faf7;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(10,40,35,.35), rgba(10,61,52,.85)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(145deg, #0a3d34 0%, #1a7a66 45%, #2a6f7a 100%);
}
.login-hero::after {
  content: '';
  position: absolute;
  inset: auto -10% -20% 20%;
  height: 55%;
  background: radial-gradient(ellipse at center, rgba(240,197,109,.35), transparent 65%);
  pointer-events: none;
  animation: pulse 6s ease-in-out infinite;
}
.login-hero .eyebrow {
  font-size: 13px;
  letter-spacing: 0.18em;
  opacity: .7;
  margin-bottom: 14px;
}
.login-hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 400;
  line-height: 1.15;
  max-width: 12em;
}
.login-hero .lead {
  margin: 18px 0 0;
  max-width: 28em;
  font-size: 16px;
  line-height: 1.7;
  opacity: .85;
}
.login-panel {
  display: grid;
  place-items: center;
  padding: 40px 32px;
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(20px);
}
.login-card {
  width: min(400px, 100%);
  padding: 32px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise .5s ease both;
}
.login-card h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
}
.login-card .sub { color: var(--mute); font-size: 13px; margin-bottom: 22px; }
.demo-accounts {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.demo-accounts p { margin: 0 0 8px; font-size: 12px; color: var(--mute); }
.demo-chip {
  display: inline-flex;
  margin: 0 6px 6px 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #f7faf9;
  font-size: 12px;
  transition: background .15s;
}
.demo-chip:hover { background: var(--teal-soft); }

.empty {
  padding: 36px;
  text-align: center;
  color: var(--mute);
}

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 30, 28, 0.45);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 50;
  padding: 20px;
  animation: fade .2s ease both;
}
.modal {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
  animation: rise .25s ease both;
}
.modal h3 { margin: 0 0 14px; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; font-weight: 500; }

.error-text { color: var(--rose); font-size: 13px; margin: 8px 0; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: .7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.flash-bar {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(215,235,228,.95), rgba(255,255,255,.85));
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  box-shadow: var(--shadow);
  animation: rise .35s ease both, flashPulse 2.4s ease 1;
}
@keyframes flashPulse {
  0%, 100% { box-shadow: var(--shadow); }
  40% { box-shadow: 0 0 0 4px rgba(26,122,102,.12), var(--shadow); }
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.check-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.check-ok {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}

.danger-panel {
  border-color: rgba(181,69,69,.18);
  background: linear-gradient(160deg, rgba(245,214,214,.35), var(--surface));
}
.reject-list { display: flex; flex-direction: column; gap: 8px; }
.reject-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--line);
  font-size: 13px;
}
.reject-item strong { font-weight: 550; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.7);
  font-size: 13px;
  color: var(--ink-soft);
  transition: background .15s, border-color .15s, transform .15s;
}
.chip:hover { transform: translateY(-1px); border-color: var(--teal-mid); }
.chip.on {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  box-shadow: 0 8px 18px rgba(15,92,76,.2);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.metric-chip {
  padding: 14px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 92px;
  transition: transform .2s;
}
.metric-chip:hover { transform: translateY(-2px); }
.metric-chip .m-name { font-size: 12px; color: var(--mute); }
.metric-chip .m-val {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--teal-deep);
}
.metric-chip .m-hint { font-size: 11px; color: var(--mute); }

.nav-link.active {
  animation: navIn .35s ease both;
}
@keyframes navIn {
  from { transform: translateX(-4px); opacity: .6; }
  to { transform: none; opacity: 1; }
}

@media (max-width: 1100px) {
  .metric-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1100px) {
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .two-col, .three-col { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .side-nav {
    position: relative; height: auto;
    flex-direction: row; flex-wrap: wrap;
    align-items: center;
  }
  .brand { border: none; margin: 0; padding: 4px 8px; }
  .nav-group { display: contents; }
  .nav-group-label { display: none; }
  .nav-user { width: 100%; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { min-height: 280px; padding: 32px; }
  .main { padding: 20px 16px 40px; }
  .page-head h2 { font-size: 26px; }
}
