/* JOOYA · 全站增强样式 site-enhance.css */

/* ─── Cookie 同意条 ─── */
.jy-cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--ink, #16140e); color: var(--paper, #faf7ee);
  border-top: 3px solid var(--crimson, #8b2f2f);
  padding: 18px 28px;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.18);
}
.jy-cookie-banner.show { transform: translateY(0); }
.jy-cookie-banner.hide { transform: translateY(100%); }
.jy-cookie-inner {
  max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto; gap: 28px;
  align-items: center;
}
.jy-cookie-text {
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-size: 15px; line-height: 1.55; color: #ece8d6;
  max-width: 700px;
}
.jy-cookie-text b { font-family: "Noto Serif SC", serif; font-weight: 700; color: var(--paper, #faf7ee); }
.jy-cookie-text a { color: var(--ochre-soft, #e2d3b7); border-bottom: 1px solid var(--ochre-soft, #e2d3b7); }
.jy-cookie-acts { display: flex; gap: 10px; align-items: center; }
.jy-cookie-acts .jy-btn-ghost,
.jy-cookie-acts .jy-btn-primary {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 9px 18px; border: 1px solid #3a3830;
  background: transparent; color: var(--paper, #faf7ee);
  cursor: pointer; transition: all 0.12s;
}
.jy-cookie-acts .jy-btn-primary {
  background: var(--crimson, #8b2f2f); border-color: var(--crimson, #8b2f2f);
}
.jy-cookie-acts .jy-btn-ghost:hover { background: #1f1d17; }
.jy-cookie-acts .jy-btn-primary:hover { background: #a23a3a; border-color: #a23a3a; }
.jy-cookie-link {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px; letter-spacing: 0.12em;
  color: var(--ochre-soft, #e2d3b7); text-transform: uppercase;
  margin-left: 6px;
}

/* ─── 全站 AI 助手 ─── */
.jy-ai-fab {
  position: fixed; bottom: 26px; right: 26px; z-index: 80;
  background: var(--ink, #16140e); color: var(--paper, #faf7ee);
  border: 0; padding: 12px 18px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  display: flex; align-items: center; gap: 9px;
  transition: all 0.15s;
}
.jy-ai-fab:hover { background: var(--crimson, #8b2f2f); transform: translateY(-2px); }
.jy-ai-fab .jy-ico {
  width: 22px; height: 22px; display: block; flex: 0 0 auto;
  image-rendering: pixelated;
}
.jy-ai-fab .jy-ai-label { display: block; line-height: 1; }
/* 朱印呼吸＝AI 在线/在思考（承接旧 .dot 脉冲语义） */
.jy-seal { animation: jy-pulse 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes jy-pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
@media (prefers-reduced-motion: reduce) { .jy-seal { animation: none; } }

.jy-ai-panel {
  position: fixed; bottom: 84px; right: 26px;
  width: 400px; max-width: calc(100vw - 52px); max-height: 70vh;
  z-index: 81;
  background: var(--ink, #16140e); color: var(--paper, #faf7ee);
  border: 1px solid var(--ink, #16140e);
  display: none; flex-direction: column;
  box-shadow: 0 12px 36px rgba(0,0,0,0.25);
}
.jy-ai-panel.active { display: flex; }
.jy-ai-panel .ah {
  padding: 14px 18px;
  border-bottom: 1px solid #2a2820;
  display: flex; justify-content: space-between; align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--ochre-soft, #e2d3b7);
}
.jy-ai-panel .ah .atitle { display: flex; align-items: center; gap: 8px; }
.jy-ai-panel .ah .jy-ico { width: 16px; height: 16px; display: block; flex: 0 0 auto; image-rendering: pixelated; }
.jy-ai-panel .ah .close { color: #6c6a5e; cursor: pointer; font-size: 18px; }
.jy-ai-panel .ah .close:hover { color: var(--paper, #faf7ee); }
.jy-ai-panel .abody {
  padding: 16px 18px; flex: 1; overflow-y: auto;
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-size: 15px; line-height: 1.7; color: #ece8d6;
  white-space: pre-wrap;
}
.jy-ai-panel .abody.empty {
  color: #807c6f; font-family: "Inter", sans-serif; font-size: 13px;
}
.jy-ai-panel .suggestions {
  padding: 0 18px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.jy-ai-panel .suggestion {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 10px;
  font-family: "Inter", "Noto Sans SC", sans-serif;
  font-size: 12.5px; color: #c5c2b3;
  border: 1px solid transparent; cursor: pointer;
  transition: all 0.12s;
}
.jy-ai-panel .suggestion:hover {
  border-color: #3a3830; background: #1f1d17;
  color: var(--paper, #faf7ee);
}
.jy-ai-panel .suggestion .arrow { color: var(--crimson, #8b2f2f); font-family: "JetBrains Mono", monospace; }
.jy-ai-panel .afoot {
  padding: 12px 14px; border-top: 1px solid #2a2820;
  display: flex; gap: 8px;
}
.jy-ai-panel .afoot input {
  flex: 1; background: #1f1d17; border: 1px solid #3a3830;
  color: var(--paper, #faf7ee); padding: 9px 12px; outline: 0;
  font-family: "Inter", "Noto Sans SC", sans-serif; font-size: 13px;
}
.jy-ai-panel .afoot input::placeholder { color: #6c6a5e; }
.jy-ai-panel .afoot input:focus { border-color: var(--ochre-soft, #e2d3b7); }
.jy-ai-panel .afoot button {
  background: var(--crimson, #8b2f2f); color: var(--paper, #faf7ee);
  border: 0; padding: 0 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer;
}
.jy-ai-panel .afoot button:hover { background: #a23a3a; }
.jy-ai-panel .afoot button:disabled { opacity: 0.5; cursor: wait; }

/* ─── 阅读进度条 ─── */
.jy-progress-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; background: transparent;
  z-index: 60;
}
.jy-progress-fill {
  height: 100%; background: var(--crimson, #8b2f2f);
  width: 0%; transition: width 0.08s linear;
}

/* ─── 浮动 TOC ─── */
.jy-toc {
  position: fixed; left: 24px; top: 50%;
  transform: translateY(-50%);
  width: 200px; z-index: 50;
  background: var(--paper, #faf7ee);
  border: 1px solid var(--rule, #d4ceb8);
  padding: 14px 16px;
  max-height: 70vh; overflow-y: auto;
  font-family: "Inter", "Noto Sans SC", sans-serif;
}
.jy-toc-h {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-3, #6c6a5e); margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--rule, #d4ceb8);
}
.jy-toc nav { display: flex; flex-direction: column; gap: 2px; }
.jy-toc nav a {
  font-family: "Noto Serif SC", serif;
  font-size: 12.5px; line-height: 1.45;
  color: var(--ink-3, #6c6a5e);
  padding: 5px 0 5px 12px;
  border-left: 2px solid transparent;
  transition: all 0.12s;
  text-decoration: none;
}
.jy-toc nav a:hover { color: var(--ink, #16140e); }
.jy-toc nav a.active {
  color: var(--crimson, #8b2f2f);
  border-left-color: var(--crimson, #8b2f2f);
  font-weight: 700;
}
@media (max-width: 1400px) { .jy-toc { display: none; } }

/* ─── 回到顶部 ─── */
.jy-top-btn {
  position: fixed; bottom: 26px; right: 26px;
  width: 42px; height: 42px;
  background: var(--paper, #faf7ee); color: var(--ink, #16140e);
  border: 1px solid var(--ink, #16140e);
  font-size: 18px; cursor: pointer;
  opacity: 0; pointer-events: none;
  transform: translateY(20px);
  transition: all 0.25s;
  z-index: 79;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.jy-top-btn.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.jy-top-btn:hover { background: var(--ink, #16140e); color: var(--paper, #faf7ee); }
/* 当 ai-fab 存在时，回到顶部按钮上移避免重叠 */
.jy-ai-fab + .jy-top-btn,
body:has(.jy-ai-fab) .jy-top-btn { bottom: 84px; }

/* ─── 表单字段错误 ─── */
.jy-field-err {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px; color: var(--crimson, #8b2f2f);
  margin-top: 4px; letter-spacing: 0.05em;
}

/* ─── megamenu hover 预览（导航悬浮）─── */
.masthead .nav-left,
.masthead .nav-right {
  position: relative;
}
.jy-megamenu {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--paper, #faf7ee);
  border: 1px solid var(--ink, #16140e);
  border-top: 0;
  padding: 28px 40px;
  display: none;
  z-index: 49;
  box-shadow: 0 12px 36px rgba(0,0,0,0.08);
}

/* ─── 卡片 hover lift ─── */
.card, .acard, .case, .pain, .partner, .icell, .reco .r, .output {
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.card:hover, .acard:hover, .case:hover, .pain:hover, .partner:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

/* ─── 按钮 hover 细节 ─── */
.btn, .cta, button {
  transition: all 0.15s;
}

/* ─── 滚动渐入 ─── */
.jy-fade-in {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.jy-fade-in.visible {
  opacity: 1; transform: translateY(0);
}

/* ─── 暗色模式适配 ─── */
body[data-mode="dark"] .jy-toc {
  background: var(--paper-2, #1f1d17);
  border-color: var(--rule, #3a3830);
}
body[data-mode="dark"] .jy-top-btn {
  background: var(--paper-2, #1f1d17);
  color: var(--paper, #f0ecdf);
  border-color: var(--rule, #3a3830);
}
body[data-mode="dark"] .jy-top-btn:hover {
  background: var(--paper, #f0ecdf);
  color: var(--ink, #16140e);
}

@media (max-width: 700px) {
  .jy-cookie-inner { grid-template-columns: 1fr; gap: 14px; }
  .jy-cookie-acts { justify-content: flex-end; }
  .jy-ai-panel { right: 12px; left: 12px; bottom: 80px; width: auto; }
  .jy-ai-fab, .jy-top-btn { right: 16px; }
  .jy-ai-fab { bottom: 16px; }
}

@media print {
  .jy-cookie-banner, .jy-ai-fab, .jy-ai-panel, .jy-top-btn, .jy-toc, .jy-progress-bar { display: none !important; }
}

/* ─── 移动端导航（site-enhance.js initMobileNav 注入 · ≤1100px v6.css 隐藏 .masthead nav 后的替代入口）─── */
.jy-burger { display: none; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 1px solid var(--rule, #ddd); background: var(--paper, #faf7ee);
  cursor: pointer; z-index: 60; align-items: center; justify-content: center; flex-direction: column; gap: 5px; padding: 0; }
.jy-burger span { display: block; width: 18px; height: 2px; background: var(--ink, #16140e); }
.jy-mnav { display: none; position: fixed; inset: 0; z-index: 200; background: var(--paper, #faf7ee); overflow-y: auto; padding: 22px 24px; }
.jy-mnav.open { display: block; }
.jy-mnav .hd { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 2px solid var(--ink, #16140e); }
.jy-mnav .ttl { font-family: "Noto Serif SC", serif; font-weight: 900; font-size: 20px; color: var(--ink, #16140e); }
.jy-mnav .x { width: 44px; height: 44px; border: 1px solid var(--rule, #ddd); background: transparent; font-size: 20px; cursor: pointer; color: var(--ink, #16140e); }
.jy-mnav .grp { font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-3, #888); margin: 20px 0 4px; }
.jy-mnav a { display: block; padding: 13px 2px; border-bottom: 1px solid var(--rule, #e6e0d4); font-family: "Noto Serif SC", serif; font-size: 17px; font-weight: 700; color: var(--ink, #16140e); text-decoration: none; }
.jy-mnav a.cta-line { color: var(--crimson, #8b2f2f); }
body.jy-mnav-lock { overflow: hidden; }
@media (max-width: 1100px) {
  .masthead .main { position: relative; }
  .jy-burger { display: flex; }
}
/* 窄屏 topstrip 简化：隐藏 VOL/期号行，报头高度减半 */
@media (max-width: 640px) {
  .masthead .topstrip > div:last-child { display: none; }
}
