:root {
  --primary: #1d4ed8;
  --primary-700: #1e40af;
  --primary-800: #1e3a8a;
  --primary-900: #172554;
  --primary-050: #eff6ff;
  --accent: #0ea5e9;
  --bg: #eef2f7;
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --border: #dbe2ec;
  --border-strong: #c3cddd;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 20px rgba(15, 23, 42, .08);
  --shadow-lg: 0 14px 44px rgba(15, 23, 42, .16);
}

* { 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", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(29, 78, 216, .08), transparent 60%),
    radial-gradient(900px 400px at -10% 0%, rgba(14, 165, 233, .07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-700); }

/* 中英对照：英文次要样式 */
.en, .bi i, .bi em { font-style: normal; font-weight: 400; color: var(--text-3); font-size: 12px; }
.bi b { font-weight: 600; }

/* ===== 顶部导航 ===== */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 24px;
  height: 68px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 17px; color: var(--text); }
.brand .logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px; flex: 0 0 auto;
  box-shadow: 0 4px 10px rgba(29, 78, 216, .35);
}
.brand small { display: block; font-weight: 400; font-size: 11px; color: var(--text-3); line-height: 1.3; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a {
  padding: 9px 14px; border-radius: 9px; color: var(--text-2);
  font-weight: 500; font-size: 14px; transition: .15s;
}
.nav-links a:hover { background: var(--primary-050); color: var(--primary); }
.nav-links a.active { background: var(--primary-050); color: var(--primary); }
.nav-links a.btn-primary { color: #fff; background: var(--primary); box-shadow: 0 4px 12px rgba(29,78,216,.28); }
.nav-links a.btn-primary:hover { background: var(--primary-700); }
.nav-user { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.nav-user .badge {
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: var(--primary-050); color: var(--primary); font-weight: 600;
}
.nav-user .badge.super { background: #fef2f2; color: var(--danger); }

/* ===== 布局容器 ===== */
.container { max-width: 1240px; margin: 0 auto; padding: 30px 24px 72px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { margin: 0 0 8px; font-size: 27px; letter-spacing: -.5px; }
.page-head p { margin: 0; color: var(--text-2); font-size: 14px; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(120deg, #172554 0%, #1d4ed8 52%, #0ea5e9 100%);
  color: #fff; border-radius: 22px; padding: 52px 56px; margin-bottom: 26px;
  position: relative; overflow: hidden; box-shadow: 0 16px 44px rgba(29, 78, 216, .32);
}
.hero::after {
  content: ""; position: absolute; right: -80px; bottom: -150px;
  width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255,255,255,.18), transparent 66%);
}
.hero::before {
  content: ""; position: absolute; right: 130px; top: -100px;
  width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.09);
}
.hero .tag-line {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; letter-spacing: 1px;
  background: rgba(255,255,255,.14); padding: 4px 12px; border-radius: 999px; margin-bottom: 16px;
  position: relative; z-index: 1;
}
.hero h1 { margin: 0 0 12px; font-size: 32px; letter-spacing: -.5px; position: relative; z-index: 1; }
.hero h1 .en { color: rgba(255,255,255,.82); font-size: 18px; font-weight: 500; }
.hero p { margin: 0 0 26px; color: rgba(255,255,255,.88); max-width: 720px; position: relative; z-index: 1; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; position: relative; z-index: 1; }
.hero .stats { display: flex; gap: 0; position: relative; z-index: 1; margin-top: 26px; flex-wrap: wrap; }
.hero .stat { display: flex; flex-direction: column; padding: 0 30px; border-left: 1px solid rgba(255,255,255,.22); }
.hero .stat:first-child { border-left: none; padding-left: 0; }
.hero .stat b { font-size: 26px; line-height: 1.1; }
.hero .stat span { font-size: 12px; color: rgba(255,255,255,.78); }

/* ===== 统计卡片 ===== */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
@media (max-width: 860px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
}
.stat-card .ico {
  width: 46px; height: 46px; border-radius: 12px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff;
}
.stat-card .ico.blue { background: linear-gradient(135deg, #2563eb, #0ea5e9); }
.stat-card .ico.green { background: linear-gradient(135deg, #16a34a, #22c55e); }
.stat-card .ico.orange { background: linear-gradient(135deg, #ea580c, #f59e0b); }
.stat-card .ico.violet { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.stat-card .num { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-card .lbl { font-size: 12px; color: var(--text-3); }

/* ===== 卡片 ===== */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card-pad { padding: 22px 26px; }
.card-title { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.card-sub { font-size: 13px; color: var(--text-3); margin: 0 0 18px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 17px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: .15s;
  font-family: inherit; line-height: 1.4; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(29,78,216,.25); }
.btn-primary:hover { background: var(--primary-700); }
.btn-primary .en { color: rgba(255,255,255,.82); }
.admin-side a.active .en { color: rgba(255,255,255,.85); }
.btn-outline { background: #fff; color: var(--text-2); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #f1f5f9; color: var(--text); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }

/* ===== 表单 ===== */
.field { margin-bottom: 18px; }
label.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
label.lbl .req { color: var(--danger); margin-left: 2px; }
label.lbl .en { font-weight: 400; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border-strong);
  border-radius: 10px; font-size: 14px; font-family: inherit; color: var(--text);
  background: #fff; transition: .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .14);
}
textarea { resize: vertical; min-height: 96px; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.hint.warn { color: var(--warning); background: #fffbeb; border: 1px solid #fde68a; border-radius: 7px; padding: 7px 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td {
  padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data th + th, table.data td + td { border-left: 1px solid var(--border); }
table.data th {
  background: linear-gradient(180deg, #2563eb, #1d4ed8); color: #fff;
  font-weight: 600; white-space: nowrap; position: sticky; top: 0; z-index: 1;
  border-bottom: 1px solid #1e40af;
}
table.data th .th-cn { font-size: 13px; font-weight: 600; }
table.data th .th-en { font-size: 11px; font-weight: 400; color: rgba(255,255,255,.82); }
table.data tbody tr:nth-child(even) { background: #f6f8fc; }
table.data tbody tr:hover { background: #e8f0ff; }
table.data td.num { color: var(--text-3); text-align: center; width: 48px; }
table.data td .muted, .sub { color: var(--text-3); font-size: 12px; }
table.data td .mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; }

/* ===== 通讯录分组 ===== */
.dir-group { margin-bottom: 26px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.dir-group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px; background: linear-gradient(90deg, var(--primary-900), var(--primary-700));
  color: #fff; font-weight: 600; font-size: 16px; letter-spacing: .2px;
}
.dir-group-head .count { margin-left: auto; font-size: 12px; font-weight: 400; opacity: .92; }
.dir-group-head .unit-tag { font-size: 12px; font-weight: 500; background: rgba(255,255,255,.2); padding: 2px 10px; border-radius: 999px; }
.dir-body { background: #fff; border: 1px solid var(--border); border-top: none; }

/* ===== 工具栏 ===== */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.toolbar .search { flex: 1 1 300px; max-width: 440px; position: relative; }
.toolbar .search input { padding-left: 40px; }
.toolbar .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.toolbar select { width: auto; min-width: 180px; }

/* ===== 徽章 / 标签 ===== */
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag.pending { background: #fef3c7; color: #92400e; }
.tag.approved { background: #dcfce7; color: #166534; }
.tag.rejected { background: #fee2e2; color: #991b1b; }

/* ===== 提示 ===== */
.alert { padding: 13px 17px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.toast {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%);
  z-index: 999; padding: 13px 22px; border-radius: 11px; color: #fff;
  font-size: 14px; box-shadow: var(--shadow-lg); display: none; max-width: 90vw;
}
.toast.show { display: block; animation: fadein .2s ease; }
.toast.ok { background: var(--success); }
.toast.err { background: var(--danger); }
@keyframes fadein { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===== 管理后台布局 ===== */
.admin-shell { display: grid; grid-template-columns: 250px 1fr; gap: 24px; align-items: start; }
.admin-side { position: sticky; top: 92px; }
.admin-side .card { padding: 12px; }
.admin-side .side-head { font-size: 12px; color: var(--text-3); padding: 8px 12px 4px; letter-spacing: 1px; }
.admin-side a {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  border-radius: 9px; color: var(--text-2); font-weight: 500; font-size: 14px; margin-bottom: 2px;
}
.admin-side a:hover { background: #f1f5f9; color: var(--text); }
.admin-side a.active { background: var(--primary); color: #fff; box-shadow: 0 4px 10px rgba(29,78,216,.22); }
.admin-main .panel { display: none; }
.admin-main .panel.active { display: block; }
.admin-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-head h2 { margin: 0 auto 0 0; font-size: 21px; }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } .admin-side { position: static; } }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 200;
  display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 580px;
  box-shadow: var(--shadow-lg); padding: 26px 28px; animation: modal .18s ease;
}
.modal.wide { max-width: 780px; }
.modal h3 { margin: 0 0 20px; font-size: 19px; }
.modal .modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
@keyframes modal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== 页脚 ===== */
.footer { border-top: 1px solid var(--border); padding: 28px; text-align: center; color: var(--text-3); font-size: 13px; background: #fff; }
.footer .en { display: block; font-size: 11px; margin-top: 3px; }

.empty { text-align: center; color: var(--text-3); padding: 44px 20px; }

/* 移动端导航 */
.menu-toggle { display: none; margin-left: auto; background: none; border: none; font-size: 24px; color: var(--text); cursor: pointer; }
@media (max-width: 760px) {
  .menu-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 12px; border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
}
