/* ============================================================
   词语成语词典网 · 详情页专用样式表
   文件：/css/detail.css
   说明：提取自详情页模板，包含纸质水墨风格变量、排版、组件及响应式样式
   ============================================================ */

:root {
  --paper: #F7F2E6;
  --paper-2: #EFE8D4;
  --paper-deep: #E4DAC0;
  --ink: #29251E;
  --ink-soft: #6E6456;
  --ink-faint: #9A8F7D;
  --line: #D8CDB4;
  --cinnabar: #A93C2E;
  --cinnabar-deep: #8C2F24;
  --bamboo: #4E6B52;
  --indigo: #3E5C6E;
  --gold: #B8893A;
  --serif: -apple-system-ui-serif, 'Songti SC', 'Source Han Serif SC', 'Noto Serif CJK SC', 'STSong', 'SimSun', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Source Han Sans SC', 'Noto Sans CJK SC', sans-serif;
  --shadow: 0 10px 30px rgba(41, 37, 30, .10);
}

/* ============================================================
   每日主题·七曜自动换色系统（同步 gushi 每日自动换主题体验）
   theme-sun(日·海棠粉) / theme-mon(月·黛蓝) / theme-tue(火·绛紫) /
   theme-wed(水·青绿) / theme-thu(木·茶褐) / theme-fri(金·金黄) / theme-sat(土·米黄)
   ============================================================ */
[data-theme="theme-sun"] body, body[data-theme="theme-sun"] {
  --paper: #FDF5F7; --paper-2: #FAECF0; --paper-deep: #F3DCE3;
  --ink: #2E1F27; --ink-soft: #7D5B68; --ink-faint: #A68894;
  --line: rgba(224, 90, 123, 0.22);
  --cinnabar: #E05A7B; --cinnabar-deep: #C0486A;
  background: radial-gradient(120% 90% at 50% 0%, #FFF8FA 0%, #FDF5F7 45%, #FAECF0 100%) fixed !important;
}
[data-theme="theme-mon"] body, body[data-theme="theme-mon"] {
  --paper: #F5F7FA; --paper-2: #EAEFF5; --paper-deep: #D8E0EA;
  --ink: #1B263B; --ink-soft: #5A6B85; --ink-faint: #8B9AB5;
  --line: rgba(27, 38, 59, 0.2);
  --cinnabar: #2E4057; --cinnabar-deep: #1B263B;
  background: radial-gradient(120% 90% at 50% 0%, #FAFBFD 0%, #F5F7FA 45%, #EAEFF5 100%) fixed !important;
}
[data-theme="theme-tue"] body, body[data-theme="theme-tue"] {
  --paper: #FAF4F0; --paper-2: #F0E6E1; --paper-deep: #E4D5CD;
  --ink: #3B1F24; --ink-soft: #7D5B61; --ink-faint: #A6858C;
  --line: rgba(78, 42, 49, 0.2);
  --cinnabar: #8B4A57; --cinnabar-deep: #6E3541;
  background: radial-gradient(120% 90% at 50% 0%, #FDF8F5 0%, #FAF4F0 45%, #F0E6E1 100%) fixed !important;
}
[data-theme="theme-wed"] body, body[data-theme="theme-wed"] {
  --paper: #F2F8F6; --paper-2: #E0EEE9; --paper-deep: #C8DED5;
  --ink: #1F2E2A; --ink-soft: #5B7A72; --ink-faint: #8BA69D;
  --line: rgba(46, 139, 106, 0.22);
  --cinnabar: #2E8B6A; --cinnabar-deep: #1F6B4F;
  background: radial-gradient(120% 90% at 50% 0%, #F8FCFA 0%, #F2F8F6 45%, #E0EEE9 100%) fixed !important;
}
[data-theme="theme-thu"] body, body[data-theme="theme-thu"] {
  --paper: #F6F8F3; --paper-2: #E8EBE0; --paper-deep: #D5DACB;
  --ink: #2A2E24; --ink-soft: #6B7560; --ink-faint: #98A18D;
  --line: rgba(107, 124, 79, 0.22);
  --cinnabar: #6B7C4F; --cinnabar-deep: #53633B;
  background: radial-gradient(120% 90% at 50% 0%, #FBFCF8 0%, #F6F8F3 45%, #E8EBE0 100%) fixed !important;
}
[data-theme="theme-fri"] body, body[data-theme="theme-fri"] {
  --paper: #FDFBF7; --paper-2: #F8F1E0; --paper-deep: #EEDCBE;
  --ink: #3A2E1F; --ink-soft: #7D6E57; --ink-faint: #A6967E;
  --line: rgba(196, 154, 58, 0.25);
  --cinnabar: #C49A3A; --cinnabar-deep: #A57E2A;
  background: radial-gradient(120% 90% at 50% 0%, #FFFAF0 0%, #FDFBF7 45%, #F8F1E0 100%) fixed !important;
}
[data-theme="theme-sat"] body, body[data-theme="theme-sat"] {
  --paper: #FAF6EE; --paper-2: #F0E8D8; --paper-deep: #E2D5BE;
  --ink: #3B2F24; --ink-soft: #7D6E5E; --ink-faint: #A69885;
  --line: rgba(166, 123, 79, 0.25);
  --cinnabar: #A67B4F; --cinnabar-deep: #85603A;
  background: radial-gradient(120% 90% at 50% 0%, #FFFCF5 0%, #FAF6EE 45%, #F0E8D8 100%) fixed !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 15% 5%, var(--paper-deep), transparent 55%),
    radial-gradient(ellipse at 88% 92%, var(--paper-2), transparent 50%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 40%, var(--paper-deep) 100%);
}

/* ============ 顶部导航条 ============ */
.topbar {
  max-width: 1000px;
  margin: 0 auto;
  padding: 22px 26px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-faint);
  font-size: 14px;
}
.topbar a {
  color: var(--cinnabar);
  text-decoration: none;
  padding: 8px 10px;
  margin: -8px 0 -8px -10px;
  border-radius: 6px;
}
.topbar a:hover {
  text-decoration: underline;
}
.topbar svg {
  width: 16px;
  height: 16px;
  stroke: var(--ink-faint);
}

/* ============ 词条 Hero ============ */
.hero {
  max-width: 1000px;
  margin: 0 auto;
  padding: 34px 26px 10px;
  text-align: center;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(40px, 9vw, 72px);
  letter-spacing: .12em;
  color: var(--ink);
}
.hero .py {
  margin-top: 8px;
  font-size: clamp(15px, 2.4vw, 20px);
  letter-spacing: .14em;
  color: var(--ink-soft);
}
.hero .tags {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.tag {
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 999px;
  letter-spacing: .05em;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .55);
  color: var(--ink-soft);
}
.tag.cat {
  color: var(--bamboo);
  border-color: rgba(78, 107, 82, .3);
  background: rgba(78, 107, 82, .08);
}
.tag.sent {
  background: var(--cinnabar);
  color: var(--paper);
  border-color: var(--cinnabar);
}

/* ============ 一句话概括 ============ */
.summary {
  max-width: 1000px;
  margin: 26px auto 0;
  padding: 0 26px;
}
.summary .quote-line {
  font-family: var(--serif);
  font-size: clamp(20px, 3.4vw, 28px);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.7;
  text-align: center;
  padding: 22px 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.summary .quote-line em {
  font-style: normal;
  color: var(--cinnabar);
  font-weight: 700;
}

/* ============ 正文容器 ============ */
.doc {
  max-width: 1000px;
  margin: 34px auto 20px;
  padding: 0 26px;
}
.block {
  background: rgba(255, 252, 243, .72);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 28px;
  margin-bottom: 20px;
}
.block-title {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 14px;
}
.block-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--cinnabar);
}
.block-title .sub {
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 400;
  letter-spacing: .05em;
  font-family: var(--sans);
}
.block-body {
  font-size: 15.5px;
  color: var(--ink-soft);
  line-height: 2;
}
.block-body b {
  color: var(--ink);
  font-weight: 600;
}
.block-body p + p {
  margin-top: 10px;
}

/* 精简背诵版 */
.concise {
  background: linear-gradient(135deg, rgba(169, 60, 46, .07), rgba(62, 92, 110, .07));
  border: 1.5px dashed rgba(169, 60, 46, .45);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 16.5px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.9;
}

/* 字词拆解 */
.char-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.char-box {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 10px;
  text-align: center;
}
.char-box .ch {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 34px;
  color: var(--cinnabar-deep);
  display: block;
  line-height: 1.1;
}
.char-box .mean {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}
@media (max-width: 560px) {
  .char-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 出处引文 */
.source-quote {
  display: block;
  margin: 4px 0 14px;
  padding: 14px 18px;
  border-left: 4px solid var(--cinnabar);
  background: rgba(169, 60, 46, .05);
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  line-height: 1.9;
}
.source-quote .src {
  display: block;
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-faint);
}

/* 例句 */
.examples {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.example {
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink-soft);
}
.example .mark {
  color: var(--cinnabar);
  font-weight: 700;
  margin-right: 8px;
}

/* 近反义词 */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.chip {
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  text-decoration: none;
}
.chip:hover {
  border-color: var(--cinnabar);
  color: var(--cinnabar-deep);
}
.chip.ant {
  color: var(--cinnabar-deep);
  border-color: rgba(169, 60, 46, .3);
  background: rgba(169, 60, 46, .06);
}

/* 易混辨析 */
.compare {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.compare .row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: start;
  padding: 14px 18px;
}
.compare .row + .row {
  border-top: 1px solid var(--line);
}
.compare .kw {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--cinnabar-deep);
  font-size: 16px;
}
.compare .row .txt {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.8;
}
@media (max-width: 560px) {
  .compare .row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* 联想记忆法 */
.memo {
  background: linear-gradient(135deg, rgba(62, 92, 110, .08), rgba(78, 107, 82, .08));
  border: 1px solid rgba(62, 92, 110, .25);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.9;
}

/* ============ 翻页导航 ============ */
.dt-nav {
  max-width: 1000px;
  margin: 20px auto 40px;
  padding: 0 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.dt-nav a.pn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: all .2s;
}
.dt-nav a.pn:hover {
  border-color: var(--cinnabar);
  color: var(--cinnabar-deep);
  background: #fff;
}
.dt-nav a.pn.back {
  background: var(--cinnabar);
  color: var(--paper);
  border-color: var(--cinnabar);
}
.dt-nav a.pn.back:hover {
  background: var(--cinnabar-deep);
}
.dt-nav span.pn-empty {
  display: inline-block;
  padding: 10px 20px;
  color: var(--ink-faint);
  font-size: 14.5px;
}

/* ============ 页脚 ============ */
footer {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  padding: 30px 26px 40px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
  letter-spacing: .05em;
}
footer .seal {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cinnabar);
  color: var(--paper);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  border-radius: 6px;
}
footer b {
  color: var(--ink-soft);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ==========================================================================
   七曜主题悬浮微部件 (Theme Switcher Widget)
   ========================================================================== */
.theme-switcher-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  font-family: var(--serif);
}

.theme-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}

.theme-trigger-btn:hover {
  transform: translateY(-2px);
  border-color: var(--cinnabar);
}

.theme-trigger-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--cinnabar);
  color: #FFFDF8;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
}

.theme-dropdown-panel {
  position: absolute;
  bottom: 46px;
  right: 0;
  width: 280px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  padding: 14px;
  backdrop-filter: blur(12px);
  display: none;
  animation: themeFadeIn 0.2s ease-out;
}

.theme-dropdown-panel.show {
  display: block;
}

@keyframes themeFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.theme-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
}

.theme-panel-title {
  font-weight: bold;
  color: var(--ink);
  font-size: 15px;
}

.theme-auto-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(169, 60, 46, 0.1);
  color: var(--cinnabar);
  cursor: pointer;
}

.theme-grid-list {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.theme-option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 6px 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--ink);
}

.theme-option-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.theme-option-btn.active {
  border-color: var(--cinnabar);
  background: rgba(0, 0, 0, 0.05);
}

.theme-color-chip {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.theme-day-label {
  font-size: 11px;
  color: var(--ink-soft);
}

.theme-panel-desc {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.03);
  padding: 6px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.theme-reset-row {
  text-align: right;
}

.theme-reset-link {
  font-size: 11px;
  color: var(--cinnabar);
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 768px) {
  .theme-switcher-widget {
    bottom: 16px;
    right: 14px;
  }
  .theme-trigger-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .theme-dropdown-panel {
    width: 250px;
    max-width: calc(100vw - 28px);
    right: 0;
    bottom: 40px;
    padding: 10px;
  }
  .theme-grid-list {
    gap: 4px;
  }
  .theme-color-chip {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
}
