/* ============================================================
   心理学实验平台 · 界面样式
   ------------------------------------------------------------
   结构：
   1. 基础变量与重置
   2. 背景与磨砂玻璃
   3. 顶部栏 / 齿轮菜单
   4. 被试端：侧边标签 + 详情面板
   5. 通用控件：按钮、标签、进度条、表单
   6. 实验页（纯色，不用磨砂）
   7. 管理后台
   8. 响应式与无障碍
   ============================================================ */

/* ---------- 1. 基础变量与重置 ---------- */
:root {
  --bg: #f2f5fb;
  --ink: #111827;
  --ink-2: #4b5563;
  --ink-3: #8a93a3;
  --line: rgba(17, 24, 39, 0.09);
  --line-strong: rgba(17, 24, 39, 0.16);
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.10);
  --danger: #b91c1c;
  --ok: #047857;

  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-stroke: rgba(255, 255, 255, 0.66);
  --radius-lg: 20px;
  --radius-md: 12px;

  /* 磨砂的强度集中在这里，觉得太透/太糊只改这一行 */
  --blur: 18px;
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 50px rgba(15, 23, 42, 0.07);
}

* { box-sizing: border-box; }

/* hidden 属性优先级最高：否则 .task-screen{display:flex} 会把它盖掉 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
               "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f8fafd 0%, var(--bg) 45%, #eef3fb 100%);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
ul { padding-left: 18px; }

::selection { background: rgba(37, 99, 235, 0.18); }

/* ---------- 2. 背景与磨砂玻璃 ---------- */
/* 三个彩色光斑：磨砂玻璃需要有内容可模糊，否则看起来就是半透明白块 */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg-blobs span {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
}
.bg-blobs span:nth-child(1) {
  width: 420px; height: 420px;
  left: -80px; top: -60px;
  background: #bfd6ff;
}
.bg-blobs span:nth-child(2) {
  width: 380px; height: 380px;
  right: -60px; top: 120px;
  background: #b7ecdc;
}
.bg-blobs span:nth-child(3) {
  width: 460px; height: 460px;
  left: 38%; bottom: -220px;
  background: #ffe2c9;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  border: 0.5px solid var(--glass-stroke);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-lg);
}

/* 不支持 backdrop-filter 的浏览器退化成接近不透明的白，保证可读 */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .glass { background: rgba(255, 255, 255, 0.94); }
}

/* ---------- 3. 顶部栏 / 齿轮菜单 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 76px;
  padding: 0 24px;
  background: rgba(248, 250, 253, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 0.5px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* 校徽位置：横版组合（徽标 + 校名）需要更高，否则校名会糊。
   高度固定 52px，宽度随图片比例，最宽 280px */
.brand-logo {
  height: 52px;
  min-width: 56px;
  max-width: 280px;
  padding: 3px 6px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed rgba(17, 24, 39, 0.18);
}
.brand-logo img { height: 100%; width: auto; max-width: 268px; object-fit: contain; }

/* 有图之后去掉虚线框和底色，只留图片本身 */
.brand-logo.has-image {
  border-color: transparent;
  background: transparent;
  padding: 0;
}

/* 校徽和站名之间的一道细线 */
.brand-divider {
  width: 1px;
  height: 22px;
  background: var(--line-strong);
  flex: none;
}
.brand-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}

.brand-tag {
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 5px;
  padding: 1px 5px;
  margin-left: 6px;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.domain-chip {
  font-size: 12px;
  color: var(--ink-3);
  padding: 4px 9px;
  border-radius: 999px;
  border: 0.5px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

/* 齿轮：平时只是一个灰色小图标，不写「后台」二字 */
.gear-wrap { position: relative; }

.gear-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.55);
  border: 0.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
              background 0.18s, color 0.18s, border-color 0.18s;
}
.gear-btn:hover {
  transform: translateY(-2px);
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.3);
  background: #fff;
}
.gear-btn[aria-expanded="true"] {
  color: var(--accent);
  background: #fff;
  border-color: rgba(37, 99, 235, 0.35);
}

.gear-menu {
  position: absolute;
  right: 0;
  top: 42px;
  width: 152px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.94);
  border: 0.5px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.13);
}
.gear-menu a,
.gear-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink-2);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.gear-menu a:hover,
.gear-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- 4. 被试端布局 ---------- */
.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 24px 18px;
}
.hero h1 {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero p {
  margin-top: 7px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.workspace {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.side {
  padding: 14px;
  position: sticky;
  top: 96px;
  min-width: 0; /* 不加这行，手机上的横向标签会把整页撑宽 */
}

.side-head {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  padding: 4px 8px 10px;
}

.tab-list { display: grid; gap: 6px; }

.tab {
  display: block;
  padding: 13px 13px 11px;
  border-radius: 14px;
  border: 0.5px solid transparent;
  background: rgba(255, 255, 255, 0.34);
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
              background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
/* 悬停只上浮 2px，不做放大/旋转，避免相邻元素抖动 */
.tab:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
}
.tab:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  outline-offset: 2px;
}
.tab.is-active {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.10);
}
.tab.is-closed { opacity: 0.62; }

.tab-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tab-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}
.tab-meta {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-blue { background: #3b82f6; }
.dot-teal { background: #14b8a6; }
.dot-amber { background: #f59e0b; }

.mini-bar {
  display: block;
  height: 3px;
  margin-top: 9px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
  overflow: hidden;
}
.mini-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.side-foot {
  margin: 14px 6px 2px;
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.6;
}

/* 只在窄屏出现，提示标签可以左右滑 */
.side-hint { display: none; }

.panels { min-width: 0; }

.panel { padding: 26px 28px 24px; }

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 5px;
}

.panel h2 {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}
.chip {
  font-size: 11.5px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.72);
  border: 0.5px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

.progress-block { margin: 20px 0 4px; }

.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  transition: width 0.45s ease;
}
.progress.small { height: 6px; width: 120px; }

.progress-note {
  margin-top: 7px;
  font-size: 12px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.panel h3 {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin: 22px 0 8px;
}

.body-text {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-2);
}

.req-list {
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--ink-2);
}

.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 0.5px solid var(--line);
}
.cta-note {
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ---------- 5. 通用控件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 22px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
  border: 0.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.18s, background 0.18s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(15, 23, 42, 0.09); }

.btn-primary {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.26);
}
.btn-primary:hover { background: #1d4ed8; }

.btn-disabled {
  color: var(--ink-3);
  background: rgba(17, 24, 39, 0.06);
  border-color: transparent;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-disabled:hover { transform: none; box-shadow: none; }

.btn-block { width: 100%; }

.text-btn {
  padding: 4px 6px;
  font-size: 12.5px;
  color: var(--accent);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.text-btn:hover { background: var(--accent-soft); }
.text-btn.danger { color: var(--danger); }
.text-btn.danger:hover { background: rgba(185, 28, 28, 0.08); }

.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-open { color: var(--ok); background: rgba(4, 120, 87, 0.10); }
.pill-closed { color: #6b7280; background: rgba(17, 24, 39, 0.07); }

.tag {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  font-size: 10.5px;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.09);
  border-radius: 5px;
  vertical-align: 1px;
}
.tag-muted { color: #6b7280; background: rgba(17, 24, 39, 0.06); }

.chip-btn {
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--ok);
  background: rgba(4, 120, 87, 0.09);
  border: 0.5px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}
.chip-btn.is-off {
  color: #9a3412;
  background: rgba(234, 88, 12, 0.10);
}

/* 表单 */
.stack { display: grid; gap: 18px; }
.stack.tight { gap: 12px; }

.field { display: grid; gap: 6px; align-content: start; }
.field-label {
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 500;
}
.field-label em { color: var(--danger); font-style: normal; margin-left: 2px; }
.field small { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }

input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
  height: 42px;
  padding: 0 12px;
  font-size: 13.5px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border: 0.5px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.narrow { max-width: 720px; margin: 0 auto; padding: 32px 24px 64px; }
.card { padding: 30px; }
.card h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.card h2 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.lead { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }

.consent-box {
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 0.5px solid var(--line);
}
.consent-box h2 { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.consent-box p { font-size: 13px; line-height: 1.85; color: var(--ink-2); }

.checkline {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.checkline input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--accent); }

/* 后台工具条：搜索 + 导出 */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 14px;
}
.search-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-form input { height: 36px; width: 240px; }
.export-group { display: flex; gap: 8px; flex-wrap: wrap; }
.export-group .btn, .toolbar .btn { height: 36px; padding: 0 14px; font-size: 12.5px; }

.check-grid { display: grid; gap: 10px; margin-top: 12px; }

/* 多行文本和文件选择框需要单独处理高度 */
textarea {
  height: auto;
  min-height: 96px;
  padding: 10px 12px;
  line-height: 1.7;
  resize: vertical;
}
input[type="file"] {
  height: auto;
  padding: 9px 10px;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.7);
}
code {
  padding: 1px 5px;
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(17, 24, 39, 0.06);
  border-radius: 5px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 4px;
}

.back-link {
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 4px 0;
}
.back-link:hover { color: var(--accent); }

.muted { font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }

/* 完成页 */
.center { text-align: center; }
.done-mark {
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ok);
  background: rgba(4, 120, 87, 0.10);
  border-radius: 50%;
}
.code-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 22px 0 12px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 0.5px dashed var(--line-strong);
}
.code-label { font-size: 11.5px; color: var(--ink-3); }
.code-value {
  font-size: 26px;
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
}

/* ---------- 6. 实验页：纯色，不用磨砂 ---------- */
/* 磨砂要实时计算模糊，会占用 GPU，可能影响刺激呈现和计时精度 */
.task-body { background: #fbfbfc; }
.task-body .bg-blobs { display: none; }

.task-shell {
  max-width: 880px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 26px 24px 40px;
  display: flex;
  flex-direction: column;
}

.task-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-3);
}
.task-name { color: var(--ink-2); font-weight: 500; }
.task-progress { font-variant-numeric: tabular-nums; }

.task-bar {
  height: 3px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.07);
  overflow: hidden;
}
.task-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.task-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 40px 0;
}
.task-screen h1 { font-size: 24px; font-weight: 700; }
.task-screen p { font-size: 14px; color: var(--ink-2); line-height: 1.9; max-width: 520px; }

.key-line { font-size: 15px; }
kbd {
  display: inline-block;
  min-width: 26px;
  padding: 2px 7px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  border: 0.5px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
}

.fixation { font-size: 38px; color: #374151; }
.stimulus {
  font-size: 58px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.task-hint { position: absolute; bottom: 42px; font-size: 12px; color: var(--ink-3); }

.upload-title { font-size: 17px; font-weight: 600; }
#retryBtn { margin-top: 8px; }

/* ---------- 7. 管理后台 ---------- */
.admin-body { background: linear-gradient(180deg, #f7f9fd 0%, #eef2f9 60%, #eaf0f8 100%); }

.admin-topbar { gap: 24px; }
.admin-nav {
  display: flex;
  gap: 4px;
  margin-right: auto;
  margin-left: 12px;
}
.admin-nav a {
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 6px 11px;
  border-radius: 8px;
  white-space: nowrap;
}
.admin-nav a:hover { background: rgba(255, 255, 255, 0.7); }
.admin-nav a.is-active {
  color: var(--accent);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.admin-shell { max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px; }

.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.admin-head h1 {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2px 0 6px;
}
.admin-head p { max-width: 720px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 0.5px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.stat span { display: block; font-size: 11.5px; color: var(--ink-3); }
.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.table-card {
  padding: 4px 0;
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--line);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.5); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .progress-col { width: 150px; }
.data-table .actions-col { text-align: right; white-space: nowrap; min-width: 150px; }
.data-table .actions-col form { display: inline-block; }
.data-table .note-col { min-width: 220px; }

.cell-title { font-size: 13px; font-weight: 600; }
.cell-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.row-excluded td { opacity: 0.62; }

.note-form { display: flex; align-items: center; gap: 6px; }
.note-form input {
  height: 30px;
  width: 100%;
  min-width: 120px;
  font-size: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
}
.inline-form { display: inline-block; }

.empty-card { padding: 46px 24px; text-align: center; }
.empty { font-size: 13.5px; color: var(--ink-2); }
.empty-card .muted { margin-top: 6px; }

.admin-foot { margin-top: 14px; }

/* 完成码：等宽字体，便于人工核对 */
.code-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(17, 24, 39, 0.05);
  color: var(--ink-2);
}

/* ---------- 时间轴 ---------- */
.timeline-card { padding: 6px 0; max-width: 900px; }

.timeline {
  list-style: none;
  margin: 0;
  padding: 18px 26px 18px 34px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 38px;
  top: 28px;
  bottom: 28px;
  width: 1px;
  background: rgba(17, 24, 39, 0.14);
}

.tl-item { position: relative; padding: 10px 0 10px 26px; }
.tl-dot {
  position: absolute;
  left: 0;
  top: 16px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9);
}
.tl-data { background: #2563eb; }
.tl-edit { background: #d97706; }
.tl-delete { background: #b91c1c; }
.tl-auth { background: #6b7280; }
.tl-deploy { background: #047857; }

.tl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.tl-head strong { font-size: 13px; font-weight: 600; }
.tl-head time { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.tl-body p { margin-top: 3px; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.tl-body .tag { margin-top: 6px; }

/* 后台首页的「最近动态」 */
.recent-block { margin-top: 18px; padding: 16px 20px; }
.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.recent-head h2 { font-size: 14px; font-weight: 600; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--line);
  font-size: 12.5px;
}
.feed li:last-child { border-bottom: 0; }
.feed-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.feed-title { font-weight: 500; white-space: nowrap; }
.feed-detail {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-detail::before {
  content: "·";
  margin-right: 6px;
  color: var(--ink-3);
}
.feed time { margin-left: auto; color: var(--ink-3); font-size: 11.5px; flex: none; }

/* 弹窗 */
.modal {
  width: min(460px, 92vw);
  padding: 24px;
  border: 0.5px solid var(--glass-stroke);
  border-radius: var(--radius-lg);
  color: var(--ink);
}
.modal::backdrop {
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(3px);
}
.modal h2 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.modal .field { margin-top: 14px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.help-dialog {
  width: min(460px, 92vw);
  padding: 24px;
  border: 0.5px solid var(--glass-stroke);
  border-radius: var(--radius-lg);
  color: var(--ink);
}
.help-dialog::backdrop { background: rgba(15, 23, 42, 0.3); }
.help-dialog h3 { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.help-dialog p { font-size: 13px; line-height: 1.85; color: var(--ink-2); }
.help-dialog form { display: flex; justify-content: flex-end; margin-top: 14px; }

/* 登录 */
.login-wrap {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 24px;
}
.login-card { width: min(380px, 92vw); padding: 30px; text-align: center; }
.login-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 12px;
}
.login-card h1 { font-size: 19px; font-weight: 700; }
.login-card .muted { margin: 4px 0 18px; }
.login-card .stack { text-align: left; }
.login-note { margin-top: 14px; font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }
.demo-note { margin-top: 6px; }
.demo-note code {
  padding: 1px 5px;
  font-size: 11.5px;
  background: rgba(17, 24, 39, 0.06);
  border-radius: 5px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.settings-grid .card { padding: 22px; }
.settings-grid h2 { font-size: 14px; }
.settings-grid .muted { margin: 6px 0 14px; }
.settings-grid .req-list { font-size: 13px; }

/* 提示条 */
.flash-stack {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: max-content;
  max-width: 92vw;
}
.flash {
  padding: 9px 15px;
  font-size: 12.5px;
  border-radius: 10px;
  background: #fff;
  border: 0.5px solid var(--line);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.10);
}
.flash-ok { color: var(--ok); }
.flash-warn { color: #b45309; }
.flash-error { color: var(--danger); }

/* ---------- 8. 响应式与无障碍 ---------- */
@media (max-width: 980px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; overflow: hidden; }
  .tab-list { min-width: 0; }
  /* 手机上侧边标签变成顶部横排，可左右滑动 */
  .tab-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .tab { flex: 0 0 auto; min-width: 190px; }
  .side-foot { display: none; }
  .side-hint { display: block; margin: 9px 2px 0; font-size: 11px; color: var(--ink-3); }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .topbar { padding: 0 16px; height: 64px; }
  .brand { gap: 10px; }
  .brand-logo { height: 42px; min-width: 46px; max-width: 180px; }
  .brand-logo img { max-width: 168px; }
  .brand-name { font-size: 13px; }

  /* 后台顶栏在手机上换成两行：第一行校徽+退出，第二行导航 */
  .admin-topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 8px 14px;
    row-gap: 6px;
  }
  .admin-nav {
    order: 3;
    width: 100%;
    margin: 0;
    overflow-x: auto;
  }
  /* 表格保持最小宽度，靠横向滚动查看，避免列被挤成竖排 */
  .data-table { min-width: 760px; }
  .domain-chip { display: none; }
  .hero { padding: 24px 16px 14px; }
  .hero h1 { font-size: 23px; }
  .workspace { padding: 0 16px 48px; }
  .panel { padding: 20px 18px; }
  .panel h2 { font-size: 20px; }
  .cta { flex-direction: column; align-items: stretch; gap: 12px; }
  .cta .btn { width: 100%; }
  .field-grid { grid-template-columns: 1fr; }
  .form-foot { flex-direction: column; align-items: stretch; gap: 12px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-shell { padding: 20px 14px 48px; }
  .admin-nav { margin-left: 4px; }
  .admin-topbar .text-btn:first-child { display: none; }
  .stimulus { font-size: 44px; }
  .task-shell { padding: 18px 16px 32px; }
}

/* 很窄的手机上只留校徽，避免和后台导航挤在一起 */
@media (max-width: 480px) {
  .brand-divider,
  .brand-name { display: none; }
}

/* 尊重系统的「减少动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
  .tab:hover, .gear-btn:hover, .btn:hover { transform: none; }
}
