/* 签课系统 Web · 基于 UIKit 设计令牌的布局补充 */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg, #f4f7fb);
  color: var(--txt, #162033);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
}
button, input, select, textarea { font-family: inherit; }
a { color: var(--blue, #2f6fed); text-decoration: none; }

/* ---------- 登录 ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(420px, .95fr);
}
.auth-brand {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 12% 20%, rgba(255,255,255,.16), transparent 28%),
    radial-gradient(circle at 82% 76%, rgba(255,255,255,.12), transparent 30%),
    linear-gradient(145deg, #0b2342 0%, #123d75 55%, #1b5fae 100%);
  display: flex;
  align-items: center;
  padding: 56px;
}
.auth-brand::after {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  right: -180px; bottom: -220px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  box-shadow: 0 0 0 46px rgba(255,255,255,.035), 0 0 0 92px rgba(255,255,255,.025);
}
.auth-brand-inner { position: relative; z-index: 1; max-width: 520px; }
.auth-brand-logo, .auth-card-logo {
  width: 58px; height: 58px;
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 800;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(8px);
}
.auth-brand h1 { font-size: 38px; line-height: 1.25; margin: 30px 0 16px; letter-spacing: .5px; }
.auth-brand p { color: rgba(255,255,255,.74); font-size: 15px; line-height: 1.9; margin: 0; }
.auth-brand ul { list-style: none; padding: 0; margin: 34px 0 0; display: grid; gap: 14px; }
.auth-brand li { color: rgba(255,255,255,.9); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.auth-brand li::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #7dd3fc; box-shadow: 0 0 0 4px rgba(125,211,252,.16);
}
.auth-brand-foot { margin-top: 54px; color: rgba(255,255,255,.45); font-size: 12px; letter-spacing: 1px; }
.auth-panel {
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 48px;
}
.auth-card { width: min(380px, 100%); }
.auth-card-logo {
  color: #fff;
  background: linear-gradient(145deg, var(--blue, #2f6fed), #174ea6);
  border: none;
  margin-bottom: 24px;
}
.auth-card h2 { margin: 0 0 8px; font-size: 28px; }
.auth-card-sub { color: var(--sub, #68758a); margin: 0 0 28px; }
.field-label { display: block; font-size: 13px; color: var(--sub, #68758a); margin: 16px 0 8px; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line, #dfe6f1);
  background: #fff;
  color: var(--txt, #162033);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.input, .select { height: 42px; padding: 0 13px; line-height: normal; }
.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7a90' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  text-overflow: ellipsis;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--blue, #2f6fed);
  box-shadow: 0 0 0 3px rgba(47,111,237,.12);
}
.textarea { min-height: 92px; resize: vertical; }
.auth-submit { width: 100%; margin-top: 22px; padding: 12px 16px; font-size: 14px; }
.auth-hint { margin-top: 18px; text-align: center; color: #93a0b4; font-size: 12px; }
.form-error { min-height: 20px; color: #d13b3b; font-size: 12px; margin-top: 10px; }

/* ---------- 应用骨架 ---------- */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.app-side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0c2340 0%, #0f315c 60%, #103a6d 100%);
  color: #fff;
  padding: 22px 14px 16px;
  z-index: 20;
}
.app-brand { display: flex; gap: 11px; align-items: center; padding: 0 8px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.app-brand-logo {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #4f9cff, #1f6fe0);
  font-weight: 800; font-size: 18px;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
.app-brand-text { display: grid; gap: 3px; min-width: 0; }
.app-brand-text strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-brand-text small { color: rgba(255,255,255,.5); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 授权提醒放在左上角 Logo + 名称处：Logo 角标 + 名称下方一行文案 */
.app-brand-logo-wrap { position: relative; flex: 0 0 auto; }
.brand-notice-dot { position: absolute; right: -3px; top: -3px; width: 11px; height: 11px; border-radius: 50%; background: #fbbf24; border: 2px solid #0f315c; box-shadow: 0 0 0 2px rgba(251,191,36,.28); }
.brand-notice-dot[data-level="error"] { background: #f87171; box-shadow: 0 0 0 2px rgba(248,113,113,.28); }
.app-brand.is-notice { cursor: pointer; }
.app-brand.is-notice .app-brand-text small { color: #fbbf24; }
.app-brand.is-notice[data-level="error"] .app-brand-text small { color: #fca5a5; }
.app-brand.is-notice:hover .app-brand-text small { text-decoration: underline; }
.app-nav { flex: 1; overflow-y: auto; padding: 14px 0; display: grid; align-content: start; gap: 3px; }
.app-nav-group { color: rgba(255,255,255,.38); font-size: 11px; letter-spacing: .12em; padding: 16px 12px 7px; }
.app-nav-item {
  border: 0; background: transparent; color: rgba(255,255,255,.74);
  text-align: left; padding: 10px 12px; border-radius: 9px;
  cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 10px;
  transition: background .16s, color .16s;
}
.app-nav-item::before {
  content: ""; width: 6px; height: 6px; border-radius: 2px;
  background: rgba(255,255,255,.26);
}
.app-nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-nav-item.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.app-nav-item.active::before { background: #7dd3fc; box-shadow: 0 0 0 4px rgba(125,211,252,.14); }
.app-side-foot { border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; display: grid; gap: 10px; }
.app-user { padding: 6px; display: flex; align-items: center; gap: 10px; cursor: pointer; border-radius: 10px; }
.app-user:hover { background: rgba(255,255,255,.07); }
.app-user-info { display: grid; gap: 3px; min-width: 0; }
.app-user strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-user small { color: rgba(255,255,255,.5); font-size: 11px; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  height: 76px; flex: 0 0 auto;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line, #e4ebf5);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 10;
}
.app-topbar-title { display: flex; align-items: center; gap: 12px; }
.app-topbar h2 { margin: 0; font-size: 20px; }
.app-topbar p { margin: 5px 0 0; color: var(--sub, #748196); font-size: 12px; }
.app-top-actions { display: flex; align-items: center; gap: 10px; }
.app-menu-btn { display: none; }
.app-content { padding: 24px 28px 42px; max-width: 1560px; width: 100%; margin: 0 auto; }

/* ---------- 通用 ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h3 { margin: 0; font-size: 18px; }
.page-head p { margin: 6px 0 0; color: var(--sub, #748196); font-size: 12px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: #fff; border: 1px solid var(--line, #e4ebf5); border-radius: 14px;
  padding: 18px 18px 16px; box-shadow: 0 8px 24px rgba(25,55,100,.045);
  position: relative; overflow: hidden;
}
.stat-card::after { content: ""; position: absolute; width: 74px; height: 74px; border-radius: 50%; right: -24px; top: -24px; background: var(--blue-l, #eef5ff); }
.stat-card .k { color: var(--sub, #748196); font-size: 12px; }
.stat-card .v { font-size: 30px; font-weight: 800; margin-top: 8px; letter-spacing: -.5px; }
.stat-card .f { color: #9aa6b8; font-size: 11px; margin-top: 6px; }
.panel { background: #fff; border: 1px solid var(--line, #e4ebf5); border-radius: 14px; box-shadow: 0 8px 24px rgba(25,55,100,.04); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line, #edf1f7); }
.panel-head h4 { margin: 0; font-size: 14px; }
.panel-head p { margin: 4px 0 0; color: var(--sub, #748196); font-size: 12px; }
.panel-body { padding: 18px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 240px; max-width: 340px; }
.toolbar .select { width: auto; min-width: 130px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; color: var(--sub, #748196); font-weight: 600; font-size: 12px;
  background: #f8fafd; padding: 11px 14px; border-bottom: 1px solid var(--line, #e8eef7); white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid #f0f3f8; vertical-align: middle; white-space: nowrap; }
.table td .small { white-space: normal; }
.table tbody tr:hover { background: #fbfdff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; white-space: nowrap; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 2px 2px; flex-wrap: wrap; }
.pager .page-actions { align-items: center; }
.pager-size { width: auto; min-width: 104px; height: 30px; padding: 0 28px 0 10px; font-size: 12px; }

/* 统一列表页：第 1 行名称 + 新增，第 2 行视图 TAB + 分页，第 3 行及以下是记录 */
.list-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px 12px; flex-wrap: wrap; }
.list-title { font-size: 20px; font-weight: 700; color: var(--txt, #162033); letter-spacing: -.2px; }
.list-title-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-title-actions .toolbar { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; flex-wrap: nowrap; }
.list-title-actions .toolbar .search { height: 32px; max-width: 220px; }
.list-title-actions .toolbar input[type="month"], .list-title-actions .toolbar input[type="date"] { width: 150px; }
.list-page-tools { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.list-page-tools .list-page-info { color: var(--sub, #748196); font-size: 12px; white-space: nowrap; }
.list-page-icon { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line, #e8eef7); background: var(--card, #fff); color: var(--sub, #748196); border-radius: var(--radius, 10px); cursor: pointer; font-size: 16px; line-height: 1; }
.list-page-icon:hover { border-color: var(--blue, #2f6fed); color: var(--blue, #2f6fed); }
.list-page-icon[disabled] { opacity: .35; cursor: not-allowed; }
.list-page-tools .pager-size { height: 28px; }
@media (max-width: 1100px) { .list-title-row, .list-title-actions, .list-title-actions .toolbar { flex-wrap: wrap; } }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px; border-bottom: 1px solid var(--line, #e4ebf5); min-height: 48px; flex-wrap: nowrap; }
.list-tabs { display: flex; align-items: center; min-width: 0; flex: 1; overflow-x: auto; }
.list-tabs .tabs { margin: 0; border-bottom: 0; gap: 2px; overflow: visible; }
.list-tabs .tab { padding: 14px 10px 12px; font-size: 13px; }
@media (max-width: 1100px) { .list-head, .list-page-tools { flex-wrap: wrap; } }
.list-page .panel-body { padding: 0; }
.list-page .ui-bulk-bar { margin: 10px 0; }
.list-page .table-wrap { border: 0; }
.list-page .table th { background: transparent; }
.list-page { background: transparent; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
.list-page .pager { padding: 12px 0; border-top: 0; }
.muted { color: var(--sub, #748196); }
.small { font-size: 12px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: #eef2f7; color: #5c6b80; white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.green { background: #e9f8ef; color: #15803d; }
.badge.blue { background: #eaf2ff; color: #1d5fd0; }
.badge.orange { background: #fff5e7; color: #b45309; }
.badge.red { background: #fdecec; color: #b42318; }
.badge.gray { background: #eef2f7; color: #64748b; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px; flex: 0 0 auto;
}
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .name { font-weight: 600; }
.person .sub { color: var(--sub, #748196); font-size: 11px; margin-top: 2px; }
.empty { padding: 42px 20px; text-align: center; color: var(--sub, #748196); }
.empty::before { content: none; }
.empty strong { display: block; color: var(--txt, #162033); margin-bottom: 6px; }
.loading { padding: 40px; text-align: center; color: var(--sub, #748196); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line, #e8eef7); margin-bottom: 16px; overflow-x: auto; }
.tab {
  border: 0; background: transparent; color: var(--sub, #748196);
  padding: 11px 14px; cursor: pointer; font-size: 13px; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab.active { color: var(--blue, #2f6fed); border-bottom-color: var(--blue, #2f6fed); font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 22px; }
.info-item .k { color: var(--sub, #748196); font-size: 11px; margin-bottom: 5px; }
.info-item .v { font-size: 13px; font-weight: 500; line-height: 1.7; min-height: 24px; padding: 1px 0; word-break: break-all; }
.form-field .ui-checkbox-group { margin-top: 2px; }
.form-field .ui-checkbox-tile { background: #fff; }
.divider { height: 1px; background: var(--line, #e8eef7); margin: 16px 0; }
.hint { color: var(--sub, #748196); font-size: 12px; line-height: 1.7; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(8, 20, 40, .42);
  backdrop-filter: blur(3px); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  width: min(760px, 100%); max-height: 90vh; background: #fff; border-radius: 16px;
  box-shadow: 0 30px 80px rgba(7, 24, 50, .28); display: flex; flex-direction: column;
  animation: modalIn .16s ease-out;
}
.modal.wide { width: min(980px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line, #e8eef7); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head p { margin: 5px 0 0; color: var(--sub, #748196); font-size: 12px; }
.modal-close { border: 0; background: transparent; font-size: 22px; color: #8b98ab; cursor: pointer; line-height: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line, #e8eef7); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { display: block; color: var(--sub, #748196); font-size: 12px; margin-bottom: 6px; }
.form-field label .req { color: #d13b3b; margin-left: 3px; }
.form-field .input, .form-field .select, .form-field .textarea { width: 100%; }
.form-field .hint { margin-top: 4px; }
.section-title { grid-column: 1 / -1; font-size: 13px; font-weight: 700; color: var(--txt, #162033); padding-top: 4px; border-top: 1px solid var(--line, #eef2f8); margin-top: 4px; }
.section-title:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.check-row { display: flex; align-items: center; gap: 8px; min-height: 38px; }
.check-row input { width: 16px; height: 16px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 200;
  background: #0f2540; color: #fff; padding: 12px 16px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 14px 34px rgba(7,24,50,.24);
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s;
  max-width: 360px;
}
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #b42318; }

/* ---------- 详情/签课 ---------- */
.hero-card {
  background: linear-gradient(135deg, #0e2d55 0%, #174b8a 70%, #1c62b4 100%);
  color: #fff; border-radius: 16px; padding: 24px; margin-bottom: 18px;
  display: flex; justify-content: space-between; gap: 18px; align-items: center;
  box-shadow: 0 18px 40px rgba(15,49,92,.18);
}
.hero-card h3 { margin: 0; font-size: 22px; }
.hero-card p { margin: 7px 0 0; color: rgba(255,255,255,.7); font-size: 12px; }
.hero-stats { display: flex; gap: 26px; flex-wrap: wrap; }
.hero-stat .v { font-size: 24px; font-weight: 800; }
.hero-stat .k { color: rgba(255,255,255,.62); font-size: 11px; margin-top: 3px; }
.sign-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 18px; }
.sign-step { display: grid; gap: 14px; }
.sign-choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.sign-choice {
  border: 1px solid var(--line, #e4ebf5); background: #fff; border-radius: 12px;
  padding: 14px; text-align: left; cursor: pointer; transition: .16s;
}
.sign-choice:hover { border-color: #9cc0ff; box-shadow: 0 8px 20px rgba(47,111,237,.08); }
.sign-choice.active { border-color: var(--blue, #2f6fed); background: #f5f9ff; box-shadow: 0 0 0 3px rgba(47,111,237,.1); }
.sign-choice strong { display: block; font-size: 13px; }
.sign-choice span { display: block; color: var(--sub, #748196); font-size: 11px; margin-top: 5px; }
.sign-result { border: 1px solid #b7e4c7; background: #f3fbf6; color: #166534; border-radius: 12px; padding: 16px; }
.sign-result.error { border-color: #fecaca; background: #fff7f7; color: #b42318; }
.signature-box { border: 1px dashed #c9d5e5; border-radius: 12px; background: #fbfdff; padding: 8px; }
.signature-box canvas { width: 100%; height: 170px; display: block; border-radius: 8px; background: #fff; touch-action: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sign-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-side {
    position: fixed; left: 0; top: 0; bottom: 0; width: 238px;
    transform: translateX(-100%); transition: transform .2s; box-shadow: 20px 0 50px rgba(0,0,0,.18);
  }
  .app-side.open { transform: none; }
  .app-menu-btn { display: inline-flex; }
  .app-topbar { padding: 0 16px; height: 70px; }
  .app-content { padding: 18px 16px 32px; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { min-height: 100vh; padding: 28px; }
}
@media (max-width: 640px) {
  .stat-grid, .grid-2, .grid-3, .form-grid, .info-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; }
  
  .hero-card { flex-direction: column; align-items: flex-start; }
  .modal-mask { padding: 10px; }
  .modal { max-height: 96vh; }
  .modal-body { padding: 16px; }
  .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .table th, .table td { padding: 10px 11px; }
}
