/* 枕潮听穹 · 首页 */
body[data-page="portal"] { min-height: 100vh; overflow-x: hidden; }

/* ---------------------------------------------------------------- 标题画面 */
.hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 56px;
  min-height: calc(100svh - var(--top-h)); padding: 12px max(7vw, 32px) 104px;
}
/* 左侧文字下面垫一层很淡的暗光:任何背景上都看得清,又不显出一块"底" */
.hero::before {
  content: ''; position: absolute; inset: -10% auto -10% -10%; width: 70%; pointer-events: none; z-index: -1;
  background: radial-gradient(closest-side at 45% 50%, rgba(5, 8, 14, calc(.46 * var(--veil, 1))), transparent);
}
.hero-text { position: relative; max-width: 560px; }
.hero-title { display: flex; flex-direction: column; align-items: flex-start; gap: 26px; }
.hero-title .logo {
  width: clamp(230px, 24vw, 380px); aspect-ratio: 495 / 328; color: var(--paper);
  filter: drop-shadow(0 4px 28px rgba(0, 0, 0, .35));
}
.site-name {
  font: 800 clamp(28px, 2.9vw, 44px)/1.1 var(--f-display); letter-spacing: .42em; margin-right: -.42em;
  color: var(--paper); text-shadow: 0 2px 22px rgba(0, 0, 0, .45);
}
/* 首页大字在全角逗号处分行:第二行错开一个字,像诗的排法 */
.site-name .hl { display: block; white-space: nowrap; }
.site-name .hl + .hl { margin-top: .34em; padding-left: 1.42em; }
.tideline { display: block; width: min(420px, 100%); height: 36px; margin: 16px 0 8px -6px; }
.tagline { font-size: 15px; letter-spacing: .32em; color: var(--text-2); text-shadow: 0 1px 10px rgba(0, 0, 0, .5); }

/* 进入模块:一块细边的"铭牌" */
.entry {
  --c: rgba(244, 242, 236, .55);
  position: relative; display: inline-grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
  min-width: 360px; margin-top: 46px; padding: 15px 18px 15px 16px; border-radius: 6px;
  background: rgba(6, 9, 15, .42); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background-color .25s, box-shadow .25s;
}
.entry::before {
  content: ''; position: absolute; inset: 4px; pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) top left / 9px 1px, linear-gradient(var(--c), var(--c)) top left / 1px 9px,
    linear-gradient(var(--c), var(--c)) bottom right / 9px 1px, linear-gradient(var(--c), var(--c)) bottom right / 1px 9px;
  background-repeat: no-repeat;
}
.entry:hover { background: rgba(6, 9, 15, .58); box-shadow: inset 0 0 0 1px var(--line-3); }
.entry-ic { width: 34px; height: 34px; color: var(--paper); }
.entry-text b { display: block; font: 800 19px/1.25 var(--f-display); letter-spacing: .16em; color: var(--paper); }
.entry-text small { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-2); }
.entry-go { width: 20px; height: 20px; color: var(--text-2); transition: transform .3s var(--ease-out), color .2s; }
.entry:hover .entry-go { transform: translateX(4px); color: var(--paper); }

/* ---------------------------------------------------------------- 共鸣者卡片 */
.feature { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 0; }
.feature-card {
  position: relative; display: block; height: clamp(380px, 66vh, 640px); aspect-ratio: 3 / 4; border-radius: 4px;
  overflow: hidden; isolation: isolate; background: color-mix(in oklab, var(--deep) 75%, #000);
  box-shadow: 0 34px 90px -34px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .1);
}
.feature-card::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 55% at 100% 0, rgba(6, 9, 15, .5) 0, rgba(6, 9, 15, .16) 34%, transparent 58%);
}
.feature-card::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); transition: box-shadow .35s var(--ease);
}
.feature-card:hover::after { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--a) 70%, #fff), inset 0 0 30px -8px var(--a); }
.feature-card .tag { position: absolute; z-index: 2; top: 18px; right: 14px; }
.feature-card .name { font: 800 34px/1 var(--f-display); letter-spacing: .18em; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 0 22px rgba(0, 0, 0, .35); }
.feature-card.in-next { animation: card-in-next .5s var(--ease-out); }
.feature-card.in-prev { animation: card-in-prev .5s var(--ease-out); }
@keyframes card-in-next { from { opacity: 0; transform: translateX(18px); } }
@keyframes card-in-prev { from { opacity: 0; transform: translateX(-18px); } }
/* 四角刻线:和对话框、模块铭牌同一个母题 */
.feature::before {
  --c: rgba(244, 242, 236, .5);
  content: ''; position: absolute; left: -10px; right: -10px; top: -10px; height: calc(clamp(380px, 66vh, 640px) + 20px); pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) top left / 16px 1px, linear-gradient(var(--c), var(--c)) top left / 1px 16px,
    linear-gradient(var(--c), var(--c)) top right / 16px 1px, linear-gradient(var(--c), var(--c)) top right / 1px 16px,
    linear-gradient(var(--c), var(--c)) bottom left / 16px 1px, linear-gradient(var(--c), var(--c)) bottom left / 1px 16px,
    linear-gradient(var(--c), var(--c)) bottom right / 16px 1px, linear-gradient(var(--c), var(--c)) bottom right / 1px 16px;
  background-repeat: no-repeat;
}
.feature-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; margin-top: 8px; }
.feature-bar .ib { color: var(--text); filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .5)); }
/* 名字和「24 / 39」是一个按钮:点开牌阵,一下子看到全部共鸣者 */
.feature-meta {
  display: flex; flex-direction: column; align-items: center; gap: 1px; justify-self: center; min-width: 0;
  padding: 4px 14px; border: 0; border-radius: 999px; background: none; color: inherit; cursor: pointer;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .6); transition: background .25s var(--ease);
}
.feature-meta:hover, .feature-meta:focus-visible { background: rgba(8, 12, 20, .42); outline: none; }
.feature-meta small { font: italic 13px/1.3 var(--f-italic); letter-spacing: .06em; color: var(--text-2); }
.feature-all { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); transition: color .25s var(--ease); }
.feature-all svg.i { width: 15px; height: 15px; stroke-width: 1.5; stroke-linejoin: round; }
.feature-all .num { font-size: 11.5px; letter-spacing: .12em; }
.feature-meta:hover .feature-all, .feature-meta:focus-visible .feature-all { color: var(--paper); }
.feature.decking .feature-card, .feature.decking::before { visibility: hidden; }

/* ---------------------------------------------------------------- 牌阵 */
/* 大卡片像一副牌一样从原位摊开成扇形;转动看完全部,鼠标停在哪张哪张就抬起来动,点一下飞回原位换上 */
.deck { position: fixed; inset: 0; z-index: 130; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; }
.deck-veil {
  position: absolute; inset: 0;
  background: radial-gradient(130% 80% at 50% 108%, rgba(5, 8, 14, .9) 0, rgba(5, 8, 14, .66) 55%, rgba(5, 8, 14, .5) 100%);
  -webkit-backdrop-filter: blur(16px) saturate(1.15); backdrop-filter: blur(16px) saturate(1.15);
  animation: deck-veil-in .45s var(--ease-out) both;
}
.deck.out .deck-veil { animation: deck-veil-out .42s var(--ease) both; }
@keyframes deck-veil-in { from { opacity: 0; } }
@keyframes deck-veil-out { to { opacity: 0; } }
.deck-head {
  position: absolute; left: 0; right: 0; top: calc(var(--top-h) * .25 + env(safe-area-inset-top)); display: flex; justify-content: center;
  padding: 0 64px; animation: deck-up .5s var(--ease-out) .12s both;
}
.deck-find { width: min(320px, 100%); }
.deck-close { position: absolute; right: max(18px, env(safe-area-inset-right)); top: 0; color: var(--text); }
.deck-now {
  position: absolute; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
  text-align: center; text-shadow: 0 2px 18px rgba(0, 0, 0, .6); animation: deck-up .5s var(--ease-out) .18s both;
}
.deck-now b { font: 800 clamp(34px, 5.2vw, 64px)/1.05 var(--f-display); letter-spacing: .28em; margin-right: -.28em; color: #fff; }
.deck-now small { font: italic 15px/1.3 var(--f-italic); letter-spacing: .08em; color: var(--text-2); }
.deck-now .num { font-size: 12px; letter-spacing: .16em; color: var(--text-3); }
.deck-now .lit { color: color-mix(in oklab, var(--paper) 60%, var(--a)); }
.deck-tip { font-size: 12.5px; letter-spacing: .08em; color: var(--text-3); }
.deck.out .deck-head, .deck.out .deck-now { animation: deck-veil-out .25s var(--ease) both; }
@keyframes deck-up { from { opacity: 0; transform: translateY(10px); } }
.deck-ring { position: absolute; left: 50%; top: 0; width: 0; height: 0; }
.deck-card {
  position: absolute; left: calc(var(--cw) / -2); top: calc(var(--ch) / -2); width: var(--cw); height: var(--ch);
  padding: 0; border: 0; border-radius: 4px; overflow: hidden; isolation: isolate; cursor: pointer; color: inherit;
  background: color-mix(in oklab, var(--deep) 75%, #000); will-change: transform, opacity;
  box-shadow: 0 22px 46px -18px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .12);
  transition: box-shadow .3s var(--ease);
}
.deck-card .frame { position: absolute; inset: 0; filter: brightness(var(--lum, 1)); transition: filter .35s var(--ease); }
.deck-card::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background: linear-gradient(180deg, rgba(6, 9, 15, .42), transparent 34%);
}
.deck-card .name {
  position: absolute; z-index: 4; top: 10px; left: 9px; font: 800 17px/1 var(--f-display); letter-spacing: .14em; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 0 14px rgba(0, 0, 0, .4);
}
.deck-card.r .name { left: auto; right: 9px; }
.deck-card .lit { position: absolute; z-index: 4; bottom: 9px; left: 9px; width: 12px; height: 12px; color: var(--paper); filter: drop-shadow(0 0 6px var(--a)); }
.deck-card.r .lit { left: auto; right: 9px; }
.deck-card.on { box-shadow: 0 30px 60px -18px rgba(0, 0, 0, .95), 0 0 0 1px color-mix(in oklab, var(--a) 72%, #fff), 0 0 34px -6px var(--a); }
.deck-card.is-now::before {
  content: ''; position: absolute; z-index: 4; left: 50%; bottom: 8px; width: 18px; height: 2px; margin-left: -9px; border-radius: 2px;
  background: var(--paper); box-shadow: 0 0 8px var(--a);
}
.deck-card.dim { filter: saturate(.3) brightness(.45); }
.deck-card:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
@media (hover: none) { .deck-head { padding: 0 56px 0 16px; justify-content: flex-start; } }

/* ---------------------------------------------------------------- 背景说明 */
.wall-cap {
  position: absolute; right: max(7vw, 32px); bottom: 26px; display: flex; align-items: center; gap: 2px;
  font-size: 12.5px; color: var(--text-2); text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}
.wall-cap .ib { color: var(--text); filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .5)); }
.wall-cap-text { display: inline-flex; gap: 10px; padding: 0 6px; }
.wall-cap-text .num { color: var(--text-3); letter-spacing: .08em; }
#wallFav svg { width: 14px; height: 14px; opacity: .55; }
#wallFav[aria-pressed="true"] svg { opacity: 1; color: var(--paper); filter: drop-shadow(0 0 4px var(--a)); }
.ripple-hint { margin-right: 14px; padding-right: 14px; border-right: 1px solid var(--line-2); color: var(--text-3); transition: opacity .6s, transform .6s; }
.ripple-hint.gone { opacity: 0; transform: translateY(4px); pointer-events: none; }

/* ---------------------------------------------------------------- 最近看过 / 点亮的角色 */
.shelf { padding: 6px max(7vw, 32px) 26px; }
.shelf-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font: 800 19px/1.2 var(--f-display); letter-spacing: .2em; text-shadow: 0 1px 12px rgba(0, 0, 0, .5); }
.shelf-h::before { content: ''; width: 6px; height: 6px; transform: rotate(45deg); background: var(--paper); }
.shelf-row { list-style: none; display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.mini-card {
  position: relative; display: block; width: 132px; aspect-ratio: 3 / 4; border-radius: 4px; overflow: hidden; scroll-snap-align: start;
  background: color-mix(in oklab, var(--deep) 75%, #000); box-shadow: 0 0 0 1px rgba(255, 255, 255, .1);
  transition: transform .3s var(--ease-out), box-shadow .3s;
}
.mini-card:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px color-mix(in oklab, var(--a) 70%, #fff), 0 12px 30px -12px rgba(0, 0, 0, .7); }
.mini-card::before { content: ''; position: absolute; inset: 0; z-index: 1; background: radial-gradient(120% 60% at 100% 0, rgba(6, 9, 15, .55), transparent 58%); }
.mini-card .name { position: absolute; z-index: 2; top: 9px; right: 7px; font: 800 15px/1 var(--f-display); letter-spacing: .14em; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }

/* ---------------------------------------------------------------- 开场:Logo 浮现、站名收拢、潮汐线从中间展开 */
.portal.intro .hero-title .logo { animation: intro-logo 1.3s var(--ease-out) both; }
.portal.intro .site-name { animation: intro-name 1.5s var(--ease-out) .15s both; }
.portal.intro .tideline { animation: intro-line 1.4s var(--ease-out) .45s both; }
.portal.intro .tagline { animation: intro-fade 1s var(--ease) .75s both; }
.portal.intro .entry { animation: intro-rise .9s var(--ease-out) .9s both; }
.portal.intro .feature { animation: intro-feature 1.2s var(--ease-out) .35s both; }
@keyframes intro-logo { from { opacity: 0; filter: blur(10px) drop-shadow(0 4px 28px rgba(0, 0, 0, .35)); transform: translateY(-6px); } }
@keyframes intro-name { from { opacity: 0; letter-spacing: .7em; } }
@keyframes intro-line { from { clip-path: inset(0 50% 0 50%); } to { clip-path: inset(0 0 0 0); } }
@keyframes intro-fade { from { opacity: 0; } }
@keyframes intro-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes intro-feature { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* ---------------------------------------------------------------- 小屏 */
@media (max-width: 1000px) {
  .hero { gap: 36px; }
  .feature-card { height: clamp(340px, 58vh, 540px); }
  .feature::before { height: calc(clamp(340px, 58vh, 540px) + 20px); }
}
@media (max-width: 800px) {
  .hero { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 30px; padding: 26px 18px 100px; min-height: 0; }
  .hero::before { inset: 0; width: auto; background: radial-gradient(closest-side at 50% 30%, rgba(5, 8, 14, .4), transparent); }
  .hero-title { align-items: center; gap: 18px; }
  .hero-title .logo { width: min(64vw, 280px); }
  .site-name { font-size: 26px; letter-spacing: .3em; margin-right: -.3em; }
  .site-name .hl + .hl { padding-left: 0; }
  .site-name .hp { margin-right: -1.3em; }       /* 行尾标点挂到行外:居中的是字,不是字加逗号 */
  .tideline { margin: 12px auto 6px; width: min(320px, 90%); }
  .tagline { font-size: 13.5px; letter-spacing: .22em; }
  .entry { min-width: 0; width: min(100%, 420px); margin-top: 28px; text-align: left; }
  .feature-card { height: auto; width: min(76vw, 420px); }
  .feature::before { display: none; }
  .feature-card .name { font-size: 26px; }
  .wall-cap { position: static; justify-content: center; flex-wrap: wrap; margin-top: -10px; }
  .ripple-hint { flex-basis: 100%; margin: 0 0 4px; padding: 0; border: 0; text-align: center; }
  .shelf { padding: 4px 16px 20px; }
  .mini-card { width: 112px; }
}
