/* ============================================================
   美刻变身学习平台 · 共享样式（学员端 + 教师端）
   设计基调：暖纸底色 + 鼠尾草绿，柔和有机、治愈系
   ============================================================ */

:root {
  --bg: #F4F2EA;
  --bg-deep: #ECE9DD;
  --surface: #FFFFFF;
  --surface-2: #FAF9F3;
  --ink: #2D3A33;
  --ink-2: #4C5B52;
  --muted: #87958C;
  --line: #E3E0D2;
  --line-soft: #EDEBE0;
  --green: #57806A;
  --green-deep: #3E6350;
  --green-mist: #E9F0E8;
  --honey: #C08A38;
  --honey-mist: #F6EDDA;
  --rose: #B85C52;
  --rose-mist: #F5E5E2;
  --sky: #4E7D8C;
  --sky-mist: #E4EEF1;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 28px rgba(62, 82, 70, 0.09);
  --shadow-soft: 0 3px 12px rgba(62, 82, 70, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* 有机纹理背景光斑 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(480px 320px at 110% -60px, rgba(87, 128, 106, 0.10), transparent 70%),
    radial-gradient(420px 300px at -80px 108%, rgba(192, 138, 56, 0.07), transparent 70%);
  z-index: 0;
}

#app { position: relative; z-index: 1; }

button, input, textarea, select { font-family: inherit; font-size: 1rem; color: var(--ink); }
button { cursor: pointer; border: none; background: none; }
a { color: var(--green); text-decoration: none; }

/* ---------------- 布局框架 ---------------- */

.app-frame {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px calc(96px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

.app-frame.no-nav { padding-bottom: 40px; }

/* ---------------- 认证页 ---------------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 20px;
  position: relative;
  z-index: 1;
}

.auth-brand { text-align: center; margin-bottom: 28px; }

.auth-brand svg { width: 64px; height: 64px; display: block; margin: 0 auto 12px; }

.auth-brand h1 { font-size: 1.45rem; letter-spacing: 0.02em; }

.auth-brand p { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow);
}

.auth-card h2 { font-size: 1.12rem; margin-bottom: 18px; }

.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: 0.9rem; }

.auth-foot a { font-weight: 600; }

.auth-notice {
  background: var(--honey-mist);
  color: #8A6425;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.86rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ---------------- 表单 ---------------- */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 0.86rem;
  color: var(--ink-2);
  font-weight: 600;
  margin-bottom: 6px;
}

.input, textarea.input, select.input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  outline: none;
  font-size: 1rem;
}

.input:focus {
  border-color: var(--green);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(87, 128, 106, 0.12);
}

textarea.input { resize: vertical; min-height: 96px; line-height: 1.6; }

.input-hint { font-size: 0.78rem; color: var(--muted); margin-top: 5px; }

.form-error {
  background: var(--rose-mist);
  color: var(--rose);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.86rem;
  margin-bottom: 14px;
  line-height: 1.5;
  word-break: break-all;
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
  user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-block { width: 100%; }

.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 6px 16px rgba(87, 128, 106, 0.28);
}

.btn-primary:hover { background: var(--green-deep); }

.btn-ghost {
  background: var(--green-mist);
  color: var(--green-deep);
}

.btn-ghost:hover { background: #DDE9DC; }

.btn-plain {
  background: var(--surface);
  color: var(--ink-2);
  border: 1.5px solid var(--line);
}

.btn-danger-ghost {
  background: var(--rose-mist);
  color: var(--rose);
}

.btn-sm { padding: 7px 13px; font-size: 0.86rem; border-radius: var(--radius-sm); }

.btn-link { color: var(--muted); font-size: 0.86rem; padding: 6px; }

.btn-link.danger { color: var(--rose); }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- 卡片与列表 ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-title-row h3 { font-size: 1.02rem; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 22px 2px 12px;
}

.section-head h2 { font-size: 1.05rem; }

.section-head .more { font-size: 0.84rem; color: var(--muted); }

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line-soft);
}

.list-item:last-child { border-bottom: none; }

.list-item .grow { flex: 1; min-width: 0; }

.list-item .title { font-weight: 600; font-size: 0.96rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list-item .sub { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

.empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.empty svg { width: 52px; height: 52px; opacity: 0.5; margin-bottom: 10px; }

/* ---------------- 徽章 / 标签 / 状态 ---------------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.tag-green { background: var(--green-mist); color: var(--green-deep); }
.tag-honey { background: var(--honey-mist); color: #8A6425; }
.tag-rose  { background: var(--rose-mist); color: var(--rose); }
.tag-sky   { background: var(--sky-mist); color: var(--sky); }
.tag-gray  { background: var(--bg-deep); color: var(--muted); }

.stat-inline { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; color: var(--ink-2); }

/* ---------------- 学员端：顶部问候 ---------------- */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #5E8A73 0%, #47705B 100%);
  border-radius: var(--radius-lg);
  color: #fff;
  padding: 22px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.hero::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -40px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 70%);
}

.hero .hello { font-size: 1.22rem; font-weight: 700; }

.hero .sub { font-size: 0.84rem; opacity: 0.85; margin-top: 4px; }

.hero-stats { display: flex; gap: 18px; margin-top: 16px; position: relative; }

.hero-stats .num { font-size: 1.3rem; font-weight: 700; }

.hero-stats .lab { font-size: 0.74rem; opacity: 0.82; }

.hero-leaf { position: absolute; right: 18px; bottom: 14px; opacity: 0.5; }

/* ---------------- 底部导航（学员端） ---------------- */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: center;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}

.bottom-nav-inner { display: flex; width: 100%; max-width: 420px; }

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0 2px;
  color: var(--muted);
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}

.bottom-nav a svg { width: 23px; height: 23px; }

.bottom-nav a.active { color: var(--green-deep); font-weight: 600; }

/* ---------------- 培训卡片 ---------------- */

.training-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 12px;
  transition: transform 0.15s, box-shadow 0.2s;
  display: block;
  color: var(--ink);
}

.training-card:active { transform: scale(0.985); }

.training-card h3 { font-size: 1.05rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }

.training-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

.progress-track {
  height: 7px;
  background: var(--bg-deep);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6C9A80, var(--green));
  border-radius: 99px;
  transition: width 0.5s ease;
}

.progress-row { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-top: 6px; }

/* ---------------- 打卡成功页 ---------------- */

.checkin-result {
  max-width: 420px;
  margin: 0 auto;
  padding: 48px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.checkin-icon {
  width: 92px;
  height: 92px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-mist);
  animation: pop-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.checkin-icon svg { width: 44px; height: 44px; }

.checkin-icon.warn { background: var(--honey-mist); }

.checkin-icon.bad { background: var(--rose-mist); }

@keyframes pop-in {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.checkin-result h2 { text-align: center; font-size: 1.3rem; margin-bottom: 6px; }

.checkin-result .sub { text-align: center; color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }

.checkin-info-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 22px;
}

.checkin-info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.94rem;
}

.checkin-info-row:last-child { border-bottom: none; }

.checkin-info-row .k { color: var(--muted); }

.checkin-info-row .v { font-weight: 600; text-align: right; }

.checkin-info-row .v.time { color: var(--green-deep); font-variant-numeric: tabular-nums; }

/* ---------------- 答题 ---------------- */

.quiz-card { margin-bottom: 14px; }

.quiz-card .q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }

.q-index {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--green-mist);
  color: var(--green-deep);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.q-title { font-weight: 600; font-size: 0.98rem; line-height: 1.55; margin-bottom: 12px; white-space: pre-wrap; word-break: break-word; }

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  margin-bottom: 9px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.option-row:hover { border-color: #B9CDBD; }

.option-row input[type="radio"] {
  accent-color: var(--green);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.option-row .opt-letter {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--bg-deep);
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.option-row .opt-text { flex: 1; font-size: 0.94rem; word-break: break-word; }

.result-chip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 0.88rem;
  margin-top: 10px;
  line-height: 1.5;
}

.result-chip.good { background: var(--green-mist); color: var(--green-deep); }
.result-chip.bad { background: var(--rose-mist); color: var(--rose); }
.result-chip.wait { background: var(--honey-mist); color: #8A6425; }

.quiz-submit-bar {
  position: sticky;
  bottom: calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.quiz-submit-bar .hint { flex: 1; font-size: 0.78rem; color: var(--muted); padding-left: 6px; }

.char-count { text-align: right; font-size: 0.74rem; color: var(--muted); margin-top: 4px; }

/* ---------------- 教师端 ---------------- */

.admin-shell { max-width: 1020px; margin: 0 auto; padding: 0 16px 60px; position: relative; z-index: 1; }

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 242, 234, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  margin: 0 -16px 20px;
  padding: 10px 16px;
}

.admin-topbar-inner {
  max-width: 1020px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.02rem; }

.admin-logo svg { width: 26px; height: 26px; }

.admin-logo .role-tag { font-size: 0.7rem; background: var(--green-mist); color: var(--green-deep); padding: 2px 8px; border-radius: 99px; font-weight: 600; }

.admin-nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }

.admin-nav a {
  padding: 7px 14px;
  border-radius: 99px;
  color: var(--ink-2);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.admin-nav a.active { background: var(--green); color: #fff; }

.admin-user { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--muted); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.stat-card .num { font-size: 1.5rem; font-weight: 700; color: var(--green-deep); font-variant-numeric: tabular-nums; }

.stat-card .num.honey { color: var(--honey); }

.stat-card .lab { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

/* 分段选项卡 */
.seg-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-deep);
  border-radius: 99px;
  padding: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.seg-tabs button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.seg-tabs button.active { background: var(--surface); color: var(--green-deep); box-shadow: var(--shadow-soft); }

.seg-tabs button .dot {
  display: inline-block;
  min-width: 17px;
  height: 17px;
  line-height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--rose);
  color: #fff;
  font-size: 0.7rem;
  margin-left: 4px;
}

/* 表格 */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 560px;
}

table.data th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

table.data tr:last-child td { border-bottom: none; }

table.data .actions { display: flex; gap: 6px; flex-wrap: wrap; }

table.data td.num { font-variant-numeric: tabular-nums; }

/* 场次卡片 */
.session-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.session-card:last-child { border-bottom: none; }

.session-card .s-info { flex: 1; min-width: 160px; }

.session-card .s-title { font-weight: 600; }

.session-card .s-sub { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

/* 题目卡片 */
.question-item { border-bottom: 1px solid var(--line-soft); padding: 14px 0; }

.question-item:last-child { border-bottom: none; }

.question-item .q-line { display: flex; gap: 8px; align-items: flex-start; }

.question-item .opts { margin: 8px 0 0 34px; font-size: 0.86rem; color: var(--ink-2); }

.question-item .opts .right { color: var(--green-deep); font-weight: 700; }

/* 评分卡片 */
.grade-card { margin-bottom: 12px; }

.grade-card .g-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }

.grade-card .g-answer {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}

.grade-form { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }

.grade-form .score-input { width: 92px; flex-shrink: 0; }

.grade-form .feedback-input { flex: 1; min-width: 200px; }

/* 工具行 */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }

.toolbar .spacer { flex: 1; }

.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.inline-form .field { margin-bottom: 0; flex: 1; min-width: 140px; }

.inline-form .btn { flex-shrink: 0; }

/* ---------------- 弹窗 ---------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 58, 51, 0.4);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 480px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px;
  animation: slide-up 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slide-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal h3 { font-size: 1.08rem; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.modal .modal-close {
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  padding: 4px;
  border-radius: 8px;
}

.modal .modal-close:hover { color: var(--ink); }

.modal-actions { display: flex; gap: 10px; margin-top: 18px; }

.modal-actions .btn { flex: 1; }

/* 二维码弹窗 */
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 4px;
}

.qr-box .qr-canvas {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.qr-box img, .qr-box canvas { display: block; }

.qr-url {
  width: 100%;
  margin-top: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.78rem;
  color: var(--ink-2);
  word-break: break-all;
  text-align: center;
}

.qr-tip { font-size: 0.8rem; color: var(--muted); text-align: center; margin-top: 10px; line-height: 1.6; }

/* ---------------- Toast ---------------- */

#toast-wrap {
  position: fixed;
  top: 18px;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(45, 58, 51, 0.92);
  color: #fff;
  padding: 11px 20px;
  border-radius: 99px;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  max-width: 86vw;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s, transform 0.25s;
}

.toast.show { opacity: 1; transform: translateY(0); }

.toast.success { background: rgba(62, 99, 80, 0.95); }

.toast.error { background: rgba(150, 68, 60, 0.95); }

/* ---------------- 加载 ---------------- */

.loading {
  text-align: center;
  padding: 60px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.loading .spin {
  width: 30px;
  height: 30px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--green);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--bg-deep) 25%, #F1EEE3 50%, var(--bg-deep) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------- 打印（二维码） ---------------- */

@media print {
  body * { visibility: hidden; }
  .qr-print-area, .qr-print-area * { visibility: visible; }
  .qr-print-area {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 40px;
  }
  .qr-print-area .qr-canvas { border: 2px solid #333; padding: 20px; }
  .qr-print-area h2 { font-size: 22px; margin-bottom: 6px; }
  .qr-print-area p { font-size: 14px; color: #333; }
}

/* ---------------- 响应式 ---------------- */

@media (min-width: 768px) {
  .app-frame { padding-top: 32px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .admin-shell { padding: 0 24px 80px; }
  .admin-topbar { margin: 0 -24px 24px; padding: 12px 24px; }
}

@media (min-width: 1440px) {
  .app-frame { padding-top: 48px; }
  .admin-shell { padding: 0 32px 100px; }
}

@media (max-width: 374px) {
  .hero-stats { gap: 12px; }
  .btn { padding: 11px 16px; }
}

/* ---------------- 题目批量导入 ---------------- */

.import-steps {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.84rem;
  color: var(--ink-2);
  line-height: 1.9;
  margin-bottom: 14px;
}

.import-steps a { font-weight: 600; }

.file-drop {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color 0.2s, background 0.2s;
}

.file-drop:hover { border-color: var(--green); background: var(--green-mist); }

.file-drop svg { width: 26px; height: 26px; color: var(--green); flex-shrink: 0; }

.file-drop b { display: block; font-size: 0.92rem; color: var(--ink); }

.file-drop span { display: block; font-size: 0.78rem; color: var(--muted); }

.imp-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.84rem;
  margin: 14px 0 8px;
}

.imp-list {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface);
}

.imp-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.84rem;
}

.imp-row:last-child { border-bottom: none; }

.imp-row .no {
  flex-shrink: 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.74rem;
  color: var(--muted);
  width: 26px;
}

.imp-row .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.imp-row .why { flex-shrink: 0; font-size: 0.76rem; color: var(--rose); max-width: 46%; }

.imp-note { font-size: 0.78rem; color: var(--muted); margin-top: 8px; }

.ai-prompt {
  width: 100%;
  height: 320px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 12px 14px;
  font-size: 0.84rem;
  line-height: 1.8;
  color: var(--ink);
  font-family: var(--font);
  resize: vertical;
}

.ai-prompt:focus {
  outline: none;
  border-color: var(--green);
  background: var(--surface);
}
