/* 安置帮教数字管理平台 · 政务风格 */
:root {
  --primary: #0E479E;
  --primary-dark: #0A3677;
  --primary-light: #1B5FC1;
  --primary-50: #EAF1FC;
  --bg: #F2F5FA;
  --card: #FFFFFF;
  --text: #1F2D3D;
  --muted: #7A8699;
  --line: #E3E9F2;
  --danger: #D93F3F;
  --danger-bg: #FDECEC;
  --warn: #D98E1F;
  --warn-bg: #FDF4E5;
  --ok: #2E9E6B;
  --ok-bg: #E9F7F0;
  --shadow: 0 2px 10px rgba(16, 54, 110, 0.06);
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 224px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0E479E 0%, #0A3677 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.sidebar .brand .shield {
  width: 34px; height: 38px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 6px 6px 16px 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.sidebar .brand h1 { font-size: 15px; font-weight: 600; line-height: 1.35; }
.sidebar .brand h1 span { display: block; font-size: 11px; color: rgba(255,255,255,.62); font-weight: 400; margin-top: 2px; }

.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav .group-title {
  font-size: 11px; color: rgba(255,255,255,.45);
  padding: 10px 10px 6px; letter-spacing: 1px;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: rgba(255,255,255,.82);
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: background .15s;
}
.nav a .ico { width: 18px; text-align: center; font-size: 15px; opacity: .9; }
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }

.sidebar .foot {
  padding: 14px 18px;
  font-size: 11px;
  color: rgba(255,255,255,.45);
  border-top: 1px solid rgba(255,255,255,.1);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .crumbs { color: var(--muted); font-size: 13px; }
.topbar .crumbs b { color: var(--text); font-weight: 600; }
.topbar .right { display: flex; align-items: center; gap: 16px; }
.topbar .right .user { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.topbar .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-50); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.tag-role {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: var(--primary-50); color: var(--primary);
}

.content { padding: 22px 24px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.page-head h2 { font-size: 20px; font-weight: 600; }
.page-head p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #EDF1F7;
}
.card .card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.card .card-head h3 { font-size: 15px; font-weight: 600; }
.card .card-body { padding: 18px; }

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

.stat {
  background: #fff; border-radius: var(--radius); padding: 18px;
  border: 1px solid #EDF1F7; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -20px; top: -20px;
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--primary-50); opacity: .7;
}
.stat .label { font-size: 13px; color: var(--muted); }
.stat .num { font-size: 28px; font-weight: 700; color: var(--primary); margin: 8px 0 4px; }
.stat .sub { font-size: 12px; color: var(--muted); }
.stat.warn .num { color: var(--warn); }
.stat.danger .num { color: var(--danger); }
.stat.ok .num { color: var(--ok); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12.5px; color: var(--muted);
  font-weight: 500; padding: 11px 14px; background: #F7FAFE;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td {
  padding: 12px 14px; border-bottom: 1px solid #F1F4F9;
  font-size: 13px; vertical-align: middle;
}
.table tbody tr:hover { background: #FAFCFF; }
.table .center { text-align: center; }
.table .ops a { color: var(--primary); margin-right: 10px; font-size: 12.5px; }
.table .ops a.danger { color: var(--danger); }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 10px;
  font-size: 12px; line-height: 18px; white-space: nowrap;
}
.tag-high { background: var(--danger-bg); color: var(--danger); }
.tag-mid { background: var(--warn-bg); color: var(--warn); }
.tag-low { background: var(--ok-bg); color: var(--ok); }
.tag-blue { background: var(--primary-50); color: var(--primary); }
.tag-gray { background: #EEF1F6; color: var(--muted); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 8px 14px; border-radius: 8px; font-size: 13px;
  transition: all .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.btn-primary:hover { background: var(--primary-light); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: #F3C9C9; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ---------- 筛选栏 ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.filter-bar label { font-size: 13px; color: var(--muted); }
.filter-bar input, .filter-bar select {
  height: 32px; border: 1px solid var(--line); border-radius: 6px;
  padding: 0 10px; outline: none; background: #fff; min-width: 140px;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary); }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; height: 36px; border: 1px solid var(--line);
  border-radius: 7px; padding: 0 10px; outline: none; background: #fff;
}
.field textarea { height: 90px; padding: 8px 10px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }

/* ---------- 弹窗 ---------- */
dialog.modal {
  border: none; border-radius: 12px; padding: 0;
  width: 640px; max-width: 92vw;
  box-shadow: 0 18px 60px rgba(10, 40, 90, .25);
}
dialog.modal::backdrop { background: rgba(15, 35, 70, .35); }
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 16px; }
.modal-head button { border: none; background: none; font-size: 20px; color: var(--muted); }
.modal-body { padding: 18px 20px; max-height: 64vh; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 登录页 ---------- */
body.login-page {
  background: radial-gradient(circle at 20% 10%, #123f86 0%, #0A2A5C 45%, #061B3D 100%);
  min-height: 100vh;
}
.login-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 46px 46px;
}
.login-copyright {
  margin-top: 18px; font-size: 12px; color: rgba(255,255,255,.4);
}

/* 品牌卖点 */
.brand-points { list-style: none; margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.brand-points li { font-size: 13px; color: rgba(255,255,255,.82); display: flex; align-items: center; gap: 9px; }
.brand-points i {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.16); color: #fff; font-style: normal;
  font-size: 11px; display: flex; align-items: center; justify-content: center;
}

/* 登录/注册主选项卡 */
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.auth-tabs button {
  flex: 1; border: none; background: none; padding: 11px 4px;
  font-size: 15px; color: var(--muted); border-bottom: 2px solid transparent;
}
.auth-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 身份切换 */
.role-switch { display: flex; background: #F2F5FA; border-radius: 8px; padding: 3px; margin-bottom: 16px; }
.role-switch button {
  flex: 1; border: none; background: transparent; padding: 7px;
  border-radius: 6px; font-size: 13px; color: var(--muted);
}
.role-switch button.active {
  background: #fff; color: var(--primary); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* 错误提示 */
.form-error {
  display: none; background: var(--danger-bg); color: var(--danger);
  border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px;
}
.form-error.show { display: block; }

/* 记住账号 / 忘记密码 */
.check-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 2px 0 16px; font-size: 13px; color: var(--muted);
}
.check-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.check-row input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--primary); }
.auth-link { color: var(--primary); cursor: pointer; }
.auth-link:hover { text-decoration: underline; }

.login-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }

.login-card {
  width: 940px; max-width: 100%;
  background: #fff; border-radius: 16px; overflow: hidden;
  display: grid; grid-template-columns: 1.05fr .95fr;
  box-shadow: 0 30px 80px rgba(0, 10, 30, .45);
}
.login-left {
  background: linear-gradient(150deg, #0E479E, #08306C);
  color: #fff; padding: 48px 42px; position: relative;
}
.login-left .shield-big {
  width: 64px; height: 72px; border-radius: 10px 10px 32px 32px;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; margin-bottom: 26px;
}
.login-left h1 { font-size: 26px; line-height: 1.45; font-weight: 700; }
.login-left p { margin-top: 14px; color: rgba(255,255,255,.72); line-height: 1.9; font-size: 13.5px; }
.login-left .badge {
  position: absolute; bottom: 34px; left: 42px; right: 42px;
  font-size: 12px; color: rgba(255,255,255,.5);
  border-top: 1px solid rgba(255,255,255,.15); padding-top: 14px;
}
.login-right { padding: 46px 44px 40px; }
.login-right h2 { font-size: 20px; margin-bottom: 6px; }
.login-right .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-tabs { display: flex; gap: 8px; margin-bottom: 22px; background: #F2F5FA; padding: 4px; border-radius: 9px; }
.login-tabs button {
  flex: 1; border: none; background: transparent; padding: 9px;
  border-radius: 7px; font-size: 13.5px; color: var(--muted);
}
.login-tabs button.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.login-right .field { margin-bottom: 16px; }
.login-right .field label { color: #5B6B84; }
.login-right .field input { height: 42px; }
.captcha-row { display: flex; gap: 10px; }
.captcha-row input { flex: 1; }
.captcha-box {
  width: 108px; height: 42px; border-radius: 7px; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  background: #F3F7FF; color: var(--primary); font-weight: 700;
  letter-spacing: 4px; font-size: 18px; user-select: none; cursor: pointer;
}
.login-submit { width: 100%; height: 44px; justify-content: center; font-size: 15px; margin-top: 6px; }
.login-tip { margin-top: 16px; font-size: 12px; color: var(--muted); line-height: 1.8; }

/* ---------- 方案页 ---------- */
.plan-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.info-list { display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.info-list .row { display: flex; }
.info-list .k { width: 76px; color: var(--muted); flex-shrink: 0; }
.info-list .v { flex: 1; }
.plan-paper {
  background: #FCFDFF; border: 1px solid var(--line); border-radius: 8px;
  padding: 18px 20px; font-size: 13.5px; line-height: 2;
  max-height: 560px; overflow-y: auto;
}
.plan-paper h4 { color: var(--primary); font-size: 14px; margin: 14px 0 4px; }
.plan-paper h4:first-child { margin-top: 0; }
.plan-paper p { color: #3B4A5F; }
.ai-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--primary); background: var(--primary-50); padding: 4px 10px; border-radius: 12px; }
.match-box { border: 1px dashed #C9D8EF; background: #F7FAFF; border-radius: 8px; padding: 14px; font-size: 13px; margin-top: 10px; }
.match-box .line { margin: 4px 0; color: #40526B; }

/* ---------- 时间线 ---------- */
.steps { display: flex; gap: 0; margin: 6px 0 18px; }
.steps .step { flex: 1; text-align: center; position: relative; font-size: 12.5px; color: var(--muted); }
.steps .step::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.steps .step:first-child::before { display: none; }
.steps .dot { width: 26px; height: 26px; border-radius: 50%; background: #EAF0F8; color: var(--muted); display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; font-weight: 600; position: relative; z-index: 1; }
.steps .step.done .dot { background: var(--ok); color: #fff; }
.steps .step.now .dot { background: var(--primary); color: #fff; }
.steps .step.now { color: var(--primary); font-weight: 600; }
.steps .step.warn-step .dot { background: var(--danger); color: #fff; }

/* ---------- 其它 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 18px; }
.tabs button {
  border: none; background: none; padding: 13px 16px; font-size: 14px;
  color: var(--muted); border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 13px; }
.muted { color: var(--muted); }
.mb16 { margin-bottom: 16px; }
.mt16 { margin-top: 16px; }
.flex { display: flex; }
.between { justify-content: space-between; }
.items { align-items: center; }
.gap8 { gap: 8px; }
.gap12 { gap: 12px; }
.right { text-align: right; }
.small { font-size: 12px; }

.chart-box { position: relative; width: 100%; }
.chart-box canvas { display: block; width: 100%; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 6px; }

.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding: 14px 18px; font-size: 12.5px; color: var(--muted); }
.pagination button {
  min-width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--text);
}
.pagination button.active { background: var(--primary); border-color: var(--primary); color: #fff; }

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .login-card { grid-template-columns: 1fr; }
  .login-left { display: none; }
}
