/* ==========================================================================
   妥妥递 · 经营决策中台管理平台 高端现代化设计系统 (Design System 2.0)
   ========================================================================== */

:root {
  --sidebar-bg: #0f172a;       /* 深邃 Slate-900 侧边栏 */
  --sidebar-hover: #1e293b;
  --sidebar-active: #2563eb;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-border: #1e293b;
  
  --bg-main: #f8fafc;          /* 极清爽浅灰底色 */
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --line-border: #e2e8f0;
  --line-faint: #f1f5f9;
  
  --text-main: #0f172a;        /* 极高对比度标题 */
  --text-muted: #334155;
  --text-dim: #64748b;
  
  --brand: #2563eb;            /* 经典专业业务蓝 */
  --brand-hover: #1d4ed8;
  --brand-light: #eff6ff;
  --brand-glow: rgba(37, 99, 235, 0.15);
  
  --green: #10b981;
  --green-bg: #ecfdf5;
  --green-border: #a7f3d0;
  
  --yellow: #f59e0b;
  --yellow-bg: #fffbeb;
  --yellow-border: #fde68a;
  
  --red: #ef4444;
  --red-bg: #fef2f2;
  --red-border: #fecaca;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.02);
  --shadow-float: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* 整体弹性布局 */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ==========================================================================
   左侧高级暗黑导航栏 (Linear/Stripe 风格)
   ========================================================================== */
.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 50;
}

.sidebar-header {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37,99,235,0.4);
}
.sidebar-brand-name {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.3px;
}
.sidebar-brand-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 14px;
  overflow-y: auto;
}
.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  padding: 8px 10px 4px;
  letter-spacing: 0.8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #f8fafc;
}
.nav-item.active {
  background: var(--sidebar-active);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.nav-item .icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-border);
  background: rgba(15, 23, 42, 0.6);
}
.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #94a3b8;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16,185,129,0.3);
}

/* ==========================================================================
   右侧主体工作区 (高精致度卡片设计)
   ========================================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-main);
}

.top-bar {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--line-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.01);
}
.top-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.content-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 40px;
}

/* 卡片样式 */
.card {
  background: #ffffff;
  border: 1px solid var(--line-border);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease;
}
.card:hover {
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-faint);
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 3px;
}

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

/* 按钮设计 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(37,99,235,0.25);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
}
.btn-secondary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}
.btn-secondary:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* 表单输入控件 */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 9px 13px;
  font-size: 13px;
  border: 1px solid var(--line-border);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: #0f172a;
  transition: all 0.15s;
}
.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.form-text {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 5px;
}

/* 优雅精致的开关 Toggle */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.switch { position: relative; display: inline-block; width: 42px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 22px;
}
.slider:before {
  position: absolute; content: "";
  height: 16px; width: 16px; left: 3px; bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
input:checked + .slider { background-color: var(--brand); }
input:checked + .slider:before { transform: translateX(20px); }

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
}
.badge-green { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow-border); }
.badge-red { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.badge-blue { background: var(--brand-light); color: var(--brand); border: 1px solid var(--brand-border); }

/* 高清精致表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-border);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-faint);
  color: #1e293b;
}
.data-table tr:hover { background: #f8fafc; }

/* 模态弹窗 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-card {
  background: #ffffff;
  border-radius: 14px;
  width: 440px;
  padding: 26px;
  box-shadow: var(--shadow-float);
  border: 1px solid rgba(255,255,255,0.8);
}
