:root {
  --primary: #0070c0;
  --primary-dark: #005a9e;
  --accent: #e84683;
  --bg: #f4f7fb;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
header {
  background: linear-gradient(135deg, #005a9e 0%, #0070c0 50%, #e84683 100%);
  color: white;
  padding: 18px 28px;
  box-shadow: 0 4px 20px rgba(0,112,192,0.18);
}
.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.title-area h1 { font-size: 22px; font-weight: 700; margin-bottom: 2px; }
.title-area p { opacity: 0.92; font-size: 13px; }
.badge {
  display: inline-block;
  background: rgba(255,255,255,0.22);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}
.cart-summary-badge {
  background: white;
  color: var(--primary-dark);
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.cart-summary-badge:hover { transform: scale(1.03); }
.cart-summary-badge { flex-shrink: 0; white-space: nowrap; }
nav {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.nav-tabs {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  padding: 0 20px;
}
.tab-btn {
  padding: 14px 18px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.container {
  max-width: 1400px;
  margin: 20px auto;
  padding: 0 20px;
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Multi-Subject Ribbon Bar */
.subject-ribbon-container {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  box-shadow: inset 0 -1px 3px rgba(0,0,0,0.02);
  position: sticky;
  top: 51px;
  z-index: 99;
  transition: all 0.2s ease;
}
.subject-ribbon {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.subject-ribbon-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
  flex-shrink: 0;
  padding: 4px 10px 4px 0;
  position: sticky;
  left: 0;
  background: #f8fafc;
  z-index: 5;
}
.subject-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.subject-pill:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.subject-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0,90,158,0.25);
}
.subject-pill .sub-count {
  background: rgba(0,0,0,0.07);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
}
.subject-pill.active .sub-count {
  background: rgba(255,255,255,0.25);
  color: white;
}
.badge-subject {
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  color: white;
}

/* Card styling */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  transition: all 0.2s ease;
}
.card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.05); }

/* Filter Bar */
.filter-section {
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}
.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.filter-row:last-child { margin-bottom: 0; }
.filter-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  width: 70px;
  flex-shrink: 0;
}
.tag-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s ease;
}
.tag-btn:hover { background: #e0f2fe; color: var(--primary); border-color: #bae6fd; }
.tag-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 600;
}
.search-input {
  flex: 1;
  min-width: 240px;
  padding: 8px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,112,192,0.15); }

/* Button styles */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { opacity: 0.9; }
.btn-outline { background: white; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: #f1f5f9; border-color: #cbd5e1; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: #ef4444; color: white; }

/* Question Card */
.q-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  padding: 18px 22px;
  margin-bottom: 16px;
  position: relative;
}
.q-card.picked { border-color: var(--primary); background: #f8fbff; }
.q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}
.q-badge-type {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.q-source-banner {
  font-size: 12px;
  color: #475569;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.q-knowledge-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.k-tag {
  font-size: 11px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
}
.k-tag:hover { background: #dbeafe; }
/* ================= 高考数学出版级排版与字体优化 ================= */
.q-stem, .q-options-container, .q-solution-box, .q-modal-body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  color: #1e293b;
  letter-spacing: 0.015em;
  font-feature-settings: "tnum";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.q-stem {
  font-size: 15.5px;
  line-height: 1.85;
  margin: 14px 0;
  text-align: justify;
  word-break: break-word;
  display: flow-root; /* 隔离内部右浮动，保持段落独立 */
}

/* 选择题作答括号右对齐样式（高考/模拟试卷标准排版） */
.q-choice-bracket {
  float: right;
  margin-left: 16px;
  font-family: KaTeX_Main, "Times New Roman", serif;
  font-size: 1.05em;
  letter-spacing: 0.25em;
  color: #1e293b;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
}

/* 独立行间公式展示框美化（仅保留外部盒模型样式，不干涉 KaTeX 内部排版） */
.katex-display {
  margin: 14px 0 !important;
  padding: 10px 16px !important;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  overflow-x: auto;
  overflow-y: hidden;
}

/* 选项容器严格标准对齐（对标 BPAOptions） */
.q-options-container {
  margin: 14px 0;
  padding: 12px 18px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #eef2f6;
  font-size: 15.5px;
  line-height: 1.75;
}
.q-opt-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 4px 6px;
  border-radius: 6px;
  min-width: 0;
}
.q-opt-item:hover {
  background: #f1f5f9;
}
.q-opt-label {
  color: var(--primary);
  font-weight: 700;
  min-width: 20px;
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.q-opt-text {
  flex: 1;
  word-break: break-word;
  color: #1e293b;
  min-width: 0;
}
@media (max-width: 768px) {
  .q-options-container {
    grid-template-columns: 1fr !important;
  }
}

.q-solution-box {
  margin-top: 14px;
  background: #f8fafc;
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  display: none;
  font-size: 15px;
  line-height: 1.8;
}
.q-solution-box.show { display: block; }
.badge-choice {
  display: inline-block;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #0070c0, #005a9e);
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 14px;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.q-answer-rendered {
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

/* Layout & Form Controls */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #334155;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,112,192,0.15); }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* Paper Library Grid */
.paper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
.paper-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
}
.paper-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,112,192,0.12);
}
.paper-title { font-weight: 700; font-size: 14px; line-height: 1.5; color: #1e293b; }
.paper-meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11px; }
.badge-meta { background: #f1f5f9; color: #475569; padding: 2px 6px; border-radius: 4px; }
.badge-prov { background: #e0f2fe; color: #0284c7; font-weight: 600; padding: 2px 6px; border-radius: 4px; }

/* Knowledge Tree Sidebar Layout */
.qb-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .qb-layout { grid-template-columns: 1fr; }
}

/* Tab 4: Export & Typesetting Layout */
.export-layout {
  display: grid;
  grid-template-columns: minmax(480px, 540px) 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1100px) {
  .export-layout { grid-template-columns: 1fr; }
}
.export-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) {
  .export-form-grid { grid-template-columns: 1fr; }
}

/* Tab 4 Visual Template Selector Gallery */
.template-selector-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1200px) {
  .template-selector-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .template-selector-grid { grid-template-columns: 1fr; }
}
.template-select-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}
.template-select-card:hover {
  border-color: #94a3b8;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}
.template-select-card.active {
  border-color: var(--primary);
  background: #f8fbff;
  box-shadow: 0 0 0 3px rgba(0, 112, 192, 0.2), 0 8px 24px rgba(0, 112, 192, 0.12);
}
.template-select-card.style-academic_navy.active {
  border-color: #005a9e;
  box-shadow: 0 0 0 3px rgba(0, 90, 158, 0.25), 0 8px 24px rgba(0, 90, 158, 0.15);
}
.template-select-card.style-gaokao_red.active {
  border-color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.25), 0 8px 24px rgba(185, 28, 28, 0.15);
}
.template-select-card.style-modern_cyan.active {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25), 0 8px 24px rgba(13, 148, 136, 0.15);
}
.template-select-card.style-neutral_blue_pink.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25), 0 8px 24px rgba(37, 99, 235, 0.15);
}
.template-select-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #10b981;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
  display: none;
}
.template-select-card.active .template-select-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.tree-sidebar {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  height: fit-content;
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}
.tree-item-module {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tree-item-module:hover { background: #f1f5f9; }
.tree-children {
  margin-left: 12px;
  padding-left: 8px;
  border-left: 2px solid #e2e8f0;
  margin-top: 4px;
  margin-bottom: 8px;
}
.tree-item-leaf {
  font-size: 12px;
  color: #475569;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.tree-item-leaf:hover { background: #e0f2fe; color: var(--primary); }
.tree-item-leaf.active { background: var(--primary); color: white; font-weight: 600; }

/* Cart Enhanced Card & List Styles */
.cart-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: all 0.2s ease;
  overflow: hidden;
}
.cart-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(0,112,192,0.08);
}
.cart-card-header {
  background: #f8fafc;
  border-bottom: 1px solid #edf2f7;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.cart-card-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cart-idx-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 2px 5px rgba(0,112,192,0.25);
}
.cart-card-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cart-score-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.cart-score-wrap input {
  width: 44px;
  border: none;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  font-size: 13px;
  outline: none;
}
.cart-card-body {
  padding: 16px 20px;
}
.cart-stem-text {
  font-size: 14.5px;
  line-height: 1.8;
  color: #0f172a;
  display: flow-root;
}
.cart-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 16px;
  margin-top: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #eef2f6;
  font-size: 13.5px;
}
.cart-card-footer {
  border-top: 1px dashed #e2e8f0;
  padding: 8px 18px;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cart-sol-toggle {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  width: fit-content;
}
.cart-sol-toggle:hover {
  text-decoration: underline;
}
.cart-sol-box {
  margin-top: 4px;
  padding: 12px 16px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.65;
}

/* Cart Compact Row View */
.cart-compact-row {
  display: grid;
  grid-template-columns: 36px 105px 1fr 115px 120px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.15s ease;
}
.cart-compact-row:hover { background: #f8fafc; }

.q-type-single { background: #e0f2fe; color: #0284c7; }
.q-type-multi { background: #f3e8ff; color: #7c3aed; }
.q-type-blank { background: #dcfce7; color: #15803d; }
.q-type-solve { background: #fef3c7; color: #b45309; }

/* Responsive */
@media (max-width: 600px) {
  .cart-compact-row { grid-template-columns: 1fr; gap: 8px; }
  .cart-card-header { flex-direction: column; align-items: flex-start; }
}

/* ================= v2 新增（只加不改，旧样式原样保留） ================= */

/* 题干 / 选项 / 解析：用 pre-wrap 保留题库里的换行，
   这样不用往文本里插任何 HTML，公式片段也不会被截断 */
.rich-text {
  white-space: pre-wrap;
  word-break: break-word;
}

/* 题目图片：单张最高 180 像素，保持比例、小图不放大 */
.q-img {
  display: block;
  max-width: min(360px, 100%);
  max-height: 180px;
  width: auto;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  padding: 4px;
  cursor: zoom-in;
}
.q-opt-text .q-img,
.cart-stem-text .q-img {
  max-width: min(190px, 100%);
  max-height: 180px;
}

/* 连续的图排在同一行，放不下自动换行；图注在图的正下方、居中、小字号 */
.img-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 6px 14px;
  margin: 6px 0;
}
.img-cell { display: flex; flex-direction: column; align-items: center; }
.img-caption {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  text-align: center;
}
.img-missing {
  display: inline-block;
  margin: 8px 4px;
  padding: 6px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 13px;
}

/* 数据缺失统一用这个灰色「暂无」 */
.none-text {
  color: var(--text-muted);
  font-weight: normal;
}

/* 未开放的学科胶囊 */
.subject-pill.locked {
  opacity: 0.55;
  cursor: not-allowed;
}
.subject-pill.locked:hover {
  border-color: var(--border);
  transform: none;
  box-shadow: none;
}

/* 知识点树第三级 */
.tree-children-3 {
  margin-left: 12px;
  padding-left: 8px;
  border-left: 2px dashed #e2e8f0;
}
.tree-item-leaf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.tree-count {
  font-size: 11px;
  color: #94a3b8;
  flex-shrink: 0;
}
.tree-item-leaf.active .tree-count { color: rgba(255,255,255,0.85); }
.tree-item-module .tree-count { color: #94a3b8; }

/* 提示条 */
.notice-bar {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}
.empty-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}

/* ================= 阶段 4：下载 Word / PDF ================= */
.export-download-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 640px) {
  .export-download-grid { grid-template-columns: 1fr; }
}
.export-download-grid .btn {
  justify-content: center;
  padding: 10px 12px;
  font-size: 13.5px;
}
.export-download-grid .btn:disabled {
  opacity: 0.55;
  cursor: progress;
}
.export-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.7;
  border: 1px solid var(--border);
  background: white;
  color: #334155;
}
.export-status.busy { border-color: #bae6fd; background: #f0f9ff; color: #0369a1; }
.export-status.ok { border-color: #86efac; background: #f0fdf4; color: #166534; }
.export-status.warn { border-color: #fed7aa; background: #fff7ed; color: #9a3412; }
.export-status.error { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }

/* V-15：PDF 勾选版本 */
.export-pdf-box {
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: rgba(255,255,255,0.9);
  padding: 10px 12px;
}
.export-pdf-title { font-size: 13.5px; font-weight: 700; color: #0369a1; margin-bottom: 6px; }
.export-pdf-options { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.export-pdf-options label { font-size: 13.5px; color: #1e293b; cursor: pointer; }
.export-pdf-options label span { color: #64748b; font-size: 12px; margin-left: 8px; }
.export-pdf-options input:disabled + * { opacity: 0.5; }
.export-pdf-box .btn { width: 100%; justify-content: center; padding: 10px 12px; }
.export-pdf-box .btn:disabled { opacity: 0.55; cursor: progress; }
.export-file-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.export-file-links a { text-decoration: none; }

/* 空选项占位（阶段 6）：选项内容为空时显示这行灰字，不留空白 */
.opt-empty { color: #94a3b8; font-size: 13px; }

/* 题干 / 选项 / 解析里的简单 HTML 表格：排成真表格。
   线条用三线表（上、表头下、下），与打印页和导出的 Word/PDF 保持一致。
   容器是 white-space: pre-wrap，这里显式改回 normal，免得单元格里换行错乱。 */
.q-table {
  border-collapse: collapse;
  margin: 8px auto;
  font-size: 15px;
  white-space: normal;
  border-top: 1.2px solid #333;
  border-bottom: 1.2px solid #333;
}
.q-table td,
.q-table th { padding: 4px 14px; text-align: center; vertical-align: middle; }
/* 单元格里的图：比正文里的小一圈，免得把表格撑破 */
.q-table .q-img { max-width: min(200px, 100%); max-height: 120px; margin: 2px auto; }
.q-table th { font-weight: 700; border-bottom: 0.8px solid #333; }
/* 表头下的那条线：跨行的格子（rowspan）不画，否则线会横在格子中间。
   这样「满意度」下面有线、旁边跨两行的「性别」「合计」没有线，正是通行的排法。 */
.q-table tr:first-child td:not([rowspan]) { border-bottom: 0.8px solid #333; }

/* ===================== 阶段 9：账号、反馈、页脚 ===================== */

.account-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 26px;
  padding: 6px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.account-bar .who {
  font-weight: 700;
  color: var(--text-main);
}

.account-bar .level-pill {
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11.5px;
  font-weight: 700;
}

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

.account-bar button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 12.5px;
  cursor: pointer;
}

.account-bar button:hover { background: #f1f5f9; color: var(--text-main); }

.tab-link { text-decoration: none; display: inline-flex; align-items: center; }

/* ---- 反馈按钮与弹窗 ---- */

.q-feedback-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  border-radius: 7px;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  margin-left: 6px;
}
.q-feedback-btn:hover { background: #fff7ed; color: #c2410c; border-color: #fdba74; }

#feedback-modal, #password-modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
  z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 24px;
}

#feedback-card, #password-card {
  background: #fff; border-radius: 14px; padding: 22px 26px;
  width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(15, 23, 42, 0.32);
  max-height: 86vh; overflow: auto;
}

#feedback-card h3, #password-card h3 {
  margin: 0 0 6px; font-size: 17px; font-weight: 800; color: var(--text-main);
}
#feedback-sub { margin: 0 0 14px; font-size: 12.5px; color: var(--text-muted); }

.fb-field { margin-bottom: 13px; }
.fb-field label {
  display: block; font-size: 12.5px; font-weight: 700;
  color: var(--text-muted); margin-bottom: 5px;
}
.fb-field textarea, .fb-field input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13.5px; box-sizing: border-box;
  font-family: inherit; color: var(--text-main); background: #fff;
}
.fb-field textarea { min-height: 84px; resize: vertical; }

.fb-cat {
  display: inline-block; margin: 0 6px 6px 0; padding: 5px 11px;
  border: 1px solid var(--border); border-radius: 16px;
  font-size: 12.5px; cursor: pointer; color: var(--text-muted); background: #fff;
}
.fb-cat.active { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; font-weight: 700; }

.fb-msg {
  margin-top: 10px; padding: 8px 11px; border-radius: 7px;
  font-size: 13px; background: #f1f5f9; color: #334155;
}
.fb-msg.bad { background: #fef2f2; color: #b91c1c; }
.fb-msg.good { background: #f0fdf4; color: #15803d; }

/* ---- 页脚 ---- */

.site-footer {
  margin-top: 40px; padding: 18px 0 26px;
  border-top: 1px solid var(--border); background: #fff;
}
.site-footer-inner {
  max-width: 1360px; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--primary); text-decoration: underline; }
.footer-sep { color: #cbd5e1; }
.footer-link-btn {
  border: none; background: none; color: var(--text-muted);
  font-size: 12.5px; cursor: pointer; padding: 2px 4px;
}
.footer-link-btn:hover { color: var(--primary); text-decoration: underline; }

/* 学科切换器上的「另一科篮子里还有几道题」小标（阶段 11） */
.subject-pill .sub-basket {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 8px;
  background: rgba(236, 72, 153, 0.14);
  color: #be185d;
  font-size: 11px;
  font-weight: 700;
}

/* 只有一门学科时，切换器不占地方（阶段 11 工单第 2.1 条） */
.subject-ribbon-container.single-subject { display: none !important; }

/* ===================== 资料排版（阶段 15） ===================== */

.pw-promise-list { margin: 10px 0 0; padding-left: 26px; line-height: 2; color: #334155; font-size: 14.5px; }
.pw-promise-list li { margin: 2px 0; }

.pw-form label { display: block; margin-bottom: 14px; font-size: 13.5px; font-weight: 700; color: #475569; }
.pw-form input[type="text"], .pw-form select {
  display: block; width: 100%; max-width: 520px; margin-top: 6px; padding: 9px 12px;
  border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.pw-form input[type="file"] { display: block; margin-top: 6px; font-size: 13.5px; }
.pw-check { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; font-size: 13.5px; }
.pw-check input { margin-top: 3px; }

.pw-verdict { margin: 4px 0 16px; padding: 12px 14px; border-radius: 9px; font-size: 13.5px; line-height: 1.8; }
.pw-verdict.good { background: #f0fdf4; border: 1px solid #86efac; color: #14532d; }
.pw-verdict.warn { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.pw-verdict-title { font-weight: 800; margin-bottom: 4px; }

.pw-msg { margin-top: 12px; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; background: #f1f5f9; color: #334155; }
.pw-msg.bad { background: #fef2f2; color: #b91c1c; }
.pw-msg.good { background: #f0fdf4; color: #15803d; }

.pw-job { padding: 14px 16px; border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 12px; background: #fff; }
.pw-job-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pw-job-time { font-size: 12.5px; color: #94a3b8; }
.pw-job-meta { margin-top: 6px; font-size: 13px; color: #64748b; }
.pw-job-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.pw-job-actions .btn { padding: 4px 12px; font-size: 12.5px; }

.pw-status { margin-left: 8px; padding: 1px 9px; border-radius: 9px; font-size: 11.5px; font-weight: 700; background: #e2e8f0; color: #475569; }
.pw-pending { background: #fef3c7; color: #92400e; }
.pw-working { background: #dbeafe; color: #1e40af; }
.pw-delivered { background: #dcfce7; color: #166534; }
.pw-rework { background: #fae8ff; color: #86198f; }
.pw-accepted { background: #e2e8f0; color: #475569; }
.pw-deleted { background: #f1f5f9; color: #94a3b8; }
.pw-scan { background: #ffedd5; color: #9a3412; }

.pw-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); display: none; align-items: center; justify-content: center; z-index: 90; padding: 30px; }
.pw-modal-card { position: relative; background: #fff; border-radius: 14px; padding: 26px 30px; max-width: 720px; width: 100%; max-height: 82vh; overflow: auto; }
.pw-modal-close { position: absolute; top: 12px; right: 14px; border: none; background: none; font-size: 18px; color: #94a3b8; cursor: pointer; }
.pw-modal-card h3 { margin: 0 0 4px; font-size: 19px; }
.pw-modal-card h4 { margin: 18px 0 6px; font-size: 14.5px; color: #334155; }
.pw-modal-card label { display: block; margin-bottom: 12px; font-size: 13.5px; font-weight: 700; color: #475569; }
.pw-modal-card input[type="text"], .pw-modal-card select {
  display: block; width: 100%; margin-top: 6px; padding: 8px 11px;
  border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; box-sizing: border-box;
}
.pw-files { margin: 6px 0 0; padding-left: 22px; line-height: 2; font-size: 13.5px; }
.pw-log-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pw-log-table th, .pw-log-table td { padding: 5px 9px; border-bottom: 1px solid #e2e8f0; text-align: left; }
.pw-log-table th { color: #64748b; font-weight: 700; }
