/* kaoshibao 刷题前端 — 与 static 下各页 class 一致 */

:root {
  --color-bg: #f4f4f8;
  --color-surface: #ffffff;
  --color-text: #1e1b2e;
  --color-muted: #6b6580;
  --color-primary: #4338ca;
  --color-primary-hover: #3730a3;
  --color-primary-soft: #e0e7ff;
  --color-border: #e2e8f0;
  --color-success: #059669;
  --color-success-bg: #ecfdf5;
  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(30, 27, 46, 0.08);
  --font: "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
}

/* —— 登录页 —— */
.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 2rem;
  position: relative;
  overflow-x: hidden;
}

.auth-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
      ellipse 120% 80% at 50% -20%,
      rgba(67, 56, 202, 0.18),
      transparent 55%
    ),
    radial-gradient(
      ellipse 80% 50% at 100% 100%,
      rgba(99, 102, 241, 0.12),
      transparent 45%
    );
}

.auth-main {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.login-hero {
  text-align: center;
  margin-bottom: 1.25rem;
}

.login-logo__mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--color-primary), #6366f1);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(67, 56, 202, 0.35);
}

.login-tagline {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.login-card {
  box-shadow: var(--shadow);
}

.login-footer {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* —— 顶栏 —— */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0 0.35rem 0 0.25rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.top-bar--balanced {
  padding: 0 0.75rem;
}

.top-bar__edge {
  flex: 0 0 44px;
  min-height: 44px;
}

.top-bar__edge--end {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 44px;
}

.top-bar__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.top-bar__back {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-bar__back:hover {
  background: var(--color-primary-soft);
}

.top-bar__back::before {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(2px, -1px);
}

.top-bar__title {
  flex: 1;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
}

.top-bar__spacer {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}

.top-bar__action {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--color-primary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.top-bar__action:hover {
  background: var(--color-primary-soft);
}

/* —— 页面主体 —— */
.page-body {
  padding: 1rem 1rem 2.5rem;
  max-width: 720px;
  margin: 0 auto;
}

.page-body--tight-top {
  padding-top: 0.75rem;
}

/* —— 卡片 —— */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  margin-bottom: 1rem;
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(30, 27, 46, 0.04);
}

.card-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.card-sub {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-muted);
}

.hint code {
  font-size: 0.82em;
  background: #f1f5f9;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  margin: 0 0 0.5rem;
}

/* —— 表单 —— */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.inline-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.inline-row .form-group {
  flex: 1;
  min-width: 120px;
}

/* —— 按钮 —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: #fff;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-ghost {
  background: transparent;
  color: var(--color-muted);
  border-color: transparent;
}

.btn-ghost:hover {
  background: #f1f5f9;
  color: var(--color-text);
}

.btn-sm {
  min-height: 36px;
  padding: 0.4rem 0.65rem;
  font-size: 0.88rem;
}

.row-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* —— 首页用户条 —— */
.user-banner {
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    #6366f1 100%
  );
  color: #fff;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 28px rgba(67, 56, 202, 0.28);
}

.user-banner__name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.user-banner__meta {
  font-size: 0.9rem;
  opacity: 0.92;
}

/* —— 模式方块 —— */
.grid-modes {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mode-tile {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mode-tile:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 16px rgba(67, 56, 202, 0.1);
}

.mode-tile__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
}

.mode-tile__icon--seq {
  background: linear-gradient(145deg, #4338ca, #6366f1);
}
.mode-tile__icon--rnd {
  background: linear-gradient(145deg, #0d9488, #14b8a6);
}
.mode-tile__icon--wrong {
  background: linear-gradient(145deg, #dc2626, #f97316);
}

.mode-tile__body h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.mode-tile__body p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--color-muted);
  line-height: 1.45;
}

/* —— 表格 —— */
.table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.table-users {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table-users th,
.table-users td {
  padding: 0.55rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.table-users th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--color-muted);
}

.table-users tbody tr:last-child td {
  border-bottom: none;
}

.table-users input {
  width: 100%;
  min-width: 72px;
  font: inherit;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.tpl-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.import-result {
  display: block;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin: 0;
  max-height: 320px;
  overflow: auto;
}

/* —— 专业目录 —— */
.specialty-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.sp-title {
  font-size: 1.05rem;
}

/* —— 做题页 —— */
.practice-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.practice-meta-bar {
  font-size: 0.88rem;
  color: var(--color-muted);
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.practice-meta-bar__label {
  margin-right: 0.35rem;
}

.practice-meta-bar__id {
  color: var(--color-primary);
}

.question-card {
  padding: 1rem 1.1rem;
}

.question-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.question-stem {
  font-size: 1.02rem;
  line-height: 1.65;
  user-select: none;
}

.options-panel {
  user-select: none;
}

.options-list {
  padding: 0.35rem 0;
}

.option-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.35rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
}

.option-row:hover {
  background: #f8fafc;
}

.option-row input {
  margin-top: 0.2rem;
  accent-color: var(--color-primary);
}

.option-row span {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.5;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  vertical-align: middle;
  margin-right: 0.35rem;
  letter-spacing: 0.02em;
}

.badge-single {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.badge-multi {
  background: #ccfbf1;
  color: #0f766e;
}
.badge-judge {
  background: #ffedd5;
  color: #c2410c;
}

.result-panel {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.result-panel.ok {
  background: var(--color-success-bg);
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.result-panel.bad {
  background: var(--color-danger-bg);
  border: 1px solid #fecaca;
  color: #991b1b;
}

.result-panel code {
  font-size: 0.9em;
}

.finish-panel a {
  color: var(--color-primary);
  font-weight: 600;
}

.practice-footnote {
  margin: 1.25rem 0 0;
  font-size: 0.8rem;
  color: var(--color-muted);
  text-align: center;
}

/* —— Toast —— */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(120%);
  z-index: 200;
  max-width: min(90vw, 360px);
  padding: 0.65rem 1rem;
  background: #1e1b2e;
  color: #fff;
  font-size: 0.9rem;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* —— 双入口登录页：考生 / 管理员 —— */
.auth-body--student {
  --student-accent: #0d9488;
  --student-accent-dark: #0f766e;
  --student-glow: rgba(13, 148, 136, 0.22);
}

.auth-student-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(165deg, #ecfdf5 0%, #f0fdfa 35%, #e0f2fe 100%);
}

.auth-student-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      ellipse 100% 70% at 80% -15%,
      var(--student-glow),
      transparent 50%
    ),
    radial-gradient(
      ellipse 60% 40% at 0% 100%,
      rgba(59, 130, 246, 0.12),
      transparent 45%
    );
}

.auth-main--wide {
  max-width: 420px;
}

.auth-student-hero {
  text-align: center;
  margin-bottom: 1.35rem;
}

.auth-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}

.auth-badge--student {
  background: rgba(13, 148, 136, 0.15);
  color: var(--student-accent-dark);
  border: 1px solid rgba(13, 148, 136, 0.35);
}

.auth-student-title {
  margin: 0 0 0.5rem;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.auth-student-lead {
  margin: 0;
  font-size: 0.94rem;
  color: var(--color-muted);
  line-height: 1.65;
  max-width: 36ch;
  margin-inline: auto;
}

.auth-student-card {
  border: 1px solid rgba(13, 148, 136, 0.2);
  box-shadow: 0 12px 40px rgba(13, 148, 136, 0.1), var(--shadow);
}

.auth-form-title {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.auth-form-hint {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--color-muted);
}

.auth-form .form-group:last-of-type {
  margin-bottom: 1rem;
}

.btn-student-primary {
  background: linear-gradient(180deg, #14b8a6, var(--student-accent));
  border: none !important;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.4);
}

.btn-student-primary:hover {
  filter: brightness(1.05);
  background: linear-gradient(
    180deg,
    #2dd4bf,
    var(--student-accent-dark)
  );
}

.auth-student-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.auth-student-links a {
  color: var(--student-accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.auth-student-links a:hover {
  text-decoration: underline;
}

.auth-link-admin {
  color: var(--color-muted) !important;
  font-weight: 500 !important;
  font-size: 0.85rem !important;
}

.auth-dot {
  color: var(--color-border);
  user-select: none;
}

.auth-student-footnote {
  margin: 1.35rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.auth-student-footnote code {
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.04);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* 管理员登录 —— 深色控制台风格 */
.auth-body--admin {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 2rem;
  position: relative;
  overflow-x: hidden;
  background: #0a0f1a;
  color: #e2e8f0;
}

.auth-admin-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
      ellipse 80% 55% at 50% 0%,
      rgba(245, 158, 11, 0.12),
      transparent 55%
    ),
    radial-gradient(ellipse 50% 40% at 100% 80%, rgba(59, 130, 246, 0.08), transparent);
}

.auth-admin-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: linear-gradient(
      rgba(148, 163, 184, 0.07) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
}

.auth-admin-main {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.auth-admin-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-admin-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #1e293b, #334155);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.auth-badge--admin {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.auth-admin-title {
  margin: 0.35rem 0 0.25rem;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.auth-admin-sub {
  margin: 0;
  font-size: 0.88rem;
  color: #94a3b8;
}

.auth-admin-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
}

.auth-form-title--light {
  color: #f8fafc;
}

.auth-form-hint--muted {
  color: #94a3b8 !important;
}

.input-admin {
  background: rgba(30, 41, 59, 0.6) !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
  color: #f1f5f9 !important;
}

.auth-body--admin .form-group label {
  color: #cbd5e1;
}

.btn-admin-primary {
  background: linear-gradient(180deg, #f59e0b, #d97706);
  border: none !important;
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
}

.btn-admin-primary:hover {
  filter: brightness(1.08);
}

.auth-admin-back {
  margin: 1.1rem 0 0;
  text-align: center;
  font-size: 0.88rem;
}

.auth-admin-back a {
  color: #94a3b8;
  text-decoration: none;
}

.auth-admin-back a:hover {
  color: #e2e8f0;
  text-decoration: underline;
}

.auth-admin-warning {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.5;
}

/* 嵌入工作台 iframe 时隐藏子页顶栏 */
html.admin-embed .top-bar {
  display: none !important;
}

html.admin-embed .page-body--tight-top {
  padding-top: 1rem;
}

/* —— 管理后台：侧栏 + 多标签工作台 —— */
.admin-workspace {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--color-bg);
}

.admin-workspace__sidebar {
  width: 232px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(148, 163, 184, 0.15);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.06);
}

.admin-workspace__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.admin-workspace__brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(145deg, #334155, #475569);
  color: #fbbf24;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-workspace__brand-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
  color: #f8fafc;
}

.admin-workspace__brand-sub {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.12rem;
}

.admin-workspace__nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.65rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-nav__btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.admin-nav__btn:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #f8fafc;
}

.admin-nav__btn.is-open {
  background: rgba(245, 158, 11, 0.18);
  color: #fef3c7;
  border-left: 3px solid #f59e0b;
  padding-left: calc(0.75rem - 3px);
}

.admin-workspace__footer {
  padding: 0.75rem 0.65rem 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-workspace__footlink {
  font-size: 0.85rem;
  color: #94a3b8;
  text-align: center;
  text-decoration: none;
}

.admin-workspace__footlink:hover {
  color: #e2e8f0;
  text-decoration: underline;
}

.admin-workspace__logout {
  margin: 0;
  background: rgba(248, 250, 252, 0.08) !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
  color: #e2e8f0 !important;
}

.admin-workspace__logout:hover {
  background: rgba(248, 250, 252, 0.14) !important;
}

.admin-workspace__main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 自定义 display 会盖过 [hidden] 的默认 none，导致「空状态」在打开标签后仍占位 */
.admin-workspace-empty[hidden],
.admin-tab-panes[hidden],
.admin-tab-bar-wrap[hidden] {
  display: none !important;
}

.admin-tab-bar-wrap {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 0.35rem 0.5rem 0;
}

.admin-tab-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  max-width: 200px;
  border-radius: 8px 8px 0 0;
  border: 1px solid var(--color-border);
  border-bottom: none;
  background: #f1f5f9;
  overflow: hidden;
}

.admin-tab--active {
  background: #fff;
  border-color: var(--color-border);
  box-shadow: 0 -2px 0 #4338ca inset;
}

.admin-tab__label {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.5rem 0.45rem 0.65rem;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.admin-tab__close {
  flex-shrink: 0;
  width: 28px;
  height: 100%;
  min-height: 36px;
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
}

.admin-tab__close:hover {
  background: rgba(220, 38, 38, 0.12);
  color: var(--color-danger);
}

.admin-workspace-empty {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--color-muted);
  text-align: center;
}

.admin-workspace-empty__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}

.admin-workspace-empty__hint {
  margin: 0;
  font-size: 0.9rem;
  max-width: 28rem;
  line-height: 1.55;
}

.admin-tab-panes {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #fff;
}

.admin-tab-pane {
  position: absolute;
  inset: 0;
  background: #fff;
}

.admin-tab-pane__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@media (max-width: 720px) {
  .admin-workspace {
    flex-direction: column;
  }

  .admin-workspace__sidebar {
    width: 100%;
    max-height: none;
  }

  .admin-workspace__nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .admin-nav__btn {
    flex: 1 1 auto;
    min-width: 120px;
    text-align: center;
  }
}
