/* ================================================================
   中国风视觉增强层
   叠加在 themes.css 之上，不改动原有代码
   ================================================================ */

/* ═══ 一、宣纸纹理（混合模式叠加，所有主题适用） ═══ */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .12;
  /* 纤维噪声 + 纵向绢纹 */
  background:
    /* 细纤维纹 */
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(180, 160, 120, .08) 3px,
      rgba(180, 160, 120, .08) 3.5px
    ),
    /* 随机粗纤维（通过多层 radial-gradient 模拟） */
    radial-gradient(ellipse at 12% 8%, rgba(200, 170, 110, .15) 0, transparent 30%),
    radial-gradient(ellipse at 85% 22%, rgba(180, 140, 90, .1) 0, transparent 25%),
    radial-gradient(ellipse at 45% 60%, rgba(190, 155, 100, .12) 0, transparent 35%),
    radial-gradient(ellipse at 72% 88%, rgba(170, 140, 100, .08) 0, transparent 28%),
    radial-gradient(ellipse at 28% 75%, rgba(200, 160, 120, .1) 0, transparent 22%);
  /* noise 注入 */
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.28'/%3E%3C/svg%3E");
  mask-size: 256px 256px;
}

/* ── 暗色主题调低宣纸纹理强度 ── */
[data-theme="ink"] body::after,
[data-theme="glaze"] body::after {
  opacity: .05;
}

/* ═══ 二、回纹装饰边框（卡片四角） ═══ */
.card--ornament {
  border-radius: 10px !important;
  border: 1px solid var(--border) !important;
  position: relative;
}
/* 回纹角标——用 border 拼出 L 形纹样 */
.card--ornament::after {
  content: '';
  position: absolute;
  pointer-events: none;
  /* 四角回纹 */
  top: 6px; left: 6px;
  width: 22px; height: 22px;
  border-top: 2px solid rgba(var(--accent-rgb), .25);
  border-left: 2px solid rgba(var(--accent-rgb), .25);
  border-radius: 3px 0 0 0;
}
.card--ornament .ornament-br {
  position: absolute;
  bottom: 6px; right: 6px;
  width: 22px; height: 22px;
  border-bottom: 2px solid rgba(var(--accent-rgb), .25);
  border-right: 2px solid rgba(var(--accent-rgb), .25);
  border-radius: 0 0 3px 0;
  pointer-events: none;
}
.card--ornament .ornament-tr {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  border-top: 2px solid rgba(var(--accent-rgb), .25);
  border-right: 2px solid rgba(var(--accent-rgb), .25);
  border-radius: 0 3px 0 0;
  pointer-events: none;
}
.card--ornament .ornament-bl {
  position: absolute;
  bottom: 6px; left: 6px;
  width: 22px; height: 22px;
  border-bottom: 2px solid rgba(var(--accent-rgb), .25);
  border-left: 2px solid rgba(var(--accent-rgb), .25);
  border-radius: 0 0 0 3px;
  pointer-events: none;
}

/* ═══ 三、祥云分隔线 ═══ */
.divider-cloud {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px auto;
  width: fit-content;
}
.divider-cloud::before,
.divider-cloud::after {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), .45), transparent);
}
.divider-cloud .cloud-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), .5);
  flex-shrink: 0;
}

/* 双线祥云分隔（用于 section 之间） */
.section-divider {
  width: 120px;
  height: 10px;
  margin: 48px auto;
  position: relative;
  opacity: .5;
}
.section-divider::before,
.section-divider::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.section-divider::before { top: 2px; }
.section-divider::after { bottom: 2px; }
.section-divider .dot {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(var(--accent-rgb), .4);
}

/* ═══ 四、印章落款效果 ═══ */

/* 双排方印（从右往左竖排） */
.seal-double {
  display: inline-flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  font-family: 'Liu Jian Mao Cao', cursive;
  color: #fffef9;
  background: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 4px;
  padding: 6px 14px;
  min-width: 54px;
  transform: rotate(-3deg);
  box-shadow: 2px 4px 12px rgba(var(--accent-rgb), .35);
  animation: stamp-in .6s cubic-bezier(.34,1.56,.64,1) .15s both;
  position: relative;
}
.seal-double .seal-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.3rem;
  letter-spacing: 1px;
  line-height: 1.2;
}
.seal-double::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 2px;
  pointer-events: none;
}

.seal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
}
.seal-footer .seal-sig {
  font-size: .75rem;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.8;
  letter-spacing: 2px;
}

/* AI 解读末尾印章 */
.seal-closure {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  animation: fade-in .6s ease both;
}
.seal-closure .seal-sig {
  font-size: .72rem;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.8;
  letter-spacing: 2px;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══ 五、墨韵诗句雨 ═══ */
.ink-rain-container {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
}
.verse-col {
  position: absolute;
  font-family: 'Ma Shan Zheng', cursive;
  pointer-events: none;
  writing-mode: vertical-rl;
  text-orientation: upright;
  line-height: 1.6;
  white-space: nowrap;
  letter-spacing: 6px;
}

/*"
.seal-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Liu Jian Mao Cao', cursive;
  color: var(--bg-card);
  background: var(--accent);
  border: 3px solid var(--accent);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 1.5rem;
  letter-spacing: 4px;
  transform: rotate(-3deg);
  box-shadow: 2px 3px 8px rgba(var(--accent-rgb), .25);
  animation: stamp-in .5s cubic-bezier(.34,1.56,.64,1) both;
  position: relative;
}
.seal-stamp::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 3px;
  pointer-events: none;
}
@keyframes stamp-in {
  0% { transform: translateY(14px) rotate(-8deg) scale(1.4); opacity: 0; }
  100% { transform: translateY(0) rotate(-3deg) scale(1); opacity: 1; }
}

/* 圆形印章变体 */
.seal-stamp--round {
  border-radius: 50%;
  width: 56px;
  height: 56px;
  padding: 0;
  font-size: 1.4rem;
  letter-spacing: 0;
}
.seal-stamp--round::after {
  border-radius: 50%;
  inset: 4px;
}

/* ═══ 五、竖排文字工具类 ═══ */
.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 4px;
  line-height: 2;
}
/* 古籍批注容器 */
.classics-block {
  background: rgba(var(--accent-rgb), .04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 14px;
  font-family: 'Noto Serif SC', 'SimSun', serif;
  font-size: .85rem;
  line-height: 2;
  color: var(--text-sec);
  position: relative;
  max-height: 320px;
  overflow-y: auto;
}
/* 古籍批注红点 */
.classics-block::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), .12), transparent);
  border-radius: 1px;
}

/* ═══ 六、标题金粉描边 ═══ */
.gold-underline {
  position: relative;
  display: inline-block;
}
.gold-underline::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 10%;
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 1px;
}

/* ═══ 七、合页边框动画 ═══ */
.card--brocade {
  border: 1px solid var(--border);
  outline: 1px solid rgba(var(--accent-rgb), .08);
  outline-offset: -8px;
  border-radius: 12px !important;
}

/* ═══ 八、小篆图标区 ═══ */
.seal-icon {
  font-family: 'Liu Jian Mao Cao', cursive;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: .7;
  transition: all .4s;
}
.seal-icon--lg { font-size: 3rem; }
.seal-icon--md { font-size: 2rem; }

/* ═══ 九、首页 Hero 印章强化 ═══ */
.hero-home .hero-dao {
  /* 模拟印章排布效果 */
  text-shadow:
    2px 2px 0 rgba(var(--accent-rgb), .15),
    -1px -1px 0 rgba(var(--accent-rgb), .08);
}

/* ═══ 十、墨韵点按涟漪 ═══ */
/* 核心墨点：中心浓向外淡 */
.ink-core {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(circle at 45% 40%, rgba(var(--accent-rgb), 1) 0%, rgba(var(--accent-rgb), .45) 45%, transparent 100%);
  filter: url(#ink-blot);
  animation: ink-core-fade 1.2s ease-out forwards;
  opacity: 0;
}
/* 内层墨晕 */
.ink-wash-inner {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  background: radial-gradient(circle at 50% 45%, rgba(var(--accent-rgb), .35) 0%, rgba(var(--accent-rgb), .12) 55%, transparent 100%);
  filter: url(#ink-blot);
  animation: ink-wash-out 2.4s ease-out forwards;
  opacity: 0;
}
/* 外层渗透 */
.ink-wash-outer {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9996;
  background: radial-gradient(circle at 48% 42%, rgba(var(--accent-rgb), .18) 10%, rgba(var(--accent-rgb), .06) 55%, transparent 100%);
  filter: url(#ink-blot);
  animation: ink-wash-out 3s ease-out .15s forwards;
  opacity: 0;
}
@keyframes ink-core-fade {
  0%   { transform: scale(.15); opacity: .75; }
  25%  { opacity: .48; }
  100% { transform: scale(3.2); opacity: 0; }
}
@keyframes ink-wash-out {
  0%   { transform: scale(.1); opacity: .40; }
  30%  { opacity: .24; }
  70%  { opacity: .08; }
  100% { transform: scale(6); opacity: 0; }
}

/* ═══ 响应式适配 ═══ */
@media (max-width: 768px) {
  .card--ornament::after { width: 16px; height: 16px; top: 4px; left: 4px; }
  .card--ornament .ornament-br { width: 16px; height: 16px; bottom: 4px; right: 4px; }
  .card--ornament .ornament-tr { width: 16px; height: 16px; top: 4px; right: 4px; }
  .card--ornament .ornament-bl { width: 16px; height: 16px; bottom: 4px; left: 4px; }
  .seal-stamp { font-size: 1.2rem; padding: 4px 10px; }
  .seal-stamp--round { width: 44px; height: 44px; font-size: 1.1rem; }
}
