/* ====================================================================
   三十六計 · 古典水墨风样式
   配色：宣纸米白 / 墨色 / 朱砂红 / 黛青
   ==================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500;600;700;900&family=Ma+Shan+Zheng&family=ZCOOL+QingKe+HuangYou&display=swap');

:root {
  --paper:      #f4ece0;   /* 宣纸底 */
  --paper-2:    #ece0cf;   /* 略深宣纸 */
  --ink:        #1f1a17;   /* 浓墨 */
  --ink-soft:   #443c35;   /* 淡墨 */
  --ink-faint:  #6f655b;   /* 灰墨 */
  --cinnabar:   #9e2b25;   /* 朱砂红 */
  --cinnabar-2: #c0392f;   /* 亮朱砂 */
  --seal:       #b23a30;   /* 印章红 */
  --dai:        #38545c;   /* 黛青 */
  --gold:       #a9852f;   /* 旧金 */
  --line:       rgba(31,26,23,.16);
  --shadow:     0 18px 50px -22px rgba(31,26,23,.55);

  --serif: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  --brush: 'Ma Shan Zheng', 'Noto Serif SC', cursive;
  --hei:   'ZCOOL QingKe HuangYou', 'Noto Serif SC', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.85;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 20% 15%, rgba(158,43,37,.04), transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(56,84,92,.05), transparent 45%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244,236,224,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; gap: 28px;
  padding: 12px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-glyph {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  background: var(--ink); color: var(--paper);
  border-radius: 6px; font-size: 20px;
}
.brand-text { font-family: var(--brush); font-size: 28px; letter-spacing: 2px; }
.group-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.group-nav a {
  text-decoration: none; color: var(--ink-soft);
  font-size: 15px; padding: 6px 12px; border-radius: 4px;
  transition: all .2s; letter-spacing: 1px;
}
.group-nav a:hover { color: var(--cinnabar); background: rgba(158,43,37,.07); }

/* ============ 首屏 ============ */
.hero {
  position: relative; min-height: 88vh;
  display: grid; place-items: center;
  text-align: center; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(56,84,92,.10), transparent 70%);
}
.hero-bg::before {
  content: '兵'; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%,-54%);
  font-family: var(--brush); font-size: min(62vw, 720px);
  color: rgba(31,26,23,.035); line-height: 1; pointer-events: none;
}
.hero-content { position: relative; z-index: 1; padding: 40px 24px; max-width: 760px; }
.hero-kicker {
  font-family: var(--hei); letter-spacing: 8px; font-size: 15px;
  color: var(--cinnabar); margin-bottom: 18px;
}
.hero-title {
  font-family: var(--brush);
  font-size: clamp(80px, 18vw, 200px);
  line-height: .95; letter-spacing: 6px; color: var(--ink);
  text-shadow: 2px 4px 0 rgba(158,43,37,.10);
}
.hero-sub {
  font-size: clamp(17px, 3vw, 24px); color: var(--ink-soft);
  letter-spacing: 4px; margin: 18px 0 26px;
}
.hero-desc {
  font-size: 16px; color: var(--ink-faint); line-height: 2;
  max-width: 620px; margin: 0 auto 34px; text-align: justify;
}
.hero-desc b { color: var(--cinnabar); font-weight: 600; }
.hero-cta {
  display: inline-block; text-decoration: none;
  font-family: var(--hei); letter-spacing: 4px; font-size: 17px;
  color: var(--paper); background: var(--ink);
  padding: 13px 38px; border-radius: 40px;
  transition: all .25s; box-shadow: var(--shadow);
}
.hero-cta:hover { background: var(--cinnabar); transform: translateY(-2px); }
.hero-seal {
  position: absolute; right: 40px; bottom: 40px;
  writing-mode: vertical-rl;
  font-family: var(--brush); font-size: 22px; letter-spacing: 6px;
  color: var(--paper); background: var(--seal);
  padding: 18px 10px; border-radius: 6px;
  box-shadow: var(--shadow); opacity: .92;
}

/* ============ 套路分组 ============ */
.group-block { max-width: 1180px; margin: 0 auto; padding: 64px 24px 24px; }
.group-head {
  display: flex; align-items: flex-end; gap: 18px;
  border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 38px;
}
.group-index {
  font-family: var(--brush); font-size: 60px; line-height: .8;
  color: var(--cinnabar); flex-shrink: 0;
}
.group-titles { flex: 1; }
.group-name {
  font-family: var(--hei); font-size: 34px; letter-spacing: 4px; color: var(--ink);
}
.group-sub { font-size: 15px; color: var(--ink-faint); letter-spacing: 1px; margin-top: 2px; }
.group-range {
  font-family: var(--serif); font-size: 14px; color: var(--paper);
  background: var(--ink); padding: 4px 12px; border-radius: 20px;
  letter-spacing: 1px; white-space: nowrap;
}

/* ============ 计策卡片网格 ============ */
.card-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
  position: relative; cursor: pointer;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 10px -6px rgba(31,26,23,.3);
  transition: transform .28s cubic-bezier(.2,.7,.3,1), box-shadow .28s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card:hover .card-fig::after { opacity: .15; }
.card-fig {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(135deg, var(--paper-2), #ddd0bd);
}
.card-fig img { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 1; }
.card-fig::after {
  content: ''; position: absolute; inset: 0; background: var(--ink);
  opacity: 0; transition: opacity .3s;
}
/* 配图占位（图片缺失时显示） */
.fig-placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  text-align: center; color: var(--ink-faint);
  background:
    repeating-linear-gradient(45deg, transparent, transparent 11px, rgba(31,26,23,.03) 11px, rgba(31,26,23,.03) 12px),
    linear-gradient(135deg, var(--paper-2), #d9ccb8);
}
.fig-placeholder .ph-glyph { font-family: var(--brush); font-size: 46px; color: rgba(158,43,37,.5); }
.fig-placeholder .ph-text { font-size: 12px; letter-spacing: 2px; margin-top: 4px; }
.card-no {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-family: var(--serif); font-weight: 700; font-size: 13px;
  color: var(--paper); background: rgba(31,26,23,.78);
  padding: 3px 10px; border-radius: 20px; letter-spacing: 1px;
}
.card-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.card-name {
  font-family: var(--hei); font-size: 25px; letter-spacing: 3px; color: var(--ink);
}
.card-pinyin { font-size: 12.5px; color: var(--cinnabar); letter-spacing: 1px; margin-top: 2px; }
.card-meaning {
  font-size: 14px; color: var(--ink-faint); line-height: 1.75;
  margin-top: 10px; flex: 1;
}
.card-more {
  margin-top: 12px; font-size: 13px; color: var(--dai);
  letter-spacing: 1px; align-self: flex-start;
}
.card-more::after { content: ' →'; transition: margin .2s; }
.card:hover .card-more::after { margin-left: 4px; }

/* ============ 详情弹层 ============ */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 24px;
}
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(20,16,13,.6); backdrop-filter: blur(3px); }
.modal-card {
  position: relative; z-index: 1;
  width: min(820px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--paper); border-radius: 14px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
  animation: pop .32s cubic-bezier(.2,.8,.3,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }

.m-hero { position: relative; aspect-ratio: 16/8; overflow: hidden; background: linear-gradient(135deg, var(--paper-2), #d9ccb8); }
.m-hero img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.m-hero .fig-placeholder .ph-glyph { font-size: 70px; }
.m-close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 38px; height: 38px; border: none; cursor: pointer;
  background: rgba(31,26,23,.8); color: var(--paper);
  border-radius: 50%; font-size: 20px; line-height: 1;
  transition: background .2s;
}
.m-close:hover { background: var(--cinnabar); }
.m-titlebar {
  position: absolute; left: 0; bottom: 0; right: 0;
  padding: 26px 28px 18px;
  background: linear-gradient(transparent, rgba(20,16,13,.78));
  color: var(--paper);
}
.m-no { font-size: 14px; letter-spacing: 2px; opacity: .85; }
.m-name { font-family: var(--brush); font-size: 52px; letter-spacing: 4px; line-height: 1; }
.m-pinyin { font-size: 14px; letter-spacing: 2px; opacity: .9; margin-top: 4px; }

.m-body { padding: 28px 30px 34px; }
.m-section { margin-bottom: 26px; }
.m-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--hei); font-size: 17px; letter-spacing: 3px; color: var(--cinnabar);
  margin-bottom: 12px;
}
.m-label::before { content: '◆'; font-size: 11px; color: var(--gold); }

.m-original {
  font-size: 19px; line-height: 2.1; color: var(--ink);
  background: var(--paper-2); border-left: 4px solid var(--cinnabar);
  padding: 16px 20px; border-radius: 0 8px 8px 0; letter-spacing: 1px;
}
.m-text { font-size: 16px; line-height: 2; color: var(--ink-soft); text-align: justify; }

/* 注音注释列表 */
.notes-list { list-style: none; display: grid; gap: 10px; }
.note-item {
  display: flex; gap: 12px; align-items: baseline;
  background: rgba(56,84,92,.06); padding: 10px 14px; border-radius: 8px;
}
.note-char {
  font-family: var(--hei); font-size: 22px; color: var(--ink); flex-shrink: 0;
  min-width: 40px; text-align: center;
}
.note-py { color: var(--dai); font-size: 14px; letter-spacing: 1px; flex-shrink: 0; min-width: 90px; }
.note-def { color: var(--ink-soft); font-size: 15px; }

.m-anno {
  font-size: 15px; line-height: 1.95; color: var(--ink-faint);
  font-style: italic; border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line); padding: 14px 0;
}

/* 配图提示词 */
.prompt-box {
  background: var(--ink); color: #d8cdbd; border-radius: 10px;
  padding: 16px 18px; font-size: 13.5px; line-height: 1.7;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  position: relative;
}
.prompt-box .pb-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; color: var(--gold);
  font-family: var(--hei); font-size: 14px; letter-spacing: 2px;
}
.copy-btn {
  cursor: pointer; border: 1px solid rgba(217,205,189,.35);
  background: transparent; color: #d8cdbd;
  font-size: 12px; padding: 4px 12px; border-radius: 20px;
  transition: all .2s; font-family: var(--serif);
}
.copy-btn:hover { background: rgba(217,205,189,.15); }
.copy-btn.done { color: #8fcf8f; border-color: rgba(143,207,143,.5); }
.prompt-text { user-select: all; word-break: break-word; }

/* 弹层内导航 */
.m-pager {
  display: flex; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--line); padding-top: 20px; margin-top: 8px;
}
.m-pager button {
  cursor: pointer; background: var(--paper-2); border: 1px solid var(--line);
  color: var(--ink-soft); font-family: var(--serif); font-size: 14px;
  padding: 9px 16px; border-radius: 8px; transition: all .2s; letter-spacing: 1px;
}
.m-pager button:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.m-pager button:disabled { opacity: .35; cursor: default; }

/* ============ 页脚 ============ */
.site-footer {
  text-align: center; padding: 70px 24px 56px; margin-top: 50px;
  border-top: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 0%, rgba(56,84,92,.06), transparent 60%);
}
.footer-line { font-family: var(--brush); font-size: 46px; letter-spacing: 10px; color: var(--ink); }
.footer-note { color: var(--ink-soft); letter-spacing: 3px; margin-top: 10px; font-size: 15px; }
.footer-meta { color: var(--ink-faint); font-size: 13px; letter-spacing: 1px; margin-top: 8px; }

/* ============ 返回顶部 ============ */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  width: 48px; height: 48px; border: none; cursor: pointer;
  background: var(--ink); color: var(--paper);
  border-radius: 50%; font-size: 20px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: all .3s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--cinnabar); }

/* ============ 响应式 ============ */
/* 中等及以下宽度，居中正文会占满，隐藏侧边印章避免遮挡 */
@media (max-width: 1180px) {
  .hero-seal { display: none; }
}
@media (max-width: 720px) {
  .group-nav { display: none; }
  .header-inner { padding: 10px 16px; }
  .group-block { padding: 48px 16px 16px; }
  .group-index { font-size: 44px; }
  .group-name { font-size: 26px; }
  .m-body { padding: 22px 20px 28px; }
  .m-name { font-size: 40px; }
  .note-item { flex-wrap: wrap; }
  .hero-seal { font-size: 17px; right: 4%; }
}
