
/* 知否知否 · "文"板块 · 诗人卡片墙样式（唐诗 / 以后的宋词、元曲共用）
   接着 wen.css 的 theme-wen 配色往下写；弹窗部分复用 css/wen-read.css 里
   已经写好的 wr-char-modal-* 样式（三国人物关系弹窗同一套），这里只加卡片墙自己的部分。
   只在 body.theme-wen 的页面生效；请在 wen.css、wen-read.css 之后加载本文件。 */

.theme-wen .tp-eras { display: flex; flex-direction: column; gap: 34px; }

.theme-wen .tp-era-title {
  position: relative; margin-bottom: 16px; padding-bottom: 8px;
  font-family: var(--display); font-size: 19px; color: var(--zy-gold);
}
.theme-wen .tp-era-title::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 46px; height: 1px; background: var(--zy-gold);
}

.theme-wen .tp-poet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* 诗人卡片：跟其他板块的 zy-card 是同一种"宣纸质感"，收起时等高，点开一张不影响邻居 */
.theme-wen .tp-poet {
  position: relative; border-radius: 6px; padding: 0;
  background-color: var(--zy-paper);
  background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 5px 5px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24), 0 0 0 1px var(--zy-line);
}
.theme-wen .tp-poet[open] { grid-column: 1 / -1; }

.theme-wen .tp-poet-summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  padding: 16px 18px; cursor: pointer; list-style: none; user-select: none;
}
.theme-wen .tp-poet-summary::-webkit-details-marker { display: none; }
.theme-wen .tp-poet-summary::before {
  content: '▸'; margin-right: 2px; font-size: 11px; color: var(--zy-gold); transition: transform 0.15s ease;
}
.theme-wen .tp-poet[open] > .tp-poet-summary::before { transform: rotate(90deg); }
.theme-wen .tp-poet-name { font-family: var(--display); font-size: 19px; color: #fbeef7; }
.theme-wen .tp-poet-hint { flex: 1 1 100%; font-size: 13.5px; line-height: 1.7; color: var(--zy-soft); }
.theme-wen .tp-poet-count { margin-left: auto; font-size: 12px; color: var(--zy-gold); white-space: nowrap; }

.theme-wen .tp-poet-body { padding: 0 18px 20px; }
.theme-wen .tp-poet-life { margin: 0 0 16px; font-size: 14.5px; line-height: 1.9; color: #f1e6f0; }

.theme-wen .tp-poet-groups { display: flex; flex-direction: column; gap: 16px; }
.theme-wen .tp-group-label { margin-bottom: 8px; font-size: 12.5px; letter-spacing: 0.08em; color: var(--zy-gold); }
.theme-wen .tp-works { display: flex; flex-wrap: wrap; gap: 8px; }

.theme-wen .tp-work-btn {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px;
  border-radius: 20px; border: 1px solid rgba(230, 190, 215, 0.4); background: rgba(0, 0, 0, 0.14);
  color: #f5e6f4; font: inherit; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
}
.theme-wen .tp-work-btn:hover, .theme-wen .tp-work-btn:focus-visible {
  background: rgba(237, 194, 222, 0.18); border-color: var(--zy-gold); outline: none;
}
.theme-wen .tp-work-title { font-size: 15px; color: #fbeef7; }
.theme-wen .tp-work-form { font-size: 11.5px; color: var(--zy-soft); }

/* 作品详情弹窗：在 wr-char-modal-card 的骨架上加体裁小字、原文块和讲解段落 */
.theme-wen .tp-modal-card { max-width: 480px; }
.theme-wen .tp-modal-form { margin: -10px 30px 14px 0; font-size: 12.5px; letter-spacing: 0.1em; color: var(--zy-gold); }
.theme-wen .tp-modal-poem { margin-bottom: 16px; }
.theme-wen .tp-modal-note { margin: 0; font-size: 14.5px; line-height: 1.95; color: #f1e6f0; }

/* ---------- 搜索框：固定在页面顶部，滚动时一直可见 ---------- */
.theme-wen .tp-search {
  position: sticky; top: 0; z-index: 30; padding: 10px 0;
  background: rgba(18, 9, 29, 0.94);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--zy-line);
}
.theme-wen .tp-search-box { position: relative; max-width: 640px; margin: 0 auto; }
.theme-wen .tp-search-input {
  display: block; width: 100%; box-sizing: border-box; padding: 11px 42px 11px 16px;
  border-radius: 24px; border: 1px solid rgba(230, 190, 215, 0.5); background: rgba(0, 0, 0, 0.28);
  color: #fbeef7; font: inherit; font-size: 16px; /* 16px：手机上点进输入框时页面不会自动放大 */
}
.theme-wen .tp-search-input::placeholder { color: #cdbcd6; }
.theme-wen .tp-search-input:focus { outline: none; border-color: var(--zy-gold); box-shadow: 0 0 0 2px rgba(240, 205, 227, 0.25); }
.theme-wen .tp-search-clear {
  position: absolute; top: 50%; right: 8px; width: 28px; height: 28px; margin-top: -14px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #f5e6f4; font-size: 18px; line-height: 1; cursor: pointer;
}
.theme-wen .tp-search-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 31;
  margin: 0; padding: 6px; list-style: none; max-height: min(60vh, 460px); overflow-y: auto;
  border-radius: 10px; background: var(--zy-paper-2); border: 1px solid var(--zy-line);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}
.theme-wen .tp-sr-row { margin: 0; }
.theme-wen .tp-sr-item {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; width: 100%; box-sizing: border-box;
  padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: #f5e6f4;
  font: inherit; text-align: left; cursor: pointer;
}
.theme-wen .tp-sr-item:hover, .theme-wen .tp-sr-item.is-active { background: rgba(237, 194, 222, 0.16); }
.theme-wen .tp-sr-tag { flex: none; padding: 1px 7px; border-radius: 10px; font-size: 11.5px; letter-spacing: 0.06em; border: 1px solid; }
.theme-wen .tp-sr-tag-poet { color: var(--zy-gold); border-color: var(--zy-gold); }
.theme-wen .tp-sr-tag-work { color: #cfe6d2; border-color: rgba(207, 230, 210, 0.6); }
.theme-wen .tp-sr-tag-text { color: #cfd8f2; border-color: rgba(207, 216, 242, 0.6); }
.theme-wen .tp-sr-main { font-size: 15.5px; color: #fbeef7; }
.theme-wen .tp-sr-main mark { background: rgba(240, 205, 227, 0.3); color: #fff; border-radius: 2px; padding: 0 1px; }
.theme-wen .tp-sr-sub { font-size: 12.5px; color: var(--zy-soft); }
.theme-wen .tp-sr-empty, .theme-wen .tp-sr-more { padding: 10px; font-size: 13px; line-height: 1.7; color: var(--zy-soft); }

/* ---------- 搜索跳转后的高亮：闪几下，然后保持淡金色边框，几秒后自动消失 ---------- */
.theme-wen .tp-poet, .theme-wen .tp-work-btn { scroll-margin-top: 84px; }
@keyframes tp-hit-pulse {
  0%, 100% { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24), 0 0 0 2px var(--zy-gold); }
  50% { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24), 0 0 0 3px var(--zy-gold), 0 0 26px 6px rgba(240, 205, 227, 0.55); }
}
@keyframes tp-btn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 205, 227, 0); }
  50% { box-shadow: 0 0 0 3px rgba(240, 205, 227, 0.5), 0 0 18px 4px rgba(240, 205, 227, 0.5); }
}
.theme-wen .tp-poet.tp-hit { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24), 0 0 0 2px var(--zy-gold); animation: tp-hit-pulse 1.3s ease-in-out 3; }
.theme-wen .tp-work-btn.tp-hit { background: rgba(237, 194, 222, 0.28); border-color: var(--zy-gold); animation: tp-btn-pulse 1.3s ease-in-out 3; }
@media (prefers-reduced-motion: reduce) {
  .theme-wen .tp-poet.tp-hit, .theme-wen .tp-work-btn.tp-hit { animation: none; }
}

@media (max-width: 760px) {
  .theme-wen .tp-poet-grid { grid-template-columns: 1fr; }
  .theme-wen .tp-search-input { font-size: 16px; }
}

/* ---------- 元曲页新增：曲牌、注解折叠、出处、分组简介、宽弹窗 ---------- */
.theme-wen .tp-modal-card.tp-modal-wide { max-width: 560px; }
.theme-wen .tp-qupai { display: inline-block; margin-right: 6px; color: var(--zy-gold); font-size: 0.86em; letter-spacing: 0.06em; }
.theme-wen .tp-modal-note p { margin: 0 0 10px; }
.theme-wen .tp-modal-note p:last-child { margin-bottom: 0; }
.theme-wen .tp-modal-gloss { margin-top: 14px; }
.theme-wen .tp-gloss { border-top: 1px solid rgba(240, 205, 227, 0.18); padding-top: 10px; }
.theme-wen .tp-gloss-summary { cursor: pointer; font-size: 13px; letter-spacing: 0.1em; color: var(--zy-gold); }
.theme-wen .tp-gloss-h { margin: 10px 0 4px; font-size: 13px; color: var(--zy-gold); }
.theme-wen .tp-gloss-list { margin: 6px 0 0; padding-left: 1.2em; font-size: 13.5px; line-height: 1.85; color: #e9dce8; }
.theme-wen .tp-modal-src { margin-top: 14px; font-size: 12.5px; line-height: 1.8; color: var(--zy-soft); }
.theme-wen .tp-modal-src a { color: var(--zy-soft); text-decoration: underline; text-underline-offset: 3px; word-break: break-all; }
.theme-wen .tp-group-intro { margin: -2px 0 8px; font-size: 13px; line-height: 1.8; color: var(--zy-soft); }
.theme-wen .tp-group-empty { font-size: 13px; color: var(--zy-soft); }
/* 宋词：白话译文区块和讲解小标题 */
.theme-wen .tp-modal-trans { margin: 0 0 14px; }
.theme-wen .tp-trans { border-top: 1px solid rgba(240, 205, 227, 0.18); padding-top: 10px; }
.theme-wen .tp-trans-body { margin-top: 6px; font-size: 14.5px; line-height: 1.95; color: #f1e6f0; }
.theme-wen .tp-trans-body p { margin: 0 0 8px; }
.theme-wen .tp-trans-body p:last-child { margin-bottom: 0; }
.theme-wen .tp-note-h { margin-right: 4px; font-weight: 600; letter-spacing: 0.06em; color: var(--zy-gold); }
/* 回到顶部按钮（右下角，跟随页面；层级在搜索栏之上、作品弹窗之下） */
.theme-wen .tp-totop {
  position: fixed; right: 18px; bottom: 22px; z-index: 40;
  width: 46px; height: 46px; padding: 0; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1; color: #fbeef7;
  background: rgba(44, 24, 66, 0.92); border: 1px solid var(--zy-gold);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.2s;
}
.theme-wen .tp-totop[hidden] { display: none; }
.theme-wen .tp-totop:hover, .theme-wen .tp-totop:focus-visible { background: rgba(84, 48, 120, 0.95); transform: translateY(-2px); }
@media (max-width: 600px) { .theme-wen .tp-totop { right: 12px; bottom: 16px; width: 42px; height: 42px; } }
