/* ==========================================================
   匠心教务 · 设计系统基础层
   ========================================================== */
:root {
  --ink: #0B1524;
  --ink-2: #12233A;
  --ink-3: #1B314C;
  --paper: #F3F1EA;
  --paper-2: #ECE9E0;
  --surface: #FFFFFF;
  --surface-2: #FAF9F5;
  --gold: #C39A4E;
  --gold-deep: #A87F36;
  --gold-soft: #F3E7CC;
  --teal: #2C7F72;
  --teal-soft: #E1F0EC;
  --blue: #3D6EA8;
  --blue-soft: #E7EFF8;
  --rust: #B4553F;
  --rust-soft: #F8E9E4;
  --amber: #B4832F;
  --amber-soft: #FBF1DC;
  --green: #3F7F5B;
  --green-soft: #E6F2EA;
  --line: #E3DED2;
  --line-strong: #D2CBBA;
  --text: #1B2330;
  --text-2: #4F5966;
  --muted: #858A90;
  --muted-2: #A9ADA9;
  --danger: #B33E36;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-1: 0 1px 2px rgba(20, 26, 38, .04), 0 8px 24px -18px rgba(20, 26, 38, .28);
  --shadow-2: 0 2px 4px rgba(20, 26, 38, .05), 0 24px 60px -32px rgba(15, 25, 40, .35);
  --shadow-pop: 0 30px 80px -20px rgba(8, 16, 28, .45), 0 2px 6px rgba(8, 16, 28, .08);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-num: "Bodoni MT", "Didot", "Times New Roman", Georgia, serif;
  --sidebar-w: 254px;
  --topbar-h: 68px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, p { margin: 0; }
img, svg { display: block; }
::selection { background: rgba(195, 154, 78, .25); }

.ic { width: 18px; height: 18px; flex: none; stroke-width: 1.8; }
.ic.sm { width: 15px; height: 15px; }
.ic.lg { width: 22px; height: 22px; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #CDC6B6; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #B9B1A0; background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 通用文本 ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-deep); font-weight: 700;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; letter-spacing: -.2px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.text-danger { color: var(--danger); }
.text-gold { color: var(--gold-deep); }
.text-teal { color: var(--teal); }
.nowrap { white-space: nowrap; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .01em;
  border: 1px solid transparent; transition: all .22s var(--ease);
  white-space: nowrap; position: relative;
}
.btn .ic { width: 16px; height: 16px; }
.btn-ink { background: var(--ink); color: #F6F1E4; box-shadow: 0 6px 16px -10px rgba(11, 21, 36, .8); }
.btn-ink:hover { background: var(--ink-3); transform: translateY(-1px); box-shadow: 0 12px 24px -14px rgba(11, 21, 36, .8); }
.btn-gold { background: linear-gradient(135deg, #D3AF66, #B98C3F); color: #201709; box-shadow: 0 8px 18px -12px rgba(180, 140, 63, .9); }
.btn-gold:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--ink); }
.btn-soft { background: var(--gold-soft); color: #6E5320; }
.btn-soft:hover { background: #EEDCB9; }
.btn-danger { background: var(--rust-soft); color: var(--danger); }
.btn-danger:hover { background: #F2DBD5; }
.btn-sm { height: 31px; padding: 0 12px; font-size: 12.5px; border-radius: 7px; }
.btn-sm .ic { width: 14px; height: 14px; }
.btn-xs { height: 27px; padding: 0 10px; font-size: 12px; border-radius: 6px; gap: 5px; }
.btn-xs .ic { width: 13px; height: 13px; }
.btn-lg { height: 44px; padding: 0 24px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-link { color: var(--blue); font-weight: 600; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); border: 1px solid transparent; position: relative; transition: all .2s var(--ease);
}
.icon-btn:hover { background: rgba(20, 30, 45, .06); color: var(--ink); }
.icon-btn.ghost { border-color: rgba(255, 255, 255, .12); color: #C9CFD8; }
.icon-btn.ghost:hover { background: rgba(255, 255, 255, .08); }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: #EEECE5; color: #5E645F;
}
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-success { background: var(--green-soft); color: var(--green); }
.badge-warning { background: var(--amber-soft); color: var(--amber); }
.badge-danger { background: var(--rust-soft); color: var(--danger); }
.badge-info { background: var(--blue-soft); color: var(--blue); }
.badge-muted { background: #EFEDE6; color: #7D817B; }
.badge-gold { background: var(--gold-soft); color: var(--gold-deep); }

.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px;
  font-size: 11px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
}
.tag.solid { background: var(--ink); color: #EDE7D8; border-color: var(--ink); }
.tag.gold { background: var(--gold-soft); border-color: #E7D3A9; color: #7A5A1E; }
.tag.teal { background: var(--teal-soft); border-color: #CBE4DD; color: var(--teal); }
.tag.blue { background: var(--blue-soft); border-color: #D3E2F3; color: var(--blue); }
.tag.rust { background: var(--rust-soft); border-color: #EFD5CE; color: var(--rust); }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item { display: flex; flex-direction: column; gap: 7px; }
.form-item > label, .form-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.form-label .req { color: var(--rust); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line); background: #FDFCF9; color: var(--text);
  transition: border-color .2s, box-shadow .2s, background .2s; outline: none;
}
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.65; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold); background: #fff; box-shadow: 0 0 0 3px rgba(195, 154, 78, .13);
}
.input::placeholder, .textarea::placeholder { color: #A9ABA6; }
.select { appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23858A90' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.input-group { display: flex; align-items: center; gap: 8px; }
.hint { font-size: 11.5px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check i { width: 15px; height: 15px; border-radius: 4px; border: 1px solid var(--line-strong); background: #fff; position: relative; transition: all .18s; }
.check input:checked + i { background: var(--ink); border-color: var(--ink); }
.check input:checked + i::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #F0D9A8; border-width: 0 2px 2px 0; transform: rotate(42deg); }

/* 开关 */
.switch { position: relative; display: inline-flex; width: 38px; height: 21px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 100%; height: 100%; border-radius: 20px; background: #D8D3C6; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; background: #fff; border-radius: 50%; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--teal); }
.switch input:checked + i::after { transform: translateX(17px); }

/* 筛选工具条 */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.toolbar .input, .toolbar .select { height: 34px; font-size: 12.5px; }
.toolbar .select { min-width: 120px; width: auto; }
.search-box { position: relative; min-width: 220px; }
.search-box .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.search-box .input { padding-left: 33px; background: #FDFCF9; }
.seg { display: inline-flex; padding: 3px; background: #EDEAE1; border-radius: 8px; gap: 2px; }
.seg a, .seg button { height: 27px; padding: 0 12px; border-radius: 6px; font-size: 12.5px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.seg a.on, .seg button.on { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(30,35,40,.12); }

/* 头像 */
.avatar {
  --h: 210; width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: hsl(var(--h) 42% 27%);
  background: linear-gradient(145deg, hsl(var(--h) 46% 89%), hsl(var(--h) 38% 80%));
  border: 1px solid hsl(var(--h) 35% 78%);
}
.avatar.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
.avatar.lg { width: 44px; height: 44px; border-radius: 12px; font-size: 16px; }
.avatar.xl { width: 58px; height: 58px; border-radius: 16px; font-size: 20px; }

/* 工具类 */
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.hr-gold { height: 1px; background: linear-gradient(90deg, var(--gold), transparent); border: 0; }
.scroll-y { overflow-y: auto; }
.hidden { display: none !important; }
.skeleton { background: linear-gradient(90deg, #EFEDE6 25%, #F7F5F0 37%, #EFEDE6 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
