:root {
  --bg-page: #F6F5F1;
  --bg-card: #FFFFFF;
  --bg-subtle: #FAF9F6;
  --text-primary: #1F2329;
  --text-secondary: #5C626B;
  --text-muted: #8C929C;
  --accent: #E86B1A;
  --accent-soft: #FFF4EC;
  --accent-border: #FCD9BD;
  --border-light: #EAE8E3;
  --red-mark: #DC2626;
  --green-ok: #15803D;
  --shadow-card: 0 2px 10px rgba(31, 35, 41, 0.04);
  --radius-card: 14px;
}

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

html, body {
  background: #ECEAE4;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  line-height: 1.72;
  font-size: 15px;
  min-height: 100vh;
}

.app-shell {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
}

/* 顶部栏 */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-title-wrap {
  text-align: center;
  flex: 1;
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.header-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.icon-btn:hover {
  background: var(--bg-subtle);
}

.icon-btn.is-red {
  color: var(--red-mark);
}

.icon-btn.is-red svg {
  fill: var(--red-mark);
}

/* 搜索条 */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
}

.search-bar input {
  flex: 1;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  outline: none;
}

.search-bar input:focus {
  border-color: var(--accent);
  background: #fff;
}

.search-clear {
  border: none;
  background: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
}

/* 筛选条 */
.filter-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 14px;
  background: var(--bg-card);
  scrollbar-width: none;
}
.filter-strip::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
  font-weight: 600;
}

/* 五大 Tab */
.tab-bar {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: 0 8px;
  position: sticky;
  top: 55px;
  z-index: 19;
}

.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 4px;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
  white-space: nowrap;
}

.tab-btn.active {
  color: var(--text-primary);
  font-weight: 600;
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
}

/* 主卡片区 */
.main-content {
  flex: 1;
  padding: 14px 12px 124px;
}

.detail-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  padding: 18px 16px 22px;
}

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

.tab-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.copy-btn:hover {
  background: var(--bg-subtle);
  color: var(--accent);
}

/* 标签徽章 */
.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.badge.orange {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
  font-weight: 600;
}

.badge.blue {
  background: #EFF6FF;
  color: #1D4ED8;
  border-color: #BFDBFE;
}

.badge.green {
  background: #F0FDF4;
  color: #15803D;
  border-color: #BBF7D0;
}

/* 题目/正文排版 */
.article-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.45;
}

.section-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 16px 0 8px;
}

.prose p {
  margin-bottom: 13px;
  font-size: 15px;
  color: #24292F;
  text-align: justify;
  word-break: break-word;
}

/* 复刻截图2/3的橙色行内批注与高亮金句 */
.highlight-orange {
  color: var(--accent);
  font-weight: 500;
}

.anno-inline {
  color: var(--accent);
  font-weight: 500;
  display: block;
  margin: 8px 0 14px;
  padding: 8px 11px;
  background: #FFF9F4;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 13.5px;
  line-height: 1.65;
}

.anno-toggle-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 7px 11px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.toggle-switch {
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
}

/* 语料库块 */
.corpus-group {
  margin-bottom: 18px;
}

.corpus-group-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.corpus-quote-block {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-light);
}

.corpus-quote-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.corpus-quote-text {
  font-size: 14.5px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.corpus-source {
  font-size: 13px;
  color: var(--text-secondary);
}

.corpus-usage {
  margin-top: 6px;
  font-size: 13px;
  color: var(--accent);
  background: #FFF9F4;
  padding: 6px 10px;
  border-radius: 6px;
}

/* 图文报道配图建议框 */
.photo-box {
  margin-top: 14px;
  padding: 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
}

.photo-box-title {
  font-size: 13px;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 6px;
}

.photo-item {
  font-size: 13px;
  color: #334155;
  margin-bottom: 6px;
}

/* 考情提示卡 */
.exam-tip-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px;
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.exam-tip-box strong {
  color: var(--text-primary);
}

/* 我的练习区 */
.timer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.timer-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.timer-btns {
  display: flex;
  gap: 6px;
}

.btn-sm {
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--text-primary);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-sm.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.practice-textarea {
  width: 100%;
  min-height: 240px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px;
  font-size: 14.5px;
  line-height: 1.7;
  font-family: inherit;
  resize: vertical;
  outline: none;
  background: var(--bg-subtle);
}

.practice-textarea:focus {
  border-color: var(--accent);
  background: #fff;
}

.word-counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0 12px;
}

.word-counter .status-ok {
  color: var(--green-ok);
  font-weight: 600;
}

.checklist-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px;
}

.checklist-box h4 {
  font-size: 13.5px;
  margin-bottom: 8px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  cursor: pointer;
}

.check-item input {
  margin-top: 4px;
  accent-color: var(--accent);
}

/* 底部翻页栏（避开右下角 Netlify 悬浮标） */
.bottom-nav {
  position: fixed;
  bottom: 54px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 460px;
  height: 52px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(31, 35, 41, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 25;
}

.nav-arrow-btn {
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-arrow-btn:disabled {
  color: #CBD5E1;
  cursor: not-allowed;
}

.nav-arrow-btn:not(:disabled):hover {
  background: var(--bg-subtle);
}

.progress-pill {
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.code-badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

/* 抽屉目录 */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.drawer-panel {
  width: 100%;
  max-width: 520px;
  max-height: 82vh;
  background: var(--bg-card);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-header h2 {
  font-size: 16px;
}

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

.drawer-list {
  overflow-y: auto;
  padding: 10px 14px 24px;
}

.drawer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  margin-bottom: 8px;
  cursor: pointer;
  background: #fff;
}

.drawer-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drawer-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.drawer-item-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-item-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}

.red-dot {
  color: var(--red-mark);
  font-size: 12px;
  font-weight: 700;
}

.toast {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(31, 35, 41, 0.9);
  color: #fff;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  z-index: 60;
}

/* 深色护眼模式 */
body.dark {
  --bg-page: #141619;
  --bg-card: #1E2126;
  --bg-subtle: #262A30;
  --text-primary: #E8EAED;
  --text-secondary: #A6ADB8;
  --text-muted: #767D87;
  --accent: #F07B2E;
  --accent-soft: rgba(240, 123, 46, 0.14);
  --accent-border: rgba(240, 123, 46, 0.35);
  --border-light: #2E333B;
  background: #0D0F12;
}

body.dark .prose p,
body.dark .corpus-quote-text {
  color: #DCE0E5;
}

body.dark .anno-inline,
body.dark .corpus-usage {
  background: rgba(240, 123, 46, 0.1);
}

body.dark .photo-box {
  background: #23272E;
  border-color: #343A44;
}

body.dark .photo-box-title,
body.dark .photo-item {
  color: #D1D5DB;
}

body.dark .bottom-nav {
  background: rgba(30, 33, 38, 0.96);
}

body.dark .drawer-item {
  background: var(--bg-subtle);
}

.flashcard-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 18px 16px;
  margin-bottom: 14px;
}

.flashcard-answer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-light);
}

.flashcard-actions {
  display: flex;
  gap: 10px;
}

.flashcard-actions button {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-light);
}

.btn-red-mark {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FECACA !important;
}

.btn-ok-next {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent) !important;
}

.plan-week-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.plan-card-pill {
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
}

/* ==================== 首页分区与题目列表（复刻录屏） ==================== */
.home-content {
  padding: 14px 14px 40px;
}

.notice-card {
  background: var(--bg-card);
  border: 1.5px solid #FDBA74;
  border-radius: 14px;
  padding: 14px 15px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.notice-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.notice-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 10px;
}

.notice-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-btn {
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.pill-btn.orange {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
}

.partition-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.partition-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

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

.partition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.partition-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 15px 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.12s, border-color 0.15s;
}

.partition-card:active {
  transform: scale(0.98);
}

.partition-card:hover {
  border-color: var(--accent-border);
}

.part-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  margin-bottom: 10px;
}

.part-icon.orange {
  background: var(--accent-soft);
}

.part-icon.blue {
  background: #EFF6FF;
}

.part-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.part-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.part-progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.part-progress-row .pct {
  color: var(--accent);
  font-weight: 600;
}

.prog-track {
  height: 5px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.prog-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s;
}

.prog-fill.blue {
  background: #2563EB;
}

.domain-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.domain-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
}

.domain-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.domain-card-count {
  font-size: 11.5px;
  color: var(--text-muted);
}

.topic-list-wrap {
  padding: 12px 12px 40px;
}

.topic-row {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 13px 14px;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.topic-row:hover {
  border-color: var(--accent-border);
}

.topic-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.domain-tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 5px;
  flex-shrink: 0;
}

.domain-tag.red {
  background: #FEF2F2;
  color: #DC2626;
}

.domain-tag.orange {
  background: var(--accent-soft);
  color: var(--accent);
}

.domain-tag.blue {
  background: #EFF6FF;
  color: #2563EB;
}

.domain-tag.green {
  background: #F0FDF4;
  color: #15803D;
}

.domain-tag.purple {
  background: #F5F3FF;
  color: #7C3AED;
}

.topic-row-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.practiced-tag {
  font-size: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.topic-row-right {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}
