/* ===== 详情页专用样式（古诗词/成语/名句等通用） ===== */

/* 面包屑（覆盖site.css中的简版，详情页用完整版） */
.bc { font-size: 13px; color: var(--c6); margin-bottom: 16px; padding: 10px 16px; background: var(--c7); border-radius: 6px; border-left: 3px solid var(--c1); }
.bc ol { display: flex; align-items: center; flex-wrap: nowrap; white-space: nowrap; overflow: hidden; list-style: none; margin: 0; padding: 0; }
.bc li { display: inline-flex; align-items: center; }
.bc li + li::before { content: "›"; margin: 0 8px; color: var(--c8); }
.bc a { color: var(--c6); }
.bc a:hover { color: var(--c1); }
.bc li:last-child span { color: var(--c4); }

/* 页面标题区 */
.pt { font-size: 24px; font-weight: 600; color: var(--c4); text-align: center; margin-bottom: 6px; }
.pd { font-size: 14px; color: var(--c6); text-align: center; margin-bottom: 20px; line-height: 1.7; }
/* ===== 诗词正文区 ===== */
.pm { background: var(--c9); border: 1px solid var(--c8); border-radius: 8px; padding: 24px; margin-bottom: 16px; text-align: center; }
.pm .sh { text-align: left; }
.pm .pb { text-align: center; padding: 20px 0; }
/* 字典/词典内容页：大字加米字格背景（.pb.mizige 单独标记，不调用拼音插件） */
.pm > .pb.mizige { display: inline-flex; align-items: center; justify-content: center; margin: 0 auto; min-height: 160px; padding: 24px 0; font-size: 96px; line-height: 1; color: var(--c4); font-weight: 500; text-align: center; }
/* 每个字独立一个米字格 — 后端输出 <span class="mz-char">X</span> 逐字包裹 */
.pm > .pb.mizige .mz-char { display: inline-block; width: 140px; height: 140px; line-height: 140px; text-align: center; font-size: 80px; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="140" height="140" viewBox="0 0 140 140"><rect x="2" y="2" width="136" height="136" fill="none" stroke="%23e06666" stroke-width="1" stroke-dasharray="3,3"/><line x1="2" y1="2" x2="138" y2="138" stroke="%23e06666" stroke-width="0.5" stroke-dasharray="3,3"/><line x1="138" y1="2" x2="2" y2="138" stroke="%23e06666" stroke-width="0.5" stroke-dasharray="3,3"/><line x1="70" y1="2" x2="70" y2="138" stroke="%23e06666" stroke-width="0.5" stroke-dasharray="3,3"/><line x1="2" y1="70" x2="138" y2="70" stroke="%23e06666" stroke-width="0.5" stroke-dasharray="3,3"/></svg>'); background-repeat: no-repeat; background-position: center; background-size: 140px 140px; }
/* 单字时（字典页）不需要 span 包裹也能显示 — 退化为整块背景 */
.pm > .pb.mizige:not(:has(.mz-char)) { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="160" height="160" viewBox="0 0 160 160"><rect x="2" y="2" width="156" height="156" fill="none" stroke="%23e06666" stroke-width="1" stroke-dasharray="3,3"/><line x1="2" y1="2" x2="158" y2="158" stroke="%23e06666" stroke-width="0.6" stroke-dasharray="3,3"/><line x1="158" y1="2" x2="2" y2="158" stroke="%23e06666" stroke-width="0.6" stroke-dasharray="3,3"/><line x1="80" y1="2" x2="80" y2="158" stroke="%23e06666" stroke-width="0.6" stroke-dasharray="3,3"/><line x1="2" y1="80" x2="158" y2="80" stroke="%23e06666" stroke-width="0.6" stroke-dasharray="3,3"/></svg>'); background-repeat: no-repeat; background-position: center; background-size: 160px 160px; font-size: 96px; width: auto; height: auto; min-height: 160px; display: flex; }
@media (max-width: 768px) {
  .pm > .pb.mizige .mz-char { width: 100px; height: 100px; line-height: 100px; font-size: 56px; background-size: 100px 100px; }
  .pm > .pb.mizige:not(:has(.mz-char)) { font-size: 72px; min-height: 120px; background-size: 120px 120px; }
}
.pm .pb.intro { text-align: left; font-size: 15px; line-height: 1.9; letter-spacing: 0; }
.pm .pb.intro p { font-size: 15px; line-height: 1.9; letter-spacing: 0; text-align: justify; }
.pm .pb p { font-size: 18px; line-height: 2.2; color: var(--c4); letter-spacing: 1px; margin: 0; padding: 4px 0; }
/* 大字下方的拼音行（字典/词典详情页用）— 拼拼音本四线三格，每段拼音对齐一个汉字 */
.pm .pb-py { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 0 auto 8px; padding: 6px 12px; max-width: max-content; font-family: "Times New Roman", "Georgia", serif; font-weight: 400; line-height: 1; min-height: 56px; color: var(--c1); }
.pm .pb-py .py-seg { display: inline-flex; align-items: center; justify-content: center; width: 140px; min-height: 56px; font-size: 30px; letter-spacing: 1px; background-image: linear-gradient(to bottom, #e06666 0, #e06666 1px, transparent 1px, transparent calc(33.33% - 0.5px), #4aada0 calc(33.33% - 0.5px), #4aada0 calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px), transparent calc(66.66% - 0.5px), #4aada0 calc(66.66% - 0.5px), #4aada0 calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px), transparent calc(100% - 1px), #e06666 calc(100% - 1px), #e06666 100%); background-size: 100% 100%; background-repeat: no-repeat; }
@media (max-width: 768px) {
  .pm .pb-py { gap: 12px; padding: 4px 8px; }
  .pm .pb-py .py-seg { width: 100px; min-height: 48px; font-size: 22px; }
}
/* 大字下方的元信息标签行（部首/笔画/结构 / 词性/词式） */
.pm .pb-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 8px 0 0; }
.pm .pb-meta .meta-tag { display: inline-block; padding: 3px 10px; font-size: 12px; color: var(--c5); background: var(--c7); border: 1px solid var(--c8); border-radius: 12px; line-height: 1.5; white-space: nowrap; }

/* 标签 */
.pm .tags { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; border-top: 1px dashed var(--c8); margin-top: 16px; }
.pm .tags .tag { display: inline-block; }
.pm .tags .tag a { display: inline-block; font-size: 13px; padding: 4px 12px; background: var(--c7); color: var(--c5); border-radius: 4px; border: 1px solid var(--c8); transition: all .2s; }
.pm .tags .tag a:hover { background: var(--c1); color: var(--c9); border-color: var(--c1); }

/* ===== 译注赏卡片区 ===== */
.tabs { margin-bottom: 16px; }
.tab-card { background: var(--c9); border: 1px solid var(--c8); border-radius: 8px; margin-bottom: 10px; transition: box-shadow .2s; }
.tab-card:hover { box-shadow: 0 2px 12px rgba(74,173,160,.08); }
.tab-card h2 { font-size: 16px; font-weight: 600; color: var(--c4); padding: 14px 18px; background: var(--c7); border-bottom: 1px solid var(--c8); margin: 0; border-radius: 8px 8px 0 0; }
.tab-card .tc { padding: 18px; line-height: 1.9; font-size: 15px; color: var(--c5); overflow: hidden; }
.tab-card .tc p { margin: 0 0 12px; text-indent: 2em; text-align: justify; }
.tab-card .tc p:last-child { margin-bottom: 0; }
.tab-card .tc ul { list-style: none; padding: 0; margin: 12px 0; }
.tab-card .tc li { padding: 6px 0 6px 12px; border-left: 2px solid var(--c8); margin-bottom: 4px; }
.tab-card .tc li:hover { border-left-color: var(--c1); }
.tab-card .tc li strong { color: var(--c1); font-weight: 600; margin-right: 4px; }
.tab-card .tc ol { counter-reset: item; padding: 0; margin: 12px 0; }
.tab-card .tc ol li { counter-increment: item; list-style: none; padding-left: 24px; position: relative; border-left: none; }
.tab-card .tc ol li::before { content: counter(item) "."; position: absolute; left: 0; color: var(--c1); font-weight: 600; }
.tab-card .tc blockquote { margin: 12px 0; padding: 10px 16px; background: var(--c7); border-left: 3px solid var(--c1); border-radius: 0 4px 4px 0; font-style: italic; color: var(--c5); }
.tab-card .tc blockquote p { margin: 0; text-indent: 0; }
.tab-card .tc a { color: var(--c1); border-bottom: 1px dotted var(--c1); }
.tab-card .tc a:hover { color: var(--c2); }
.tab-card .tc .info-row { display: flex; padding: 8px 0; border-bottom: 1px dashed var(--c8); }
.tab-card .tc .info-row:last-child { border-bottom: none; }
.tab-card .tc .info-label { min-width: 80px; font-weight: 600; color: var(--c4); flex-shrink: 0; }
.tab-card .tc .info-val { color: var(--c5); flex: 1; }
/* 展开/收起按钮（默认隐藏，由JS根据内容高度控制显隐） */
.tab-card .expand-btn, .tab-card .card-act { display: none; }
.tab-card .expand-btn {
  width: 100%; padding: 10px 0; margin: 0;
  background: linear-gradient(to bottom, var(--c7), #e8f4f2);
  border: none; border-top: 1px solid var(--c8);
  color: var(--c1); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .2s, color .2s; text-align: center;
  border-radius: 0 0 8px 8px;
  letter-spacing: 2px;
}
.tab-card .expand-btn:hover { background: var(--c1); color: #fff; }
.tab-card .expand-btn:active { background: var(--c2); color: #fff; }
/* 折叠态底部渐变遮罩：暗示还有更多内容 */
.tab-card .tc.collapsed { position: relative; }
.tab-card .tc.collapsed::after {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 50px;
  background: linear-gradient(transparent, var(--c9));
  pointer-events: none;
}

/* ===== 属性型紧凑卡片（标签+值 同行展示，每字段一个独立卡片） =====
   DOM 结构与普通 tab-card 一致：<section class="tab-card attr"><h2>...</h2><div class="tc">...</div></section>
   通过 .tab-card.attr 自身 flex 布局让 h2 与 .tc 同行 */
.tab-card.attr { display: flex; align-items: stretch; margin-bottom: 8px; }
.tab-card.attr h2 { display: flex; align-items: center; min-width: 96px; flex-shrink: 0; padding: 12px 16px; font-size: 14px; background: var(--c7); border-bottom: none; border-right: 1px solid var(--c8); }
.tab-card.attr .tc { flex: 1; max-height: none; overflow: visible; padding: 12px 16px; font-size: 15px; color: var(--c4); line-height: 1.7; display: flex; align-items: center; }
.tab-card.attr .tc::after { display: none; }
.tab-card.attr .tc p { margin: 0; text-indent: 0; word-break: break-word; }
@media (max-width: 768px) {
  .tab-card.attr h2 { min-width: 78px; padding: 10px 12px; font-size: 13px; }
  .tab-card.attr .tc { padding: 10px 12px; font-size: 14px; }
}

/* ===== 作者信息区 ===== */
.au-info { background: var(--c9); border: 1px solid var(--c8); border-radius: 8px; padding: 0; margin-bottom: 16px; overflow: hidden; }
.au-info h2 { font-size: 16px; font-weight: 600; color: var(--c4); padding: 14px 18px; margin: 0; border-bottom: 2px solid var(--c1); background: var(--c7); }
.au-box { display: flex; gap: 16px; padding: 18px; align-items: flex-start; background: var(--c9); border: 1px solid var(--c8); border-radius: 8px; margin-bottom: 16px; }
.au-box .av { width: 72px; height: 96px; border-radius: 6px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--c8); }
.au-ct { flex: 1; min-width: 0; font-size: 14px; color: var(--c5); line-height: 1.9; }
.au-ct .pt { text-align: left; margin-bottom: 4px; }
.au-ct .pd { text-align: left; margin-bottom: 8px; }
.au-st { margin-top: 10px; display: flex; gap: 12px; flex-wrap: wrap; }
.au-st span { font-size: 13px; color: var(--c5); background: var(--c7); padding: 4px 12px; border-radius: 4px; border: 1px solid var(--c8); display: inline-block; }
.au-st b { color: var(--c1); font-weight: 600; }
.au-st a { color: var(--c1); }
.au-st a:hover { text-decoration: underline; }

/* ===== 右侧栏-作者其他古诗 ===== */
.sd .sw { margin-bottom: 20px; background: var(--c7); border-radius: 8px; padding: 20px; }
.sd .sw h2 { font-size: 16px; font-weight: 600; color: var(--c4); margin-bottom: 14px; padding-bottom: 12px; border-bottom: 2px solid var(--c1); }
.sd .hot-item { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,.04); }
.sd .hot-item:last-child { border-bottom: none; }
.sd .hot-rank { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--c9); background: var(--c8); border-radius: 4px; flex-shrink: 0; }
.sd .hot-item:nth-child(1) .hot-rank { background: var(--c1); }
.sd .hot-item:nth-child(2) .hot-rank { background: var(--c3); }
.sd .hot-item:nth-child(3) .hot-rank { background: #8a9e9e; }
.sd .hot-item a { font-size: 14px; color: var(--c4); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.5; }
.sd .hot-item a:hover { color: var(--c1); }

/* ===== 功能工具栏（标题下方固定栏） ===== */
.toolbar { display: flex; align-items: center; gap: 20px; padding: 12px 18px; background: var(--c7); border: 1px solid var(--c8); border-radius: 8px; margin-bottom: 16px; }
.toolbar label { display: flex; align-items: center; cursor: pointer; user-select: none; gap: 6px; }
.toolbar .slider { width: 34px; height: 18px; background: var(--c8); border-radius: 10px; position: relative; transition: background .2s; flex-shrink: 0; }
.toolbar .slider::before { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; background: var(--c9); border-radius: 50%; transition: transform .2s; }
.toolbar input { display: none; }
.toolbar input:checked + .slider { background: var(--c1); }
.toolbar input:checked + .slider::before { transform: translateX(16px); }
.toolbar .lbl { font-size: 14px; color: var(--c5); font-weight: 500; }
.toolbar .voice-btn { display: flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--c8); border-radius: 6px; padding: 6px 12px; cursor: pointer; transition: all .2s; color: var(--c5); }
.toolbar .voice-btn:hover { background: var(--c1); color: var(--c9); border-color: var(--c1); }
.toolbar .voice-btn svg { width: 18px; height: 18px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .pt { font-size: 22px; font-weight: 700; text-align: center; padding: 16px 12px 4px; }
  .pd { font-size: 15px; font-weight: 500; text-align: center; line-height: 1.8; padding: 0 12px 12px; margin: 0; }
  .bc { font-size: 14px; padding: 10px 12px; border-radius: 0; margin: 0; }

  .pm { padding: 16px 12px; border-radius: 0; border: none; margin-bottom: 0; }
  .pm .pb { padding: 0; }
  .pm .pb p { font-size: 19px; line-height: 2.1; letter-spacing: 0.5px; font-weight: 500; }
  .pm .pb.intro p { font-size: 16px; line-height: 1.9; font-weight: 400; }
  .pm .tags { padding: 12px 0 0; margin-top: 12px; }
  .pm .tags .tag a { font-size: 14px; padding: 5px 12px; }

  .tab-card { border-radius: 0; border-left: none; border-right: none; margin-bottom: 0; border-bottom: none; }
  .tab-card h2 { font-size: 17px; font-weight: 600; padding: 13px 12px; border-radius: 0; }
  .tab-card .expand-btn { border-radius: 0; font-size: 15px; padding: 12px 0; }
  .tab-card .tc { padding: 14px 12px; font-size: 16px; line-height: 2; }
  .tab-card .tc p { text-indent: 1.5em; font-size: 16px; line-height: 2; }

  .au-info { border-radius: 0; border-left: none; border-right: none; margin-bottom: 0; }
  .au-info h2 { font-size: 17px; font-weight: 600; padding: 13px 12px; }
  .au-box { flex-direction: column; align-items: center; text-align: center; padding: 14px 12px; }
  .au-box .av { width: 72px; height: 96px; }
  .au-ct { font-size: 15px; line-height: 1.9; }
  .au-st { justify-content: center; flex-wrap: wrap; }
  .au-st span { font-size: 14px; padding: 5px 12px; }

  .sd .sw { padding: 14px 12px; border-radius: 0; }
  .sd .sw h2 { font-size: 17px; font-weight: 600; }
  .sd .hot-item a { font-size: 15px; }
  .sd .hot-rank { width: 24px; height: 24px; font-size: 13px; }

  /* 工具栏 */
  .toolbar { gap: 12px; padding: 12px; flex-wrap: wrap; border-radius: 0; margin: 0; border-left: none; border-right: none; }
  .toolbar label { gap: 6px; }
  .toolbar .slider { width: 34px; height: 18px; }
  .toolbar .slider::before { width: 14px; height: 14px; }
  .toolbar input:checked + .slider::before { transform: translateX(16px); }
  .toolbar .lbl { font-size: 15px; font-weight: 500; }
  .toolbar .voice-btn { padding: 8px 12px; font-size: 15px; }
  .toolbar .voice-btn svg { width: 18px; height: 18px; }

  /* 拼音区域撑满 */
  .pinyin-wrapper { margin: 10px 0; padding: 0; width: 100%; align-items: flex-start; }
  .pinyin-line { justify-content: flex-start; margin: 8px 0; width: 100%; }
  .pinyin-char-group { width: auto; min-width: auto; max-width: none; margin: 0 2px; }
  .pinyin-char-group .hanzi { font-size: 26px; font-weight: 500; }
  .pinyin-char-group .pinyin { font-size: 13px; }
  .pinyin-wrapper.single-line .pinyin-char-group { width: auto; min-width: auto; max-width: none; }

  /* 拼音文本行 */
  .pm .pb-py { min-height: 48px; }
  .pm .pb-py .py-seg { font-size: 24px; min-height: 48px; width: 120px; }
  .pm .pb-meta .meta-tag { font-size: 14px; padding: 4px 12px; }

  /* 字帖面板 */
  .zt-panel { padding: 16px; }
  .zt-label { font-size: 15px; }
  .zt-tag { padding: 6px 14px; font-size: 15px; }
  .zt-btn { padding: 9px 18px; font-size: 15px; }

  /* 章节导航 */
  .bn > * { font-size: 15px; padding: 12px 14px; }
  .bn .bn-label { font-size: 13px; }

  /* 鉴赏页 */
  .rel-tags > h2, .rel-list > h2 { font-size: 17px; font-weight: 600; }
  .rel-list > .rl a { font-size: 15px; padding: 9px 12px; }
  .au-card > h2 { font-size: 17px; }
  .au-card > .au-name { font-size: 17px; }
  .au-card > .au-bio { font-size: 15px; }
  .au-card > .au-st span { font-size: 14px; }
}

@media (max-width: 480px) {
  .pt { font-size: 20px; padding: 14px 12px 4px; }
  .pd { font-size: 14px; padding: 0 12px 10px; }
  .pm { padding: 12px 10px; }
  .pm .pb p { font-size: 18px; line-height: 2; }
  .pm .pb.intro p { font-size: 15px; line-height: 1.9; }
  .tab-card h2 { font-size: 16px; padding: 11px 12px; }
  .tab-card .tc { font-size: 15px; padding: 12px 10px; }
  .tab-card .tc p { font-size: 15px; }
  .au-info h2 { font-size: 16px; padding: 11px 12px; }
  .au-box { padding: 12px 10px; }
  .au-box .av { width: 60px; height: 80px; }
  .au-ct { font-size: 15px; }
  .toolbar { gap: 10px; padding: 10px; }
  .toolbar .lbl { font-size: 14px; }
  .toolbar .voice-btn { padding: 6px 10px; font-size: 14px; }
  .toolbar .voice-btn svg { width: 16px; height: 16px; }
  .sd .hot-item a { font-size: 15px; }
  /* 拼音更紧凑但仍可读 */
  .pinyin-char-group .hanzi { font-size: 24px; }
  .pinyin-char-group .pinyin { font-size: 12px; }
  .pinyin-char-group { margin: 0 1px; }
  .pm .pb-py .py-seg { font-size: 22px; width: 110px; }
}

/* ===== 拼音样式 ===== */
.pinyin-wrapper { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; margin: 20px 0; }
.pinyin-line { display: flex; flex-direction: row; justify-content: center; margin: 10px 0; flex-wrap: wrap; max-width: 100%; overflow-wrap: anywhere; }
.pinyin-text { color: #000; font-size: .9em; line-height: 1.2; margin-bottom: .3em; text-align: center; white-space: nowrap; }
.chinese-text { color: #000; font-size: 1.1em; line-height: 1.5; text-align: center; white-space: nowrap; }

/* 单行模式 */
.pinyin-wrapper.single-line { text-align: left; align-items: flex-start; }
.pinyin-wrapper.single-line .pinyin-line { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; margin: 1em 0; width: 100%; }
.pinyin-wrapper.single-line .pinyin-text { margin-bottom: 0; margin-right: .5em; white-space: normal; letter-spacing: 2px; }
.pinyin-wrapper.single-line .chinese-text { white-space: normal; letter-spacing: 2px; }
.pinyin-wrapper.single-line .pinyin-char-group { align-items: center; width: 2.2em; min-width: 2.2em; max-width: 2.2em; }

/* 字符分组 */
.pinyin-char-group { display: flex; flex-direction: column; align-items: center; width: 2.2em; min-width: 2.2em; max-width: 2.2em; }
.pinyin-char-group .pinyin { color: var(--c1); font-size: 13px; line-height: 1.2; border-bottom: 1px dotted var(--c8); width: 100%; text-align: center; font-family: Arial, sans-serif; margin-bottom: 2px; white-space: nowrap; }
.pinyin-char-group .hanzi { color: var(--c4); font-size: 20px; line-height: 1.5; text-align: center; width: 100%; }
.pinyin-char-group.punct .pinyin { border-bottom: none; color: transparent; }
.pinyin-char-group.punct .hanzi { color: var(--c4); }

/* 单行模式细节 */
.pinyin-line.single { white-space: normal; overflow: visible; flex-wrap: wrap; letter-spacing: 0; align-items: flex-start; }
.pinyin-line.single .pinyin-char-group .pinyin { color: var(--c6); border-bottom-color: var(--c8); line-height: 1.2; height: 1.2em; }
.pinyin-line.single .pinyin-char-group .hanzi { line-height: 1.6; height: 1.6em; }
.pinyin-line.single .pinyin-char-group.punct { margin-right: 4px; }

/* 诗词格式集成 */
.poem-uniform .pinyin-line, .poem-irregular .pinyin-line { margin: .5em 0; }
.poem-uniform .pinyin-text, .poem-irregular .pinyin-text { letter-spacing: 8px; }
.poem-irregular { text-align: left; align-items: flex-start; }
.poem-irregular .pinyin-char-group { align-items: flex-start; width: auto; min-width: auto; max-width: none; }
.poem-irregular .pinyin-line { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; width: 100%; }

/* 米字格模式 */
.pinyin-char-group.mizige { display: flex; flex-direction: column; align-items: center; width: 2.2em; margin: 0 .1em; position: relative; }
.pinyin-char-group.mizige .pinyin-outside { display: block; color: var(--c1); font-size: 15px; line-height: 1.2; margin-bottom: 5px; white-space: nowrap; min-height: 1.1em; }
.pinyin-char-group.mizige .hanzi-wrap { position: relative; width: 2.2em; height: 2.2em; display: block; }
.pinyin-char-group.mizige .mizige-bg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; background: url('data:image/svg+xml;utf8,<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="100%" height="100%" fill="none" stroke="%23e06666" stroke-width="0.4" stroke-dasharray="2,2"/><line x1="0" y1="0" x2="100%" y2="100%" stroke="%23e06666" stroke-width="0.4" stroke-dasharray="2,2"/><line x1="100%" y1="0" x2="0" y2="100%" stroke="%23e06666" stroke-width="0.4" stroke-dasharray="2,2"/><line x1="50%" y1="0" x2="50%" y2="100%" stroke="%23e06666" stroke-width="0.4" stroke-dasharray="2,2"/><line x1="0" y1="50%" x2="100%" y2="50%" stroke="%23e06666" stroke-width="0.4" stroke-dasharray="2,2"/></svg>') center/cover no-repeat; }
.pinyin-char-group.mizige .hanzi { position: absolute; left: 0; top: 45%; width: 100%; text-align: center; color: var(--c4); font-size: 22px; line-height: 1.5; z-index: 1; transform: translateY(-50%); pointer-events: none; }
.pinyin-char-group.mizige.punct .pinyin-outside { color: transparent; }
.pinyin-char-group.mizige.punct .hanzi { color: var(--c4); }

/* 拼音开关（兼容pinyin.js生成的结构） */
.pinyin-toggle-row { display: flex; justify-content: center; align-items: center; }
.pinyin-switch { display: flex; align-items: center; cursor: pointer; user-select: none; }
.pinyin-switch input[type="checkbox"] { display: none; }

/* 逗号后换行（仅移动端） */
.br-after-comma { display: inline; }

@media (max-width: 768px) {
  /* 等长诗：字符均匀分布，撑满整行 */
  .pinyin-wrapper { align-items: center; width: 100%; padding: 0; }
  .pinyin-line { justify-content: space-evenly; width: 100%; margin: 10px 0; }
  .pinyin-char-group { width: auto; min-width: auto; max-width: none; margin: 0; flex: 1; }
  .pinyin-char-group .pinyin { font-size: 13px; margin-bottom: 2px; }
  .pinyin-char-group .hanzi { font-size: 24px; font-weight: 500; }
  /* 不等长词：同样撑满 */
  .pinyin-wrapper.single-line { align-items: flex-start; }
  .pinyin-wrapper.single-line .pinyin-line { justify-content: flex-start; flex-wrap: wrap; }
  .pinyin-wrapper.single-line .pinyin-char-group { flex: 0 0 auto; width: 2em; min-width: 2em; }
  .poem-irregular .pinyin-char-group { flex: 0 0 auto; width: auto; min-width: auto; max-width: none; }
  /* 米字格 */
  .pinyin-char-group.mizige { flex: 0 0 auto; width: 2em; }
  .pinyin-char-group.mizige .pinyin-outside { font-size: 13px; min-height: .8em; margin-bottom: 3px; }
  .pinyin-char-group.mizige .hanzi-wrap { width: 2em; height: 2em; }
  .pinyin-char-group.mizige .hanzi { top: 47%; font-size: 20px; }
  .br-after-comma { display: block; width: 100%; height: 0; line-height: 0; margin: 0; padding: 0; clear: both; }
}

/* ===== 字帖面板 ===== */
.zt-panel { background: var(--c7); border: 1px solid var(--c8); border-radius: 8px; padding: 16px 18px; margin-bottom: 16px; }
.zt-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.zt-row:last-child { margin-bottom: 0; }
.zt-label { font-size: 14px; color: var(--c5); font-weight: 500; min-width: 70px; flex-shrink: 0; }
.zt-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.zt-tag { padding: 4px 12px; font-size: 13px; border-radius: 4px; border: 1px solid var(--c8); color: var(--c5); cursor: pointer; transition: all .2s; line-height: 1.4; }
.zt-tag:hover { border-color: var(--c1); color: var(--c1); }
.zt-tag.active { background: var(--c1); color: var(--c9); border-color: var(--c1); }
.zt-switch { display: flex; align-items: center; cursor: pointer; }
.zt-switch input { display: none; }
.zt-switch .slider { width: 34px; height: 18px; background: var(--c8); border-radius: 10px; position: relative; transition: background .2s; }
.zt-switch .slider::before { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; background: var(--c9); border-radius: 50%; transition: transform .2s; }
.zt-switch input:checked + .slider { background: var(--c1); }
.zt-switch input:checked + .slider::before { transform: translateX(16px); }
.zt-actions { display: flex; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--c8); }
.zt-btn { padding: 7px 18px; font-size: 14px; border-radius: 6px; border: 1px solid var(--c8); background: var(--c9); color: var(--c5); cursor: pointer; transition: all .2s; }
.zt-btn:hover { border-color: var(--c1); color: var(--c1); }
.zt-btn.primary { background: var(--c1); color: var(--c9); border-color: var(--c1); }
.zt-btn.primary:hover { background: var(--c2); }

/* 字帖预览弹窗 */
.zt-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.75); z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding: 20px; overflow-y: auto; }
.zt-modal img { width: auto; max-width: 100%; border-radius: 4px; box-shadow: 0 4px 30px rgba(0,0,0,.4); margin: auto; }
.zt-modal .zt-close { position: fixed; top: 16px; right: 24px; width: 40px; height: 40px; background: var(--c9); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 22px; color: var(--c4); box-shadow: 0 2px 12px rgba(0,0,0,.2); z-index: 1001; }

@media (max-width: 768px) {
  .zt-panel { padding: 14px; }
  .zt-row { flex-wrap: wrap; gap: 8px; }
  .zt-label { min-width: 60px; font-size: 15px; }
  .zt-tag { padding: 5px 12px; font-size: 14px; }
  .zt-actions { flex-wrap: wrap; }
  .zt-btn { flex: 1; text-align: center; font-size: 15px; padding: 9px 16px; }
}


/* ===== 章节导航（古籍 BookInfo.aspx 专用，亦可被其他长文复用） ===== */
.bn { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; margin: 20px 0 0; align-items: stretch; }
.bn > * { display: flex; flex-direction: column; justify-content: center; padding: 12px 16px; background: var(--c9); border: 1px solid var(--c8); border-radius: 6px; color: var(--c5); font-size: 14px; line-height: 1.6; min-width: 0; transition: border-color .15s, color .15s, background .15s; text-decoration: none; }
.bn > a:hover { border-color: var(--c1); color: var(--c1); background: var(--c7); }
.bn .bn-prev { text-align: left; }
.bn .bn-next { text-align: right; }
.bn .bn-label { font-size: 12px; color: var(--c6); display: block; margin-bottom: 4px; font-weight: normal; }
.bn .bn-py { font-size: 12px; color: var(--c1); font-family: Arial, sans-serif; margin-left: 4px; }
.bn .bn-cat { flex-direction: row; align-items: center; justify-content: center; padding: 12px 22px; font-weight: 500; background: var(--c1); color: var(--c9); border-color: var(--c1); }
.bn .bn-cat:hover { background: var(--c2); border-color: var(--c2); color: var(--c9); }
/* 双栏布局（仅上一字/下一字） */
.bn.bn-2col { grid-template-columns: 1fr 1fr; }
.bn.bn-2col > * { flex-direction: row; align-items: baseline; gap: 6px; padding: 12px 16px; font-size: 14px; }
.bn.bn-2col .bn-prev { justify-content: flex-start; }
.bn.bn-2col .bn-next { justify-content: flex-end; }
.bn.bn-2col .bn-label { color: var(--c6); font-size: 13px; }
.bn.bn-2col .bn-py { color: var(--c1); font-size: 13px; font-family: Arial, sans-serif; }
.bn .bn-name { color: var(--c4); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn > a:hover .bn-name { color: var(--c1); }
.bn .disabled { color: var(--c6); cursor: default; background: var(--c7); border-style: dashed; }
.bn .disabled .bn-lbl { color: var(--c6); margin-bottom: 0; font-size: 13px; }

@media (max-width: 768px) {
  .bn { grid-template-columns: 1fr 64px 1fr; gap: 6px; margin-top: 16px; }
  .bn > * { padding: 12px 14px; font-size: 15px; }
  .bn .bn-cat { padding: 12px; font-size: 15px; }
  .bn .bn-lbl { font-size: 13px; }
  .bn .bn-name { font-size: 15px; }
}

@media (max-width: 480px) {
  /* 极小屏：只保留方向标签与目录，章节名隐藏避免折行混乱 */
  .bn .bn-name { display: none; }
  .bn .bn-lbl { font-size: 13px; margin: 0; color: var(--c5); }
  .bn > * { padding: 10px; }
}

/* 古籍正文 .pm.pb.intro 样式微调（page-detail.css 已有 .pm.pb.intro 基础，这里微调段落间距） */
.pm .pb.intro p { margin: 0 0 12px; text-indent: 2em; }
.pm .pb.intro p:last-child { margin-bottom: 0; }
@media (max-width: 768px) {
  .pm .pb.intro p { font-size: 16px; line-height: 1.9; }
  .pm .pb.intro h3 { font-size: 17px; }
}


/* ===== 诗词鉴赏详情页（JieYiInfo.aspx）专用 ===== */

/* 鉴赏正文：左对齐多段落，与古籍正文一致 */
.pm .pb.intro { text-align: left; }
.pm .pb.intro p { margin: 0 0 12px; text-indent: 2em; }
.pm .pb.intro p:last-child { margin-bottom: 0; }
.pm .pb.intro h3 { font-size: 16px; font-weight: 600; color: var(--c4); margin: 18px 0 10px; padding-left: 10px; border-left: 3px solid var(--c1); line-height: 1.4; }
.pm .pb.intro h3:first-child { margin-top: 0; }

/* 元信息行 .pd 左对齐+绿色链接 */
.mc > .pd { text-align: left; }
.mc > .pd a { color: var(--c1); }
.mc > .pd a:hover { text-decoration: underline; }
.mc > .pd strong { font-weight: 600; color: var(--c4); }

/* 相关类型卡（扁平：section > h2 + p.tag-row > a） */
.rel-tags { background: var(--c9); border: 1px solid var(--c8); border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; }
.rel-tags > h2 { font-size: 16px; font-weight: 600; color: var(--c4); margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--c1); }
.rel-tags .tag-row { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rel-tags .tag-row a { display: inline-block; padding: 4px 12px; font-size: 13px; color: var(--c5); background: var(--c7); border: 1px solid var(--c8); border-radius: 4px; transition: all .15s; }
.rel-tags .tag-row a:hover { background: var(--c1); color: var(--c9); border-color: var(--c1); }
.rel-tags .tag-row a.tag-active { background: var(--c1); color: var(--c9); border-color: var(--c1); cursor: default; }

/* 作者卡（扁平：section > img + h3 + p + p） */
.au-card { display: grid; grid-template-columns: 72px 1fr; grid-template-rows: auto auto auto auto; column-gap: 16px; row-gap: 4px; background: var(--c9); border: 1px solid var(--c8); border-radius: 8px; padding: 18px; margin-bottom: 16px; align-items: start; }
.au-card > h2 { grid-column: 1 / span 2; font-size: 16px; font-weight: 600; color: var(--c4); margin: 0 0 8px; padding-bottom: 8px; border-bottom: 2px solid var(--c1); }
.au-card > .av { grid-column: 1; grid-row: 2 / span 3; width: 72px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--c8); }
.au-card > .au-name { grid-column: 2; grid-row: 2; font-size: 16px; font-weight: 600; color: var(--c4); margin: 0 0 4px; }
.au-card > .au-bio { grid-column: 2; grid-row: 3; font-size: 14px; color: var(--c5); line-height: 1.7; margin: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.au-card > .au-st { grid-column: 2; grid-row: 4; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.au-card > .au-st span { font-size: 13px; color: var(--c5); background: var(--c7); padding: 4px 12px; border-radius: 4px; border: 1px solid var(--c8); }
.au-card > .au-st b { color: var(--c1); font-weight: 600; }
.au-card > .au-st a { color: var(--c1); }
.au-card > .au-st a:hover { text-decoration: underline; }

/* 推荐列表（扁平：section > h2 + ul.rl > li > a） */
.rel-list { background: var(--c9); border: 1px solid var(--c8); border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; }
.rel-list > h2 { font-size: 16px; font-weight: 600; color: var(--c4); margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--c1); }
.rel-list > .rl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; }
.rel-list > .rl li { min-width: 0; }
.rel-list > .rl a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; font-size: 14px; color: var(--c4); border: 1px solid transparent; border-radius: 4px; line-height: 1.5; transition: all .15s; }
.rel-list > .rl a:hover { background: var(--c7); border-color: var(--c8); color: var(--c1); }
.rel-list > .rl .rl-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-list > .rl .rl-au { font-size: 12px; color: var(--c6); flex-shrink: 0; }
.rel-list > .rl a:hover .rl-au { color: var(--c1); }

@media (max-width: 768px) {
  .rel-tags, .rel-list { padding: 16px; border-radius: 6px; }
  .rel-tags > h2, .rel-list > h2 { font-size: 17px; font-weight: 600; }
  .rel-tags .tag-row a { font-size: 15px; padding: 5px 14px; }
  .au-card { padding: 16px; column-gap: 12px; grid-template-columns: 64px 1fr; }
  .au-card > h2 { font-size: 17px; }
  .au-card > .av { width: 64px; height: 86px; }
  .au-card > .au-name { font-size: 17px; }
  .au-card > .au-bio { font-size: 15px; }
  .au-card > .au-st span { font-size: 14px; }
  .rel-list > .rl { grid-template-columns: 1fr; }
  .rel-list > .rl a { padding: 9px 12px; font-size: 15px; }
  .rel-list > .rl .rl-au { font-size: 13px; }
}


/* ===== 古籍译文详情页（BookJieYiInfo.aspx）专用 ===== */

/* H2 标题旁的"·章节名"小标签链接 */
.pm > h2.sh a { color: var(--c1); font-size: 14px; font-weight: 400; }
.pm > h2.sh a:hover { text-decoration: underline; }

/* "阅读完整章节"按钮 */
.view-full-link { display: inline-block; margin-top: 12px; padding: 6px 14px; font-size: 13px; color: var(--c1); border: 1px solid var(--c1); border-radius: 4px; transition: all .15s; }
.view-full-link:hover { background: var(--c1); color: var(--c9); }

/* ===== 专题详情页（ZhuanTiInfo.aspx）专用 ===== */

/* 专题列表项：扁平 article 直接含 h3/p/div */
.tab-card .tc .zt-item { padding: 14px 0; border-bottom: 1px dashed var(--c8); }
.tab-card .tc .zt-item:first-child { padding-top: 0; }
.tab-card .tc .zt-item:last-child { border-bottom: none; padding-bottom: 0; }
.tab-card .tc .zt-item h3 { font-size: 16px; font-weight: 600; color: var(--c4); margin: 0 0 6px; line-height: 1.5; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tab-card .tc .zt-item h3 a { color: var(--c4); }
.tab-card .tc .zt-item h3 a:hover { color: var(--c1); }
.tab-card .tc .zt-item h3 .zt-py { font-size: 13px; font-weight: 400; color: var(--c6); }
.tab-card .tc .zt-item .zt-meta { font-size: 13px; color: var(--c6); margin: 0 0 6px; line-height: 1.6; }
.tab-card .tc .zt-item .zt-meta a { color: var(--c1); }
.tab-card .tc .zt-item .zt-cont { font-size: 14px; color: var(--c5); line-height: 1.8; text-indent: 0; margin: 0; }
.tab-card .tc .zt-item .zt-cont p { text-indent: 2em; margin: 0 0 8px; }

/* 名句类型：blockquote + cite */
.tab-card .tc .zt-item.zt-quote { text-align: center; padding: 16px 0; }
.tab-card .tc .zt-item.zt-quote blockquote { margin: 0 0 8px; padding: 0; font-size: 17px; line-height: 1.9; color: var(--c4); font-style: normal; background: transparent; border: none; }
.tab-card .tc .zt-item.zt-quote cite { font-size: 13px; color: var(--c6); font-style: normal; }

@media (max-width: 768px) {
  .tab-card .tc .zt-item { padding: 12px 0; }
  .tab-card .tc .zt-item h3 { font-size: 17px; }
  .tab-card .tc .zt-item .zt-meta { font-size: 15px; }
  .tab-card .tc .zt-item .zt-cont { font-size: 15px; line-height: 1.9; }
  .tab-card .tc .zt-item.zt-quote blockquote { font-size: 17px; }
  .tab-card .tc .zt-item.zt-quote cite { font-size: 14px; }
}


/* ===== 字典/词典内容页·相关字组方格布局（与字典首页一致）===== */
.rel-list > .word-grid { background: var(--c9); border: 1px solid var(--c8); border-radius: 6px; padding: 0; margin: 0; display: grid; gap: 0; overflow: hidden; }
.rel-list > .word-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.rel-list > .word-grid.char { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
.rel-list > .word-grid.pinyin { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.rel-list > .word-grid .word-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 6px; font-size: 20px; color: var(--c4); border-right: 1px solid var(--c8); border-bottom: 1px solid var(--c8); border-radius: 0; transition: all .15s; line-height: 1.4; text-align: center; min-height: 44px; background: var(--c9); }
.rel-list > .word-grid .word-cell:hover { background: var(--c7); color: var(--c1); }
.rel-list > .word-grid .word-cell.pinyin-cell { padding: 10px 12px; align-items: center; justify-content: center; font-size: 16px; }
.rel-list > .word-grid .word-cell .wc-t { font-size: 18px; font-weight: 500; color: var(--c4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; text-align: center; width: 100%; }
.rel-list > .word-grid .word-cell .wc-py { font-size: 12px; color: var(--c6); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; text-align: center; width: 100%; }
.rel-list > .word-grid .word-cell:hover .wc-t,
.rel-list > .word-grid .word-cell:hover .wc-py { color: var(--c1); }
.rel-list > .word-grid.char .word-cell { font-size: 22px; font-weight: 500; min-height: 52px; padding: 12px 6px; }
/* "含X的词语" 词语网格：字号与其他相关字组统一 */
.rel-list > .word-grid.ciyu-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.rel-list > .word-grid.ciyu-grid .word-cell { font-size: 18px; font-weight: 500; min-height: 48px; padding: 12px 8px; }
/* 标题中的拼音值 */
.rel-list > h2 .rl-h-py { color: var(--c1); font-family: Arial, sans-serif; font-weight: normal; }

@media (max-width: 768px) {
  .rel-list > .word-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
  .rel-list > .word-grid.char { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
  .rel-list > .word-grid.pinyin { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .rel-list > .word-grid .word-cell { font-size: 20px; padding: 10px 6px; min-height: 42px; }
  .rel-list > .word-grid .word-cell .wc-t { font-size: 18px; }
  .rel-list > .word-grid .word-cell .wc-py { font-size: 12px; }
  .rel-list > .word-grid.char .word-cell { font-size: 22px; min-height: 48px; padding: 12px 6px; }
  .rel-list > .word-grid.ciyu-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .rel-list > .word-grid.ciyu-grid .word-cell { font-size: 18px; min-height: 46px; padding: 10px 8px; }
}
