﻿/* 主题变量定义见 theme.css（retro 纸质 / cyber 像素两套，body[data-theme] 切换） */

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  display: flex;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--paper);
  background-image: var(--bg-image);
  background-size: var(--bg-size);
  background-attachment: fixed;
}

/* 左侧侧边栏（纸感档案卷宗风，与主体一致） */
.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: 250px;
  min-height: 100vh;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--line-dark);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  transition: width 0.2s ease;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 14px;
}

.sidebar h1 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 1px;
}
.sidebar h1::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  margin-right: 8px;
}

#sidebar-toggle {
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink-soft);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
#sidebar-toggle:hover { border-color: var(--red); color: var(--red); }

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar nav button, .sidebar-daily, .sidebar-upload, .sidebar-logout {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-family: var(--sans);
  transition: all 0.15s ease;
}
.sidebar nav button:hover { color: var(--red); background: var(--red-soft); }
.sidebar nav button.nav-active {
  border-left: 3px solid var(--red);
  background: var(--red-soft);
  color: var(--red);
  font-weight: 600;
  padding-left: 10px;
}
.sidebar-daily {
  border: 1px solid var(--ink);
  color: var(--inverse-text);
  background: var(--ink);
  text-align: center;
  font-weight: 600;
}
.sidebar-daily:hover { opacity: 0.88; color: var(--inverse-text); background: var(--ink); }

.sidebar-upload {
  border: 1px solid var(--line-dark);
  text-align: center;
  font-weight: 500;
}
.sidebar-upload:hover { border-color: var(--red); color: var(--red); }

#reviewer-link {
  display: flex;
  align-items: center;
  justify-content: center; /* a 元素 flex 容器内文字居中（text-align 对 flex 无效） */
}

.sidebar-logout {
  border: 1px solid var(--line-dark);
  text-align: center;
  font-weight: 500;
  font-size: 13px;
}
.sidebar-logout:hover { border-color: var(--red); color: var(--red); }

/* 主题切换器（侧边栏导航下方） */
.theme-switcher {
  display: flex;
  gap: 6px;
  margin: 14px 4px 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.theme-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-dark);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease;
}
.theme-dot:hover { transform: scale(1.15); }
.theme-dot.theme-active {
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--red-soft);
}

/* 底部操作组：每日更新/上传/退出始终贴底（普通用户无每日/上传时退出也在底部） */
.sidebar-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 收起态 */
.sidebar.collapsed { width: 48px; }
.sidebar.collapsed .sidebar-head { justify-content: center; border-bottom: 1px solid var(--line-dark); }
.sidebar.collapsed h1, .sidebar.collapsed nav, .sidebar.collapsed .sidebar-actions { display: none; }
.sidebar.collapsed #sidebar-toggle { border: none; }

main { flex: 1; max-width: 880px; margin: 28px auto; padding: 0 20px 60px; min-width: 0; }

.primary, #result-back, #answer-back, #detail-back, #detail-delete, #review-back {
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--sans);
  transition: all 0.15s ease;
}
#result-back:hover, #answer-back:hover, #detail-back:hover, #review-back:hover {
  border-color: var(--red);
  color: var(--red);
}
button:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

.hidden { display: none !important; }

.card {
  background: var(--card);
  border: var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 18px 22px;
  margin-bottom: 14px;
}

.card-list { display: flex; flex-direction: column; }

/* 右侧日历面板附加内容（打卡圆点 / 当日完成情况 / 答题趋势 / 概览） */
.panel-extra {
  margin-top: 14px;
  border-top: 1px solid var(--line-dark);
  padding-top: 12px;
}

/* 题库页：面板只保留概览（隐藏日历相关块） */
#calendar-panel.panel-extra-only .calendar-head,
#calendar-panel.panel-extra-only .calendar-clear-row,
#calendar-panel.panel-extra-only .calendar-week,
#calendar-panel.panel-extra-only .calendar-grid,
#calendar-panel.panel-extra-only .calendar-pick,
#calendar-panel.panel-extra-only .calendar-hint { display: none; }
#calendar-panel.panel-extra-only .panel-extra {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}
.panel-title {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: 1px;
  color: var(--ink);
}
.panel-line { font-size: 13px; margin: 0 0 6px; }

/* 当日完成进度条 */
.progress-track {
  height: 8px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  background: var(--card);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: var(--radius-sm);
  transition: width 0.3s ease;
}

/* 日历格圆点：空心 = 有题未做，实心 = 有题已答 */
.calendar-cell { position: relative; }
.cal-dot {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--red);
  background: transparent;
}
.calendar-cell.done .cal-dot { background: var(--red); }

/* 答题趋势柱状图 */
.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 110px;
}
.trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}
.trend-bar {
  width: 100%;
  max-width: 22px;
  background: var(--red-soft);
  border: 1px solid var(--line-dark);
  border-radius: 2px 2px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  min-height: 2px;
}
.trend-bar span {
  position: absolute;
  top: -16px;
  font-size: 10px;
  color: var(--ink-soft);
}
.trend-day {
  font-size: 10px;
  color: var(--ink-soft);
  margin-top: 4px;
  text-align: center;
  white-space: nowrap;
}

/* 概览数字 */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 6px;
}
.ov-item {
  text-align: center;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.ov-num {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--red);
}
.ov-label {
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 1px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 34px 22px;
}
.empty-mark {
  display: block;
  font-size: 34px;
  line-height: 1;
  color: var(--line-dark);
  margin-bottom: 10px;
}
.empty-state p { margin: 2px 0; }

/* 档案抬头（今日统计） */
.summary-card {
  border: none;
  background: transparent;
  padding: 6px 2px 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--ink);
}
.summary-num {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.5px;
}
.summary-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
  letter-spacing: 2px;
}

.filter-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-bar label { font-size: 13px; color: var(--ink-soft); }
.filter-bar select {
  margin-left: 6px;
  padding: var(--input-pad);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
}

.fav-btn {
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  padding: var(--btn-sm-pad);
  cursor: pointer;
  font-size: var(--font-sm);
  line-height: 1.3;
}
.fav-btn.active {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-soft);
}
.fav-btn:hover { border-color: var(--red); color: var(--red); }

#bank-search {
  margin-left: 6px;
  width: 170px;
  padding: var(--input-pad); padding-left: 28px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6a5e' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.5' y2='16.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 8px center;
  background-size: 13px;
  outline: none;
  transition: all 0.15s ease;
}
#bank-search:hover { border-color: var(--ink-soft); }
#bank-search:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}
#bank-search::placeholder { color: var(--ink-soft); opacity: 0.7; }

.bank-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 16px 0 8px;
}
#bank-goto {
  width: 64px;
  padding: var(--input-pad);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--sans);
  background: var(--card);
  color: var(--ink);
  outline: none;
}
#bank-goto:focus { border-color: var(--red); }
#bank-goto-btn {
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink);
  padding: var(--btn-pad);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--sans);
  transition: all 0.15s ease;
}
#bank-goto-btn:hover { border-color: var(--red); color: var(--red); }
.bank-pager select {
  margin-left: 4px;
  padding: var(--input-pad);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--sans);
  background: var(--card);
  color: var(--ink);
  outline: none;
}
.bank-pager select:focus { border-color: var(--red); }
.bank-pager button {
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink);
  padding: var(--btn-pad);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--sans);
  transition: all 0.15s ease;
}
.bank-pager button:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.bank-pager button:disabled { opacity: 0.4; cursor: not-allowed; }

.question-card { cursor: pointer; }
.question-card:hover {
  border-color: var(--red);
  transform: translateY(-1px);
}

.question-head { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }

.bank-check {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
  cursor: pointer;
  flex-shrink: 0;
}

.badge {
  font-size: 12px;
  padding: 1px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink-soft);
  font-weight: 500;
}
.badge-todo {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}
.badge-done {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin: 12px 0;
  line-height: 1.5;
}

.question-card p {
  font-size: 15px;
  font-weight: 500;
  margin: 8px 0 2px;
}

.meta { color: var(--ink-soft); font-size: 13px; margin: 4px 0; }

.chat-item {
  margin: 10px 0;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-user { background: var(--soft-bg); }
.chat-interviewer {
  border-left: 3px solid var(--red);
  background: var(--card);
  color: var(--ink);
}
.chat-latest { border-left: 3px solid var(--red); }
.chat-level {
  display: inline-block;
  font-size: 11px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--red);
  background: var(--red-soft);
  color: var(--red);
  margin-left: 8px;
  font-family: var(--serif);
}

.attempt-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.attempt-tab {
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink);
  padding: var(--btn-pad);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--sans);
  transition: all 0.15s ease;
}
.attempt-tab:hover { border-color: var(--red); color: var(--red); }
.attempt-tab.active {
  border-color: var(--ink);
  border-bottom: 2px solid var(--red);
  font-weight: 600;
}

.history-delete {
  margin-left: auto;
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink-soft);
  padding: var(--btn-sm-pad);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.history-delete:hover { color: var(--red); border-color: var(--red); }

.weak-tag-entry {
  display: inline-block;
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink);
  padding: var(--btn-sm-pad);
  border-radius: var(--radius-sm);
  font-size: var(--font-btn);
  cursor: pointer;
  margin: 0 8px 8px 0;
  font-family: var(--sans);
  transition: all 0.15s ease;
}
.weak-tag-entry:hover { border-color: var(--red); color: var(--red); }
.weak-tag-entry .badge { margin-left: 4px; }

.rev-tags-open {
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--red);
  border-radius: var(--radius-sm);
  width: 24px;
  height: 24px;
  line-height: 1;
  margin-left: 8px;
  cursor: pointer;
  font-size: 15px;
  vertical-align: middle;
}
.rev-tags-open:hover { border-color: var(--red); background: var(--red-soft); }

.rv-tags-scroll { overflow: auto; max-height: 60vh; }
.rev-tags-group { margin-bottom: 12px; }
.rev-tags-group-head {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.rev-tags-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.rev-tags-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  cursor: pointer;
}
.rev-tags-check input { accent-color: var(--red); }

#answer-back, #detail-back, #review-back {
  margin-bottom: 12px;
  margin-left: 0;
}

#detail-delete {
  color: var(--red);
  border-color: var(--red);
  margin-top: 12px;
  margin-right: 8px;
}
#detail-delete:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }
#detail-delete:disabled { opacity: 0.4; cursor: not-allowed; }

textarea {
  width: 100%;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--sans);
  resize: vertical;
  line-height: 1.7;
  background: var(--card);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.primary {
  background: var(--ink);
  color: var(--inverse-text);
  border-color: var(--ink);
  margin-top: 12px;
  font-weight: 600;
  padding: var(--btn-pad);
}
.primary:hover { color: var(--inverse-text); border-color: var(--ink); opacity: 0.88; }
.primary:disabled { opacity: 0.45; cursor: not-allowed; }
.modal-foot .primary { margin-top: 0; font-weight: 400; } /* 弹窗内主按钮与取消按钮字号/粗细一致（仅背景区分主次） */

details { margin: 12px 0; font-size: 14px; }
details summary { cursor: pointer; color: var(--ink-soft); transition: color 0.15s ease; }
details summary:hover { color: var(--red); }

.score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
  font-size: 14px;
}
.score-bar {
  flex: 1;
  height: 6px;
  background: var(--soft-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.score-fill {
  height: 100%;
  background: var(--red);
  border-radius: var(--radius-sm);
}

#result-review, #detail-review { white-space: pre-wrap; }

#result-title {
  font-family: var(--serif);
  color: var(--red);
  font-size: 34px;
  font-weight: 700;
  margin: 8px 0;
}

#result-retry {
  background: var(--red);
  color: var(--inverse-text);
  border: none;
  padding: var(--btn-pad);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
#result-retry:hover { opacity: 0.9; }

/* 右侧常驻日历（纸感档案风，历史日期范围筛选） */
#calendar-panel {
  position: sticky;
  top: 28px;
  align-self: flex-start;
  width: 300px;
  flex-shrink: 0;
  margin: 28px 28px 28px 0;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-md);
}

#calendar-title { cursor: pointer; }
#calendar-title:hover { color: var(--red); }

.calendar-pick {
  position: absolute;
  top: 46px;
  left: 10px;
  right: 10px;
  z-index: 10;
  background: var(--card);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  padding: 10px;
  box-shadow: var(--shadow-modal);
}
.pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
#pick-year {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}
#pick-year-prev, #pick-year-next {
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink-soft);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-sm);
  padding: 0;
  transition: all 0.15s ease;
}
#pick-year-prev:hover, #pick-year-next:hover { border-color: var(--red); color: var(--red); }
.pick-months {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.pick-month {
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink);
  padding: 5px 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--sans);
  transition: all 0.15s ease;
}
.pick-month:hover { background: var(--red-soft); color: var(--red); }
.pick-month.pick-current { border-color: var(--red); color: var(--red); font-weight: 600; }

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
#calendar-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
}
#calendar-prev, #calendar-next {
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink-soft);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-sm);
  padding: 0;
  transition: all 0.15s ease;
}
#calendar-prev:hover, #calendar-next:hover { border-color: var(--red); color: var(--red); }

.calendar-clear-row {
  text-align: right;
  margin-bottom: 8px;
}
#calendar-clear {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-family: var(--sans);
  cursor: pointer;
  padding: 0;
}
#calendar-clear:hover { color: var(--red); }

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.calendar-cell {
  position: relative;
  height: 34px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-family: var(--sans);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.calendar-cell.blank { cursor: default; }
.calendar-cell:hover:not(.blank) { background: var(--red-soft); color: var(--red); }
.calendar-cell.today { border-color: var(--red); color: var(--red); font-weight: 600; }
.calendar-cell.in-range { background: var(--red-soft); }
.calendar-cell.range-start, .calendar-cell.range-end {
  background: var(--red);
  color: var(--inverse-text);
  font-weight: 600;
}
.calendar-hint { font-size: 12px; margin: 10px 0 0; text-align: center; }

.filter-bar input[type="date"] {
  margin-left: 6px;
  padding: var(--input-pad);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
  outline: none;
}
.filter-bar input[type="date"]:focus { border-color: var(--red); }

@media (max-width: 1100px) and (min-width: 769px) {
  #calendar-panel { display: none; }
}

/* 移动端：汉堡按钮 + 侧边栏抽屉 + 日历弹层 */
.hamburger {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 60;
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  box-shadow: var(--shadow-modal);
}
.hamburger.cal-toggle { left: 56px; }

#ui-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 90;
  max-width: 86%;
  background: var(--ink);
  color: var(--inverse-text);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--sans);
  box-shadow: var(--shadow-modal);
}
#ui-toast.toast-error { background: var(--red); }

.calendar-close {
  display: none;
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink-soft);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-sm);
  padding: 0;
  margin-left: auto;
}

@media (max-width: 768px) {
  .hamburger { display: block; }
  .calendar-close { display: inline-block; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 55;
    width: 240px;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-modal);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar.collapsed { width: 240px; }
  body.sidebar-open .sidebar.collapsed h1,
  body.sidebar-open .sidebar.collapsed nav,
  body.sidebar-open .sidebar.collapsed .sidebar-actions { display: flex; }
  body.sidebar-open .sidebar.collapsed #sidebar-toggle { border: 1px solid var(--line-dark); }
  main { margin: 64px auto 40px; padding: 0 14px 60px; max-width: 100%; }
  #calendar-panel {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    width: 280px;
    margin: 0;
    border-right: none;
    border-top: none;
    border-bottom: none;
    overflow-y: auto;
  }
  .question-head { flex-wrap: wrap; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .upload-row { flex-wrap: wrap; }
  #ui-toast { bottom: 16px; }
}

/* 上传页 */
.upload-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.upload-tab {
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--sans);
  transition: all 0.15s ease;
}
.upload-tab:hover { border-color: var(--red); color: var(--red); }
.upload-tab.upload-active {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
  font-weight: 600;
}
.upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}
#upload-count {
  width: 70px;
  margin-left: 8px;
  padding: var(--input-pad);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--sans);
  background: var(--card);
  color: var(--ink);
}
#upload-status { margin-top: 12px; font-size: 13px; }
#upload-status.upload-ok { color: var(--green); }
#upload-status.upload-err { color: var(--red); }
.candidate-stem {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--sans);
  background: var(--card);
  color: var(--ink);
  resize: vertical;
  outline: none;
}
.candidate-stem:focus { border-color: var(--red); }
#candidate-confirm { margin-top: 10px; }

.export-link {
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

/* 登录/注册 */
.auth-card {
  max-width: 420px;
  margin: 60px auto;
  padding: 24px;
}
.auth-title {
  font-family: var(--serif);
  font-size: 26px;
  margin: 0 0 4px;
}
.auth-form label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 10px 0 4px;
}
.auth-form input {
  width: 100%;
  box-sizing: border-box;
  padding: var(--input-pad);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--sans);
  background: var(--card);
  color: var(--ink);
  outline: none;
}
.auth-form input:focus { border-color: var(--red); }
#auth-submit { margin-top: 14px; width: 100%; }
#auth-error { color: var(--red); }

/* 管理员按钮与编辑弹层 */
.admin-btn {
  margin-left: auto;
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink-soft);
  padding: var(--btn-sm-pad);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--sans);
  transition: all 0.15s ease;
}
.admin-btn:hover { border-color: var(--red); color: var(--red); }
.admin-delete:hover { border-color: var(--red); color: var(--red); }
.modal {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 40%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-card {
  width: 480px;
  max-width: 92vw;
  max-height: 88vh;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-modal);
}
.modal-card label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 10px 0 4px;
}
.modal-card input, .modal-card select, .modal-card textarea {
  width: 100%;
  box-sizing: border-box;
  padding: var(--input-pad);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--sans);
  background: var(--card);
  color: var(--ink);
  outline: none;
}
.modal-card textarea { resize: vertical; }
.modal-card input:focus, .modal-card textarea:focus, .modal-card select:focus { border-color: var(--red); }
.modal-foot {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-foot button {
  border: 1px solid var(--line-dark);
  background: var(--card);
  color: var(--ink);
  padding: var(--btn-pad);
  border-radius: var(--radius-sm);
  font-size: var(--font-btn);
  cursor: pointer;
}
.modal-foot button:hover { border-color: var(--red); color: var(--red); }
#qm-error { color: var(--red); }







