/**
 * 少侠嘉奖卷轴 · 弹层与嘉奖阁样式（2026-10-15）
 *
 * 与主站共用 styles.css 的变量（宣纸 / 朱砂 / 描金 / 楷体标题），
 * 不重复定义色值，保证与名帖页、问剑帖等卡片同源。
 *
 * 卷轴本体尺寸：纸宽 min(92vw, 430px)，高度由内容决定（min-height 420px）；
 * 上下卷轴杆的滚动距离由 js/scroll.js 量出纸高后写入 --jh-half，
 * 因此换行行数变化时不需要改 CSS。
 */

/* =========================== 弹层 =========================== */
.jh-scroll-layer {
  position: fixed; inset: 0; z-index: 240;
  display: none; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 42%, rgba(42, 37, 32, .55), rgba(20, 16, 13, .84));
  backdrop-filter: blur(3px);
  padding: 20px;
}
.jh-scroll-layer.show { display: flex; }
.jh-scroll-layer.leaving { animation: jhLayerOut .5s ease forwards; }
@keyframes jhLayerOut { to { opacity: 0; visibility: hidden; } }

/* 金色尘埃 */
.jh-mote {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 1;
  background: radial-gradient(circle, #f4df9a, rgba(232, 199, 106, 0));
  animation: jhMoteUp linear infinite;
}
@keyframes jhMoteUp {
  0% { transform: translateY(30px) scale(.6); opacity: 0; }
  18% { opacity: .9; }
  82% { opacity: .55; }
  100% { transform: translateY(-46vh) scale(1.15); opacity: 0; }
}

/* 光柱 */
.jh-beam {
  position: absolute; top: -12%; left: 50%; width: 360px; height: 120%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(232, 199, 106, .28), rgba(232, 199, 106, .05) 55%, transparent);
  clip-path: polygon(38% 0, 62% 0, 88% 100%, 12% 100%);
  opacity: 0; pointer-events: none; filter: blur(4px);
}
.jh-scroll-layer.show .jh-beam { animation: jhBeamIn 1.4s ease .25s forwards; }
@keyframes jhBeamIn { 0% { opacity: 0; } 45% { opacity: .85; } 100% { opacity: .35; } }

/* =========================== 卷轴本体 =========================== */
.jh-scroll-box {
  --jh-half: 240px;
  position: relative; z-index: 3;
  width: min(92vw, 430px);
  animation: jhDescend .9s cubic-bezier(.22, 1.2, .36, 1) both;
}
@keyframes jhDescend {
  0% { transform: translateY(-64px) scale(.86); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.jh-scroll-box.leaving { animation: jhAscend .6s ease-in forwards; }
@keyframes jhAscend { to { transform: translateY(-60px) scale(.82); opacity: 0; } }

/* 宣纸：由中线向上下展开 */
.jh-paper {
  position: relative; margin: 0 6px;
  height: auto; min-height: 420px; max-height: 82vh;
  background:
    linear-gradient(100deg, rgba(42, 37, 32, .05), transparent 18%, transparent 82%, rgba(42, 37, 32, .07)),
    radial-gradient(circle at 20% 12%, rgba(201, 162, 39, .09), transparent 34%),
    radial-gradient(circle at 82% 88%, rgba(160, 52, 44, .06), transparent 40%),
    linear-gradient(180deg, #f7f0dd, #f0e6cc 60%, #ecdfc0);
  border-left: 1px solid rgba(140, 108, 12, .35);
  border-right: 1px solid rgba(140, 108, 12, .35);
  box-shadow: inset 0 0 46px rgba(140, 108, 12, .14), 0 18px 40px -18px rgba(20, 16, 13, .6);
  clip-path: inset(50% 0 50% 0);
  transition: clip-path 1.1s cubic-bezier(.65, 0, .25, 1);
  overflow: hidden;
}
.jh-scroll-box.open .jh-paper { clip-path: inset(0 0 0 0); }
.jh-paper::before {
  content: ""; position: absolute; inset: 7px; z-index: 0;
  border: 1.5px solid rgba(140, 108, 12, .4); border-radius: 3px; pointer-events: none;
}
.jh-paper::after {
  content: ""; position: absolute; inset: 11px; z-index: 0;
  border: 1px solid rgba(140, 108, 12, .22); border-radius: 2px; pointer-events: none;
}

/* 角落云纹 */
.jh-corner { position: absolute; width: 26px; height: 26px; color: rgba(140, 108, 12, .5); pointer-events: none; }
.jh-corner svg { width: 100%; height: 100%; }
.jh-corner.c1 { top: 13px; left: 13px; }
.jh-corner.c2 { top: 13px; right: 13px; transform: scaleX(-1); }
.jh-corner.c3 { bottom: 13px; left: 13px; transform: scaleY(-1); }
.jh-corner.c4 { bottom: 13px; right: 13px; transform: scale(-1); }

/* 上下卷轴杆 */
.jh-rod {
  position: absolute; left: -8px; right: -8px; height: 26px; border-radius: 13px; z-index: 4;
  background: linear-gradient(180deg, #6b4a2f, #452c18 55%, #2e1c0e);
  box-shadow: 0 4px 10px rgba(20, 16, 13, .5), inset 0 2px 3px rgba(255, 235, 200, .25);
}
.jh-rod::before, .jh-rod::after {
  content: ""; position: absolute; top: 2px; width: 16px; height: 22px; border-radius: 8px;
  background: radial-gradient(circle at 34% 30%, #f0d488, #c9a227 45%, #7d6109);
  box-shadow: 0 2px 5px rgba(20, 16, 13, .5);
}
.jh-rod::before { left: -9px; }
.jh-rod::after { right: -9px; }
.jh-rod-top { top: -8px; transform: translateY(var(--jh-half)); }
.jh-rod-bottom { bottom: -8px; transform: translateY(calc(-1 * var(--jh-half))); }
.jh-scroll-box.open .jh-rod-top { animation: jhRodUp 1.1s cubic-bezier(.65, 0, .25, 1) forwards; }
.jh-scroll-box.open .jh-rod-bottom { animation: jhRodDown 1.1s cubic-bezier(.65, 0, .25, 1) forwards; }
@keyframes jhRodUp { from { transform: translateY(var(--jh-half)); } to { transform: translateY(0); } }
@keyframes jhRodDown { from { transform: translateY(calc(-1 * var(--jh-half))); } to { transform: translateY(0); } }

/* =========================== 卷内排版 =========================== */
.jh-inner {
  position: relative; z-index: 1;
  padding: 26px 24px 20px;
  display: flex; flex-direction: column;
  height: 100%; max-height: 82vh; overflow-y: auto;
}
.jh-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.jh-title-v {
  order: 2; writing-mode: vertical-rl;
  font-family: var(--font-title); font-size: 24px; letter-spacing: 9px; font-weight: 700;
  color: var(--ink); line-height: 1; padding-top: 2px;
}
.jh-title-v em { font-style: normal; color: var(--seal); }
.jh-tag {
  order: 1; align-self: flex-start;
  font-family: var(--font-ui); font-size: 11px; letter-spacing: .14em;
  color: #8c6c0c; background: rgba(232, 199, 106, .16);
  border: 1px solid rgba(140, 108, 12, .45); border-radius: 4px;
  padding: 3px 8px; margin-top: 4px;
}
.jh-body { margin-top: 14px; flex: 1; }
.jh-salute {
  display: flex; align-items: center; gap: 9px; margin-bottom: 9px;
  font-family: var(--font-title); font-size: 15px; letter-spacing: .04em; color: var(--seal);
}
.jh-avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: 50% 60%;
  flex: none; border: 2px solid var(--gold-hi, #e8c76a); background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 253, 247, .9), 0 3px 8px rgba(42, 37, 32, .25);
}
.jh-text {
  font-family: var(--font-body); font-size: 15px; line-height: 2.05;
  color: var(--ink); text-align: justify;
}
.jh-text b { color: var(--seal); }
.jh-text .gold { color: #8c6c0c; font-weight: 700; }
.jh-text .ln { display: block; opacity: 0; transform: translateY(9px); }
.jh-scroll-box.open .jh-text .ln { animation: jhLnIn .7s ease forwards; }
.jh-scroll-box.open .jh-text .ln:nth-child(1) { animation-delay: 1.05s; }
.jh-scroll-box.open .jh-text .ln:nth-child(2) { animation-delay: 1.5s; }
.jh-scroll-box.open .jh-text .ln:nth-child(3) { animation-delay: 1.95s; }
@keyframes jhLnIn { to { opacity: 1; transform: none; } }
.jh-salute, .jh-title-v, .jh-tag { opacity: 0; }
.jh-scroll-box.open .jh-salute,
.jh-scroll-box.open .jh-title-v,
.jh-scroll-box.open .jh-tag { animation: jhLnIn .7s ease .95s forwards; }

/* 印章 */
.jh-stamp {
  position: absolute; right: 22px; bottom: 74px; width: 64px; height: 64px;
  opacity: 0; transform: scale(2.6) rotate(8deg);
  filter: drop-shadow(0 3px 6px rgba(110, 26, 20, .4));
}
.jh-stamp svg { width: 100%; height: 100%; }
.jh-scroll-box.open .jh-stamp { animation: jhStampIn .42s cubic-bezier(.5, 1.8, .5, 1) 2.85s forwards; }
@keyframes jhStampIn {
  0% { opacity: 0; transform: scale(2.6) rotate(8deg); }
  70% { opacity: 1; transform: scale(.94) rotate(-5deg); }
  100% { opacity: 1; transform: scale(1) rotate(-5deg); }
}

/* 落款与按钮 */
.jh-sign {
  margin-top: 10px; padding-right: 78px; text-align: right;
  font-family: var(--font-body); font-size: 12px; color: var(--ink-3, #8c8272); opacity: 0;
}
.jh-sign .who { font-family: var(--font-title); font-size: 13px; color: var(--ink-2, #5a5248); }
.jh-scroll-box.open .jh-sign { animation: jhLnIn .7s ease 3.05s forwards; }
.jh-actions { margin-top: 14px; text-align: center; opacity: 0; transform: translateY(8px); }
.jh-scroll-box.open .jh-actions { animation: jhLnIn .6s ease 3.3s forwards; }
.jh-receive {
  font-family: var(--font-title); font-size: 15px; letter-spacing: .32em;
  color: var(--ivory, #fdf3e2); border: 0; cursor: pointer;
  padding: 11px 34px 11px 40px; border-radius: 24px;
  background: linear-gradient(160deg, var(--seal-hi, #c4453a), var(--seal) 55%, var(--seal-lo, #6e1a14));
  box-shadow: 0 8px 20px -8px rgba(110, 26, 20, .8), inset 0 1px 0 rgba(255, 235, 200, .35);
  transition: .2s ease;
}
.jh-receive:hover { filter: brightness(1.1); transform: translateY(-1px); }
.jh-hold {
  display: block; margin: 9px auto 0; border: 0; background: none; cursor: pointer;
  font-family: var(--font-ui); font-size: 11.5px; color: rgba(42, 37, 32, .45);
  text-decoration: underline dotted;
}

/* 收起后的余韵提示 */
.jh-after {
  position: absolute; left: 50%; top: 44%; z-index: 30;
  transform: translate(-50%, -50%) scale(.85);
  background: rgba(255, 253, 247, .97);
  border: 1px solid rgba(201, 162, 39, .55); border-radius: 14px;
  padding: 18px 28px; text-align: center;
  box-shadow: 0 16px 36px -14px rgba(42, 37, 32, .5);
  display: none;
}
.jh-after.show { display: block; animation: jhToastIn .5s cubic-bezier(.3, 1.5, .5, 1) forwards; }
@keyframes jhToastIn { to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.jh-after .big { font-family: var(--font-title); font-size: 18px; letter-spacing: .16em; color: var(--seal); }
.jh-after .sm { font-family: var(--font-ui); font-size: 12px; color: var(--ink-3, #8c8272); margin-top: 6px; }
.jh-after .to-gal {
  margin-top: 12px; cursor: pointer; font-family: var(--font-body); font-size: 12.5px;
  color: #8c6c0c; background: rgba(232, 199, 106, .18);
  border: 1px solid rgba(140, 108, 12, .45); border-radius: 20px; padding: 7px 18px;
}
.jh-after .to-gal:hover { background: rgba(232, 199, 106, .32); }

/* 撒金纸屑 */
.jh-confetti { position: absolute; z-index: 25; pointer-events: none; opacity: 0; }
@keyframes jhConfFall {
  0% { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: 0; transform: translateY(70vh) rotate(540deg); }
}

/* =========================== 嘉奖阁列表 =========================== */
.jh-gal-list { display: grid; gap: 10px; }
.jh-gal-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line-2, rgba(42, 37, 32, .18));
  border-radius: 12px; padding: 12px 13px; cursor: pointer; transition: .16s ease;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(42, 37, 32, .06));
}
.jh-gal-item:hover { border-color: var(--seal); transform: translateY(-1px); }
.jh-gal-item .rodmini {
  width: 34px; height: 34px; flex: none; border-radius: 9px; position: relative;
  background: linear-gradient(160deg, #6b4a2f, #452c18);
  display: grid; place-items: center;
  box-shadow: inset 0 1px 2px rgba(255, 235, 200, .25);
}
.jh-gal-item .rodmini::before {
  content: ""; position: absolute; left: 4px; right: 4px; top: 5px; bottom: 5px; border-radius: 3px;
  background: linear-gradient(180deg, #f7f0dd, #ecdfc0);
}
.jh-gal-item .rodmini span {
  position: relative; font-family: var(--font-title); font-size: 14px;
  font-weight: 700; color: var(--seal);
}
.jh-gal-item .meta { flex: 1; min-width: 0; }
.jh-gal-item .tt {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-ui); font-size: 13px; font-weight: 600; color: var(--ink);
}
.jh-gal-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--seal); flex: none; }
.jh-gal-item .dd {
  font-family: var(--font-ui); font-size: 11.5px; color: var(--ink-3, #8c8272); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jh-gal-item .go { font-family: var(--font-ui); font-size: 12px; color: var(--seal); flex: none; }
.jh-gal-tip {
  font-family: var(--font-ui); font-size: 12px; color: var(--ink-3, #8c8272);
  margin-top: 12px; text-align: center;
}

/* 小屏适配 */
@media (max-width: 560px) {
  .jh-inner { padding: 20px 16px 16px; }
  .jh-paper { min-height: 380px; }
  .jh-title-v { font-size: 20px; letter-spacing: 7px; }
  .jh-text { font-size: 14px; line-height: 1.95; }
  .jh-stamp { width: 56px; height: 56px; right: 16px; bottom: 70px; }
}
