/**
 * 北京大学中文考研真题研习系统 - 样式表
 * 文件路径: css/style.css
 * 配色体系: 北大深红 (#8B0000) · 古铜金 (#C9A96E) · 宣纸暖白 (#FAF8F5)
 */

/* ==========================================
 * 1. 变量与基础规范 (Design Tokens)
 * ========================================== */
:root {
  --pku-red: #8b0000;
  --pku-red-hover: #700000;
  --pku-red-dark: #580000;
  --pku-red-light: #faf0f0;
  --pku-gold: #c9a96e;
  --pku-gold-dark: #a68545;
  --pku-gold-light: #fdfaf2;
  --bg-paper: #faf8f5;
  --card-bg: #ffffff;
  --text-dark: #222222;
  --text-sub: #555555;
  --text-muted: #888888;
  --border-color: #e8e2d8;
  --border-dark: #d4ccc0;
  --wrong: #c93b3b;
  --wrong-bg: #fdf0f0;
  --star: #d48806;
  --star-bg: #fffbe6;
  --ok: #278248;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(139, 0, 0, 0.08);
  --shadow-hover: 0 8px 24px rgba(139, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Serif SC", "STSong",
    "Songti SC", "SimSun", "Microsoft YaHei", serif, sans-serif;
  background-color: var(--bg-paper);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* ==========================================
 * 2. 顶部校训栏 (Top Motto Bar)
 * ========================================== */
.top-motto-bar {
  background: #191414;
  color: var(--pku-gold);
  border-bottom: 1px solid rgba(201, 169, 110, 0.2);
  padding: 6px 0;
  font-size: 12px;
}

.motto-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.motto-cn {
  font-weight: 700;
  letter-spacing: 2px;
}

.motto-en {
  font-family: "Georgia", serif;
  font-style: italic;
  color: #a89f91;
  font-size: 11px;
}

/* ==========================================
 * 3. 顶部导航栏 (Header)
 * ========================================== */
.header {
  background-color: #ffffff;
  border-bottom: 2px solid var(--pku-red);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 70px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.brand-emblem {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--pku-red);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  border: 2px solid var(--pku-gold);
  font-family: "STSong", "Songti SC", serif;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 19px;
  font-weight: 900;
  color: var(--pku-red);
  font-family: "STSong", "Songti SC", "SimSun", serif;
  letter-spacing: 2px;
  line-height: 1.2;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-item a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-dark);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item a:hover {
  color: var(--pku-red);
  background: var(--pku-red-light);
}

.nav-item a.active {
  color: var(--pku-red);
  font-weight: 700;
  background: var(--pku-red-light);
}

/* AI 批改专属样式：纯深红字体、无底框、加宽间距 */
.nav-item a.nav-ai-grade {
  color: var(--pku-red) !important;
  font-weight: 700;
  padding: 8px 22px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.nav-item a.nav-ai-grade:hover {
  color: var(--pku-red-hover) !important;
  opacity: 0.85;
}

/* ==========================================
 * 4. 顶部横幅区 (Banner)
 * ========================================== */
.banner {
  height: 180px;
  position: relative;
  background: linear-gradient(135deg, #8b0000 0%, #680000 55%, #3d0000 100%);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--pku-gold);
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top right,
    rgba(201, 169, 110, 0.15),
    transparent 70%
  );
}

.banner-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.banner-motto {
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 6px;
  font-family: "STSong", "Songti SC", "SimSun", serif;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.banner-sub {
  font-size: 13.5px;
  color: #e8d0d0;
  margin-top: 6px;
  letter-spacing: 1px;
}

/* ==========================================
 * 5. 主体容器与通用面板 (Layout & Panels)
 * ========================================== */
.main-container {
  max-width: 1200px;
  margin: 28px auto 60px;
  padding: 0 24px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.section-box {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--pku-red);
  margin-bottom: 18px;
}

.section-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--pku-red);
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.section-tip {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================
 * 6. 首页看板组件 (Dashboard Components)
 * ========================================== */
.data-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.data-card {
  background-color: var(--pku-red);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(201, 169, 110, 0.3);
  transition: transform 0.2s ease;
}

.data-card:hover {
  transform: translateY(-3px);
}

.data-number {
  font-size: 34px;
  font-weight: 900;
  font-family: "Georgia", "STSong", serif;
  line-height: 1.1;
  color: #fffef8;
}

.data-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 5px;
}

.portals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.portal-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px 18px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.portal-card:hover {
  transform: translateY(-4px);
  border-color: var(--pku-red);
  box-shadow: var(--shadow-hover);
}

.portal-icon {
  font-size: 26px;
  margin-bottom: 10px;
}

.portal-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.portal-card:hover .portal-name {
  color: var(--pku-red);
}

.portal-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}

.year-btn {
  background: var(--bg-paper);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.year-btn:hover {
  border-color: var(--pku-red);
  background: #fff8f8;
  transform: translateY(-2px);
}

.year-btn.active {
  background: var(--pku-red);
  color: #ffffff;
  border-color: var(--pku-red);
}

.year-title {
  font-size: 16px;
  font-weight: 800;
}

.year-cnt {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.year-btn.active .year-cnt {
  color: #ffcccc;
}

/* ==========================================
 * 7. 题目卡片与作答区 (Question Cards)
 * ========================================== */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.q-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.q-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.badge {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.badge-year {
  background: #ede8df;
  color: #4a453e;
}

.badge-subject {
  background: var(--pku-red-light);
  color: var(--pku-red);
  border: 1px solid #f2d0d0;
}

.badge-code {
  background: #eef2f7;
  color: #1f426d;
}

.badge-type {
  background: #fdf5e6;
  color: #8c610b;
}

.badge-score {
  background: #edf7ed;
  color: #1e592f;
  margin-left: auto;
}

.q-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.7;
  margin-bottom: 12px;
  color: var(--text-dark);
  font-family: "Noto Serif SC", "STSong", serif;
  white-space: pre-line;
}

.q-analysis {
  display: none;
  background: var(--bg-paper);
  border-left: 4px solid var(--pku-red);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px;
  margin: 14px 0;
}

.q-analysis.show {
  display: block;
}

.q-analysis-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--pku-red);
  margin-bottom: 6px;
}

.q-analysis-body {
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-line;
  color: #333333;
}

.q-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag {
  font-size: 11px;
  padding: 2px 8px;
  background: #f0eae1;
  color: var(--text-sub);
  border-radius: var(--radius-sm);
}

.q-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* 按钮规范 */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

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

.btn-primary {
  background: var(--pku-red);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--pku-red-hover);
}

.btn-ghost {
  background: var(--pku-red-light);
  color: var(--pku-red);
  border: 1px solid #f2d0d0;
}

.btn-wrong {
  background: var(--wrong-bg);
  color: var(--wrong);
  border: 1px solid #f8cdcd;
}

.btn-wrong-active {
  background: var(--wrong);
  color: #ffffff;
}

.btn-fav {
  background: var(--star-bg);
  color: #9c6800;
  border: 1px solid #fae69e;
}

.btn-fav-active {
  background: var(--star);
  color: #ffffff;
}

/* 作答框与 AI 批改卡片 */
.ai-grade-container {
  margin-top: 16px;
  border-top: 1px dashed var(--border-color);
  padding-top: 14px;
}

.answer-label {
  font-size: 13px;
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
  color: var(--text-sub);
}

.card-answer-input {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  background: #ffffff;
}

.card-answer-input:focus {
  border-color: var(--pku-red);
  outline: none;
}

.ai-ctrl-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.muted-tip {
  font-size: 12px;
  color: var(--text-muted);
}

.ai-result-box {
  margin-top: 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--pku-red);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.ai-score-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ok);
  margin-bottom: 6px;
}

.ai-score-row {
  font-size: 13px;
  margin-bottom: 4px;
}

.ok-tag {
  color: var(--ok);
}

.miss-tag {
  color: var(--wrong);
}

.ai-feedback-box {
  background: var(--bg-paper);
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: #444444;
  margin-top: 8px;
}

/* ==========================================
 * 8. 模考控制台与答题卡 (Exam Workspace)
 * ========================================== */
.paper-ctrl-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.paper-selects {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.ctrl-label {
  font-size: 13.5px;
  font-weight: 700;
}

.paper-selects select {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: #ffffff;
}

.mode-btn-group {
  display: flex;
  gap: 6px;
}

.paper-nav-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 18px 0 24px;
}

.ac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.ac-cell {
  aspect-ratio: 1;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: all 0.15s ease;
}

.ac-cell.cur {
  background: var(--pku-red);
  color: #ffffff;
  border-color: var(--pku-red);
}

.ac-cell.marked {
  border-color: var(--wrong);
  color: var(--wrong);
}

/* ==========================================
 * 9. 分类与检索组件 (Category & Search)
 * ========================================== */
.subj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.subj-card {
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.subj-card:hover,
.subj-card.active {
  border-color: var(--pku-red);
  background: var(--pku-red-light);
}

.sc-name {
  font-size: 14.5px;
  font-weight: 700;
  display: block;
}

.sc-cnt {
  font-size: 11.5px;
  color: var(--pku-red);
  margin-top: 2px;
  display: block;
}

.type-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.type-chip {
  padding: 6px 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.type-chip:hover {
  border-color: var(--pku-red);
}

.type-chip.active {
  background: var(--pku-red);
  color: #ffffff;
  border-color: var(--pku-red);
}

.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.search-bar input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14.5px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.search-bar input:focus {
  border-color: var(--pku-red);
  outline: none;
}

.search-summary {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================
 * 10. 表单与通用反馈 (Forms, Toast, Empty)
 * ========================================== */
.settings-desc {
  font-size: 13.5px;
  color: var(--text-sub);
  margin-bottom: 16px;
  line-height: 1.6;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.form-input:focus {
  border-color: var(--pku-red);
  outline: none;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.empty-box {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  background: #191414;
  color: #ffffff;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#toast.show {
  opacity: 1;
  bottom: 42px;
}

/* ==========================================
 * 11. 响应式布局 (Responsive Breakpoints)
 * ========================================== */
@media (max-width: 960px) {
  .data-cards-grid,
  .portals-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .year-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 680px) {
  .header-inner {
    padding: 0 16px;
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
    flex-direction: column;
    gap: 10px;
  }
  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }
  .nav-item a {
    font-size: 13px;
    padding: 6px 8px;
  }
  .nav-item a.nav-ai-grade {
    padding: 6px 12px !important;
  }
  .banner {
    height: 150px;
  }
  .banner-motto {
    font-size: 24px;
    letter-spacing: 3px;
  }
  .main-container {
    padding: 0 16px;
  }
  .data-cards-grid,
  .portals-grid {
    grid-template-columns: 1fr;
  }
  .year-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================
 * 12. 微信联系弹窗 (Wechat Contact Modal)
 * ========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 10, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px 28px 24px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--pku-gold);
  transform: scale(0.9);
  transition: transform 0.25s ease;
}

.modal-overlay.show .modal-box {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

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

.modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--pku-red);
  margin-bottom: 16px;
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.modal-qrcode {
  width: 220px;
  max-width: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  margin: 0 auto 14px;
  display: block;
}

.modal-tip {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 18px;
}

.modal-ok {
  width: 100%;
}

/* API Key 显示/隐藏切换按钮 */
.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn .form-input {
  flex: 1;
}

.btn-key-toggle {
  white-space: nowrap;
  padding-left: 14px;
  padding-right: 14px;
}

/* ==========================================
 * 13. 身份认证：验证中 / 登录页 / 状态栏 (Auth Screens)
 * ========================================== */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--bg-paper) 0%, #f3ece2 100%);
  padding: 16px;
}

.auth-checking-box {
  text-align: center;
  color: var(--text-sub);
}

.auth-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 4px solid var(--border-color);
  border-top-color: var(--pku-red);
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

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

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card-bg);
  border: 1px solid var(--pku-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
  padding: 32px 28px 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 18px;
}

.login-title {
  text-align: center;
  font-size: 19px;
  font-weight: 800;
  color: var(--pku-red);
  margin-bottom: 20px;
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-label {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 10px;
}

.login-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: var(--bg-paper);
  color: var(--text-dark);
}

.login-input:focus {
  outline: none;
  border-color: var(--pku-red);
  background: #fff;
}

.login-input:disabled {
  opacity: 0.6;
}

.login-error {
  color: var(--wrong);
  background: var(--wrong-bg);
  border: 1px solid var(--wrong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  margin-top: 12px;
}

.login-submit {
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  font-size: 15px;
}

.login-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-contact {
  margin-top: 16px;
  text-align: center;
}

.login-tip {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-muted);
}

.login-help {
  margin: 10px 0 6px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-sub);
}

.wechat-contact-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-wechat {
  color: var(--pku-red);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  word-break: break-all;
}

.copy-wechat-btn {
  padding: 4px 10px;
  border: 1px solid var(--pku-gold);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--pku-red);
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.copy-wechat-btn:hover {
  color: #fff;
  background: var(--pku-red);
  border-color: var(--pku-red);
}

.copy-wechat-btn:focus-visible {
  outline: 2px solid var(--pku-gold);
  outline-offset: 2px;
}

.copy-wechat-message {
  min-height: 20px;
  margin: 4px 0 0;
  color: var(--ok);
  font-size: 12px;
  line-height: 20px;
}

/* 顶部登录状态栏：当前账号 / 退出登录 */
.auth-status-bar {
  background: var(--pku-red-dark);
  color: #fff;
}

.auth-status-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 24px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
}

.auth-status-account strong {
  color: var(--pku-gold);
  font-weight: 700;
}

.ai-quota-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid rgba(201, 169, 110, 0.75);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--pku-gold);
  font-size: 12px;
  font-weight: 700;
}

.ai-result-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.75;
}

.ai-quota-empty {
  text-align: center;
  padding: 8px 4px;
}

.ai-quota-empty h4 {
  color: var(--pku-red);
  margin-bottom: 8px;
}

.ai-quota-empty .btn {
  margin-top: 10px;
}

.ai-error-text {
  color: var(--wrong);
}

.auth-logout-btn {
  padding: 4px 14px;
  font-size: 12.5px;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.auth-logout-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* 移动端适配 */
@media (max-width: 680px) {
  .login-card {
    padding: 26px 20px 22px;
  }
  .auth-status-inner {
    padding: 6px 16px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
}
