/* ==========================================================================
   胖罗背单词 (PANG LUO VOCAB)
   风格：橘色暖调治愈风 · 高饱和多巴胺卡片 · 涂鸦动漫手账画风
   特性：原版完整功能完美呈现 · 手机端黄金比例 · 初始卡片 one.jpg 治愈背景 · 严格居中
   ========================================================================== */

:root {
  --bg-page: #FFF9F2;
  --bg-card: #FFFFFF;
  --bg-card-sub: #FFF3E6;
  --text-main: #2D2320;
  --text-sub: #7A6960;
  --text-muted: #A89890;
  --border-line: #2D2320;
  --border-width: 2px;
  --comic-shadow: 3.5px 3.5px 0px #2D2320;
  --comic-shadow-sm: 2px 2px 0px #2D2320;
  --comic-shadow-lg: 5px 5px 0px #2D2320;

  --brand-orange: #FF6B35;
  --brand-orange-light: #FFE8DF;
  --brand-orange-deep: #E8590C;
  --brand-yellow: #FFA000;

  --dopamine-orange: #FF6F3C;
  --dopamine-green: #10B981;
  --dopamine-yellow: #F59E0B;
  --dopamine-pink: #F43F5E;
  --dopamine-blue: #0284C7;
  --dopamine-purple: #8B5CF6;

  --color-forgot: #EF4444;
  --color-hard: #F59E0B;
  --color-good: #10B981;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --app-max-width: 440px;
}

html.dark, [data-theme="dark"] {
  --bg-page: #1A1614;
  --bg-card: #27211E;
  --bg-card-sub: #332B27;
  --text-main: #FBF7F4;
  --text-sub: #D1C2BB;
  --text-muted: #8E7F78;
  --border-line: #4F4038;
  --comic-shadow: 3.5px 3.5px 0px #120F0E;
  --comic-shadow-sm: 2px 2px 0px #120F0E;
  --comic-shadow-lg: 5px 5px 0px #120F0E;

  --brand-orange: #FF7E4A;
  --brand-orange-light: #3D2921;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.skip {
  position: absolute;
  top: -999px;
  left: 0;
}

/* 手机端外壳 (严格保持原版黄金比例) */
.app-shell {
  width: 100%;
  max-width: var(--app-max-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-page);
  border-left: 1px solid rgba(45, 35, 32, 0.08);
  border-right: 1px solid rgba(45, 35, 32, 0.08);
}

/* 顶部栏 Topbar (胖罗背单词左边图标不需要框，只展示图片，尺寸放大清晰) */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: var(--border-width) solid var(--border-line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

/* 无边框、无阴影、大尺寸清晰展示 */
.brand-avatar {
  width: 52px;
  height: 52px;
  border: none !important;
  box-shadow: none !important;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  background: transparent;
}

.brand span {
  font-size: 1.2rem;
  font-weight: 900;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.brand small {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--brand-orange);
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connection {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-card-sub);
  border: 1.5px solid var(--border-line);
  color: var(--brand-orange, #FF7E4A);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
  transition: transform 0.1s ease, border-color 0.1s ease, color 0.1s ease;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection:hover {
  border-color: var(--brand-orange, #FF7E4A);
}

.connection:active {
  transform: scale(0.95);
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: var(--border-width) solid var(--border-line);
  background: var(--bg-card);
  box-shadow: var(--comic-shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  color: var(--text-main);
}

.icon-button:active {
  transform: translate(1.5px, 1.5px);
  box-shadow: none;
}

.icon-button .icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.icon-slot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand-orange);
  display: inline-block;
}

/* 主内容容器 */
#main {
  flex: 1;
  padding: 14px 16px calc(76px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.quiet-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 8px 16px 20px;
  letter-spacing: 0.02em;
}

/* 底部导航栏 Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-card);
  border-top: var(--border-width) solid var(--border-line);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-sub);
  height: 100%;
  gap: 3px;
  transition: all 0.15s ease;
}

.nav-tab-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  transition: transform 0.15s ease;
}

.nav-item.active {
  color: var(--brand-orange-deep);
  font-weight: 800;
}

.nav-item.active .nav-tab-icon {
  transform: scale(1.15);
}

.nav-item span {
  font-size: 0.74rem;
  font-weight: 700;
}

/* 标题栏 */
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.page-heading h1 {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--brand-orange-light);
  border: 1.5px solid var(--border-line);
  color: var(--brand-orange-deep);
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: var(--comic-shadow-sm);
}

.streak-pill .icon {
  width: 14px;
  height: 14px;
  fill: var(--brand-orange);
}

/* 通用手绘风格按钮与输入框 */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  border: var(--border-width) solid var(--border-line);
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--comic-shadow);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  min-height: 44px;
}

.button:active {
  transform: translate(2px, 2px);
  box-shadow: 1.5px 1.5px 0px var(--border-line);
}

.button.primary {
  background: var(--brand-orange);
  color: #FFFFFF;
}

.button.secondary {
  background: var(--bg-card);
  color: var(--text-main);
}

.button.ghost {
  background: transparent;
  color: var(--text-main);
  border: 1.5px dashed var(--border-line);
  box-shadow: none;
}

.button.danger {
  background: var(--color-forgot);
  color: #FFFFFF;
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.text-button {
  background: none;
  border: none; border-radius: 0 var(--radius-md, 16px) var(--radius-md, 16px) 0;
  color: var(--brand-orange-deep);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  padding: 6px 10px;
}

.field {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.92rem;
  color: var(--text-main);
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-sm);
  outline: none;
  font-family: inherit;
}

.field:focus {
  border-color: var(--brand-orange);
  box-shadow: var(--comic-shadow-sm);
}

/* ==========================================================================
   板块一：今日复习 (初始卡片使用 assets/one.jpg 背景 · 无图标 · 居中对齐)
   ========================================================================== */

.review-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.review-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sub);
}

.review-meta .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-orange);
  display: inline-block;
  margin-right: 4px;
}

.review-meta .dot.green {
  background: var(--dopamine-green);
}

.review-meta .right {
  margin-left: auto;
}

progress {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-line);
  overflow: hidden;
  appearance: none;
}

progress::-webkit-progress-bar {
  background: var(--bg-card-sub);
}

progress::-webkit-progress-value {
  background: var(--brand-orange);
}

.deck-area {
  width: 100%;
  height: 440px;
  position: relative;
}

.review-card {
  width: 100%;
  height: 440px;
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--comic-shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  outline: none;
  cursor: pointer;
  user-select: none;
  background-color: hsl(var(--card-hue, 28), 90%, 94%);
  position: relative;
}

html.dark .review-card,
[data-theme="dark"] .review-card {
  background-color: #FFFDF9 !important;
  border: 2.5px solid #1A1614 !important;
  box-shadow: 4px 4px 0px #000000 !important;
}

/* 核心：初始卡片使用 assets/one.jpg 背景，图片彻底删掉，文字居中清晰 */
.prep-card {
  background-image: url('./assets/one.jpg') !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  color: #2D2320 !important;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--comic-shadow-lg);
  overflow: hidden;
}

.prep-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 248, 240, 0.12);
  border-radius: inherit;
  pointer-events: none;
}

html.dark .prep-card::before {
  background: rgba(26, 22, 20, 0.2);
}

/* 初始卡片内容绝对居中，无图标 */
.card-prep-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 20px;
  gap: 12px;
  width: 100%;
  height: 100%;
}

/* 初始卡片文字：亮橘色爱马仕橙 (Hermès Orange) · 明暗鲜明区分 · 绝不与背景混淆 */
.card-prep-content h2 {
  font-size: 1.85rem;
  font-weight: 900;
  color: #FF5500;
  text-align: center;
  line-height: 1.35;
  margin: 0 auto;
  letter-spacing: -0.01em;
  text-shadow: 
    -1.5px -1.5px 0 #FFFFFF,  
     1.5px -1.5px 0 #FFFFFF,
    -1.5px  1.5px 0 #FFFFFF,
     1.5px  1.5px 0 #FFFFFF,
     0 2px 8px rgba(255, 255, 255, 0.98),
     0 0 18px rgba(255, 255, 255, 0.95);
}

.card-prep-content .prep-sub {
  font-size: 1rem;
  font-weight: 800;
  color: #FF5E00;
  text-align: center;
  margin: 0 auto;
  text-shadow: 
    -1px -1px 0 #FFFFFF,  
     1px -1px 0 #FFFFFF,
    -1px  1px 0 #FFFFFF,
     1px  1px 0 #FFFFFF,
     0 1px 6px rgba(255, 255, 255, 0.95);
}

html.dark .card-prep-content h2,
[data-theme="dark"] .card-prep-content h2 {
  color: #FF7733;
  text-shadow: 
    -1.5px -1.5px 0 #1A1614,  
     1.5px -1.5px 0 #1A1614,
    -1.5px  1.5px 0 #1A1614,
     1.5px  1.5px 0 #1A1614,
     0 3px 12px rgba(0, 0, 0, 0.9),
     0 0 20px rgba(255, 119, 51, 0.4);
}

html.dark .card-prep-content .prep-sub,
[data-theme="dark"] .card-prep-content .prep-sub {
  color: #FFA066;
  text-shadow: 
    -1px -1px 0 #1A1614,  
     1px -1px 0 #1A1614,
    -1px  1px 0 #1A1614,
     1px  1px 0 #1A1614,
     0 2px 8px rgba(0, 0, 0, 0.9);
}

.review-main-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.big-btn {
  width: 100%;
  padding: 13px;
  font-size: 1.05rem;
}

.card-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 8px;
}

.stage-badge {
  font-size: 0.76rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1.5px solid var(--border-line);
  box-shadow: var(--comic-shadow-sm);
  color: var(--text-main);
}

.card-top-bar .speak {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: var(--border-width) solid var(--border-line);
  background: var(--bg-card);
  box-shadow: var(--comic-shadow-sm);
}

.card-content-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 20px;
  overflow-y: auto;
}

.card-front-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
}

.word-title {
  font-size: 2.3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #FF5500;
  word-break: break-word;
  text-shadow: 0 1px 2px rgba(255, 85, 0, 0.15);
}

html.dark .word-title,
[data-theme="dark"] .word-title {
  color: #FF7733;
  text-shadow: 0 0 16px rgba(255, 119, 51, 0.3);
}

.phonetic {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-orange-deep);
  margin-top: 8px;
}

.card-back-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-back-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-back-word {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--text-main);
}

.meaning-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.part-of-speech {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--brand-orange-light);
  border: 1px solid var(--border-line);
  color: var(--brand-orange-deep);
}

.meaning-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
}

.card-back-sentence {
  background: rgba(255, 255, 255, 0.65);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

html.dark .card-back-sentence {
  background: rgba(0, 0, 0, 0.3);
}

.example-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.example-text mark {
  background: var(--brand-orange-light);
  color: var(--brand-orange-deep);
  font-weight: 800;
  border-radius: 4px;
  padding: 0 4px;
}

.example-trans {
  font-size: 0.82rem;
  color: var(--text-sub);
}

.def-toggle-btn {
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border-line);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  background: var(--bg-card);
  cursor: pointer;
  align-self: flex-start;
  margin-top: 4px;
}

.card-embedded-ratings {
  height: 68px;
  width: 100%;
  background: var(--bg-card);
  border-top: var(--border-width) solid var(--border-line);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 14px;
  gap: 10px;
}

.rating-btn {
  flex: 1;
  height: 44px;
  border-radius: var(--radius-md);
  border: var(--border-width) solid var(--border-line);
  box-shadow: var(--comic-shadow-sm);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.rating-btn:active {
  transform: translate(1.5px, 1.5px);
  box-shadow: none;
}

.rating-btn.forgot {
  background-color: #FEE2E2;
  color: #B91C1C;
}

.rating-btn.hard {
  background-color: #FEF3C7;
  color: #B45309;
}

.rating-btn.good {
  background-color: #D1FAE5;
  color: #047857;
}

/* ==========================================================================
   板块二：拾取生词 (完全恢复原版功能与样式)
   ========================================================================== */

#photo-panel {
  margin-bottom: 14px;
}

.photo-panel-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.photo-btn {
  flex: 1;
}

.photo-editor {
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--comic-shadow);
  background: #000000;
}

#photo-canvas {
  width: 100%;
  display: block;
  touch-action: pan-y;
  cursor: crosshair;
}

.photo-editor.cropping-active {
  box-shadow: 0 0 0 2.5px var(--brand-orange, #FF6B35), var(--comic-shadow);
  border-color: var(--brand-orange, #FF6B35);
}

.photo-editor.cropping-active #photo-canvas {
  touch-action: none;
}

.photo-tools, .photo-modes, .photo-recognize-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.chip {
  padding: 6px 14px;
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--comic-shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chip.active {
  background: var(--brand-orange);
  color: #FFFFFF;
}

.photo-recognized-fold {
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--comic-shadow);
  overflow: hidden;
  margin-top: 6px;
}

.photo-fold-summary {
  padding: 12px 14px;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--brand-orange-deep);
  cursor: pointer;
  background: var(--bg-card-sub);
  list-style: none;
}

.photo-fold-summary::-webkit-details-marker {
  display: none;
}

.photo-fold-body {
  padding: 12px;
  max-height: 280px;
  overflow-y: auto;
}

.photo-items-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-item {
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: #FFFFFF;
}

.parse-panel {
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 14px;
  background: var(--bg-card);
  box-shadow: var(--comic-shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sub);
}

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

#candidate-area {
  margin-top: 14px;
}

.candidate-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px;
  font-size: 0.85rem;
  font-weight: 700;
}

.select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.candidate-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.candidate {
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  padding: 12px 14px;
  box-shadow: var(--comic-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.candidate.existing {
  border-color: var(--dopamine-green);
  background: #E6F8F2;
}

.candidate-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.check-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 800;
}

.candidate-fields {
  display: flex;
  gap: 8px;
}

.meaning-field {
  flex: 2;
}

.candidate-actions {
  margin-top: 14px;
}

.candidate-actions .button {
  width: 100%;
}

/* ==========================================================================
   板块三：单词本 (完整恢复收录日历、筛选与多巴胺卡片)
   ========================================================================== */

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 4px 12px;
  box-shadow: var(--comic-shadow);
  margin-bottom: 10px;
}

.search-wrap .icon {
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
}

.search-wrap .field {
  border: none; border-radius: 0 var(--radius-md, 16px) var(--radius-md, 16px) 0;
  box-shadow: none;
  padding: 8px 0;
}

.date-divider {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--brand-orange-deep);
  padding: 8px 0 4px;
}

/* ==========================================================================
   单词本：半透明磨砂玻璃卡片 · 无外边框 · 喇叭统一靠右对齐
   ========================================================================== */
.word-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: none !important;
  border-radius: var(--radius-md, 16px);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.68) !important;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
  position: relative;
  z-index: 1;
}

.word-row:active {
  transform: scale(0.99);
}

.word-row.mastered {
  background: rgba(230, 248, 242, 0.75) !important;
  border: none !important;
}

/* 单词详情点击区域（英文与词性释义） */
.word-row .word-open {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  background: transparent;
  border: none; border-radius: 0 var(--radius-md, 16px) var(--radius-md, 16px) 0;
  padding: 0;
  cursor: pointer;
  gap: 3px;
}

.word-row .word-open strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.word-row .word-open small {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-sub);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* 状态药丸标签 */
.word-row .word-status {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-sub);
  white-space: nowrap;
  border: none !important;
}

.word-row .word-status.mastered {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #059669 !important;
}

.word-row .word-status.due {
  background: rgba(255, 126, 74, 0.15) !important;
  color: #EA580C !important;
}

/* 读音喇叭：统一靠最右对齐 */
.word-row .icon-button[data-action="speak"] {
  flex-shrink: 0;
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none !important;
  background: rgba(255, 126, 74, 0.12) !important;
  color: var(--brand-orange) !important;
  box-shadow: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.word-row .icon-button[data-action="speak"]:active {
  transform: scale(0.9);
  background: rgba(255, 126, 74, 0.22) !important;
}

.word-row .icon-button[data-action="speak"] .icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* 分组日期标题 */
.collection-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--brand-orange-deep, #EA580C);
  margin: 14px 2px 6px;
  letter-spacing: 0.02em;
}

.collection-group span {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ==========================================================================
   深色模式：半透明深色磨砂卡片 · 浅色文字对比
   ========================================================================== */
html.dark .word-row,
[data-theme="dark"] .word-row {
  background: rgba(36, 30, 27, 0.72) !important;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: none !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
}

html.dark .word-row.mastered,
[data-theme="dark"] .word-row.mastered {
  background: rgba(16, 56, 42, 0.72) !important;
  border: none !important;
}

html.dark .word-row .word-open strong,
[data-theme="dark"] .word-row .word-open strong {
  color: #FBF7F4 !important;
}

html.dark .word-row .word-open small,
[data-theme="dark"] .word-row .word-open small {
  color: #D1C2BB !important;
}

html.dark .word-row .word-status,
[data-theme="dark"] .word-row .word-status {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #D1C2BB !important;
}

html.dark .word-row .word-status.mastered,
[data-theme="dark"] .word-row .word-status.mastered {
  background: rgba(16, 185, 129, 0.22) !important;
  color: #34D399 !important;
}

html.dark .word-row .word-status.due,
[data-theme="dark"] .word-row .word-status.due {
  background: rgba(255, 126, 74, 0.22) !important;
  color: #FF9B70 !important;
}

html.dark .word-row .icon-button[data-action="speak"],
[data-theme="dark"] .word-row .icon-button[data-action="speak"] {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #FF9B70 !important;
}

html.dark .word-row .icon-button[data-action="speak"]:active,
[data-theme="dark"] .word-row .icon-button[data-action="speak"]:active {
  background: rgba(255, 255, 255, 0.16) !important;
}

html.dark .collection-group,
[data-theme="dark"] .collection-group {
  color: #FF9B70;
}

html.dark .collection-group span,
[data-theme="dark"] .collection-group span {
  color: #8E7F78;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-weight: 700;
}

/* ==========================================================================
   板块四：我的成长 (热力图、统计指标、设置、备份)
   ========================================================================== */

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.metric {
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  box-shadow: var(--comic-shadow);
  background: #FFF0EB;
}

.metric:nth-child(2) { background: #E6F8F2; }
.metric:nth-child(3) { background: #FEF8E7; }
.metric:nth-child(4) { background: #F3EEFE; }

.metric strong {
  font-size: 2rem;
  font-weight: 900;
  display: block;
  line-height: 1.1;
}

.metric span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-sub);
}

.learning-calendar {
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--comic-shadow);
  padding: 14px;
  margin-bottom: 14px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.section-title h2 {
  font-size: 1.05rem;
  font-weight: 900;
}

.heat-scroll {
  overflow-x: auto;
  padding: 8px 0;
}

.heat-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  gap: 3px;
}

.heat-cell {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--border-line);
  padding: 0;
  cursor: pointer;
}

.heat-0 { background: #F5EFEB; }
.heat-1 { background: #C6F6D5; }
.heat-2 { background: #68D391; }
.heat-3 { background: #38A169; }
.heat-4 { background: #22543D; }

.heat-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  margin-top: 8px;
  justify-content: flex-end;
}

.heat-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  border: 1px solid var(--border-line);
}

.day-summary {
  margin-top: 10px;
  border-top: 1.5px dashed rgba(45, 35, 32, 0.15);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-weight: 700;
  font-size: 0.9rem;
}

.backup-actions {
  display: flex;
  gap: 10px;
  margin: 8px 0;
}

.backup-actions .button {
  flex: 1;
}

/* ==========================================================================
   登录/开通界面样式 (严格整体居中 · 治愈手账风 · 细腻间距)
   ========================================================================== */

.login-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 16px 8px;
  width: 100%;
}

.account-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--comic-shadow-lg);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0 auto;
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.login-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  margin-bottom: 4px;
}

.eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--brand-orange);
  text-transform: uppercase;
}

.login-title {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.login-header .subtitle {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-sub);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin-top: 4px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.input-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  padding: 2px 0;
  user-select: none;
}

.check-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand-orange);
}

.error-tip {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-forgot);
  min-height: 1.2em;
  text-align: center;
}

.login-submit-btn {
  width: 100%;
  height: 48px;
  font-size: 1.05rem;
  font-weight: 900;
  border-radius: var(--radius-md);
  margin-top: 2px;
}

.login-footer-tips {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  border-top: 1.5px dashed rgba(45, 35, 32, 0.15);
  padding-top: 14px;
}

.tip-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

#account-retry {
  font-size: 0.8rem;
  padding: 4px 8px;
}

.account-bar {
  display: none !important;
}

/* 模态框与弹窗 */
#modal {
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--comic-shadow-lg);
  padding: 0;
  max-width: 90vw;
  width: 380px;
  margin: auto;
  background: var(--bg-card);
}

#modal::backdrop {
  background: rgba(45, 35, 32, 0.45);
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1.5px solid var(--border-line);
  background: var(--bg-card-sub);
}

.modal-fields {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1.5px solid var(--border-line);
}

#toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #25201C;
  color: #FBF7F4;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  border: 1.5px solid #4F4038;
  z-index: 999;
}

html.dark #toast,
[data-theme="dark"] #toast {
  background: #211D1A !important;
  color: #FBF7F4 !important;
  border: 1.5px solid #4F4038 !important;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.7) !important;
}

/* ==========================================================================
   单词本板块背景 (使用 assets/two.jpg 并附带上下边缘渐隐效果，自然衔接)
   ========================================================================== */
.wordbook-layout {
  position: relative;
  width: 100%;
  min-height: 100%;
}

.wordbook-layout::before {
  content: '';
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  height: calc(100vh - 124px);
  background-image: url('./assets/two.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;

  /* 上下边缘柔和渐隐消失，自然融入暖调宣纸底色 */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.4) 6%,
    rgba(0, 0, 0, 1) 18%,
    rgba(0, 0, 0, 1) 82%,
    rgba(0, 0, 0, 0.4) 94%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.4) 6%,
    rgba(0, 0, 0, 1) 18%,
    rgba(0, 0, 0, 1) 82%,
    rgba(0, 0, 0, 0.4) 94%,
    transparent 100%
  );
}

html.dark .wordbook-layout::before {
  opacity: 0.35;
}

.wordbook-layout > * {
  position: relative;
  z-index: 1;
}

/* word-row styles unified above */

/* ==========================================================================
   单词本末尾添加生词按钮 (居中 · 伴随列表向下移动)
   ========================================================================== */
.wordbook-footer-action {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px 0 12px;
  width: 100%;
}

.wordbook-add-btn {
  min-width: 180px;
  padding: 12px 28px;
  font-size: 1.05rem;
  font-weight: 900;
  border-radius: var(--radius-pill);
  background: var(--brand-orange) !important;
  color: #FFFFFF !important;
  box-shadow: var(--comic-shadow);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--border-width) solid var(--border-line);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.wordbook-add-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1.5px 1.5px 0px var(--border-line);
}

/* ==========================================================================
   收录日历：黄色 × 关闭按钮 & GitHub 热力方块优化
   ========================================================================== */
.yellow-close-btn {
  background: #FFB800 !important;
  border: var(--border-width) solid var(--border-line) !important;
  box-shadow: 2px 2px 0px var(--border-line) !important;
  color: #2D2320 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.yellow-close-btn .close-mark {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  color: #2D2320;
  line-height: 1;
  display: inline-block;
  margin-top: -2px;
}

.calendar-sheet {
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
}

.calendar-sheet .month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  margin: 10px 14px;
  border: 1.5px solid var(--border-line);
}

.calendar-sheet .weekday {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  padding-bottom: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid rgba(45, 35, 32, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease;
  font-weight: 800;
  padding: 2px;
}

.calendar-day:active {
  transform: scale(0.92);
}

.calendar-day span {
  font-size: 0.78rem;
  line-height: 1;
}

.calendar-day small {
  font-size: 0.6rem;
  line-height: 1;
  margin-top: 2px;
}

.calendar-day.heat-0 { background-color: #EBEDF0; color: #57606A; border-color: rgba(27, 31, 36, 0.15); }
.calendar-day.heat-1 { background-color: #9BE9A8; color: #1B4721; border-color: #85D793; }
.calendar-day.heat-2 { background-color: #40C463; color: #0E3B16; border-color: #34B055; }
.calendar-day.heat-3 { background-color: #30A14E; color: #FFFFFF; border-color: #26873F; }
.calendar-day.heat-4 { background-color: #216E39; color: #FFFFFF; border-color: #1A592D; }

.calendar-day.today {
  outline: 2px solid var(--brand-orange);
  outline-offset: 1px;
}

html.dark .calendar-day.heat-0,
[data-theme="dark"] .calendar-day.heat-0 {
  background-color: rgba(45, 35, 32, 0.08) !important;
  color: #7A6960 !important;
  border-color: rgba(45, 35, 32, 0.08) !important;
}
html.dark .calendar-day.heat-1 { background-color: #0E4429; color: #7EE787; border-color: #195837; }
html.dark .calendar-day.heat-2 { background-color: #006D32; color: #D2FEDB; border-color: #0E803E; }
html.dark .calendar-day.heat-3 { background-color: #26A641; color: #FFFFFF; border-color: #38BD55; }
html.dark .calendar-day.heat-4 { background-color: #39D353; color: #000000; border-color: #46E161; }

/* ==========================================================================
   我的成长日历背景 (assets/day.jpg)
   ========================================================================== */
.learning-calendar {
  background-image: url('./assets/day.jpg') !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  position: relative;
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--comic-shadow-lg);
  overflow: hidden;
  padding: 16px;
  margin-bottom: 16px;
}

.learning-calendar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 249, 242, 0.75);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  pointer-events: none;
  z-index: 0;
}

html.dark .learning-calendar::before {
  background: rgba(26, 22, 20, 0.78);
}

.learning-calendar > * {
  position: relative;
  z-index: 1;
}

.heat-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 13px);
  gap: 3.5px;
  padding: 10px 2px;
}

.heat-cell {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  border: 1px solid rgba(45, 35, 32, 0.15);
  padding: 0;
  cursor: pointer;
}

.heat-cell.heat-0 { background-color: #EBEDF0; }
.heat-cell.heat-1 { background-color: #9BE9A8; }
.heat-cell.heat-2 { background-color: #40C463; }
.heat-cell.heat-3 { background-color: #30A14E; }
.heat-cell.heat-4 { background-color: #216E39; }

html.dark .heat-cell.heat-0,
[data-theme="dark"] .heat-cell.heat-0 {
  background-color: rgba(45, 35, 32, 0.08) !important;
  border-color: rgba(45, 35, 32, 0.06) !important;
}

html.dark .heat-legend i.heat-0,
[data-theme="dark"] .heat-legend i.heat-0 {
  background-color: rgba(45, 35, 32, 0.08) !important;
  border-color: rgba(45, 35, 32, 0.12) !important;
}
html.dark .heat-cell.heat-1 { background-color: #0E4429; }
html.dark .heat-cell.heat-2 { background-color: #006D32; }
html.dark .heat-cell.heat-3 { background-color: #26A641; }
html.dark .heat-cell.heat-4 { background-color: #39D353; }

/* ==========================================================================
   我的成长：下半部分背景 (assets/there.jpg，向下对齐，从下往上渐隐)
   ========================================================================== */
.stats-layout {
  position: relative;
  width: 100%;
  min-height: 100%;
  padding-bottom: 24px;
}

.stats-layout::after {
  content: '';
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  height: 44vh;
  background-image: url('./assets/there.jpg');
  background-size: cover;
  background-position: bottom center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
  opacity: 0.62;

  -webkit-mask-image: linear-gradient(
    to top,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.85) 40%,
    rgba(0, 0, 0, 0.25) 75%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to top,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.85) 40%,
    rgba(0, 0, 0, 0.25) 75%,
    transparent 100%
  );
}

html.dark .stats-layout::after {
  opacity: 0.35;
}

.stats-layout > * {
  position: relative;
  z-index: 1;
}

.stats-card-box {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-md);
  box-shadow: var(--comic-shadow);
  padding: 16px;
  margin-bottom: 14px;
}

html.dark .stats-card-box {
  background: rgba(39, 33, 30, 0.88);
}

.stats-card-box .section-title h2 {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
}

.setting-row .field {
  max-width: 140px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.help-desc {
  font-size: 0.8rem;
  color: var(--text-sub);
  line-height: 1.5;
  margin: 6px 0 10px;
}

.status-line {
  margin-top: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ==================== AI 密钥配置卡片样式 ==================== */
.api-key-card {
  position: relative;
  overflow: hidden;
}

.key-badge {
  font-size: 0.76rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--border-line);
  letter-spacing: 0.02em;
}

.key-badge.configured {
  background: #E8F5E9;
  color: #2E7D32;
  border-color: #81C784;
}

.key-badge.empty {
  background: #FFF3E0;
  color: #E65100;
  border-color: #FFB74D;
}

html.dark .key-badge.configured {
  background: #1B3820;
  color: #81C784;
  border-color: #2E7D32;
}

html.dark .key-badge.empty {
  background: #3E2723;
  color: #FFB74D;
  border-color: #BF360C;
}

.key-display-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px dashed var(--border-line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 12px 0 14px 0;
  user-select: none;
}

html.dark .key-display-panel {
  background: rgba(0, 0, 0, 0.25);
}

.key-mask-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-icon {
  font-size: 1.1rem;
}

.key-cipher-dots {
  letter-spacing: 2px;
  color: var(--text-muted);
}

.key-status-indicator {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  white-space: nowrap;
}

.key-status-indicator.active {
  color: #2E7D32;
}

html.dark .key-status-indicator.active {
  color: #81C784;
}

.key-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.key-btn-paste {
  flex: 1 1 auto;
  font-weight: 800;
  background: var(--brand-orange, #FF5500) !important;
  color: #fff !important;
  border-color: var(--border-line) !important;
}

.key-btn-test {
  flex: 0 0 auto;
  font-weight: 800;
}

.key-btn-clear {
  flex: 0 0 auto;
  color: #D32F2F !important;
  font-weight: 800;
}

.key-feedback-box {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-line);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.2s ease;
}

.key-feedback-box.testing {
  background: #FFF8E1;
  color: #E65100;
  border-color: #FFE082;
}

.key-feedback-box.success {
  background: #E8F5E9;
  color: #2E7D32;
  border-color: #A5D6A7;
}

.key-feedback-box.error {
  background: #FFEBEE;
  color: #C62828;
  border-color: #FFCDD2;
}

html.dark .key-feedback-box.testing {
  background: #332B10;
  color: #FFE082;
  border-color: #F57F17;
}

html.dark .key-feedback-box.success {
  background: #152C18;
  color: #A5D6A7;
  border-color: #2E7D32;
}

html.dark .key-feedback-box.error {
  background: #331518;
  color: #EF9A9A;
  border-color: #C62828;
}

.secure-paste-modal {
  padding: 4px 0;
}

/* ==================== 拍照识词板块（移动端专属优化） ==================== */
.parser-layout {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.comic-card {
  background: rgba(255, 255, 255, 0.92);
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-md);
  box-shadow: var(--comic-shadow);
  padding: 14px 16px;
  margin-bottom: 12px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

html.dark .comic-card {
  background: rgba(39, 33, 30, 0.92);
}

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

.comic-card .section-title h2 {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text-main);
  margin: 0;
}

.card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* 拍照识词操作按钮 */
.photo-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.photo-btn {
  flex: 1;
  min-height: 44px;
  font-size: 0.92rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-sm);
  box-shadow: var(--comic-shadow-sm);
  background: var(--bg-card);
  cursor: pointer;
}

.photo-remove-btn {
  font-size: 0.8rem;
  color: var(--color-danger, #D32F2F);
  font-weight: 700;
}

/* 折叠窗口栏（识别结果默认折叠） */
.photo-recognized-fold {
  border: 2px solid var(--border-line);
  border-radius: var(--radius-sm);
  background: #FFFDF7;
  box-shadow: var(--comic-shadow-sm);
  margin-top: 10px;
  overflow: hidden;
  transition: all 0.2s ease;
}

html.dark .photo-recognized-fold {
  background: #25201C;
}

.photo-fold-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #FFF8E1;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

html.dark .photo-fold-summary {
  background: #332B10;
  color: #FFE082;
}

.photo-fold-summary::-webkit-details-marker {
  display: none;
}

.fold-summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fold-tag {
  font-size: 0.95rem;
}

.fold-count {
  font-weight: 800;
  color: var(--brand-orange-deep, #D84315);
}

html.dark .fold-count {
  color: #FFB74D;
}

.fold-summary-arrow {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
}

.photo-fold-content {
  padding: 12px 14px;
  max-height: 280px;
  overflow-y: auto;
  border-top: 1.5px dashed var(--border-line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-fold-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
}

.photo-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.photo-item-card {
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

html.dark .photo-item-card {
  background: #1E1B18;
}

.photo-item-fields {
  display: flex;
  gap: 6px;
}

.mini-field {
  padding: 4px 8px !important;
  font-size: 0.82rem !important;
  min-height: 32px !important;
}

.saved-reuse-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.75rem;
}

.saved-hint {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-select {
  padding: 2px 6px !important;
  font-size: 0.75rem !important;
  height: 28px !important;
  width: auto !important;
}

/* 文本输入模块 */
.text-source-area {
  min-height: 85px;
  max-height: 130px;
  font-size: 0.9rem;
  resize: vertical;
}

.text-input-footer {
  display: flex;
  justify-content: flex-end;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 浅色小字右对齐提示 */
.parser-privacy-hint {
  text-align: right;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 2px 4px 12px auto;
  letter-spacing: 0.01em;
}

/* 移动端核心双核操作栏：并排补全与提取 */
.parser-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 8px;
}

.action-btn-enrich {
  flex: 1;
  min-height: 48px;
  font-size: 0.98rem;
  font-weight: 900;
  border: var(--border-width) solid var(--border-line);
  box-shadow: var(--comic-shadow-sm);
  background: var(--bg-card);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.action-btn-enrich:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.action-btn-extract {
  flex: 1;
  min-height: 48px;
  font-size: 0.98rem;
  font-weight: 900;
  background: var(--brand-orange, #FF5500) !important;
  color: #FFFFFF !important;
  border: var(--border-width) solid var(--border-line) !important;
  box-shadow: var(--comic-shadow) !important;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.action-btn-extract:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.action-btn-enrich:disabled,
.action-btn-extract:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.parser-status-msg {
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  margin: 6px 0 14px 0;
}

/* ==================== 提取模式圆圈点选项 ==================== */
.photo-circle-modes {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 12px 0 14px 0;
  user-select: none;
}

.circle-mode-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text-main);
  position: relative;
}

.circle-mode-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.mode-circle-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-line);
  background: var(--bg-card, #FFFFFF);
  box-shadow: var(--comic-shadow-sm, 2px 2px 0 var(--border-line));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  position: relative;
  flex-shrink: 0;
}

.circle-mode-option input[type="checkbox"]:checked + .mode-circle-dot::after {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand-orange, #FF5500);
}

html.dark .circle-mode-option input[type="checkbox"]:checked + .mode-circle-dot::after {
  background: var(--brand-orange, #FF5500);
}

.circle-mode-option:hover .mode-circle-dot {
  transform: scale(1.05);
}

/* ==========================================================================
   拍照识词板块背景 (assets/four.jpg，上下边缘柔和渐隐，自然衔接)
   ========================================================================== */
.parser-layout {
  position: relative;
  width: 100%;
  min-height: 100%;
}

.parser-layout::before {
  content: '';
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  height: calc(100vh - 124px);
  background-image: url('./assets/four.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.52;
  pointer-events: none;
  z-index: 0;

  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
}

html.dark .parser-layout::before,
[data-theme="dark"] .parser-layout::before {
  opacity: 0.26;
  filter: brightness(0.85) contrast(1.1);
}

.parser-layout > * {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   待入库生词折叠卡片 (点击可收起/展开，防止列表太长太乱)
   ========================================================================== */
.candidate-fold-wrapper {
  margin-top: 14px;
  border: var(--border-width) solid var(--border-line);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--comic-shadow);
  overflow: hidden;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
}

.candidate-fold-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-card-sub);
  border-bottom: 1.5px solid var(--border-line);
  cursor: pointer;
  user-select: none;
  font-size: 0.88rem;
}

.candidate-fold-summary::-webkit-details-marker {
  display: none;
}

.candidate-fold-wrapper:not([open]) .candidate-fold-summary {
  border-bottom: none;
}

.candidate-summary-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fold-toggle-indicator {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--brand-orange);
  transition: transform 0.2s ease;
}

.candidate-fold-wrapper:not([open]) .fold-toggle-indicator {
  transform: rotate(-90deg);
}

.fold-title {
  font-size: 0.92rem;
  color: var(--text-main);
  font-weight: 800;
}

.fold-count-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-orange);
  background: rgba(255, 126, 74, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.fold-tip-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.candidate-fold-content {
  padding: 12px;
}

.candidate-summary-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-line);
}

/* ==========================================================================
   暗色模式色彩全面升级：暖纸底色 · 高反差深色字 · 单词本选中爱马仕橙
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 我的成长板块：学习足迹/年份/日期与统计/密钥/偏好/备份等字眼全部设为深色
   -------------------------------------------------------------------------- */
/* 日历卡片与统计卡片采用暖纸质感表面，保证深色字体清晰呈现 */
html.dark .learning-calendar::before,
[data-theme="dark"] .learning-calendar::before {
  background: rgba(255, 248, 240, 0.94) !important;
}

html.dark .stats-card-box,
[data-theme="dark"] .stats-card-box {
  background: rgba(255, 252, 247, 0.95) !important;
  border-color: #D9C8BE !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18) !important;
}

/* “学习足迹”大标题 */
html.dark .learning-calendar h2,
[data-theme="dark"] .learning-calendar h2,
html.dark .learning-calendar .section-title h2,
[data-theme="dark"] .learning-calendar .section-title h2 {
  color: #1A1614 !important;
}

/* “年份”标签及下拉框 */
html.dark .learning-calendar .year-label,
[data-theme="dark"] .learning-calendar .year-label {
  color: #1A1614 !important;
}

html.dark .learning-calendar .year-label select,
[data-theme="dark"] .learning-calendar .year-label select {
  background: #FFFFFF !important;
  color: #1A1614 !important;
  border-color: #C8B9AF !important;
}

/* 日期 “2026-10-09” 及选择日期标签 */
html.dark .day-summary h3,
[data-theme="dark"] .day-summary h3,
html.dark .day-summary label,
[data-theme="dark"] .day-summary label {
  color: #1A1614 !important;
}

html.dark .day-summary input.field,
[data-theme="dark"] .day-summary input.field {
  background: #FFFFFF !important;
  color: #1A1614 !important;
  border-color: #C8B9AF !important;
}

/* “新收录 5 词 · 复习 5 词 · 练习 12 次” */
html.dark .day-summary p,
[data-theme="dark"] .day-summary p,
html.dark .day-summary p b,
[data-theme="dark"] .day-summary p b {
  color: #1A1614 !important;
}

/* “AI 密钥配置” */
html.dark .api-key-card h2,
[data-theme="dark"] .api-key-card h2 {
  color: #1A1614 !important;
}

/* “用户可配置个人阿里云百炼 API Key。密钥全程安全加密，界面不可见，用户亦不可查看明文，仅支持点击粘贴更新。” */
html.dark .api-key-card p.help,
[data-theme="dark"] .api-key-card p.help {
  color: #382A24 !important;
}

/* 密钥掩码卡片在暗色模式下同样适配暖纸深色字 */
html.dark .key-display-panel,
[data-theme="dark"] .key-display-panel {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: #B8A89E !important;
}

html.dark .key-mask-display,
[data-theme="dark"] .key-mask-display {
  color: #1A1614 !important;
}

html.dark .key-cipher-dots,
[data-theme="dark"] .key-cipher-dots {
  color: #55443B !important;
}

/* “偏好设置”大标题 */
html.dark .stats-card-box h2,
[data-theme="dark"] .stats-card-box h2,
html.dark .stats-card-box .section-title h2,
[data-theme="dark"] .stats-card-box .section-title h2 {
  color: #1A1614 !important;
}

/* “界面主题”、“发音偏好”、“切卡自动发音” */
html.dark .setting-row span,
[data-theme="dark"] .setting-row span {
  color: #1A1614 !important;
}

html.dark .setting-row .field,
[data-theme="dark"] .setting-row .field {
  background: #FFFFFF !important;
  color: #1A1614 !important;
  border-color: #C8B9AF !important;
}

/* “数据备份与恢复” */
html.dark .stats-card-box:last-of-type h2,
[data-theme="dark"] .stats-card-box:last-of-type h2 {
  color: #1A1614 !important;
}

/* “数据保存在服务器账号空间。” */
html.dark .stats-card-box p.help,
[data-theme="dark"] .stats-card-box p.help {
  color: #382A24 !important;
}

/* “离线缓存已就绪。” */
html.dark #offline-status,
[data-theme="dark"] #offline-status {
  color: #382A24 !important;
}

/* --------------------------------------------------------------------------
   2. 拍照识词板块：卡片标题、点选项、提示语全部换为深色
   -------------------------------------------------------------------------- */
/* 拍照识词卡片在暗色模式下采用暖纸质感表面 */
html.dark .comic-card,
[data-theme="dark"] .comic-card {
  background: rgba(255, 252, 247, 0.95) !important;
  border-color: #D9C8BE !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18) !important;
}

/* 标题：“拍照识词”、“粘贴文本”字眼换为深色 */
html.dark .photo-input-section h2,
[data-theme="dark"] .photo-input-section h2,
html.dark .text-input-section h2,
[data-theme="dark"] .text-input-section h2,
html.dark .comic-card .section-title h2,
[data-theme="dark"] .comic-card .section-title h2 {
  color: #1A1614 !important;
}

/* 选项：“只提取划线词”、“全文提取”字眼换为深色 */
html.dark .circle-mode-option,
[data-theme="dark"] .circle-mode-option,
html.dark .circle-mode-option .mode-text,
[data-theme="dark"] .circle-mode-option .mode-text {
  color: #1A1614 !important;
}

/* 提示语：“请先拍照或从相册选择图片。原图仅在本地处理，不会保存到服务器。”全部换为深色 */
html.dark .photo-status,
[data-theme="dark"] .photo-status,
html.dark .parser-privacy-hint,
[data-theme="dark"] .parser-privacy-hint,
html.dark .parser-status-msg,
[data-theme="dark"] .parser-status-msg {
  color: #2D2320 !important;
}

/* 副标题与小字说明 */
html.dark .card-subtitle,
[data-theme="dark"] .card-subtitle,
html.dark .text-input-footer span,
[data-theme="dark"] .text-input-footer span {
  color: #4A3B35 !important;
}

/* 粘贴文本输入框：字色始终为深色黑墨 */
.text-source-area {
  background: #FFFDF9 !important;
  color: #1A1614 !important;
  border: var(--border-width) solid var(--border-line) !important;
}

.text-source-area::placeholder {
  color: #7A706A !important;
}

html.dark .text-source-area,
[data-theme="dark"] .text-source-area {
  background: #FFFFFF !important;
  color: #1A1614 !important;
  border-color: #C8B9AF !important;
}

html.dark .text-source-area::placeholder,
[data-theme="dark"] .text-source-area::placeholder {
  color: #7A706A !important;
}

/* --------------------------------------------------------------------------
   3. 单词本板块：深色模式下选中变为亮橘色爱马仕橙功能恢复
   -------------------------------------------------------------------------- */
/* 筛选按钮基础与选中高亮：选中时恢复纯正爱马仕橙色 */
.chip {
  color: var(--text-main);
  background: var(--bg-card);
  transition: all 0.15s ease;
}

.chip.active {
  background: var(--brand-orange, #FF6B35) !important;
  color: #FFFFFF !important;
  border-color: var(--brand-orange, #FF6B35) !important;
}

html.dark .chip,
[data-theme="dark"] .chip {
  background: #332B27;
  color: #FBF7F4;
  border-color: #55483E;
}

/* 核心恢复：深色模式下筛选按钮选中变为鲜艳爱马仕橙 */
html.dark .chip.active,
[data-theme="dark"] .chip.active {
  background: var(--brand-orange, #FF6B35) !important;
  color: #FFFFFF !important;
  border-color: var(--brand-orange, #FF6B35) !important;
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.45) !important;
}

/* 单词卡片：在深色模式下点击/选中/悬停时变为亮橘色爱马仕橙 */
html.dark .word-row:active,
[data-theme="dark"] .word-row:active,
html.dark .word-row:hover,
[data-theme="dark"] .word-row:hover,
html.dark .word-row:focus-within,
[data-theme="dark"] .word-row:focus-within {
  background: rgba(45, 38, 34, 0.82) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45) !important;
}

html.dark .word-row:active .word-open strong,
[data-theme="dark"] .word-row:active .word-open strong,
html.dark .word-row:hover .word-open strong,
[data-theme="dark"] .word-row:hover .word-open strong,
html.dark .word-row:focus-within .word-open strong,
[data-theme="dark"] .word-row:focus-within .word-open strong,
html.dark .word-open:active strong,
[data-theme="dark"] .word-open:active strong,
html.dark .word-open:focus strong,
[data-theme="dark"] .word-open:focus strong,
html.dark .word-open:hover strong,
[data-theme="dark"] .word-open:hover strong {
  color: var(--brand-orange, #FF6B35) !important;
}

/* 单词被选中态 */
html.dark .word-row.selected,
[data-theme="dark"] .word-row.selected {
  background: rgba(48, 40, 36, 0.85) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45) !important;
}

html.dark .word-row.selected .word-open strong,
[data-theme="dark"] .word-row.selected .word-open strong {
  color: var(--brand-orange, #FF6B35) !important;
}

/* 我的成长总词数方框 */
.metric strong {
  color: #1A1614 !important;
}

.metric span {
  color: #4A3B35 !important;
}

html.dark .metric strong,
[data-theme="dark"] .metric strong {
  color: #1A1614 !important;
}

html.dark .metric span,
[data-theme="dark"] .metric span {
  color: #4A3B35 !important;
}


/* 复习卡片内文字及元素样式：翻转及亮暗模式下色彩保持完全一致、恒定不变 */
.review-card .word-title,
html.dark .review-card .word-title,
[data-theme="dark"] .review-card .word-title {
  color: #FF5500 !important;
  text-shadow: none !important;
}

.review-card .card-back-word,
html.dark .review-card .card-back-word,
[data-theme="dark"] .review-card .card-back-word {
  color: #1A1614 !important;
}

.review-card .phonetic,
html.dark .review-card .phonetic,
[data-theme="dark"] .review-card .phonetic {
  color: #C84814 !important;
}

.review-card .meaning-text,
html.dark .review-card .meaning-text,
[data-theme="dark"] .review-card .meaning-text {
  color: #1A1614 !important;
}

.review-card .part-of-speech,
html.dark .review-card .part-of-speech,
[data-theme="dark"] .review-card .part-of-speech {
  background: #FFE8D6 !important;
  color: #B84010 !important;
  border: 1px solid rgba(184, 64, 16, 0.3) !important;
}

.review-card .card-back-sentence,
html.dark .review-card .card-back-sentence,
[data-theme="dark"] .review-card .card-back-sentence {
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1.5px solid rgba(0, 0, 0, 0.12) !important;
}

.review-card .example-text,
html.dark .review-card .example-text,
[data-theme="dark"] .review-card .example-text {
  color: #1A1614 !important;
}

.review-card .example-text mark,
html.dark .review-card .example-text mark,
[data-theme="dark"] .review-card .example-text mark {
  background: #FFE3D1 !important;
  color: #B84010 !important;
}

.review-card .example-trans,
html.dark .review-card .example-trans,
[data-theme="dark"] .review-card .example-trans {
  color: #5C4E47 !important;
}

.review-card .stage-badge,
html.dark .review-card .stage-badge,
[data-theme="dark"] .review-card .stage-badge {
  background: #FFFFFF !important;
  color: #1A1614 !important;
  border: 1.5px solid #1A1614 !important;
}

.review-card .card-top-bar .speak,
html.dark .review-card .card-top-bar .speak,
[data-theme="dark"] .review-card .card-top-bar .speak {
  background: #FFFFFF !important;
  color: #1A1614 !important;
  border: 1.5px solid #1A1614 !important;
}

.review-card .def-toggle-btn,
html.dark .review-card .def-toggle-btn,
[data-theme="dark"] .review-card .def-toggle-btn {
  background: #FFFFFF !important;
  color: #1A1614 !important;
  border: 1px solid rgba(0, 0, 0, 0.25) !important;
}

.review-card .card-embedded-ratings,
html.dark .review-card .card-embedded-ratings,
[data-theme="dark"] .review-card .card-embedded-ratings {
  background: rgba(255, 255, 255, 0.95) !important;
  border-top: 1.5px solid rgba(0, 0, 0, 0.15) !important;
}


/* ============================================================================
   单词列表左滑删除样式 (Apple iOS 风格)
   ============================================================================ */
.word-swipe-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md, 16px);
  margin-bottom: 10px;
  touch-action: pan-y;
  background: transparent !important;
}

html.dark .word-swipe-container,
[data-theme="dark"] .word-swipe-container {
  background: transparent !important;
}

.word-swipe-delete-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 70px;
  background: #EF4444;
  color: #FFFFFF;
  border: none; border-radius: 0 var(--radius-md, 16px) var(--radius-md, 16px) 0;
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
  transition: background 0.15s ease;
  user-select: none;
}

.word-swipe-delete-btn:hover,
.word-swipe-delete-btn:active {
  background: #DC2626;
}

html.dark .word-swipe-delete-btn,
[data-theme="dark"] .word-swipe-delete-btn {
  background: #DC2626;
  color: #FFFFFF;
}

html.dark .word-swipe-delete-btn:hover,
html.dark .word-swipe-delete-btn:active {
  background: #B91C1C;
}

.word-swipe-container .word-row {
  margin-bottom: 0 !important;
  position: relative;
  z-index: 2;
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.4, 1);
  will-change: transform;
}

/* ============================================================================
   卡片正面翻转提示栏（正面不显示三个按钮）
   ============================================================================ */
.card-flip-prompt {
  height: 68px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8C7B73;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-top: 1.5px dashed rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.7);
  user-select: none;
  pointer-events: none;
}

html.dark .card-flip-prompt,
[data-theme="dark"] .card-flip-prompt {
  color: #8C7B73;
  border-top: 1.5px dashed rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.85);
}


/* ============================================================================
   全局电子小猫向右走路循环动画加载指示器
   ============================================================================ */
.cat-global-loader {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: calc(100% - 32px);
}

.cat-global-loader.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.cat-loader-card {
  position: relative;
  background: rgba(255, 252, 247, 0.96);
  border: 2px solid #1A1614;
  border-radius: 20px;
  padding: 12px 22px 12px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22), 3px 3px 0px #1A1614;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  max-width: 380px;
}

html.dark .cat-loader-card,
[data-theme="dark"] .cat-loader-card {
  background: rgba(38, 32, 29, 0.96);
  border: 2px solid #FF6B35;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5), 0 0 18px rgba(255, 107, 53, 0.3);
}

.cat-stage {
  width: 76px;
  height: 56px;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}

.cat-body-group {
  animation: cat-body-bob 0.45s ease-in-out infinite alternate;
  transform-origin: 40px 35px;
}

@keyframes cat-body-bob {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-2.5px) rotate(1.2deg); }
}

.cat-head-group {
  animation: cat-head-bob 0.45s ease-in-out infinite alternate;
  transform-origin: 55px 25px;
}

@keyframes cat-head-bob {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-2px); }
}

.cat-tail {
  animation: cat-tail-sway 0.55s ease-in-out infinite alternate;
  transform-origin: 22px 36px;
}

@keyframes cat-tail-sway {
  0% { transform: rotate(-14deg); }
  100% { transform: rotate(18deg); }
}

.leg-fl {
  animation: leg-stride-1 0.45s ease-in-out infinite alternate;
  transform-origin: 48px 38px;
}
.leg-fr {
  animation: leg-stride-2 0.45s ease-in-out infinite alternate;
  transform-origin: 54px 38px;
}
.leg-bl {
  animation: leg-stride-2 0.45s ease-in-out infinite alternate;
  transform-origin: 26px 38px;
}
.leg-br {
  animation: leg-stride-1 0.45s ease-in-out infinite alternate;
  transform-origin: 32px 38px;
}

@keyframes leg-stride-1 {
  0% { transform: rotate(-24deg); }
  100% { transform: rotate(26deg); }
}

@keyframes leg-stride-2 {
  0% { transform: rotate(26deg); }
  100% { transform: rotate(-24deg); }
}

.cat-ground-line {
  animation: ground-run 0.45s linear infinite;
}

@keyframes ground-run {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 12; }
}

html.dark .cat-ground-line,
[data-theme="dark"] .cat-ground-line {
  stroke: #5C4D44 !important;
}

.cat-shadow {
  animation: shadow-scale 0.45s ease-in-out infinite alternate;
  transform-origin: 40px 56px;
}

@keyframes shadow-scale {
  0% { transform: scaleX(1); opacity: 0.35; }
  100% { transform: scaleX(0.85); opacity: 0.2; }
}

html.dark .cat-shadow,
[data-theme="dark"] .cat-shadow {
  fill: #000000 !important;
}

.cat-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.cat-title {
  font-size: 15px;
  font-weight: 800;
  color: #1A1614;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: -0.01em;
}

html.dark .cat-title,
[data-theme="dark"] .cat-title {
  color: #FFFDF9;
}

.cat-title-dots span {
  display: inline-block;
  animation: dot-bounce 1.1s infinite;
  font-weight: 900;
  color: #FF6B35;
}
.cat-title-dots span:nth-child(1) { animation-delay: 0s; }
.cat-title-dots span:nth-child(2) { animation-delay: 0.2s; }
.cat-title-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(-3px); opacity: 1; }
}

.cat-sub {
  font-size: 12px;
  color: #7A6960;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.dark .cat-sub,
[data-theme="dark"] .cat-sub {
  color: #D1C2BB;
}

.cat-loader-close {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none; border-radius: 0 var(--radius-md, 16px) var(--radius-md, 16px) 0;
  background: transparent;
  color: #9C8C84;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cat-loader-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #1A1614;
}
html.dark .cat-loader-close,
[data-theme="dark"] .cat-loader-close {
  color: #A89890;
}
html.dark .cat-loader-close:hover,
[data-theme="dark"] .cat-loader-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFDF9;
}


/* ============================================================================
   暗色模式定制：弹窗均为深色 · 识别结果与点击展开核对均为深色字
   ============================================================================ */

/* 1. 模态弹窗 (#modal) 在暗色模式下均为深色 */
html.dark #modal,
[data-theme="dark"] #modal {
  background: #25201C !important;
  border-color: #4F4038 !important;
  color: #FBF7F4 !important;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.75) !important;
}

html.dark #modal::backdrop,
[data-theme="dark"] #modal::backdrop {
  background: rgba(0, 0, 0, 0.75) !important;
}

html.dark .modal-top,
[data-theme="dark"] .modal-top {
  background: #2E2622 !important;
  border-bottom-color: #4F4038 !important;
  color: #FBF7F4 !important;
}

html.dark .modal-top h2,
[data-theme="dark"] .modal-top h2 {
  color: #FBF7F4 !important;
}

html.dark .modal-fields,
[data-theme="dark"] .modal-fields {
  background: #25201C !important;
  color: #FBF7F4 !important;
}

html.dark .modal-fields label,
[data-theme="dark"] .modal-fields label {
  color: #D1C2BB !important;
}

html.dark .modal-fields .field,
[data-theme="dark"] .modal-fields .field {
  background: #1E1B18 !important;
  color: #FBF7F4 !important;
  border-color: #4F4038 !important;
}

html.dark .modal-actions,
[data-theme="dark"] .modal-actions {
  background: #25201C !important;
  border-top-color: #4F4038 !important;
}

/* 2. 拍照识词：“识别结果”与“点击展开核对”在暗色模式下均为清晰深色 */
html.dark .photo-recognized-fold,
[data-theme="dark"] .photo-recognized-fold {
  background: #FFFDF9 !important;
  border-color: #D9C8BE !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

html.dark .photo-fold-summary,
[data-theme="dark"] .photo-fold-summary {
  background: #F5EBE1 !important;
  color: #1A1614 !important;
  border-bottom: 1px solid #D9C8BE !important;
}

/* “识别结果”字眼为深色 */
html.dark .photo-fold-summary .fold-tag,
[data-theme="dark"] .photo-fold-summary .fold-tag,
html.dark .fold-tag,
[data-theme="dark"] .fold-tag {
  color: #1A1614 !important;
  font-weight: 800 !important;
}

/* 检出统计标签为深橘色 */
html.dark .photo-fold-summary .fold-count,
[data-theme="dark"] .photo-fold-summary .fold-count,
html.dark .fold-count,
[data-theme="dark"] .fold-count {
  color: #A33D0D !important;
  font-weight: 800 !important;
}

/* “点击展开核对 ▾”字眼为深色 */
html.dark .photo-fold-summary .fold-arrow,
[data-theme="dark"] .photo-fold-summary .fold-arrow,
html.dark .fold-arrow,
[data-theme="dark"] .fold-arrow,
html.dark .photo-fold-summary .fold-summary-arrow,
[data-theme="dark"] .photo-fold-summary .fold-summary-arrow {
  color: #2D2320 !important;
  font-weight: 700 !important;
}

/* 展开区域内文本也适配深色 */
html.dark .photo-fold-content,
[data-theme="dark"] .photo-fold-content {
  background: #FFFDF9 !important;
  border-top-color: #D9C8BE !important;
}

html.dark .photo-fold-content .input-label,
[data-theme="dark"] .photo-fold-content .input-label {
  color: #1A1614 !important;
  font-weight: 700 !important;
}

html.dark .photo-fold-content #photo-text,
[data-theme="dark"] .photo-fold-content #photo-text {
  background: #FFFFFF !important;
  color: #1A1614 !important;
  border-color: #C8B9AF !important;
}

html.dark .photo-fold-tools,
[data-theme="dark"] .photo-fold-tools,
html.dark .photo-fold-tools span,
[data-theme="dark"] .photo-fold-tools span {
  color: #1A1614 !important;
  font-weight: 700 !important;
}

html.dark .photo-item-card,
[data-theme="dark"] .photo-item-card {
  background: #FFFFFF !important;
  border-color: #D9C8BE !important;
}

html.dark .photo-item-card .check-label,
[data-theme="dark"] .photo-item-card .check-label,
html.dark .photo-item-card strong,
[data-theme="dark"] .photo-item-card strong {
  color: #1A1614 !important;
}

html.dark .photo-item-card .word-lemma,
[data-theme="dark"] .photo-item-card .word-lemma {
  color: #55443B !important;
}

html.dark .photo-item-card input.mini-field,
[data-theme="dark"] .photo-item-card input.mini-field,
html.dark .photo-item-card select.mini-field,
[data-theme="dark"] .photo-item-card select.mini-field {
  background: #FAF8F5 !important;
  color: #1A1614 !important;
  border-color: #C8B9AF !important;
}

/* 3. 待入库候选词条折叠栏：在暗色模式下也保持深色 */
html.dark .candidate-fold-summary,
[data-theme="dark"] .candidate-fold-summary {
  background: #F5EBE1 !important;
  border-bottom-color: #D9C8BE !important;
}

html.dark .candidate-fold-summary .fold-title,
[data-theme="dark"] .candidate-fold-summary .fold-title {
  color: #1A1614 !important;
  font-weight: 800 !important;
}

html.dark .candidate-fold-summary .fold-tip-label,
[data-theme="dark"] .candidate-fold-summary .fold-tip-label {
  color: #4A3B35 !important;
  font-weight: 700 !important;
}

html.dark .candidate-summary-toolbar,
[data-theme="dark"] .candidate-summary-toolbar,
html.dark .select-all-label,
[data-theme="dark"] .select-all-label {
  color: #1A1614 !important;
  font-weight: 700 !important;
}

html.dark .candidate,
[data-theme="dark"] .candidate {
  background: #FFFFFF !important;
  border-color: #D9C8BE !important;
}

html.dark .candidate strong,
[data-theme="dark"] .candidate strong {
  color: #1A1614 !important;
}

html.dark .candidate .field,
[data-theme="dark"] .candidate .field {
  background: #FAF8F5 !important;
  color: #1A1614 !important;
  border-color: #C8B9AF !important;
}

html.dark .candidate details summary,
[data-theme="dark"] .candidate details summary,
html.dark .candidate details label,
[data-theme="dark"] .candidate details label {
  color: #382A24 !important;
}


/* 粘贴文本模块一键粘贴按钮 */
.paste-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm, 10px);
  border: var(--border-width, 2px) solid var(--border-line, #2D2320);
  background: var(--bg-card, #FFFFFF);
  box-shadow: var(--comic-shadow-sm, 2px 2px 0px #2D2320);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--brand-orange, #FF6B35);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.15s ease, color 0.15s ease;
}

.paste-icon-btn:hover {
  background: var(--brand-orange-light, #FFE8DF);
  color: var(--brand-orange-deep, #E8590C);
}

.paste-icon-btn:active {
  transform: translate(1.5px, 1.5px);
  box-shadow: none;
}

.paste-icon-btn .icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

html.dark .paste-icon-btn,
[data-theme="dark"] .paste-icon-btn {
  background: #FFFDF9 !important;
  color: var(--brand-orange) !important;
  border-color: #2D2320 !important;
  box-shadow: var(--comic-shadow-sm, 2px 2px 0px #2D2320) !important;
}

html.dark .paste-icon-btn:hover,
[data-theme="dark"] .paste-icon-btn:hover {
  background: #FFE8DF !important;
}

/* 拍照识词识别结果专属居中补全按钮 */
.photo-enrich-center-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 14px 0 6px;
  width: 100%;
}

.photo-enrich-center-wrap .photo-enrich-btn {
  min-width: 180px;
  max-width: 280px;
  width: 100%;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: var(--comic-shadow);
}

.candidate-fold-wrapper + .candidate-fold-wrapper {
  margin-top: 14px;
}

.photo-fold-tool-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 微信朋友圈样式九宫格缩略图 */
.photo-thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 6px 0;
  width: 100%;
}

.photo-thumb-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm, 10px);
  border: var(--border-width, 2px) solid var(--border-line, #2D2320);
  background: var(--bg-card-sub, #F5EFEB);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--comic-shadow-sm, 2px 2px 0px #2D2320);
  transition: transform 0.1s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.photo-thumb-item:active {
  transform: translate(1px, 1px);
}

.photo-thumb-item.active {
  border-color: var(--brand-orange, #FF6B35);
  box-shadow: 0 0 0 2.5px var(--brand-orange, #FF6B35), var(--comic-shadow-sm, 2px 2px 0px #2D2320);
}

.photo-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-thumb-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(45, 35, 32, 0.78);
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.2;
}

.photo-thumb-item.active .photo-thumb-badge {
  background: var(--brand-orange, #FF6B35);
}

.photo-thumb-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(220, 40, 40, 0.92);
  color: #FFFFFF;
  border: 1.5px solid #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  z-index: 2;
  transition: transform 0.1s ease, background-color 0.1s ease;
}

.photo-thumb-del:hover {
  background: #E02020;
  transform: scale(1.1);
}

.photo-thumb-add {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm, 10px);
  border: 2px dashed var(--border-line, #2D2320);
  background: var(--bg-card, #FFFFFF);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  color: var(--text-muted, #7A6960);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0;
  margin: 0;
  outline: none;
  font-family: inherit;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  user-select: none;
}

.photo-thumb-add:active {
  transform: translate(1px, 1px);
}

.photo-thumb-add:hover {
  background: var(--brand-orange-light, #FFE8DF);
  border-color: var(--brand-orange, #FF6B35);
  color: var(--brand-orange-deep, #E8590C);
}

.photo-thumb-add-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.photo-active-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--brand-orange-deep, #E8590C);
  background: var(--brand-orange-light, #FFE8DF);
  padding: 6px 10px;
  border-radius: var(--radius-sm, 8px);
  border: 1.5px solid var(--brand-orange, #FF6B35);
  margin: 4px 0 6px;
}

.photo-active-bar small {
  font-size: 0.72rem;
  color: #7A4530;
  font-weight: 700;
}

html.dark .photo-active-bar,
[data-theme="dark"] .photo-active-bar {
  background: #2D2320 !important;
  color: #FFA07A !important;
  border-color: #FF6B35 !important;
}

html.dark .photo-active-bar small,
[data-theme="dark"] .photo-active-bar small {
  color: #D9C8BE !important;
}

html.dark .photo-thumb-item,
[data-theme="dark"] .photo-thumb-item {
  border-color: #4A3B35 !important;
}

html.dark .photo-thumb-add,
[data-theme="dark"] .photo-thumb-add {
  background: #231C1A !important;
  border-color: #5A4840 !important;
  color: #C8B9AF !important;
}

/* 拍照识词原文操作与快速追加栏 */
.photo-ocr-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 6px;
}

.photo-ocr-tip {
  font-size: 0.75rem;
  color: var(--text-muted, #7A6960);
  font-weight: 700;
}

.photo-quick-add-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card-sub, #F5EFEB);
  padding: 6px 10px;
  border-radius: var(--radius-sm, 8px);
  border: 1.5px dashed var(--border-line, #2D2320);
  margin: 6px 0 4px;
}

.photo-quick-input {
  flex: 1;
  height: 32px;
  font-size: 0.85rem;
}

.photo-quick-add-btn {
  height: 32px;
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

html.dark .photo-quick-add-bar,
[data-theme="dark"] .photo-quick-add-bar {
  background: #231C1A !important;
  border-color: #5A4840 !important;
}

html.dark .photo-ocr-tip,
[data-theme="dark"] .photo-ocr-tip {
  color: #C8B9AF !important;
}


/* 红笔色相校准按钮与色彩方块 */
.photo-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.photo-calib-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  background: var(--bg-card, #ffffff);
  border: var(--border-width, 2px) solid var(--border-line, #2d3748);
  border-radius: var(--radius-sm, 8px);
  box-shadow: 2px 2px 0 var(--border-line, #2d3748);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-main, #2d3748);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.photo-calib-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--border-line, #2d3748);
}

.photo-calib-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--border-line, #2d3748);
}

.photo-calib-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}


/* ==========================================================================
   拍照识词：全文无滑动窗口完整展示与红色点选交互
   ========================================================================== */

.photo-ocr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  margin-bottom: 6px;
}

.photo-raw-toggle {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-orange, #FF5500);
  cursor: pointer;
}

.photo-fulltext-container {
  width: 100%;
  max-height: none !important;
  overflow: visible !important;
  background: var(--bg-card, #ffffff);
  border: var(--border-width, 2px) solid var(--border-line, #2d3748);
  border-radius: var(--radius-md, 8px);
  padding: 14px 16px;
  line-height: 1.85;
  font-size: 0.98rem;
  color: var(--text-main, #2d3748);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
  user-select: text;
  word-break: break-word;
}

.photo-text-line {
  margin-bottom: 6px;
  line-height: 1.85;
}

.photo-text-line.empty-line {
  margin-bottom: 12px;
}

.photo-text-word {
  display: inline;
  padding: 2px 4px;
  margin: 0 1px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: inherit;
}

.photo-text-word:hover {
  background-color: rgba(255, 85, 0, 0.14);
  color: #D84315;
  text-decoration: underline;
}

/* 已被识别出的单词 / 点选添加的单词（红色显示） */
.photo-text-word.is-recognized {
  color: #dc2626 !important;
  font-weight: 800 !important;
  background-color: rgba(220, 38, 38, 0.12) !important;
  border-bottom: 2px solid #dc2626 !important;
  border-radius: 3px;
}

.photo-text-word.is-recognized:hover {
  background-color: rgba(220, 38, 38, 0.22) !important;
}

/* 暗色主题适配 */
html.dark .photo-fulltext-container,
[data-theme="dark"] .photo-fulltext-container {
  background: #1e1e24 !important;
  color: #e2e8f0 !important;
  border-color: #4a5568 !important;
}

html.dark .photo-text-word:hover,
[data-theme="dark"] .photo-text-word:hover {
  background-color: rgba(255, 107, 107, 0.2) !important;
  color: #ff8787 !important;
}

html.dark .photo-text-word.is-recognized,
[data-theme="dark"] .photo-text-word.is-recognized {
  color: #f87171 !important;
  background-color: rgba(239, 68, 68, 0.25) !important;
  border-bottom-color: #f87171 !important;
}


/* 词组左右扩展加号按钮 */
.phrase-plus-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0 3px;
  padding: 0;
  border-radius: 50%;
  background: var(--brand-orange, #FF5500);
  color: #ffffff;
  border: 1.5px solid #2d3748;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.25);
  vertical-align: middle;
  transition: transform 0.12s ease, background-color 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.phrase-plus-btn:hover,
.phrase-plus-btn:active {
  transform: scale(1.22);
  background: #E64A00;
}

.phrase-plus-btn.plus-left {
  margin-right: 2px;
}

.phrase-plus-btn.plus-right {
  margin-left: 2px;
}

/* 正在处于编辑/扩展焦点中的词组外框微动效 */
.photo-text-word.is-phrase-active {
  outline: 2px dashed #FF5500;
  outline-offset: 2px;
  border-radius: 3px;
}

/* 暗色主题适配 */
html.dark .phrase-plus-btn,
[data-theme="dark"] .phrase-plus-btn {
  border-color: #ffffff;
  box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.2);
}

/* 独立全文点选卡片：置于识别结果折叠框之上，无滑动窗口，自适应高度，固定宽度 */
.photo-fulltext-card {
  width: 100%;
  box-sizing: border-box;
  margin-top: 12px;
  background: var(--bg-card, #ffffff);
  border: var(--border-width, 2px) solid var(--border-line, #2d3748);
  border-radius: var(--radius-md, 8px);
  padding: 12px 14px;
  box-shadow: var(--comic-shadow-sm, 2px 2px 0px #2d3748);
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

html.dark .photo-fulltext-card,
[data-theme="dark"] .photo-fulltext-card {
  background: #FFFDF9 !important;
  border-color: #D9C8BE !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.photo-fulltext-card #photo-text {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}
