/* ============ 学搭子运营中台 · 设计系统 ============ */
:root {
  --bg: #f5f3ef;
  --panel: #ffffff;
  --ink: #14161b;
  --ink2: #454b57;
  --muted: #8b909b;
  --line: rgba(20, 22, 27, 0.09);
  --line2: rgba(20, 22, 27, 0.14);
  --brand: #ff5a1f;
  --brand-d: #e14a12;
  --brand-l: #fff1ea;
  --nav: #14161b;
  --nav2: #1d2129;
  --green: #0f9d58;
  --green-l: #e8f6ee;
  --blue: #2563eb;
  --blue-l: #eaf0ff;
  --purple: #7c3aed;
  --purple-l: #f2ecff;
  --amber: #b45309;
  --amber-l: #fdf3e3;
  --red: #dc2626;
  --red-l: #fdecec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 22, 27, 0.05), 0 8px 24px rgba(20, 22, 27, 0.05);
  --shadow-lg: 0 20px 50px rgba(20, 22, 27, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}
.login-side {
  position: relative;
  background:
    radial-gradient(900px 520px at 12% 8%, rgba(255, 90, 31, 0.26), transparent 62%),
    radial-gradient(700px 480px at 88% 92%, rgba(124, 58, 237, 0.22), transparent 58%),
    linear-gradient(160deg, #101216 0%, #1b1f28 52%, #14161b 100%);
  color: #fff;
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.login-side::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70% 60% at 40% 40%, #000 30%, transparent 100%);
  pointer-events: none;
}
.brand-row { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.brand-logo { width: 46px; height: 46px; border-radius: 13px; object-fit: contain; box-shadow: 0 10px 24px rgba(255, 90, 31, 0.35); }
.brand-txt b { display: block; font-size: 19px; letter-spacing: 0.5px; }
.brand-txt span { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.5); margin-top: 3px; letter-spacing: 2px; }

.login-hero { position: relative; z-index: 1; }
.login-hero h1 {
  font-size: 40px;
  line-height: 1.24;
  margin: 0 0 18px;
  letter-spacing: -1px;
  font-weight: 800;
}
.login-hero h1 em { font-style: normal; color: #ffb08a; }
.login-hero p { margin: 0; color: rgba(255, 255, 255, 0.62); font-size: 14.5px; line-height: 1.9; max-width: 430px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero-chips span {
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.78);
}
.login-foot { position: relative; z-index: 1; font-size: 12px; color: rgba(255, 255, 255, 0.34); letter-spacing: 0.3px; }

.login-main { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.login-card {
  width: 100%;
  max-width: 396px;
  background: var(--panel);
  border-radius: 22px;
  padding: 40px 36px 34px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.7);
}
.login-card h2 { margin: 0 0 6px; font-size: 23px; letter-spacing: -0.4px; }
.login-card .sub { margin: 0 0 26px; color: var(--muted); font-size: 13px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--ink2); margin-bottom: 7px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1.5px solid var(--line2);
  background: #fbfaf8;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: 0.16s;
}
.field textarea { height: auto; padding: 11px 14px; resize: vertical; min-height: 84px; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.12);
}
.row-between { display: flex; align-items: center; justify-content: space-between; }
.check { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink2); cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--brand); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 18px;
  border-radius: 11px;
  border: 1.5px solid transparent;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.16s;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-d); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; height: 48px; font-size: 15px; margin-top: 6px; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line2); }
.btn-ghost:hover { background: #faf8f5; color: var(--ink); }
.btn-dark { background: var(--ink); }
.btn-dark:hover { background: #24282f; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #b91c1c; }
.btn-link { background: none; border: none; color: var(--brand); font-size: 13px; cursor: pointer; padding: 0; height: auto; }
.btn-link:hover { text-decoration: underline; background: none; transform: none; }

.alert {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 16px;
  display: none;
}
.alert.on { display: block; }
.alert-err { background: var(--red-l); color: #a51b1b; }
.alert-ok { background: var(--green-l); color: #0a6b3d; }
.alert-info { background: var(--blue-l); color: #1e40af; }

/* ---------- 主框架 ---------- */
.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }

.side {
  background: var(--nav);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.side::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 260px at 10% 0%, rgba(255, 90, 31, 0.16), transparent 70%);
  pointer-events: none;
}
.side-top {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 18px;
  position: relative;
  z-index: 1;
}
.side-top img { width: 34px; height: 34px; border-radius: 10px; object-fit: contain; }
.side-top b { font-size: 14.5px; letter-spacing: 0.3px; display: block; }
.side-top span { font-size: 10.5px; color: rgba(255, 255, 255, 0.4); letter-spacing: 1.6px; }

.nav { padding: 6px 10px; flex: 1; overflow-y: auto; position: relative; z-index: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13.5px;
  cursor: pointer;
  transition: 0.14s;
  margin-bottom: 3px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.on { background: rgba(255, 90, 31, 0.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 90, 31, 0.3); }
.nav-item.on svg { color: #ff8a5c; }
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: 0.9; }
.nav-sep { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 10px 12px; }

.side-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); position: relative; z-index: 1; }
.me-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.me-avatar {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(140deg, #ff8a4d, var(--brand));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex: 0 0 auto;
}
.me-info b { display: block; font-size: 13px; font-weight: 600; }
.me-info span { display: block; font-size: 11px; color: rgba(255, 255, 255, 0.42); margin-top: 2px; }
.me-actions { display: flex; gap: 6px; margin-top: 8px; }
.me-actions button {
  flex: 1; height: 30px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04); color: rgba(255, 255, 255, 0.72);
  font-size: 12px; cursor: pointer; transition: 0.14s;
}
.me-actions button:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 243, 239, 0.86);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { font-size: 18px; margin: 0; letter-spacing: -0.2px; font-weight: 700; }
.topbar .tb-right { display: flex; align-items: center; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  font-size: 12px; border: 1px solid var(--line2); background: #fff; color: var(--ink2);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.pill.ok .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(15, 157, 88, 0.16); }
.pill.warn .dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.14); }

.content { padding: 26px 30px 60px; flex: 1; }
.page { display: none; }
.page.on { display: block; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 卡片 / 网格 ---------- */
.card {
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.card-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 17px 20px; border-bottom: 1px solid var(--line);
}
.card-h h2 { margin: 0; font-size: 14.5px; font-weight: 700; letter-spacing: -0.1px; }
.card-h .hint { font-size: 12px; color: var(--muted); }
.card-b { padding: 18px 20px; }
.card-b.tight { padding: 0; }

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

.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .k-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .k-val { font-size: 29px; font-weight: 800; letter-spacing: -1px; margin: 8px 0 2px; line-height: 1.1; }
.kpi .k-val small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi .k-sub { font-size: 12px; color: var(--muted); }
.kpi .k-icon {
  position: absolute; right: 16px; top: 16px;
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-l); color: var(--brand);
}
.kpi.alt .k-icon { background: var(--blue-l); color: var(--blue); }
.kpi.alt2 .k-icon { background: var(--purple-l); color: var(--purple); }
.kpi.alt3 .k-icon { background: var(--green-l); color: var(--green); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--muted);
  padding: 11px 16px; border-bottom: 1px solid var(--line); background: #fbfaf8;
  white-space: nowrap; position: sticky; top: 0;
}
table.tb td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tb tr:last-child td { border-bottom: none; }
table.tb tbody tr:hover { background: #fcfbf9; }
table.tb .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty .big { font-size: 30px; margin-bottom: 10px; opacity: 0.35; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 9px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.tag.gray { background: #f1efec; color: #6b7280; }
.tag.green { background: var(--green-l); color: var(--green); }
.tag.blue { background: var(--blue-l); color: var(--blue); }
.tag.amber { background: var(--amber-l); color: var(--amber); }
.tag.red { background: var(--red-l); color: var(--red); }
.tag.purple { background: var(--purple-l); color: var(--purple); }
.tag.brand { background: var(--brand-l); color: var(--brand-d); }

/* ---------- 工具条 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px; border-radius: 10px;
  background: #fff; border: 1.5px solid var(--line2); min-width: 230px;
}
.search input { border: none; outline: none; background: none; font-size: 13.5px; width: 100%; color: var(--ink); }
.search svg { width: 15px; height: 15px; color: var(--muted); flex: 0 0 auto; }
select.sel {
  height: 38px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line2);
  background: #fff; font-size: 13.5px; color: var(--ink); outline: none; cursor: pointer;
}

/* ---------- 柱状图 ---------- */
.bars { display: flex; align-items: flex-end; gap: 12px; height: 150px; padding: 10px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%; max-width: 42px; border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #ff8a5c, var(--brand));
  min-height: 3px; transition: 0.4s cubic-bezier(0.2, 0.8, 0.3, 1);
  position: relative;
}
.bar.zero { background: #e8e4de; }
.bar-col .bl { font-size: 11px; color: var(--muted); }
.bar-col .bv { font-size: 11px; color: var(--ink2); font-weight: 600; }

/* ---------- 列表 ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 11px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: none; }
.feed-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex: 0 0 auto; }
.feed-dot.gray { background: #cfcac3; }
.feed-dot.red { background: var(--red); }
.feed-dot.green { background: var(--green); }
.feed-body { min-width: 0; }
.feed-body b { font-size: 13px; font-weight: 600; display: block; }
.feed-body span { font-size: 12px; color: var(--muted); display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-time { font-size: 11.5px; color: var(--muted); margin-left: auto; flex: 0 0 auto; padding-top: 2px; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.pager .pages { display: flex; gap: 6px; }
.pager button {
  height: 30px; min-width: 30px; padding: 0 9px; border-radius: 8px;
  border: 1px solid var(--line2); background: #fff; color: var(--ink2); cursor: pointer; font-size: 12.5px;
}
.pager button:hover:not([disabled]) { border-color: var(--brand); color: var(--brand); }
.pager button[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 18, 22, 0.5);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-mask.on { display: flex; }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 460px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 0.18s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
.modal-h { padding: 20px 24px 0; }
.modal-h h3 { margin: 0 0 5px; font-size: 17px; }
.modal-h p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.modal-b { padding: 18px 24px; }
.modal-f { padding: 0 24px 22px; display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- 提示条 ---------- */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 11px 18px; border-radius: 11px; font-size: 13px; font-weight: 500;
  background: var(--ink); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  animation: drop 0.2s ease;
}
.toast.err { background: #b91c1c; }
.toast.ok { background: #0a7a45; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 角色卡 ---------- */
.role-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.role-card {
  border: 1.5px solid var(--line2); border-radius: 12px; padding: 14px;
  cursor: pointer; transition: 0.14s; background: #fff;
}
.role-card:hover { border-color: #cfcac3; }
.role-card.on { border-color: var(--brand); background: var(--brand-l); box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.1); }
.role-card b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.role-card span { font-size: 11.5px; color: var(--muted); line-height: 1.5; display: block; }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); word-break: break-all; }

.hr { height: 1px; background: var(--line); margin: 18px 0; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g21 { grid-template-columns: 1fr; }
  .role-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: -220px; z-index: 60; transition: 0.2s; }
  .side.open { left: 0; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .content { padding: 18px 16px 50px; }
}

/* ---------- 题库：粘贴解析预览 ---------- */
.modal.modal-lg { max-width: 920px; }
.modal-lg .modal-b { padding-top: 16px; }
.hint-row { font-size: 12px; color: var(--muted); margin-top: -6px; }
.parse-sum {
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center;
  padding: 11px 14px; border-radius: 11px; background: #faf8f5;
  border: 1px solid var(--line); font-size: 12.5px; color: var(--ink2);
}
.parse-sum b { font-size: 15px; color: var(--ink); }
.warn-box {
  margin-top: 10px; padding: 11px 14px; border-radius: 11px;
  background: var(--amber-l); border: 1px solid rgba(180, 83, 9, 0.16);
  font-size: 12.5px; color: var(--amber);
}
.warn-box b { display: block; margin-bottom: 4px; }
.warn-box ul { margin: 0; padding-left: 18px; line-height: 1.75; }
.ok-box {
  margin-top: 10px; padding: 11px 14px; border-radius: 11px;
  background: var(--green-l); border: 1px solid rgba(15, 157, 88, 0.16);
  font-size: 12.5px; color: var(--green); font-weight: 600;
}
.opt-line { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.7; }
