/* =========================
   KEYWORD HIGHLIGHT
========================= */

.kw {
  display: inline;
  padding: 0 0.08em;
  margin: 0;
  border-radius: 0.14em;
  font-size: inherit;
  line-height: inherit;
  font-weight: 700;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Global keyword palette (unik untuk semua bab) */
.kw-tokoh { color: #9f1239; background: rgba(255, 228, 230, 0.92); }
.kw-masa { color: #1e40af; background: rgba(219, 234, 254, 0.92); }
.kw-tahun { color: #075985; background: rgba(224, 242, 254, 0.94); }
.kw-tempat { color: #166534; background: rgba(220, 252, 231, 0.92); }
.kw-konsep { color: #9a3412; background: rgba(255, 237, 213, 0.94); }
.kw-kerajaan { color: #6d28d9; background: rgba(237, 233, 254, 0.94); }
.kw-istilah { color: #0f766e; background: rgba(204, 251, 241, 0.94); }
.kw-pentadbiran { color: #92400e; background: rgba(254, 243, 199, 0.94); }
.kw-perjanjian { color: #be185d; background: rgba(252, 231, 243, 0.94); }
.kw-peristiwa { color: #b45309; background: rgba(254, 249, 195, 0.94); }
.kw-gerakan { color: #7e22ce; background: rgba(243, 232, 255, 0.94); }
.kw-pertubuhan { color: #4338ca; background: rgba(224, 231, 255, 0.94); }
.kw-karya { color: #0e7490; background: rgba(207, 250, 254, 0.94); }

.paper-chip .kw,
.point-line .kw,
.lead .kw,
.emoji-point-list .kw,
.answer-paper .kw,
.paper-kingdom .kw,
.paper-timeline-panel .kw,
.paper-accordion-panel .kw,
.keyword-legend-item .kw {
  font-size: inherit;
  line-height: inherit;
  font-weight: 700;
}

/* =========================
   DARK MODE — GLOBAL
========================= */

html[data-theme="dark"] .kw-tokoh {
  color: #f2a7bb;
  background: rgba(110, 28, 50, 0.34);
}

html[data-theme="dark"] .kw-masa { color: #a9c4f2; background: rgba(42, 66, 132, 0.34); }
html[data-theme="dark"] .kw-tahun { color: #8ecae6; background: rgba(8, 47, 73, 0.34); }

html[data-theme="dark"] .kw-tempat {
  color: #9dd8b0;
  background: rgba(24, 78, 48, 0.34);
}

html[data-theme="dark"] .kw-konsep { color: #fdba74; background: rgba(124, 45, 18, 0.34); }
html[data-theme="dark"] .kw-pentadbiran { color: #facc15; background: rgba(113, 63, 18, 0.34); }
html[data-theme="dark"] .kw-perjanjian { color: #f9a8d4; background: rgba(131, 24, 67, 0.34); }
html[data-theme="dark"] .kw-peristiwa { color: #fcd34d; background: rgba(120, 53, 15, 0.34); }

html[data-theme="dark"] .kw-kerajaan { color: #c4b5fd; background: rgba(76, 29, 149, 0.34); }
html[data-theme="dark"] .kw-gerakan { color: #d8b4fe; background: rgba(88, 28, 135, 0.34); }
html[data-theme="dark"] .kw-pertubuhan { color: #a5b4fc; background: rgba(49, 46, 129, 0.34); }

html[data-theme="dark"] .kw-istilah { color: #86ddd4; background: rgba(14, 90, 82, 0.34); }
html[data-theme="dark"] .kw-karya { color: #67e8f9; background: rgba(21, 94, 117, 0.34); }

/* =========================
   IDENTITI BLOK PERANG
========================= */

.bloc-central,
.bloc-triple-entente,
.bloc-axis,
.bloc-allies {
  display: inline;
  padding: 0 0.04em;
  border-radius: 0.12em;
  font-weight: 700;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.bloc-central { color: #334155; background: rgba(226, 232, 240, 0.58); }
.bloc-triple-entente { color: #166534; background: rgba(220, 252, 231, 0.58); }
.bloc-axis { color: #991b1b; background: rgba(254, 226, 226, 0.58); }
.bloc-allies { color: #1d4ed8; background: rgba(219, 234, 254, 0.58); }

.paper-chip.bloc-chip-central {
  color: #334155;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border-color: rgba(71, 85, 105, 0.22);
}

.paper-chip.bloc-chip-entente {
  color: #14532d;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: rgba(22, 101, 52, 0.20);
}

.paper-chip.bloc-chip-axis {
  color: #991b1b;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border-color: rgba(153, 27, 27, 0.20);
}

.paper-chip.bloc-chip-allies {
  color: #1d4ed8;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: rgba(29, 78, 216, 0.20);
}

.bloc-box {
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-soft);
  transition: background 0.35s ease;
}

.bloc-box-central {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border-color: rgba(71, 85, 105, 0.18);
}

.bloc-box-entente {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: rgba(22, 101, 52, 0.18);
}

.bloc-box-axis {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border-color: rgba(153, 27, 27, 0.18);
}

.bloc-box-allies {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: rgba(29, 78, 216, 0.18);
}

.bloc-legend-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.65rem;
  margin-top: 0.75rem;
}

.bloc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.72rem;
  border-radius: 14px;
  border: 1px solid rgba(92, 110, 132, 0.12);
  background: rgba(255, 253, 248, 0.82);
  box-shadow: var(--shadow-soft);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.35;
  transition: background 0.35s ease;
}

.bloc-legend-swatch {
  display: inline-flex;
  width: 0.92rem;
  height: 0.92rem;
  border-radius: 999px;
  flex: 0 0 auto;
}

.bloc-legend-central .bloc-legend-swatch { background: #64748b; }
.bloc-legend-entente .bloc-legend-swatch { background: #16a34a; }
.bloc-legend-axis .bloc-legend-swatch { background: #dc2626; }
.bloc-legend-allies .bloc-legend-swatch { background: #2563eb; }

/* =========================
   KEYWORD LEGEND
========================= */

.keyword-legend-wrap {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.6);
  border: 1px solid rgba(92, 110, 132, 0.08);
  box-shadow: var(--shadow-soft);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.keyword-legend-title {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink);
}

.keyword-legend-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.6rem;
}

.keyword-legend-item {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  line-height: 1.2;
}

.keyword-legend-item .kw,
.keyword-legend-item [class^="kw-"] {
  display: inline;
  font-size: 0.92rem;
  line-height: 1.3;
  font-weight: 700;
  padding: 0.08rem 0.35rem;
  border-radius: 0.42rem;
}

/* =========================
   DARK MODE — IDENTITI BLOK PERANG
========================= */

html[data-theme="dark"] .paper-chip.bloc-chip-central {
  color: #94a3b8 !important;
  background: linear-gradient(135deg, rgba(30, 40, 55, 0.92), rgba(25, 35, 50, 0.92)) !important;
  border-color: rgba(148, 163, 184, 0.20) !important;
}

html[data-theme="dark"] .paper-chip.bloc-chip-entente {
  color: #86efac !important;
  background: linear-gradient(135deg, rgba(20, 50, 35, 0.92), rgba(15, 45, 30, 0.92)) !important;
  border-color: rgba(134, 239, 172, 0.20) !important;
}

html[data-theme="dark"] .paper-chip.bloc-chip-axis {
  color: #fca5a5 !important;
  background: linear-gradient(135deg, rgba(50, 20, 20, 0.92), rgba(45, 15, 15, 0.92)) !important;
  border-color: rgba(252, 165, 165, 0.20) !important;
}

html[data-theme="dark"] .paper-chip.bloc-chip-allies {
  color: #93c5fd !important;
  background: linear-gradient(135deg, rgba(20, 35, 65, 0.92), rgba(15, 30, 60, 0.92)) !important;
  border-color: rgba(147, 197, 253, 0.20) !important;
}

/* =========================
   MOD BAHASA CINA (中文模式)
========================= */

/* FAB toggle button — base styles (mirrors .display-fab from layout.css) */
.zh-mode-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.zh-mode-fab:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

/* FAB toggle button — active state (red tint) */
.zh-mode-fab.is-active {
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.30);
  color: #dc2626;
}

html[data-theme="dark"] .zh-mode-fab.is-active {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.38);
  color: #f87171;
}

/* Keyword annotation — hidden by default */
:root {
  --z-floating: 60;
  --z-toast: 70;
  --z-overlay: 300;
  --floating-bottom-offset: calc(var(--bottom-nav-h, 56px) + var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 0.9rem);
  --floating-bottom-offset-avoid-sparkle: calc(var(--floating-bottom-offset) + 4.25rem);
}

.kw-zh-ann {
  display: none;
}

/* Annotated keywords show a subtle click cue in zh mode */
html[data-lang-mode="zh"] .kw.kw-zh-annotated {
  cursor: pointer;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: currentColor;
}

/* On click (.kw-zh-open), stack Chinese annotation below the BM keyword */
html[data-lang-mode="zh"] .kw.kw-zh-open {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: bottom;
  line-height: 1.15;
}

html[data-lang-mode="zh"] .kw.kw-zh-open .kw-zh-ann {
  display: block;
  font-size: 0.6em;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: inherit;
  opacity: 0.78;
  margin-top: 0.06em;
  pointer-events: none;
  user-select: none;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
}

html[data-theme="dark"][data-lang-mode="zh"] .kw.kw-zh-open .kw-zh-ann {
  opacity: 0.88;
}

/* Disclaimer toast */
.zh-disclaimer-toast {
  position: fixed;
  bottom: calc(1rem + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 2rem));
  z-index: var(--z-toast);
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  max-width: min(520px, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: #1c1917;
  color: #fafaf9;
  font-size: 0.85rem;
  line-height: 1.5;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
  opacity: 0;
}

.zh-disclaimer-content {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 0.28rem;
}

.zh-toast-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.zh-toast-hide {
  transform: translateX(-50%) translateY(calc(100% + 2rem));
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.zh-disclaimer-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.22);
  color: #fca5a5;
  font-size: 0.88rem;
  font-weight: 800;
}

.zh-disclaimer-text {
  color: #d6d3d1;
  font-size: 0.8rem;
  line-height: 1.25;
}

.zh-disclaimer-help {
  color: #d6d3d1;
  font-size: 0.75rem;
  line-height: 1.35;
}

.zh-help-toggle {
  align-self: flex-start;
  border: 1px solid rgba(250, 250, 249, 0.18);
  border-radius: 999px;
  padding: 0.14rem 0.42rem;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.zh-disclaimer-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #78716c;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.1rem 0.2rem;
  line-height: 1;
  transition: color 0.15s;
}

.zh-disclaimer-close:hover {
  color: #fafaf9;
}

html[data-theme="dark"] .zh-disclaimer-toast {
  background: #292524;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* Zh chip — tap-to-reveal layout */

/* Clickable cursor on all zh chips */
.paper-chip.zh-chip-can-flip {
  cursor: pointer;
  touch-action: manipulation;
  position: relative;
}

/* Subtle 中 hint badge — top-right corner, visible before tap */
.paper-chip.zh-chip-can-flip:not(.zh-chip-flipped)::after {
  content: '中';
  position: absolute;
  top: 0.18em;
  right: 0.3em;
  font-size: 0.58em;
  font-weight: 800;
  color: #b91c1c;
  opacity: 0.38;
  line-height: 1;
  pointer-events: none;
}

/* Inline layout: original text + Chinese side by side */
.paper-chip .zh-chip-inner {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.18em;
}

/* Primary text: full color always (no fading on flip) */
.paper-chip .zh-chip-primary {
  display: inline;
  color: inherit;
  font-weight: inherit;
}

/* Translation hidden by default; appears after tap */
.paper-chip .zh-chip-translation {
  display: none;
  color: #9a3412;
  font-size: 0.88em;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

/* Reveal translation when flipped */
.paper-chip.zh-chip-flipped .zh-chip-translation {
  display: inline;
}

.paper-chip .zh-chip-short-inline {
  display: inline;
}

.paper-chip .zh-chip-full-sentence-wrap {
  display: block;
  margin-top: 0.3rem;
  padding-top: 0.24rem;
  border-top: 1px dashed rgba(154, 52, 18, 0.32);
  line-height: 1.5;
}

.paper-chip .zh-chip-full-sentence-label {
  font-size: 0.76em;
  font-weight: 800;
  opacity: 0.72;
  margin-right: 0.3em;
}

.paper-chip .zh-chip-full-sentence {
  display: inline;
  font-weight: 650;
}

html[data-theme="dark"] .paper-chip .zh-chip-translation {
  color: #fdba74;
}

html[data-theme="dark"] .paper-chip .zh-chip-full-sentence-wrap {
  border-top-color: rgba(253, 186, 116, 0.35);
}

/* Chip back structure: BM context (small, muted) + Chinese content */
.zh-chip-back-bm {
  display: block;
  font-size: 0.75em;
  font-weight: 600;
  opacity: 0.52;
  margin-bottom: 0.3em;
  color: inherit;
  font-style: italic;
}

.zh-chip-back-cn {
  display: block;
}

.zh-chip-mode-label {
  font-size: 0.78em;
  font-weight: 700;
  opacity: 0.62;
  margin-right: 0.18em;
}

.zh-chip-fallback {
  font-size: 0.82em;
  opacity: 0.65;
}

.zh-comprehension-panel {
  margin: 0.55rem 0 0.9rem;
  padding: 0.72rem 0.82rem;
  border: 1px dashed rgba(220, 38, 38, 0.26);
  border-radius: 12px;
  background: rgba(255, 247, 247, 0.9);
}

.zh-comprehension-title {
  margin: 0 0 0.32rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #b91c1c;
}

.zh-comprehension-explain {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #7f1d1d;
}

.zh-comprehension-points {
  margin: 0.42rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: #991b1b;
  line-height: 1.45;
}

.zh-comprehension-focus {
  margin: 0.55rem 0 0;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  color: #7f1d1d;
  background: rgba(185, 28, 28, 0.07);
  border-left: 3px solid #b91c1c;
  border-radius: 0 4px 4px 0;
  line-height: 1.5;
}

.zh-comprehension-focus span {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.65;
  display: block;
  margin-bottom: 0.15rem;
  letter-spacing: 0.02em;
}

.zh-comprehension-focus strong {
  font-weight: 800;
  font-size: 1em;
  color: #7f1d1d;
}

html[data-theme="dark"] .zh-comprehension-panel {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(80, 20, 20, 0.36);
}

html[data-theme="dark"] .zh-comprehension-title,
html[data-theme="dark"] .zh-comprehension-explain,
html[data-theme="dark"] .zh-comprehension-points,
html[data-theme="dark"] .zh-comprehension-focus {
  color: #fecaca;
}

html[data-theme="dark"] .zh-comprehension-focus {
  background: rgba(248, 113, 113, 0.1);
  border-left-color: #f87171;
}

html[data-theme="dark"] .zh-comprehension-focus strong {
  color: #fecaca;
}

/* Panel toggle (collapsed by default) */
.zh-comprehension-panel .zh-panel-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  color: #b91c1c;
  cursor: pointer;
  text-align: left;
  line-height: 1.3;
  gap: 0.4rem;
}

.zh-panel-chevron {
  font-size: 0.65rem;
  flex-shrink: 0;
  opacity: 0.7;
}

.zh-comprehension-panel.zh-panel-collapsed {
  padding: 0.5rem 0.82rem;
  background: rgba(255, 247, 247, 0.72);
  border-style: dashed;
}

.zh-comprehension-panel.zh-panel-open {
  padding: 0.72rem 0.82rem;
}

.zh-panel-body {
  margin-top: 0.45rem;
}

html[data-theme="dark"] .zh-comprehension-panel.zh-panel-collapsed {
  background: rgba(80, 20, 20, 0.22);
}

html[data-theme="dark"] .zh-comprehension-panel .zh-panel-toggle {
  color: #fca5a5;
}

/* Orphan heading annotation toggle */
.zh-heading-toggle {
  display: none;
}

html[data-lang-mode="zh"] .zh-heading-has-ann .zh-heading-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.45em;
  padding: 0 0.32em;
  height: 1.3em;
  font-size: 0.68em;
  font-weight: 800;
  color: #b91c1c;
  background: rgba(254, 226, 226, 0.9);
  border: 1px solid rgba(185, 28, 28, 0.28);
  border-radius: 0.3em;
  cursor: pointer;
  vertical-align: middle;
  line-height: 1;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  transition: background 0.12s;
}

html[data-lang-mode="zh"] .zh-heading-has-ann .zh-heading-toggle:hover {
  background: rgba(254, 202, 202, 0.95);
}

.zh-heading-ann[hidden] {
  display: none;
}

html[data-lang-mode="zh"] .zh-heading-ann:not([hidden]) {
  display: block;
  margin-top: 0.5em;
  margin-left: 0;
  padding: 0.38em 0.7em;
  background: rgba(185, 28, 28, 0.06);
  border-left: 2px solid rgba(185, 28, 28, 0.28);
  border-radius: 0 6px 6px 0;
  font-size: 0.8em;
  font-weight: 600;
  line-height: 1.55;
  color: #b91c1c;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  opacity: 0.9;
}

/* 句中词汇 structured annotation — BM prominent, Chinese secondary */
.zh-ann-label {
  font-weight: 600;
  opacity: 0.65;
  margin-right: 0.15em;
  font-size: 0.9em;
}

.zh-ann-pair {
  white-space: nowrap;
}

.zh-ann-bm {
  font-weight: 800;
  font-size: 1em;
  color: inherit;
}

.zh-ann-zh {
  font-size: 0.85em;
  opacity: 0.72;
  font-weight: 500;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

.zh-ann-sep {
  opacity: 0.35;
}

.zh-glossary-pairs {
  line-height: 1.7;
}

html[data-theme="dark"][data-lang-mode="zh"] .zh-heading-has-ann .zh-heading-toggle {
  color: #fca5a5;
  background: rgba(60, 20, 20, 0.5);
  border-color: rgba(248, 113, 113, 0.3);
}

html[data-theme="dark"][data-lang-mode="zh"] .zh-heading-ann:not([hidden]) {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.08);
  border-left-color: rgba(248, 113, 113, 0.3);
}

@media (max-width: 760px) {
  .zh-disclaimer-toast {
    bottom: var(--floating-bottom-offset);
  }
}

body.sparkle-panel-open .zh-disclaimer-toast {
  bottom: var(--floating-bottom-offset-avoid-sparkle);
}

/* ── Multi-pair chip: column layout ─────────────────────────────────────── */
.paper-chip.zh-chip-has-pairs .zh-chip-inner,
.paper-chip.zh-chip-has-explain .zh-chip-inner {
  flex-direction: column;
  align-items: flex-start;
}

.paper-chip .zh-chip-translation-pairs,
.paper-chip .zh-chip-translation-explain {
  display: none;
}

.paper-chip.zh-chip-flipped .zh-chip-translation-pairs {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  margin-top: 0.28em;
}

.paper-chip.zh-chip-flipped .zh-chip-translation-explain {
  display: block;
  margin-top: 0.3em;
  font-size: 0.82em;
  line-height: 1.5;
  color: #9a3412;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

.zh-pair-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22em;
  flex-wrap: nowrap;
}

.zh-pair-bm {
  font-weight: 700;
  font-size: 0.8em;
  opacity: 0.6;
  color: inherit;
}

.zh-pair-eq {
  opacity: 0.38;
  font-size: 0.72em;
}

.zh-pair-zh {
  color: #9a3412;
  font-weight: 600;
  font-size: 0.85em;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

html[data-theme="dark"] .zh-pair-zh,
html[data-theme="dark"] .paper-chip.zh-chip-flipped .zh-chip-translation-explain {
  color: #fdba74;
}

/* ── Raw text annotations (zh-raw-ann) ──────────────────────────────────── */
html[data-lang-mode="zh"] .zh-raw-ann {
  cursor: pointer;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: rgba(185, 28, 28, 0.42);
  text-underline-offset: 2px;
  display: inline;
}

html[data-lang-mode="zh"] .zh-raw-ann.kw-zh-open {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: bottom;
  line-height: 1.15;
  text-decoration: none;
}

html[data-lang-mode="zh"] .zh-raw-ann .kw-zh-ann {
  display: none;
}

html[data-lang-mode="zh"] .zh-raw-ann.kw-zh-open .kw-zh-ann {
  display: block;
  font-size: 0.62em;
  font-weight: 600;
  color: #b91c1c;
  white-space: nowrap;
  line-height: 1.2;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

html[data-theme="dark"][data-lang-mode="zh"] .zh-raw-ann.kw-zh-open .kw-zh-ann {
  color: #fdba74;
}
