:root {
  --ink: #1a2332;
  --muted: #6b7a90;
  --line: #e3e8ef;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --brand: #0d9488;
  --brand-dark: #0a756b;
  --brand-light: #ccfbf1;
  --accent: #f59e0b;
  --sidebar: #0f1923;
  --sidebar-hover: #1a2a3a;
  --sidebar-active: #0d9488;
  --sidebar-muted: #8899aa;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(15,23,42,.06);
  --shadow-md: 0 4px 16px rgba(15,23,42,.08);
  --shadow-lg: 0 8px 30px rgba(15,23,42,.12);
}

* { box-sizing: border-box; }
body { color: var(--ink); background: var(--canvas); font-family: "Inter", "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
body.admin-page { direction: ltr; text-align: left; }

.eyebrow { color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 4px; }
.brand-mark { display: inline-grid; width: 38px; height: 38px; place-items: center; border-radius: var(--radius); color: #fff; background: linear-gradient(135deg, var(--brand), #14b8a6); font-size: 1.15rem; font-weight: 800; box-shadow: 0 4px 12px rgba(13,148,136,.3); }

/* ============ 登录页 ============ */
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: linear-gradient(135deg, #0f1923 0%, #1a2a3a 50%, #0d3d38 100%); }
.login-shell { display: grid; grid-template-columns: minmax(360px, 1.05fr) minmax(380px, .95fr); width: min(980px, 100%); overflow: hidden; border-radius: 16px; background: #fff; box-shadow: var(--shadow-lg); }
.login-intro { display: flex; align-items: center; gap: 20px; min-height: 520px; padding: 56px; color: #fff; background: linear-gradient(145deg, #0f1923, #1a3040); }
.login-intro .brand-mark { width: 56px; height: 56px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), #14b8a6); font-size: 1.5rem; }
.login-intro .eyebrow { color: #5eead4; }
.login-intro h1 { margin: 0 0 12px; color: #fff; font-size: 2.1rem; font-weight: 700; }
.intro-copy { max-width: 280px; margin: 0; color: #94a3b8; line-height: 1.8; }
.login-card { display: flex; align-items: center; background: #fff; }
.login-card .card-body { width: 100%; }
.login-card h2 { color: var(--ink); font-weight: 700; }
.login-card .form-control { min-height: 48px; border-color: #dde3ec; border-radius: var(--radius); }
.login-card .form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 .25rem rgba(13,148,136,.12); }
.login-card .btn-primary { border: 0; border-radius: var(--radius); background: linear-gradient(135deg, var(--brand), #0d9488); font-weight: 700; padding: 14px; }
.login-card .btn-primary:hover { background: linear-gradient(135deg, var(--brand-dark), #0a756b); }

/* ============ 后台布局 ============ */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 20;
  display: flex; flex-direction: column;
  width: 264px; padding: 20px 14px 16px;
  border-right: 1px solid rgba(255,255,255,.06);
  color: #d7e1ed;
  background: var(--sidebar);
  box-shadow: 4px 0 24px rgba(0,0,0,.1);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 20px; color: #fff; font-size: 1.05rem; font-weight: 700; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 16px; }
.brand .brand-mark { width: 38px; height: 38px; border-radius: var(--radius); background: linear-gradient(135deg, var(--brand), #14b8a6); font-size: 1rem; }

.sidebar-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 14px;
  border-radius: var(--radius);
  color: var(--sidebar-muted);
  font-size: .88rem; font-weight: 500;
  text-decoration: none;
  transition: all .2s ease;
  position: relative;
  flex-shrink: 0;
}

.sidebar-nav a .nav-icon { width: 20px; height: 20px; flex-shrink: 0; opacity: .7; transition: opacity .2s; }
.sidebar-nav a:hover { color: #f0f9ff; background: var(--sidebar-hover); }
.sidebar-nav a:hover .nav-icon { opacity: 1; }
.sidebar-nav a.active { color: #fff; background: linear-gradient(135deg, var(--brand), #0d9488); box-shadow: 0 4px 14px rgba(13,148,136,.35); }
.sidebar-nav a.active .nav-icon { opacity: 1; }
.sidebar-nav a.disabled { cursor: not-allowed; color: #4a5568; opacity: .5; }
.sidebar-nav a span.badge { margin-left: auto; font-size: .65rem; padding: 2px 7px; border-radius: 99px; background: rgba(255,255,255,.1); color: var(--sidebar-muted); }

.sidebar-bottom { padding: 14px 14px 0; border-top: 1px solid rgba(255,255,255,.08); color: #4a5568; font-size: .72rem; text-align: center; }

/* ============ 主内容区 ============ */
.main-content { width: calc(100% - 264px); margin-left: 264px; padding: 28px clamp(24px, 3vw, 48px) 52px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 52px; margin-bottom: 28px; }
.topbar h1 { margin: 0; color: var(--ink); font-size: 1.5rem; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.date-label { color: var(--muted); font-size: .82rem; }
.admin-user { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font-weight: 600; font-size: .84rem; box-shadow: var(--shadow-sm); }
.topbar .btn { border-radius: var(--radius); }

/* ============ 欢迎面板 ============ */
.welcome-panel { display: flex; align-items: center; justify-content: space-between; gap: 32px; min-height: 180px; padding: 32px 36px; border: 0; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #0f1923 0%, #1a3040 60%, #0d4d45 100%); box-shadow: var(--shadow-md); margin-bottom: 28px; }
.welcome-panel .eyebrow { color: #5eead4; }
.welcome-panel h2 { margin: 0 0 8px; color: #fff; font-size: 1.5rem; font-weight: 700; }
.welcome-panel p:not(.eyebrow) { max-width: 580px; margin: 0; color: #94a3b8; line-height: 1.75; }
.status-ring { display: grid; flex: 0 0 auto; width: 78px; height: 78px; border: 6px solid rgba(94,234,212,.25); border-top-color: #5eead4; border-radius: 50%; place-items: center; color: #5eead4; font-size: .8rem; font-weight: 700; }

/* ============ 指标卡片 ============ */
.metric-card, .action-card { height: 100%; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s; }
.metric-card:hover, .action-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.metric-card p { margin: 0 0 10px; color: var(--muted); font-size: .82rem; }
.metric-card strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 1.45rem; font-weight: 700; }
.metric-card small { color: var(--brand); font-weight: 600; }

.quick-section { margin-top: 36px; }
.section-heading { margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.step-number { display: inline-grid; width: 30px; height: 30px; margin-bottom: 16px; border-radius: 50%; place-items: center; color: var(--brand); background: var(--brand-light); font-size: .75rem; font-weight: 800; }
.action-card h3 { margin: 0 0 8px; font-size: .98rem; font-weight: 700; }
.action-card p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.7; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .sidebar { position: static; width: 100%; min-height: auto; padding: 14px; }
  .admin-layout { display: block; }
  .sidebar-nav { display: flex; gap: 4px; margin-top: 14px; overflow-x: auto; padding-bottom: 4px; flex-direction: row; }
  .sidebar-nav a { flex: 0 0 auto; height: 40px; }
  .sidebar-bottom { display: none; }
  .main-content { width: 100%; margin-left: 0; padding: 24px 18px 40px; }
}

@media (max-width: 640px) {
  .login-page { padding: 14px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-intro { min-height: auto; padding: 28px; }
  .login-intro h1 { font-size: 1.4rem; }
  .topbar, .topbar-actions { align-items: flex-start; flex-direction: column; }
  .topbar { margin-bottom: 18px; }
  .topbar-actions { gap: 8px; }
  .welcome-panel { align-items: flex-start; padding: 22px; }
  .status-ring { width: 56px; height: 56px; border-width: 4px; }
}
