:root {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: #342b28;
  background: #fff8ef;
  font-synthesis: none;
  --sidebar-w: 320px;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, label:focus-visible { outline: 3px solid #425f8b; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* === 整体两栏布局架构 === */
.layout-container {
  min-height: 100vh;
  width: 100%;
  position: relative;
  background: #fff8ef;
}

/* === 左侧字卡侧边栏 (Fixed 吸附固定，独立滚动) === */
.cards-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fffcf8;
  border-right: 1.5px solid #ebd9c7;
  box-shadow: 4px 0 20px rgba(154, 114, 76, 0.06);
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.3s ease;
  will-change: transform;
}

/* 侧栏收起状态 */
.layout-container.sidebar-collapsed .cards-sidebar {
  transform: translateX(-100%);
  box-shadow: none;
}

/* 侧栏顶部标题栏 */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 12px;
  background: #fffcf8;
  border-bottom: 1.5px solid #f2e4d6;
  flex-shrink: 0;
}
.sidebar-title-box { display: flex; align-items: center; gap: 8px; }
.sidebar-icon-badge {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #faebd7;
  color: #c86341;
  font-size: 16px;
}
.sidebar-title-text { display: flex; flex-direction: column; }
.sidebar-main-title { font-size: 15px; font-weight: 700; color: #3b2c26; line-height: 1.2; }
.sidebar-sub-title { font-size: 11px; color: #9c8a7f; margin-top: 2px; }
.sidebar-sub-title strong { color: #df7352; }

/* 侧栏收起按钮 */
.sidebar-collapse-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  background: #f7ebe1;
  color: #8c5740;
  border: 1px solid #e5cbb7;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sidebar-collapse-btn:hover {
  background: #f0ded1;
  border-color: #d8b69d;
  color: #6e3d29;
  transform: translateX(-2px);
}
.sidebar-collapse-btn:active { transform: scale(0.95); }

/* 侧栏分类筛选区域 */
.sidebar-filter-section {
  padding: 10px 12px 8px;
  background: #fffcf8;
  border-bottom: 1px solid #f6ebe0;
  flex-shrink: 0;
}
.sidebar-filter-section .card-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
}
.sidebar-filter-section .filter-tab {
  padding: 4px 8px;
  font-size: 10.5px;
}

/* 侧栏字卡滚动容器 */
.sidebar-scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px 30px;
  -webkit-overflow-scrolling: touch;
}

/* 侧栏字卡网格（4列排布，方块精致大方） */
.sidebar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.sidebar-grid .picker-card {
  aspect-ratio: 1;
  border-radius: 12px;
  font-size: 32px;
  border: 1.5px solid #ebd9c7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.sidebar-grid .picker-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(189, 122, 60, 0.15);
  border-color: #d1ab8d;
}
.sidebar-grid .picker-card.current {
  outline: 3px solid #e77c61;
  outline-offset: 1px;
  box-shadow: 0 0 0 4px rgba(231, 124, 97, 0.25);
  animation: currentPulse 1.2s infinite alternate;
}
@keyframes currentPulse {
  0% { transform: scale(1.02); }
  100% { transform: scale(1.06); }
}

/* 自定义滚动条风格 */
.sidebar-scroll-area::-webkit-scrollbar { width: 5px; }
.sidebar-scroll-area::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll-area::-webkit-scrollbar-thumb { background: #e6d3c2; border-radius: 999px; }
.sidebar-scroll-area::-webkit-scrollbar-thumb:hover { background: #cbb49f; }

/* === 侧栏收起后的浮动书签按钮 === */
.sidebar-float-trigger {
  position: fixed;
  left: 0;
  top: 110px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px 14px 16px;
  background: linear-gradient(135deg, #f27c5e 0%, #db5939 100%);
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-left: none;
  border-radius: 0 26px 26px 0;
  box-shadow: 2px 8px 26px rgba(220, 89, 58, 0.42);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}
.layout-container.sidebar-collapsed .sidebar-float-trigger {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.sidebar-float-trigger:hover {
  background: linear-gradient(135deg, #f9896c 0%, #e66648 100%);
  padding-left: 19px;
  padding-right: 25px;
  box-shadow: 3px 10px 32px rgba(220, 89, 58, 0.52);
}
.sidebar-float-trigger .trigger-icon {
  font-size: 21px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.18));
}
.sidebar-float-trigger .trigger-arrow {
  color: #ffe6de;
  font-size: 13px;
  margin-left: 2px;
  transition: transform 0.2s;
}
.sidebar-float-trigger:hover .trigger-arrow { transform: translateX(3px); }

/* === 右侧主内容区 === */
.main-stage {
  min-height: 100vh;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: margin-left 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  padding: 16px 20px 40px;
}
.layout-container.sidebar-collapsed .main-stage {
  margin-left: 0;
}
.main-stage .page-shell {
  width: min(100%, 540px);
  margin: 0 auto;
  padding: 0;
}

/* 顶部快捷开关条 */
.header-sidebar-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e7cdb8;
  background: #fffdf9;
  color: #8c5740;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.header-sidebar-btn:hover {
  background: #faede2;
  border-color: #d9b194;
  color: #d35f3b;
}

/* 遮罩层（小屏抽屉模式使用） */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(45, 30, 20, 0.35);
  backdrop-filter: blur(2px);
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* === 原有组件样式与排版 === */
.page-shell { width: min(100%, 520px); min-height: 100vh; margin: auto; padding: 12px 14px 30px; }
.site-header { display: flex; align-items: center; gap: 8px; }
.range-tabs { display:flex; gap:10px; margin:0 0 12px; }
.range-tab { border:1px solid #ebd8ca; border-radius:14px 14px 0 0; background:#fff9f4; color:#8b6d5e; padding:11px 20px; font:700 16px inherit; cursor:pointer; box-shadow:0 2px 6px #ad846515; }
.range-tab small { margin-left:6px; font-size:11px; font-weight:500; }
.range-tab.active { color:#ad4f33; background:#fff; border-color:#e7b99e; border-bottom-color:#fff; box-shadow:0 -2px 8px #ad84651a; }
.range-tab:focus-visible { outline:3px solid #e88765; outline-offset:2px; }
.original-word[hidden], .word-red-overlay[hidden], .sentence-tile img[hidden], .sentence-highlight-overlay[hidden] { display:none!important; }
.sentence-pinyin-grid.custom-pinyin { display:none; }
.custom-word-text { display:block; font-family:"KaiTi","STKaiti","Kaiti SC","楷体","Songti SC",serif; font-size:clamp(32px,4vw,48px); font-weight:400; line-height:1.1; letter-spacing:.02em; color:#3e2e2b; text-align:center; background:#fffdf4; padding:3px 6px; }
.custom-word-text[hidden] { display:none; }
.word-wrap.active-red .custom-word-text { color:#d94a36; }
.custom-sentence-grid:not([hidden]) { display:flex; width:100%; flex-wrap:nowrap; padding:5px 0 2px; background:#fffdf5; box-sizing:border-box; }
.custom-sentence-cell { display:flex; flex:0 0 calc(100% / 11.35); flex-direction:column; align-items:stretch; min-width:0; box-sizing:border-box; }
.custom-sentence-cell small { display:flex; align-items:center; justify-content:center; min-height:20px; font-family:"PingFang SC","Microsoft YaHei",sans-serif; font-size:clamp(10px,2.3cqw,14px); font-weight:400; color:#9a6548; white-space:nowrap; }
.custom-sentence-cell strong { display:grid; place-items:center; width:100%; aspect-ratio:1; box-sizing:border-box; background:linear-gradient(45deg,transparent 49%,#f5ead7 50%,transparent 51%),linear-gradient(-45deg,transparent 49%,#f5ead7 50%,transparent 51%),#fffdf4; border:1px solid #f5ead7; font-family:"KaiTi","STKaiti","Kaiti SC","楷体","Songti SC",serif; font-size:min(8.4cqw,54px); font-weight:400; line-height:1; color:#3e2e2b; }
.custom-sentence-cell.punctuation { flex:0 0 calc(35% / 11.35); }
.custom-sentence-cell.punctuation strong { background:none; border:0; }
.sentence-pic-box.is-reading .custom-sentence-cell strong { color:#d94a36; }
.brand-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 11px; background: #e88065; color: #fffaf2; font-size: 22px; line-height: 1; transform: rotate(-8deg); }
.brand-copy { display: flex; flex-direction: column; gap: 1px; white-space: nowrap; flex: none; }
.brand-copy strong { font-size: 15px; letter-spacing: .04em; }
.brand-copy span { color: #988b82; font-size: 10px; }
.sample-badge { margin-left: auto; padding: 5px 8px; border: 1px solid #e5dacf; border-radius: 999px; background: #fffdf9; color: #8c786c; font-size: 10px; white-space: nowrap; }
@media (max-width: 600px) {
  .site-header .sample-badge { display: none; }
}

.review-card { overflow: hidden; border: 1px solid #f0ded0; border-radius: 26px; background: #fff; box-shadow: 0 12px 35px #926b3a17; }
.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  padding: 8px 12px;
  border-bottom: 1px solid #f6ece4;
  background: #fffdfa;
}
.card-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.number-label { color: #876f62; font-size: 13px; font-weight: 500; white-space: nowrap; flex: none; }
.number-label strong { color: #dc795d; font-size: 16px; }

.card-degree-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  animation: degreePop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.card-degree-badge.retry { background: #fdeeee; color: #c92a2a; border: 1px solid #f5a3a3; }
.card-degree-badge.hard { background: #fff2e6; color: #d96b27; border: 1px solid #f7b788; }
.card-degree-badge.good { background: #fefae6; color: #947100; border: 1px solid #edd477; }
.card-degree-badge.remember { background: #eaf6ec; color: #1e6e30; border: 1px solid #8ed098; }

.rating-area { display: flex; align-items: center; min-width: 0; }
.rating-buttons { display: flex; gap: 4px; flex-wrap: nowrap; }
.button-rate {
  min-height: 32px;
  padding: 0 9px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 1.5px 4px rgba(0,0,0,0.03);
  transition: transform .15s cubic-bezier(0.2, 0.8, 0.3, 1), filter .15s, background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.button-rate:active { transform: scale(.94); }

/* 四色评价色彩（默认未选中态） */
.rate-retry { background: #fdeeee; color: #c92a2a; border: 1.5px solid #f5a3a3; }
.rate-retry:hover, .rate-retry:active { background: #fadcdc; }
.rate-hard { background: #fff2e6; color: #d96b27; border: 1.5px solid #f7b788; }
.rate-hard:hover, .rate-hard:active { background: #ffe5cf; }
.rate-good { background: #fefae6; color: #947100; border: 1.5px solid #edd477; }
.rate-good:hover, .rate-good:active { background: #fcf3c5; }
.rate-remember { background: #eaf6ec; color: #1e6e30; border: 1.5px solid #8ed098; }
.rate-remember:hover, .rate-remember:active { background: #d9f0dd; }

/* 程度选中高亮态（打完标签之后显示程度） */
@keyframes degreePop {
  0% { transform: scale(0.92); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.button-rate.is-selected {
  font-weight: 800;
  transform: scale(1.03);
  z-index: 2;
  animation: degreePop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.button-rate.rate-retry.is-selected {
  background: #e53935 !important;
  color: #ffffff !important;
  border-color: #c62828 !important;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.35);
}
.button-rate.rate-hard.is-selected {
  background: #f57c00 !important;
  color: #ffffff !important;
  border-color: #e65100 !important;
  box-shadow: 0 2px 8px rgba(245, 124, 0, 0.35);
}
.button-rate.rate-good.is-selected {
  background: #eab308 !important;
  color: #ffffff !important;
  border-color: #ca8a04 !important;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.35);
}
.button-rate.rate-remember.is-selected {
  background: #2e7d32 !important;
  color: #ffffff !important;
  border-color: #1b5e20 !important;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.35);
}

/* 当已有评价程度时，未选中的其它3个按钮略微柔和，突显当前掌握程度 */
.rating-buttons.has-selected .button-rate:not(.is-selected) {
  opacity: 0.65;
  filter: grayscale(15%);
}
.rating-buttons.has-selected .button-rate:not(.is-selected):hover {
  opacity: 0.95;
  filter: none;
}

.button { min-height: 48px; border: 0; border-radius: 15px; font-weight: 700; transition: transform .15s, filter .15s; }
.button:active { transform: scale(.98); }
.button:hover { filter: brightness(.98); }
.button-primary { width: 100%; background: #e77c61; color: white; box-shadow: 0 7px 0 #d9674c; }

.answer-face { padding: 17px; }
.answer-grid { display: grid; grid-template-columns: 47% 1fr; gap: 11px; }
.illustration-tile, .word-tile { min-width: 0; height: clamp(285px, 72vw, 360px); overflow: hidden; border-radius: 18px; }
.illustration-tile { background: #f4dabb; }
.illustration-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.word-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 12px 10px 14px;
  border: 1px solid #f0dfce;
  background: #fff9ef;
  container-type: inline-size;
  box-sizing: border-box;
}
.char-pinyin {
  color: #a45336;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 1.5px;
  line-height: 1.1;
  margin-top: 2px;
  margin-bottom: 0px;
  cursor: pointer;
  transition: color .2s, text-shadow .2s;
}
.char-pinyin.active-red {
  color: #e53935;
  text-shadow: 0 0 12px rgba(229, 57, 53, 0.4);
}
.answer-character {
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
  font-size: 100px;
  font-size: min(78cqw, 105px);
  font-weight: 400;
  line-height: .95;
  cursor: pointer;
  margin-top: 2px;
  margin-bottom: 4px;
  transition: color .2s, transform .2s, text-shadow .2s;
}
.answer-character.active-red {
  color: #e53935 !important;
  transform: scale(1.06);
  text-shadow: 0 0 20px rgba(229, 57, 53, 0.5), 0 0 35px rgba(229, 57, 53, 0.2);
  animation: charPulse 0.8s ease-in-out infinite alternate;
}
@keyframes charPulse {
  0% { transform: scale(1.04); }
  100% { transform: scale(1.08); text-shadow: 0 0 28px rgba(229, 57, 53, 0.6); }
}

.word-pinyin-row {
  display: flex;
  justify-content: space-around;
  width: min(100%, 150px);
  margin-top: 4px;
  margin-bottom: 2px;
  cursor: pointer;
}
.word-pinyin-row span {
  flex: 1;
  text-align: center;
  color: #8c5339;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0.5px;
  transition: color .2s, text-shadow .2s;
}
.word-pinyin-row.active-red span,
.word-pinyin-row span.active-red {
  color: #e53935;
  text-shadow: 0 0 8px rgba(229, 57, 53, 0.4);
}
.word-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 150px);
  height: 52px;
  cursor: pointer;
}
.original-word {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.word-red-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}
.word-red-overlay img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.word-wrap.active-red .word-red-overlay {
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(229, 57, 53, 0.5));
  animation: wordPulse 0.7s ease-in-out infinite alternate;
}
.word-wrap.active-red #word-image { opacity: 0; }
@keyframes wordPulse {
  0% { transform: scale(1.02); }
  100% { transform: scale(1.06); }
}

.sentence-tile { margin-top: 11px; padding: 12px 11px 10px; border: 1px solid #f0dfce; border-radius: 18px; background: #fffbf4; container-type:inline-size; }
.sentence-heading { display: flex; align-items: center; gap: 6px; color: #8c654e; font-size: 12px; font-weight: 700; }
.book-mark { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 6px; background: #f7e3cc; color: #d67b59; font-size: 15px; }
.sentence-pinyin-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr) 0.35fr;
  width: 100%;
  margin: 6px 0 3px;
  box-sizing: border-box;
}
.sentence-pinyin-grid span {
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #8c5339;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: visible;
  transition: color .2s, text-shadow .2s;
}
.sentence-pinyin-grid .py-dot { width: 100%; }
.sentence-pinyin-grid.is-reading span {
  color: #e53935;
  text-shadow: 0 0 6px rgba(229, 57, 53, 0.3);
}
.sentence-pic-box {
  position: relative;
  display: block;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  background: #fffdf9;
}
.sentence-tile img { display: block; width: 100%; height: auto; }
.sentence-highlight-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  clip-path: inset(0 calc(100% - var(--read-progress, 0%)) 0 0);
  will-change: clip-path;
  transition: clip-path 0.04s linear;
}
.sentence-highlight-overlay img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: drop-shadow(0 0 4px rgba(229, 57, 53, 0.4));
}
.sentence-text { margin: 8px 2px 0; color: #726057; font-size: 12px; }

.done-panel { padding: 30px 20px; border: 1px solid #f0ded0; border-radius: 26px; background: #fffdf8; text-align: center; }
.done-panel > span { color: #e8b56d; font-size: 50px; }
.done-panel h2 { margin: 5px 0 7px; font-size: 22px; }
.done-panel p { margin: 0 0 22px; color: #8c7a6e; font-size: 13px; }
.done-panel .button { max-width: 250px; }

.section-title-row { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 11px; }
.section-title-row h2 { margin: 0; font-size: 16px; }
.section-title-row span { color: #a69487; font-size: 11px; }
.progress-box { display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid #eee2d8; border-radius: 17px; background: #fffdf9; }
.progress-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 13px; background: #f7e5d9; color: #df8666; font-size: 24px; }
.progress-box strong { font-size: 13px; }
.progress-box p { margin: 4px 0 0; color: #9c8d82; font-size: 11px; }
.data-actions { display: flex; justify-content: center; gap: 22px; padding: 17px 0 0; }
.data-actions button, .data-actions label { padding: 3px 0; border: 0; background: transparent; color: #bb775e; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.data-message { min-height: 15px; margin: 6px 0 0; color: #866d5d; font-size: 11px; text-align: center; }

/* 分类胶囊标签 */
.card-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid #ebd9c7;
  background: #fffdf9;
  color: #7a685e;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.filter-tab:hover { border-color: #d1b5a2; }
.filter-tab.active {
  border-color: #bb775e;
  background: #faebe2;
  color: #a34e35;
  font-weight: 700;
}
.filter-tab .tab-count { font-size: 10px; opacity: .85; }

.filter-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 14px;
  background: #fbf1e6;
  border: 1.5px solid #ebd4c0;
  font-size: 12px;
  color: #7d5945;
  box-shadow: 0 2px 8px rgba(160, 90, 50, 0.05);
}
.banner-text { display: flex; align-items: center; gap: 6px; min-width: 0; }
.banner-icon { font-size: 14px; }
.banner-text strong { color: #bf5b3b; }
.banner-action-btn {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #cca187;
  background: #fffdf9;
  color: #8c5d43;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 1px solid transparent; }
.legend-swatch.remember { background: #eaf6ec; border-color: #8ed098; }
.legend-swatch.good { background: #fefae6; border-color: #edd477; }
.legend-swatch.hard { background: #fff2e6; border-color: #f7b788; }
.legend-swatch.retry { background: #fdeeee; border-color: #f5a3a3; }
.legend-swatch.fresh { background: #fffdf9; border-color: #ecdacb; }

/* 字卡卡片通用 */
.card-picker { display: grid; gap: 8px; }
.picker-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ecdacb;
  border-radius: 14px;
  background: #fffdf9;
  color: #4e4039;
  font-family: "KaiTi", "STKaiti", "Kaiti SC", "楷体", "Songti SC", serif;
  font-size: 32px;
  line-height: 1;
  transition: transform .15s, background-color .15s, border-color .15s, color .15s;
}
.picker-card.learned { background: #eaf3e9; border-color: #c4dac4; }
.picker-card.remembered { background: #eaf6ec; border-color: #8ed098; color: #1e6e30; font-weight: bold; }
.picker-card.remembered::before { content: ""; position: absolute; top: 4px; left: 4px; width: 6px; height: 6px; border-radius: 50%; background: #2e7d32; }
.picker-card.good { background: #fefae6; border-color: #edd477; color: #947100; font-weight: bold; }
.picker-card.good::before { content: ""; position: absolute; top: 4px; left: 4px; width: 6px; height: 6px; border-radius: 50%; background: #eab308; }
.picker-card.hard { background: #fff2e6; border-color: #f7b788; color: #d96b27; font-weight: bold; }
.picker-card.hard::before { content: ""; position: absolute; top: 4px; left: 4px; width: 6px; height: 6px; border-radius: 50%; background: #f57c00; }
.picker-card.retry { background: #fdeeee; border-color: #f5a3a3; color: #c92a2a; font-weight: bold; }
.picker-card.retry::before { content: ""; position: absolute; top: 4px; left: 4px; width: 6px; height: 6px; border-radius: 50%; background: #e53935; }
.picker-card.fresh { background: #fffdf9; border-color: #ecdacb; color: #4e4039; }
.picker-card.due::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: #e2775e; box-shadow: 0 0 0 1.5px #fff; }
.picker-card.current { outline: 3px solid #e77c61; outline-offset: 1px; box-shadow: 0 0 0 4px rgba(231, 124, 97, 0.25); }
.picker-card:active { transform: scale(.95); }

footer { padding-top: 22px; color: #b2a197; font-size: 11px; text-align: center; }

/* === 移动端 / 竖屏响应式优化 (<= 860px) === */
@media (max-width: 860px) {
  .main-stage {
    margin-left: 0 !important;
    padding: 14px 12px 30px;
  }

  .cards-sidebar {
    width: 300px;
    transform: translateX(-100%);
    box-shadow: 6px 0 30px rgba(0, 0, 0, 0.18);
  }

  /* 移动端展开侧边栏（抽屉模式） */
  .layout-container.mobile-sidebar-open .cards-sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 35px rgba(50, 30, 15, 0.25);
  }

  .layout-container.mobile-sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* 移动端浮动按钮放置在屏幕底部边缘，大号醒目圆角书签，不遮挡卡片 */
  .sidebar-float-trigger {
    top: auto;
    bottom: 28px;
    padding: 11px 17px 11px 13px;
    border-radius: 0 24px 24px 0;
    box-shadow: 2px 6px 24px rgba(220, 89, 58, 0.42);
    font-size: 14.5px;
    transform: translateX(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .layout-container.mobile-sidebar-open .sidebar-float-trigger {
    display: none;
  }
}

@media (max-width: 360px) {
  .card-topline { padding-inline: 8px; gap: 4px; }
  .number-label { font-size: 11px; }
  .number-label strong { font-size: 14px; }
  .rating-buttons { gap: 3px; }
  .button-rate { padding: 0 5px; font-size: 10px; min-height: 30px; }
  .answer-face { padding: 10px; }
  .answer-grid { gap: 6px; }
}
