/* ==========================================================================
   作业看板 —— 全站样式（前台 + 后台）
   设计规范：白/极浅灰底 · 单一强调色 · 1px 浅灰描边 · 柔和弥散阴影
             统一圆角 16px · 大留白 · 字号层级分明
   ========================================================================== */

/* ============================ 1. 设计变量 ============================ */
:root {
  --bg: #fafafa;
  --card: #ffffff;
  --surface: #f9fafb;

  --text: #111827;
  --text-2: #4b5563;
  --muted: #9ca3af;
  --line: #e5e7eb;
  --line-soft: #f3f4f6;

  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eff4ff;

  --warn: #f59e0b;
  --warn-soft: #fffbeb;
  --warn-text: #b45309;
  --danger: #ef4444;

  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 10px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .03), 0 4px 20px rgba(0, 0, 0, .03);
  --shadow: 0 4px 20px rgba(0, 0, 0, .04);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, .06);
  --ring: 0 0 0 3px rgba(37, 99, 235, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 10px; line-height: 1.4; letter-spacing: -.01em; }
::selection { background: rgba(37, 99, 235, .14); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
main { padding: 36px 0 64px; }

/* ============================ 2. 顶部导航 ============================ */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; color: var(--text); }
.brand-logo {
  width: 32px; height: 32px; border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; background: var(--accent);
}
.brand-text { letter-spacing: -.01em; }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  padding: 7px 14px; border-radius: var(--radius-xs);
  font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: background .15s ease, color .15s ease;
}
.site-nav a:hover { background: var(--line-soft); color: var(--text); }
.site-nav a.active { background: var(--line-soft); color: var(--text); font-weight: 600; }

/* ============================ 3. 数据概览 / 页头 ============================ */
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text-2); }

.overview { margin-bottom: 32px; }
.overview-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 26px;
}
.overview-head h1 { font-size: 22px; font-weight: 700; margin: 0; }
.overview-hint { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.overview-title { display: flex; align-items: center; gap: 12px; }
.subject-mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; background: var(--brand-soft, var(--line-soft));
}

.stat-strip {
  display: grid; grid-template-columns: repeat(3, minmax(0, 150px));
  gap: 0;
}
.stat-item { padding: 0 26px; border-left: 1px solid var(--line); }
.stat-item:first-child { padding-left: 0; border-left: none; }
.stat-item .n {
  font-size: 36px; font-weight: 700; line-height: 1.15;
  letter-spacing: -.03em;
}
.stat-item .t { font-size: 14px; color: var(--muted); margin-top: 2px; }
.stat-item.is-warn .n { color: var(--warn); }
.stat-item.is-dim .n { color: #c4c9d4; }

/* 页头（用于后台 / 安装页） */
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-head p { color: var(--muted); margin: 0; font-size: 14px; }

/* 页脚 */
.site-footer { padding: 28px 0 44px; }
.site-footer .wrap {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 13px; color: var(--muted);
}
.site-footer .dot { width: 6px; height: 6px; border-radius: 50%; background: #d1d5db; }
.site-footer .sep { color: #e5e7eb; }

/* ============================ 4. 学科卡片 ============================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

.subject-card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.subject-card:hover { box-shadow: var(--shadow-md); border-color: #d8dce4; }

.card-top { display: flex; align-items: flex-start; gap: 14px; padding: 24px 24px 16px; }
.card-icon {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: var(--brand-soft, var(--line-soft));
}
.card-title-box { flex: 1; min-width: 0; }
.card-title { font-size: 16px; font-weight: 700; margin: 1px 0 0; }
.card-title a:hover { color: var(--accent); }
.card-sub { font-size: 13px; color: var(--muted); margin: 2px 0 0; }

.count-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: var(--warn-soft); color: var(--warn-text);
}
.count-badge b { font-weight: 700; }
.count-badge.done { background: var(--line-soft); color: var(--text-2); }

/* 进度条：4px 极细线性 */
.progress { margin-top: 14px; }
.progress-bar { height: 4px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.progress-bar span {
  display: block; height: 100%; border-radius: 999px;
  background: var(--text);
  transition: width .5s ease;
}
.progress-label { font-size: 12px; color: var(--muted); margin-top: 7px; }

.card-body { flex: 1; padding: 0 0 4px; }

.task-list { list-style: none; margin: 0; padding: 0; }
.task {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 24px;
  border-top: 1px solid var(--line-soft);
  transition: background .15s ease;
}
.task:hover { background: var(--surface); }
.task-main { flex: 1; min-width: 0; }
.task-title {
  display: block; font-size: 14.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.task-title:hover { color: var(--accent); }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }

/* 标签：统一浅灰底 + 深灰字 */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 8px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--line-soft); color: #6b7280;
}
.chip-warn { background: var(--warn-soft); color: var(--warn-text); }
.chip-ok { background: var(--line-soft); color: var(--text-2); }
.chip-accent { background: var(--accent-soft); color: var(--accent); }
.chip-ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* 截止时间：仅紧迫时用低饱和红 */
.due { font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.due-normal { color: var(--muted); }
.due-urgent { color: var(--danger); font-weight: 600; }
.due-expired { color: var(--danger); font-weight: 600; }
.due-muted { color: var(--muted); }

.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 24px;
  border-top: 1px solid var(--line-soft);
}
.card-foot .stat { font-size: 12.5px; color: var(--muted); }
.card-foot .stat b { color: var(--text-2); font-weight: 600; }
.link-more { font-size: 13px; font-weight: 600; }

/* ============================ 5. 按钮 / 提示 ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.4;
  color: #fff; cursor: pointer;
  background: var(--accent);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--accent-dark); }
.btn-ghost { background: #fff; color: var(--text-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); border-color: #d1d5db; color: var(--text); }
.btn-danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }
.btn-sm { padding: 6px 13px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-block { width: 100%; }

.alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
}
.alert-success { background: #f6fef9; border-color: #d1f0dd; color: #15803d; }
.alert-error   { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alert-info    { background: var(--accent-soft); border-color: #dbe6ff; color: var(--accent-dark); }

.empty {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
}
.empty .big {
  width: 64px; height: 64px; margin: 0 auto 16px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; background: var(--line-soft);
}
.empty p { margin: 0 0 20px; }

/* ============================ 6. 详情页 ============================ */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px 28px;
  margin-bottom: 20px;
}
.panel h2 { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; }
.panel h2::before {
  content: ""; width: 3px; height: 15px; border-radius: 2px;
  background: var(--accent);
}
.panel-sub { color: var(--muted); font-size: 13.5px; margin: -2px 0 16px; }

.detail-title { font-size: 22px; font-weight: 700; margin: 0 0 14px; letter-spacing: -.02em; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-top: 22px;
}
.meta-item {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line-soft);
}
.meta-item .k { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.meta-item .v { font-size: 14px; font-weight: 600; }
.meta-item .due { white-space: normal; line-height: 1.5; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
/* 允许栅格子项收缩，避免内部表格/长内容把整页撑宽 */
.split > * { min-width: 0; }

.side-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.side-list li { padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.side-list li:last-child { border-bottom: none; }
.side-list a { font-weight: 600; color: var(--text); }
.side-list a:hover { color: var(--accent); }
.side-list .k { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }

.file-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
}
.file-card .fic {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: var(--radius-xs); background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; border: 1px solid var(--line-soft);
}

/* ============================ 7. 表格 / 表单 ============================ */
.table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
table.table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
table.table th,
table.table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.table th {
  background: var(--surface);
  color: var(--muted); font-size: 12.5px; font-weight: 600;
  white-space: nowrap;
}
table.table tbody tr { transition: background .15s ease; }
table.table tbody tr:hover { background: var(--surface); }
table.table tbody tr:last-child td { border-bottom: none; }
.td-actions { white-space: nowrap; text-align: right; }
.td-actions form { display: inline; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--text-2); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.field .req { color: var(--danger); }

input[type=text], input[type=password], input[type=number], input[type=datetime-local],
input[type=date], input[type=color], select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--text);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type=color] { padding: 4px; height: 42px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
textarea { min-height: 92px; resize: vertical; }
input[type=file] { font-size: 13.5px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.checkbox-line { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.checkbox-line input { width: auto; }

/* ============================ 8. 登录页 ============================ */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg);
}
.auth-card {
  width: 100%; max-width: 400px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 36px 32px;
}
.auth-card h1 { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 26px; }
.auth-card .tip {
  margin-top: 20px; padding: 10px;
  font-size: 12.5px; color: var(--muted); text-align: center;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

/* ============================ 9. 后台布局 ============================ */
.admin-body { background: var(--bg); }
.admin-layout { display: flex; min-height: 100vh; }

/* 移动端专用元素：桌面端隐藏 */
.admin-nav-toggle,
.admin-topbar,
.admin-mask,
.admin-drawer-close { display: none; }

.admin-side {
  width: 220px; flex: 0 0 220px;
  display: flex; flex-direction: column;
  padding: 22px 14px;
  background: #1e293b;
  color: #cbd5e1;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-side-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin: 0 6px 24px;
}
.admin-side .brand { color: #fff; font-size: 15px; margin: 0; white-space: nowrap; }
.admin-side .brand-logo { background: var(--accent); }
.admin-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-xs);
  color: #94a3b8; font-size: 14px; font-weight: 500;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.admin-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-nav a.active { background: var(--accent); color: #fff; font-weight: 600; }
.admin-nav .ic { width: 18px; text-align: center; }
.admin-side .side-foot {
  font-size: 12px; color: #7c8aa0;
  padding: 14px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.admin-side .side-foot a { color: #a9b6cb; }

.admin-main { flex: 1; min-width: 0; padding: 30px 34px 64px; }
.admin-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.admin-head h1 { font-size: 21px; font-weight: 700; margin: 0; }
.admin-head .sub { color: var(--muted); font-size: 13.5px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.stat-card .n { font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.stat-card .t { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.stat-card.blue .n { color: var(--text); }
.stat-card.orange .n { color: var(--warn); }
.stat-card.green .n { color: var(--text-2); }
.stat-card.purple .n { color: var(--text); }

/* ============================ 10. 富文本 / 编辑器 ============================ */
.rich-text { font-size: 15px; line-height: 1.9; word-wrap: break-word; color: #26304a; }
.rich-text img, .rich-text video { max-width: 100%; border-radius: var(--radius-sm); margin: 12px 0; }
.rich-text h1, .rich-text h2, .rich-text h3 { margin: 22px 0 10px; }
.rich-text p { margin: 10px 0; }
.rich-text ul { padding-left: 4px; list-style: none; }
.rich-text ul > li { position: relative; padding-left: 20px; margin: 8px 0; }
.rich-text ul > li::before {
  content: ""; position: absolute; left: 3px; top: .68em;
  width: 6px; height: 6px; border-radius: 50%; background: #d1d5db;
}
.rich-text ol { counter-reset: step; list-style: none; padding-left: 0; }
.rich-text ol > li { position: relative; padding-left: 38px; margin: 12px 0; }
.rich-text ol > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: .14em;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-2); background: var(--line-soft);
}
.rich-text blockquote {
  margin: 14px 0; padding: 12px 18px;
  border-left: 2px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.rich-text pre {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px;
  overflow: auto; font-size: 13.5px;
}
.rich-text code { background: var(--line-soft); padding: 1px 6px; border-radius: 6px; font-size: 13.5px; }
.rich-text table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.rich-text th, .rich-text td { border: 1px solid var(--line); padding: 9px 11px; }

.editor-box { background: #fff; }
.editor-box .ql-toolbar { border-radius: var(--radius-sm) var(--radius-sm) 0 0; border-color: var(--line); background: var(--surface); }
.editor-box .ql-container { border-radius: 0 0 var(--radius-sm) var(--radius-sm); border-color: var(--line); font-size: 15px; min-height: 260px; }
.editor-box .ql-editor { min-height: 260px; }
.editor-fallback { width: 100%; min-height: 260px; font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; }

.tag-inline { font-size: 12.5px; color: var(--muted); }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.text-muted { color: var(--muted); }
.truncate {
  display: inline-block; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: bottom;
}
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-inline .field { margin-bottom: 0; }

/* ============================ 12. 安装向导 ============================ */
.wizard { max-width: 780px; }

.steps { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.step {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px; color: var(--muted);
  white-space: nowrap;
}
.step .no {
  width: 20px; height: 20px; flex: 0 0 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--line-soft); color: var(--text-2);
  font-size: 11.5px; font-weight: 700;
}
.step.active { border-color: #c7d6ff; background: var(--accent-soft); color: var(--text); font-weight: 600; }
.step.active .no { background: var(--accent); color: #fff; }
.step.done { color: var(--text-2); }
.step.done .no { background: #e7f6ee; color: #15803d; }
.step-line { flex: 1; min-width: 10px; height: 1px; background: var(--line); }

.check-list { list-style: none; margin: 0; padding: 0; }
.check-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.check-item:last-child { border-bottom: none; }
.check-item .name { flex: 1; min-width: 0; }
.check-item .val { color: var(--muted); font-size: 13px; max-width: 52%; text-align: right; }
.tag {
  flex: 0 0 auto;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.tag-ok { background: #e7f6ee; color: #15803d; }
.tag-bad { background: #fef2f2; color: #b91c1c; }
.tag-warn { background: var(--warn-soft); color: var(--warn-text); }

.install-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
.install-foot .spacer { flex: 1; }

.install-note { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 22px; }

.req { color: var(--danger); }

.alert b { font-weight: 700; }

@media (max-width: 700px) {
  .check-item { flex-wrap: wrap; gap: 6px 10px; }
  .check-item .val { max-width: 100%; text-align: left; }
  .steps { gap: 6px; }
  .step { padding: 6px 11px; font-size: 12.5px; }
  .step-line { display: none; }
  .install-foot { flex-direction: column-reverse; align-items: stretch; }
  .install-foot .btn { width: 100%; }
  .install-foot .spacer { display: none; }
}

/* ============================ 13. 响应式 ============================ */

@media (prefers-reduced-motion: no-preference) {
  @keyframes fade-rise {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
  }
  .subject-card, .panel { animation: fade-rise .34s cubic-bezier(.22, .61, .36, 1) both; }
  .card-grid > :nth-child(2) { animation-delay: .04s; }
  .card-grid > :nth-child(3) { animation-delay: .08s; }
  .card-grid > :nth-child(4) { animation-delay: .12s; }
  .card-grid > :nth-child(5) { animation-delay: .16s; }
  .card-grid > :nth-child(6) { animation-delay: .2s; }
}

/* 窄屏：表格改为卡片式堆叠，不再横向滚动 */
@media (max-width: 700px) {
  .table-wrap {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }
  table.table { display: block; min-width: 0; font-size: 14px; }
  table.table thead { display: none; }
  table.table tbody { display: block; }
  table.table tr {
    display: block;
    padding: 15px 16px;
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
  }
  table.table tr:last-child { margin-bottom: 0; }
  table.table td {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
    padding: 5px 0;
    border: none;
    min-width: 0;
  }
  table.table th:first-child, table.table td:first-child { min-width: 0; }
  /* 首列作为卡片标题 */
  table.table td:first-child {
    display: block;
    padding: 0 0 8px;
    font-size: 15.5px;
    font-weight: 700;
  }
  table.table .truncate { max-width: none; white-space: normal; overflow: visible; }
  /* 窄屏空间有限，允许长文本换行，避免溢出卡片 */
  table.table td.nowrap,
  table.table td .due { white-space: normal; }
  table.table td[colspan] { display: block; padding: 0; font-size: 14px; font-weight: 400; }
  /* 学科页筛选：等分铺满，方便点击 */
  .overview-head .site-nav { width: 100%; gap: 6px; }
  .overview-head .site-nav a { flex: 1; text-align: center; }
  /* 卡片内的文字链接加大点击区域 */
  table.table td[data-label] a { display: inline-block; padding: 3px 0; }
  /* 其余列：左侧浅灰字段名 + 右侧取值 */
  table.table td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 72px;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 400;
  }
  /* 操作区：分隔线 + 可点按钮铺满 */
  table.table .td-actions {
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: flex-end;
    margin-top: 8px; padding-top: 12px;
    border-top: 1px solid var(--line-soft);
  }
  table.table .td-actions form,
  table.table .td-actions .btn { flex: 1 1 92px; }
  table.table .td-actions .btn { width: 100%; }
}

@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }

  /* ---------- 后台：吸顶栏 + 抽屉式导航 ---------- */
  .admin-layout { display: block; }

  .admin-nav-toggle {
    display: block;
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0; margin: 0; pointer-events: none;
  }

  .admin-topbar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 40;
    min-height: 56px; padding: 8px 16px;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .admin-topbar-title { font-size: 15px; font-weight: 700; }
  .admin-topbar-link { margin-left: auto; font-size: 13px; color: var(--text-2); }

  .admin-burger {
    width: 38px; height: 38px; flex: 0 0 38px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    border: 1px solid var(--line); border-radius: var(--radius-xs);
    background: #fff; cursor: pointer;
  }
  .admin-burger span { display: block; width: 16px; height: 1.5px; border-radius: 2px; background: var(--text); }
  .admin-nav-toggle:focus-visible ~ .admin-topbar .admin-burger { box-shadow: var(--ring); }

  .admin-side {
    position: fixed; inset: 0 auto 0 0; z-index: 60;
    width: 274px; max-width: 84vw; height: 100%;
    padding: 18px 12px;
    transform: translateX(-102%);
    transition: transform .26s cubic-bezier(.22, .61, .36, 1);
    box-shadow: 0 16px 48px rgba(15, 23, 42, .3);
  }
  .admin-nav-toggle:checked ~ .admin-side { transform: translateX(0); }

  .admin-nav { flex-direction: column; }

  .admin-drawer-close {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; flex: 0 0 32px;
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, .08);
    color: #cbd5e1; font-size: 13px; cursor: pointer;
  }

  .admin-mask {
    display: none;
    position: fixed; inset: 0; z-index: 50;
    background: rgba(15, 23, 42, .45);
  }
  .admin-nav-toggle:checked ~ .admin-mask { display: block; }
  :root:has(.admin-nav-toggle:checked) body { overflow: hidden; }

  .admin-side .side-foot { display: block; }
  .admin-main { padding: 20px 16px 64px; }
}

@media (max-width: 600px) {
  .wrap { padding: 0 18px; }
  main { padding: 26px 0 48px; }
  .card-grid { grid-template-columns: 1fr; gap: 18px; }
  .stat-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-item { padding: 0 14px; }
  .stat-item .n { font-size: 28px; }
  .stat-item .t { font-size: 12.5px; }
  .panel { padding: 22px 20px; }
  .card-top, .task, .card-foot { padding-left: 20px; padding-right: 20px; }
  .brand span.brand-text { display: none; }

  /* ---------- 后台移动端细节 ---------- */
  .admin-main { padding: 16px 14px 72px; }
  .admin-head { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 18px; }
  .admin-head h1 { font-size: 18px; }
  .admin-head .sub { font-size: 12.5px; }
  .admin-head .form-inline { width: 100%; }
  .admin-head .form-inline .btn,
  .admin-head > a.btn { flex: 1; }

  /* 统计卡：两列布局，避免单个卡片独占一行 */
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-card .n { font-size: 24px; }
  .stat-card .t { font-size: 12.5px; }

  .panel { padding: 18px 16px; }

  /* 筛选表单纵向排列，输入框全宽 */
  .panel .form-inline { flex-direction: column; align-items: stretch; }
  .panel .form-inline .field,
  .panel .form-inline .btn { width: 100%; }

  /* 触控目标与防 iOS 聚焦缩放 */
  .btn { padding: 10px 16px; }
  .btn-sm { padding: 7px 12px; }
  input[type=text], input[type=password], input[type=number], input[type=datetime-local],
  input[type=date], select, textarea { font-size: 16px; }
  .checkbox-line { padding: 4px 0; }

  /* 详情页信息卡单列 */
  .meta-grid { grid-template-columns: 1fr; gap: 10px; }
  .side-list li { padding: 10px 0; }
}
