/* ===== 黑马保研智能化系统 · 常青教务设计体系 =====
   世界：招生教务办公室的学籍档案 —— 纸面白、墨线细、常青绿印章色。
   色彩策略：Restrained（中性面 + 单一常青绿强调 + 语义状态色） */
:root {
  /* 纸面与墨色 */
  --bg: #f7f6f2;
  --card: #ffffff;
  --panel-2: #fbfaf7;          /* 第二中性层：顶栏 / 表头 / 内嵌块 */
  --ink: #1c2420;
  --ink-2: #5b6660;
  --ink-3: #8b948e;
  --line: #e7e5dc;
  --line-soft: #efece3;
  /* 常青绿强调 */
  --accent: #1e6b4a;
  --accent-deep: #155239;
  --accent-tint: #e9f3ee;
  --accent-line: #cfe0d7;
  /* 做旧金（品牌时刻） */
  --gold: #a8813c;
  --gold-tint: #f6f1e4;
  /* 语义状态 */
  --green: #1e7a46;  --green-bg: #e7f4ec;  --green-line: #c4e2cf;
  --orange: #b45309; --orange-bg: #fbf2e6; --orange-line: #ecd9bd;
  --red: #b3372e;    --red-bg: #fbeeed;    --red-line: #eecfcb;
  --amber: #92610c;  --amber-bg: #faf3e2;  --amber-line: #ead9b4;
  --blue: #2f5d82;   --blue-bg: #e9f1f6;   --blue-line: #cfe0eb;
  --grey: #6d7a72;   --grey-bg: #eef0ec;   --grey-line: #dcdedb;
  /* 形状与海拔（只声明一次） */
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(28, 36, 32, .04), 0 2px 10px rgba(28, 36, 32, .04);
  --ring: 0 0 0 3px rgba(30, 107, 74, .16);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  color: var(--ink); background: var(--bg); min-height: 100vh;
  font-size: 14px; line-height: 1.55;
  caret-color: var(--accent);
}
::selection { background: rgba(30, 107, 74, .18); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfcdc3; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #b3b1a6; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
a { text-underline-offset: 3px; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

/* ===== 顶部导航 ===== */
.layout { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 26px; min-height: 60px; flex-wrap: wrap; row-gap: 8px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.tb-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tb-logo {
  width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--accent);
  color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.tb-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.tb-brand-text b { font-size: 14px; letter-spacing: .3px; }
.tb-brand-text span { font-size: 11px; color: var(--ink-3); }
.tb-nav { display: flex; align-items: center; gap: 2px; flex: 1 1 460px; flex-wrap: wrap; }
.tb-nav a {
  padding: 6px 12px; border-radius: 8px; font-size: 12.5px; white-space: nowrap; cursor: pointer;
  color: var(--ink-2); text-decoration: none; transition: color .15s, background .15s;
}
.tb-nav a:hover { color: var(--accent-deep); background: var(--accent-tint); }
.tb-nav a.active { background: var(--accent); color: #fff; font-weight: 500; }
.tb-user { display: flex; align-items: center; gap: 8px; flex-shrink: 0; font-size: 13px; color: var(--ink-2); }
.tb-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent-deep);
  color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center;
}
.tb-user a { color: var(--ink-3); font-size: 12px; text-decoration: none; cursor: pointer; }
.tb-user a:hover { color: var(--red); }

.main { flex: 1; padding: 26px 30px 40px; max-width: 1480px; width: 100%; margin: 0 auto; }

/* ===== 页面标题 ===== */
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; letter-spacing: .2px; }
.page-sub { font-size: 13px; color: var(--ink-2); margin-bottom: 20px; }

/* ===== 卡片 / 面板 ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card, .panel {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.card { padding: 18px 20px; }
.panel { padding: 20px 22px; margin-bottom: 18px; }
.panel h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.card .label { font-size: 12px; color: var(--ink-2); margin-bottom: 8px; letter-spacing: .3px; }
.card .value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.card .value.up { color: var(--red); }
.card .hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

/* ===== 按钮 / 表单 ===== */
.btn {
  padding: 8px 18px; border: 1px solid var(--accent); border-radius: var(--radius-sm); font-size: 13px; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 500; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn:active { background: #12452f; border-color: #12452f; }
.btn.ghost { background: #fff; color: var(--accent-deep); border: 1px solid var(--accent-line); }
.btn.ghost:hover { background: var(--accent-tint); }
.btn.sm { padding: 4px 11px; font-size: 12px; }
.btn.danger { background: #fff; color: var(--red); border: 1px solid var(--red-line); }
.btn.danger:hover { background: var(--red-bg); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.toolbar .spacer { flex: 1; }
input, select, textarea {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px;
  background: #fff; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--panel-2); color: var(--ink-3); cursor: not-allowed; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 14px; margin-bottom: 12px; }
.form-grid label, .modal-fields label { font-size: 12px; color: var(--ink-2); display: block; margin-bottom: 5px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; }

/* ===== 表格 ===== */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { color: var(--ink-2); font-weight: 600; background: var(--panel-2); font-size: 12px; letter-spacing: .3px; border-bottom: 1px solid var(--line); }
tbody tr:hover td, tr:hover td { background: #f5f8f4; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tr.row-warn td { background: var(--amber-bg); }
td .ops { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { text-align: center; color: var(--ink-3); padding: 36px 0; font-size: 13px; }

/* ===== 状态徽标 ===== */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; border: 1px solid transparent; }
.badge.b-new { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-line); }
.badge.b-follow { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-line); }
.badge.b-invite { background: var(--orange-bg); color: var(--orange); border-color: var(--orange-line); }
.badge.b-deal { background: var(--green-bg); color: var(--green); border-color: var(--green-line); }
.badge.b-lost { background: var(--grey-bg); color: var(--grey); border-color: var(--grey-line); }
.badge.b-part { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-line); }
.badge.b-full { background: var(--green-bg); color: var(--green); border-color: var(--green-line); }
.badge.b-invoice { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-line); }
.badge.b-todo { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-line); }
.badge.b-done { background: var(--green-bg); color: var(--green); border-color: var(--green-line); }
.badge.b-cancel { background: var(--grey-bg); color: var(--grey); border-color: var(--grey-line); }
.badge.b-type { background: var(--accent-tint); color: var(--accent-deep); border-color: var(--accent-line); }

/* ===== 消息条 / 轻提示 ===== */
.msg { padding: 11px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; border: 1px solid; }
.msg.ok { background: var(--green-bg); border-color: var(--green-line); color: var(--green); }
.msg.err { background: var(--red-bg); border-color: var(--red-line); color: var(--red); }
#toast-root { position: fixed; top: 74px; right: 26px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 12px 18px; border-radius: var(--radius-sm); font-size: 13px; color: #fff; background: var(--ink);
  box-shadow: 0 6px 22px rgba(28, 36, 32, .22); animation: slidein .2s ease-out;
}
.toast.ok { background: var(--accent-deep); }
.toast.err { background: var(--red); }
@keyframes slidein { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; padding: 24px;
  background: rgba(23, 33, 28, .45);
  display: flex; align-items: center; justify-content: center;
}
.modal {
  width: 520px; max-width: 100%; max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: var(--radius); padding: 24px 26px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(21, 40, 31, .22);
}
.modal.wide { width: 720px; }
.modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.modal-fields { display: grid; gap: 13px; margin-bottom: 18px; }
.modal-fields input, .modal-fields select, .modal-fields textarea { width: 100%; margin-top: 5px; }
.modal-grid { grid-template-columns: 1fr 1fr; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.subhead { font-size: 13px; font-weight: 700; color: var(--ink); margin: 18px 0 8px; letter-spacing: .3px; }

/* ===== 报表 ===== */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button {
  padding: 7px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff;
  color: var(--ink-2); font-size: 13px; cursor: pointer; transition: all .15s;
}
.tabs button:hover { color: var(--accent-deep); border-color: var(--accent-line); }
.tabs button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.bar-track { background: var(--line-soft); border-radius: 999px; height: 8px; min-width: 80px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.chart { width: 100%; overflow-x: auto; }
.chart svg { display: block; margin: 0 auto; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }

/* ===== 登录页（品牌时刻：常青墨绿 + 做旧金） ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: stretch; background: #10281f; }
.login-brand {
  flex: 1.2; display: flex; flex-direction: column; justify-content: flex-end; padding: 60px 70px; color: #fff;
  background:
    radial-gradient(820px 520px at 18% 12%, rgba(30, 107, 74, .35), transparent 70%),
    radial-gradient(640px 420px at 85% 85%, rgba(168, 129, 60, .14), transparent 70%),
    #10281f;
}
.login-brand-inner { position: relative; z-index: 2; }
.login-kicker {
  display: inline-block; font-size: 12px; letter-spacing: 3px; font-weight: 600;
  border: 1px solid rgba(207, 224, 215, .4); border-radius: 999px; padding: 6px 16px; margin-bottom: 22px; width: fit-content;
  color: rgba(233, 243, 238, .92);
}
.login-brand h1 {
  font-family: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  font-size: clamp(28px, 2.9vw, 44px); font-weight: 700; letter-spacing: 2px; line-height: 1.3;
}
.login-brand p { font-size: 15px; letter-spacing: .5px; color: rgba(233, 243, 238, .82); margin-top: 14px; max-width: 520px; line-height: 1.9; }
.login-feats { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.login-feat { background: rgba(255, 255, 255, .07); border: 1px solid rgba(207, 224, 215, .25); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13px; }
.login-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.login-card {
  width: 400px; max-width: 100%; background: #fff;
  border-radius: var(--radius); padding: 38px 36px; box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.login-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-card-head .tb-logo { width: 42px; height: 42px; border-radius: var(--radius-sm); font-size: 18px; }
.login-card h2 { font-size: 19px; font-weight: 700; line-height: 1.3; }
.login-card .sub { font-size: 13px; color: var(--ink-2); margin-bottom: 26px; }
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.login-field input { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; background: var(--panel-2); }
.login-field input:focus { background: #fff; }
.login-btn { width: 100%; padding: 12px 0; font-size: 15px; margin-top: 6px; }
.login-foot { margin-top: 20px; font-size: 12px; color: var(--ink-3); background: var(--panel-2); border-radius: var(--radius-sm); padding: 12px 14px; line-height: 1.8; }
@media (max-width: 900px) { .login-brand { display: none; } .login-side { padding: 24px 20px; } }

/* ===== 详情卡 / 跟进时间线 ===== */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.detail-grid > div { background: var(--panel-2); border-radius: var(--radius-sm); padding: 10px 13px; border: 1px solid var(--line-soft); }
.detail-grid span { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 4px; }
.detail-grid b { font-size: 13px; }
.timeline { display: flex; flex-direction: column; gap: 0; max-height: 240px; overflow-y: auto; }
.tl-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.tl-item:last-child { border-bottom: none; }
.tl-time { color: var(--ink-3); font-size: 12px; white-space: nowrap; width: 118px; font-variant-numeric: tabular-nums; }
.tl-body { flex: 1; }
.tl-body b { color: var(--accent-deep); font-size: 12px; margin-right: 6px; }
.svc-book { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.svc-item { background: var(--panel-2); border-radius: var(--radius-sm); padding: 11px 14px; border: 1px solid var(--line-soft); }
.svc-item .nm { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.svc-item .amt { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.svc-item .amt b.low { color: var(--red); }
.progress { height: 6px; background: var(--line-soft); border-radius: 999px; margin-top: 7px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.progress i.full { background: var(--red); }
.muted { color: var(--ink-3); font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.link { color: var(--accent-deep); cursor: pointer; text-decoration: underline; }
.link:hover { color: var(--accent); }
.rate-box { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; background: var(--panel-2); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 14px; font-size: 13px; border: 1px solid var(--line-soft); }
.rate-box label { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.rate-box input { width: 90px; }

/* ===== 薪资规则 / 审批流程 ===== */
.formula { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-bottom: 12px; }
.fbox { background: var(--accent-tint); border: 1px solid var(--accent-line); border-radius: var(--radius-sm); padding: 12px 14px; }
.fbox b { display: block; font-size: 13px; margin-bottom: 6px; color: var(--accent-deep); }
.fbox span { font-size: 12px; color: var(--ink-2); line-height: 1.75; }
.flow-steps { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.flow-steps i { color: var(--ink-3); font-style: normal; }
.flow-steps > span { padding: 4px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.flow-steps > span.on { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
td input, td select { padding: 5px 9px; font-size: 12.5px; }
