/* ============================================================
   三小总测 —— 简约主题（黑 / 白 / 蓝）
   ============================================================ */

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #eff6ff;
  --ink: #111827;
  --ink-soft: #374151;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f8fafc;
  --white: #ffffff;
  --danger: #dc2626;
  --success: #059669;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏 ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.logo { height: 40px; width: 40px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-size: 17px; font-weight: 700; color: var(--ink); }
.brand-sub { font-size: 12px; color: var(--muted); }

.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: var(--ink-soft);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover { background: var(--blue-light); color: var(--blue); text-decoration: none; }
.nav a.active { background: var(--blue); color: #fff; }

.user-box { display: flex; align-items: center; gap: 10px; }
.user-name { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }

/* ---------- 主内容 ---------- */
.main { flex: 1 0 auto; padding-top: 28px; padding-bottom: 48px; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-head h1 { font-size: 22px; margin: 0; }
.page-head .desc { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.card h2 { font-size: 16px; margin: 0 0 12px; }

/* ---------- 提示条 ---------- */
.alert {
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
  background: #fff;
  color: var(--ink);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--ink-soft); }
.btn-ghost:hover { border-color: #cbd5e1; color: var(--ink); }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-inline { padding: 2px 8px; font-size: 12px; border-radius: 6px; }

/* ---------- 表单 ---------- */
label.field { display: block; margin-bottom: 16px; }
.field-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 180px; }
.form-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- 登录/注册卡片 ---------- */
.auth-wrap { display: flex; justify-content: center; padding-top: 40px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .logo-lg { height: 56px; width: 56px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); display: block; margin: 0 auto 12px; }
.auth-card h1 { font-size: 20px; text-align: center; margin: 0 0 20px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }

/* ---------- 统计卡片 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.stat .num { font-size: 26px; font-weight: 700; color: var(--blue); }
.stat .label { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th { font-size: 13px; color: var(--muted); font-weight: 600; background: var(--bg); }
.table tr:last-child td { border-bottom: none; }
.table .nowrap { white-space: nowrap; }
.table .muted { color: var(--muted); }

/* ---------- 列表项 ---------- */
.item-list { list-style: none; margin: 0; padding: 0; }
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.item:last-child { border-bottom: none; }
.item-main { min-width: 0; flex: 1; }
.item-title { font-weight: 600; color: var(--ink); font-size: 15px; }
.item-title a { color: var(--ink); }
.item-title a:hover { color: var(--blue); }
.item-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.item-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-gray { background: #f1f5f9; color: var(--muted); }
.badge-green { background: #ecfdf5; color: #047857; }
.badge-orange { background: #fff7ed; color: #c2410c; }

/* ---------- 详情 ---------- */
.detail-block { margin-bottom: 20px; }
.detail-label { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 6px; }
.detail-text {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
}

.comment-item { border-left: 3px solid var(--blue); padding: 10px 14px; background: var(--blue-light); border-radius: 6px; margin-bottom: 10px; }
.comment-item .comment-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.comment-item .comment-body { white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.comment-empty { color: var(--muted); font-size: 14px; }

/* ---------- 页脚（预留备案信息） ---------- */
.site-footer {
  flex-shrink: 0;
  background: var(--ink);
  color: #e5e7eb;
  margin-top: 32px;
}
.site-footer .container { padding-top: 22px; padding-bottom: 22px; text-align: center; }
.footer-text { margin: 0; font-size: 13px; color: #d1d5db; }
.beian { margin: 8px 0 0; font-size: 12px; color: #9ca3af; }

.empty { color: var(--muted); text-align: center; padding: 28px 0; font-size: 14px; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .nav { order: 3; width: 100%; margin-left: 0; }
  .nav a { flex: 1; text-align: center; }
  .user-box { margin-left: auto; }
  .form-row > * { flex: 1 1 100%; }
}
