/* ============================================================
   低空智能检验试验平台 - 共享设计系统
   现代科技风：浅色主题 / 深色文字 / 渐变动效
   ============================================================ */

:root {
  --bg-base: #f5f7fa;
  --bg-surface: #ffffff;
  --bg-elevated: #f8fafc;
  --bg-hover: #f1f5f9;
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(59, 130, 246, 0.45);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent-cyan: #0891b2;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
  --accent-gradient-soft: linear-gradient(135deg, rgba(6,182,212,0.12) 0%, rgba(59,130,246,0.12) 50%, rgba(139,92,246,0.12) 100%);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-glow: 0 4px 20px rgba(59, 130, 246, 0.25);
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.08);
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(59,130,246,0.08), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 20%, rgba(139,92,246,0.06), transparent 60%),
    var(--bg-base);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ---------- 渐变文字 ---------- */
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradient-flow 6s ease infinite;
}

@keyframes gradient-flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent-gradient);
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.brand-text { letter-spacing: 0.5px; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-menu a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-menu a:hover {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.08);
}

.nav-menu a.active {
  color: var(--accent-cyan);
  background: rgba(59, 130, 246, 0.12);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-gradient);
  background-size: 200% 200%;
  color: #fff;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.45);
  background-position: 100% 50%;
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.04);
  border-color: var(--border);
  color: var(--text-primary);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  background: rgba(59, 130, 246, 0.08);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }

.btn-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}
.btn-success:hover { background: rgba(16, 185, 129, 0.2); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ---------- 容器 ---------- */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
}

.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

.section-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 40px;
}

.section-head { text-align: center; margin-bottom: 48px; }
.section-head .section-title { display: inline-block; }

/* ---------- 网格 ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ---------- 面板（无卡片边框，仅分层背景） ---------- */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title::before {
  content: "";
  width: 3px;
  height: 16px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

.panel-body { padding: 24px; }

/* ---------- 表单 ---------- */
.form-row { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.form-label .req { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s;
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-control:disabled { opacity: 0.6; cursor: not-allowed; }

textarea.form-control { resize: vertical; min-height: 96px; }

select.form-control {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 14px 16px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15,23,42,0.04);
  color: var(--text-secondary);
}

.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(59, 130, 246, 0.06); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ---------- 徽标 / 状态 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-success { background: rgba(16,185,129,0.12); color: #6ee7b7; }
.badge-warning { background: rgba(245,158,11,0.12); color: #fcd34d; }
.badge-danger { background: rgba(239,68,68,0.12); color: #fca5a5; }
.badge-info { background: rgba(59,130,246,0.12); color: #93c5fd; }
.badge-neutral { background: rgba(160,174,192,0.12); color: var(--text-muted); }

/* ---------- 标签 / 分类胶囊 ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(15,23,42,0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover, .chip.active {
  background: rgba(59,130,246,0.12);
  border-color: var(--border-strong);
  color: var(--accent-cyan);
}

/* ---------- 子标签页（sub-tabs） ---------- */
.sub-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.sub-tab {
  padding: 12px 18px;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
  user-select: none;
}
.sub-tab:hover { color: var(--text-primary); }
.sub-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

/* ---------- 数据指标卡 ---------- */
.metric {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s;
}

.metric::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0.6;
}

.metric:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.metric-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-value {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -0.5px;
}

.metric-delta {
  font-size: 12px;
  margin-top: 8px;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 4px;
}

.metric-delta.down { color: var(--danger); }

/* ---------- 模态框 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-mask.show { display: flex; animation: fade-in 0.2s; }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.15);
  animation: pop-in 0.25s;
}

.modal.lg { max-width: 800px; }
.modal.sm { max-width: 420px; }

.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 17px; font-weight: 600; }

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--text-muted);
  font-size: 20px;
  transition: all 0.2s;
}

.modal-close:hover { background: rgba(15,23,42,0.06); color: var(--text-primary); }

.modal-body { padding: 24px; }

.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- 后台布局 ---------- */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
}

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}

.sidebar-group { margin-bottom: 8px; }

.sidebar-group-title {
  padding: 12px 24px 6px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: var(--text-secondary);
  font-size: 14px;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}

.sidebar a:hover {
  background: rgba(59,130,246,0.06);
  color: var(--text-primary);
}

.sidebar a.active {
  background: rgba(59,130,246,0.1);
  color: var(--accent-cyan);
  border-left-color: var(--accent-cyan);
}

.sidebar a .ico { width: 18px; text-align: center; }

.admin-main { padding: 28px 32px; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.breadcrumb a:hover { color: var(--accent-cyan); }

/* ---------- 筛选栏 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.toolbar .form-control { width: auto; min-width: 160px; }

.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}

.search-box input { width: 100%; padding-left: 38px; }

.search-box::before {
  content: "🔍";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.6;
}

.spacer { flex: 1; }

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}

.pagination button {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  transition: all 0.15s;
}

.pagination button:hover { border-color: var(--border-strong); color: var(--text-primary); }
.pagination button.active { background: var(--accent-gradient); border-color: transparent; color: #fff; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- 时间线 / 步骤 ---------- */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 20px 0;
}

.step {
  flex: 1;
  text-align: center;
  position: relative;
}

.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  position: relative;
  z-index: 2;
}

.step.done .step-dot { background: var(--accent-gradient); border-color: transparent; color: #fff; }
.step.current .step-dot { border-color: var(--accent-cyan); color: var(--accent-cyan); box-shadow: 0 0 0 4px rgba(59,130,246,0.12); }

.step::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 1;
}

.step:last-child::after { display: none; }
.step.done::after { background: var(--accent-cyan); }

.step-label { font-size: 12px; color: var(--text-muted); }
.step.current .step-label { color: var(--accent-cyan); font-weight: 500; }

/* ---------- 消息项 ---------- */
.msg-item {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(15,23,42,0.04);
  cursor: pointer;
  transition: background 0.15s;
}

.msg-item:hover { background: rgba(59,130,246,0.06); }
.msg-item.unread { background: rgba(59,130,246,0.05); }

.msg-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-gradient-soft);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 18px;
}

.msg-body { flex: 1; min-width: 0; }
.msg-title { font-weight: 500; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.msg-item.unread .msg-title::after {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
}
.msg-desc { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty .ico { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 48px 0 24px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand .brand { margin-bottom: 14px; }
.footer-desc { color: var(--text-muted); font-size: 13px; line-height: 1.7; }

.footer h4 { font-size: 14px; margin-bottom: 16px; color: var(--text-secondary); }
.footer ul li { margin-bottom: 10px; }
.footer ul li a { color: var(--text-muted); font-size: 13px; transition: color 0.15s; }
.footer ul li a:hover { color: var(--accent-cyan); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

/* ---------- 工具类 ---------- */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-cyan { color: var(--accent-cyan); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; }
.text-bold { font-weight: 700; }
.text-mono { font-family: var(--mono); }
.text-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.hidden { display: none; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(59,130,246,0.25); border-radius: 5px; border: 2px solid var(--bg-base); }
::-webkit-scrollbar-thumb:hover { background: rgba(59,130,246,0.45); }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; display: none; }
}

@media (max-width: 720px) {
  .topbar-inner { padding: 0 16px; }
  .container { padding: 0 16px; }
  .nav-menu { display: none; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
  .section-title { font-size: 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .admin-main { padding: 20px 16px; }
}
