/* ============ 十二原型 · 哥特秘仪卡牌 — 样式 ============ */
:root {
  --bg: #050507;
  --gold: #c6a766;
  --gold-soft: rgba(198, 166, 103, 0.55);
  --ivory: #d9d1bd;
  --dim: #847a66;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ivory);
  font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', Georgia, 'Times New Roman', serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* ---------- 背景 ---------- */
.bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 50% 125%, rgba(122, 82, 40, 0.14), transparent 62%),
    radial-gradient(800px 420px at 50% 112%, rgba(168, 100, 34, 0.16), transparent 68%),
    radial-gradient(1500px 950px at 50% -18%, rgba(38, 30, 72, 0.30), transparent 62%),
    #050507;
}
.bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 46%, transparent 52%, rgba(0, 0, 0, 0.62) 100%);
}

/* ---------- 页头 ---------- */
.head {
  position: absolute; top: 0; left: 0; right: 0; z-index: 40;
  text-align: center; padding: 34px 16px 0; pointer-events: none;
}
.kicker {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 10px; letter-spacing: 0.55em; text-indent: 0.55em;
  color: rgba(198, 166, 103, 0.72);
}
.title {
  display: flex; align-items: baseline; justify-content: center;
  margin-top: 12px; font-weight: 400;
}
.title .zh {
  font-size: 42px; font-weight: 900; letter-spacing: 0.3em; text-indent: 0.3em;
  color: #e8e0cc;
  text-shadow: 0 0 26px rgba(198, 166, 103, 0.35), 0 2px 3px rgba(0,0,0,.8);
}
.title .dot {
  color: var(--gold); font-size: 17px; margin: 0 26px; text-shadow: 0 0 14px rgba(230,180,90,.6);
}
.title .en {
  font-family: 'Cinzel', Georgia, serif; font-size: 19px; font-weight: 600;
  letter-spacing: 0.42em; text-indent: 0.42em; color: var(--gold-soft);
  text-shadow: 0 0 20px rgba(198,166,103,.25);
}
.sub {
  margin-top: 13px; font-size: 11.5px; letter-spacing: 0.32em; text-indent: 0.32em;
  color: var(--dim);
}
.sub::before, .sub::after { content: " ── "; color: rgba(198,166,103,.35); }
.head::after {
  content: ""; display: block; width: min(640px, 78vw); height: 1px; margin: 22px auto 0;
  background: linear-gradient(90deg, transparent, rgba(198,166,103,.4), transparent);
}

/* ---------- 3D 场景 ---------- */
.world {
  position: absolute; left: 0; right: 0; top: 96px; bottom: 0; z-index: 5;
  transform-origin: 50% 44%;
}
.floor {
  position: absolute; left: 50%; top: 60%;
  width: 1500px; height: 460px; margin-left: -750px;
  background: radial-gradient(ellipse closest-side, rgba(200, 140, 56, 0.17), transparent 64%);
  filter: blur(26px);
  animation: floorPulse 7s ease-in-out infinite;
}
@keyframes floorPulse {
  0%, 100% { opacity: .75; }
  50% { opacity: 1; }
}
.mist {
  position: absolute; left: -20%; width: 140%; height: 220px; top: 52%;
  background: radial-gradient(ellipse closest-side, rgba(150, 130, 190, 0.05), transparent 70%);
  filter: blur(40px); pointer-events: none;
}
.m1 { animation: drift1 26s linear infinite alternate; }
.m2 { animation: drift2 34s linear infinite alternate; opacity: .7; }
@keyframes drift1 { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
@keyframes drift2 { from { transform: translateX(5%); } to { transform: translateX(-7%); } }

.stage {
  position: absolute; inset: 0;
  perspective: 1500px;
  perspective-origin: 50% 44%;
}
.carousel {
  position: absolute; left: 50%; top: 44%; width: 0; height: 0;
  transform-style: preserve-3d;
}
/* iOS 兼容 */
.stage { -webkit-perspective: 1500px; }
.card, .lift, .flip3d { -webkit-transform-style: preserve-3d; }

/* ---------- 卡牌 ---------- */
.card {
  position: absolute; left: 0; top: 0;
  width: 188px; height: 300px;
  margin-left: -94px; margin-top: -150px;
  transform-style: preserve-3d;
  cursor: pointer;
  will-change: transform;
}
.lift {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.2, 0.75, 0.25, 1.1);
}
.card:hover .lift {
  transform: translateZ(120px) scale(1.09);
}
.flip3d {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.85s cubic-bezier(0.32, 0.15, 0.22, 1);
}
.card.open .flip3d { transform: rotateY(180deg); }

.face {
  position: absolute; inset: 0;
  border-radius: 13px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  transform: translateZ(0.5px);
  transition: filter 0.5s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  animation: faceIn 1.1s ease both;
}
.back { transform: rotateY(180deg); }
@keyframes faceIn {
  from { opacity: 0; filter: blur(7px); }
  to   { opacity: 1; filter: blur(0); }
}

/* 其他卡牌在翻开时沉入暗处 */
.carousel.has-open .card:not(.open) .face {
  filter: brightness(0.42) saturate(0.65);
  animation: none;
}

/* ---- 卡面正 / 反基础 ---- */
.front {
  background:
    radial-gradient(130% 80% at 50% -6%, rgba(255, 255, 255, 0.055), transparent 55%),
    radial-gradient(150% 130% at 50% 116%, rgba(var(--acc-rgb), 0.10), transparent 58%),
    linear-gradient(180deg, #17151c, #0c0b11 58%, #100d12);
  border: 1px solid rgba(198, 166, 103, 0.55);
  box-shadow:
    0 22px 46px -22px rgba(0, 0, 0, 0.92),
    0 0 0 1px rgba(0, 0, 0, 0.75),
    inset 0 0 60px rgba(0, 0, 0, 0.62),
    inset 0 0 90px rgba(var(--acc-rgb), 0.05);
}
.back {
  background:
    radial-gradient(120% 70% at 50% -5%, rgba(255, 255, 255, 0.045), transparent 55%),
    radial-gradient(160% 140% at 50% 118%, rgba(var(--acc-rgb), 0.13), transparent 60%),
    linear-gradient(180deg, #16131c, #0b0a10 55%, #0d0b11);
  border: 1px solid rgba(var(--acc-rgb), 0.42);
  box-shadow:
    0 22px 46px -22px rgba(0, 0, 0, 0.92),
    0 0 0 1px rgba(0, 0, 0, 0.75),
    inset 0 0 60px rgba(0, 0, 0, 0.6);
}
.card:hover .face {
  border-color: rgba(var(--acc-rgb), 0.95);
  box-shadow:
    0 26px 54px -20px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(var(--acc-rgb), 0.28),
    0 0 52px -8px rgba(var(--acc-rgb), 0.5),
    inset 0 0 60px rgba(0, 0, 0, 0.55),
    inset 0 0 100px rgba(var(--acc-rgb), 0.10);
}

/* 纹章与纹样 */
.frame {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.frame path, .frame rect {
  fill: none;
  stroke: rgba(198, 166, 103, 0.42);
  stroke-width: 1;
}
.wm {
  position: absolute; left: 50%; top: 50%;
  width: 230%; height: 230%;
  transform: translate(-50%, -50%) rotate(-9deg);
  color: var(--acc); opacity: 0.055;
  pointer-events: none;
}
.wm .glyph { stroke-width: 0.9; fill: none; }

.sigil { width: 112px; height: 112px; }
.sigil .emblem { width: 100%; height: 100%; display: block; }
.sigil .glyph { stroke: var(--acc); stroke-width: 2.4; fill: none; opacity: 0.95; }
.front:hover .sigil .glyph { filter: drop-shadow(0 0 8px rgba(var(--acc-rgb), 0.55)); }

/* ---- 正面布局 ---- */
.f-top {
  position: absolute; top: 12px; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0 17px;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 9.5px; letter-spacing: 0.32em;
  color: rgba(220, 204, 168, 0.72);
}
.f-top .f-cat { color: rgba(var(--acc-rgb), 0.95); font-size: 9px; font-weight: 600; }
.f-inner {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 48px;
}
.f-inner .sigil { margin-bottom: 18px; }
.f-name {
  font-size: 27px; font-weight: 900; line-height: 1.25;
  letter-spacing: 0.3em; text-indent: 0.3em;
  color: #eee6d2;
  text-shadow: 0 0 20px rgba(var(--acc-rgb), 0.4), 0 1px 2px rgba(0, 0, 0, 0.9);
}
.f-div {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 0 10px;
  color: var(--gold); font-size: 9px;
}
.f-div::before, .f-div::after {
  content: ""; width: 22px; height: 1px;
}
.f-div::before { background: linear-gradient(90deg, transparent, rgba(198, 166, 103, 0.75)); }
.f-div::after  { background: linear-gradient(90deg, rgba(198, 166, 103, 0.75), transparent); }
.f-en {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 9.5px; font-weight: 500; letter-spacing: 0.46em; text-indent: 0.46em;
  color: rgba(220, 208, 180, 0.6);
}
.f-base {
  position: absolute; bottom: 12px; left: 0; right: 0; text-align: center;
  color: rgba(198, 166, 103, 0.55); font-size: 8px; letter-spacing: 0.6em; text-indent: 0.6em;
}

/* ---- 背面布局 ---- */
.b-inner {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 18px 17px 13px;
  overflow: hidden;
}
.b-kicker {
  flex: none;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 8px; letter-spacing: 0.5em; text-indent: 0.5em;
  color: rgba(var(--acc-rgb), 0.9);
}
.b-title {
  flex: none;
  margin-top: 5px;
  font-size: 24px; font-weight: 900; line-height: 1.18;
  letter-spacing: 0.24em; text-indent: 0.24em;
  color: #f0e8d4;
  text-shadow: 0 0 22px rgba(var(--acc-rgb), 0.45);
}
.b-en {
  flex: none;
  margin-top: 2px;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 8px; letter-spacing: 0.38em; text-indent: 0.38em;
  color: rgba(220, 208, 180, 0.62);
}
.b-en::after {
  content: ""; display: block; width: 26px; height: 1px; margin: 6px auto 0;
  background: linear-gradient(90deg, transparent, rgba(var(--acc-rgb), 0.8), transparent);
}
.b-motto {
  flex: none;
  margin-top: 8px;
  font-family: 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
  font-size: 13px; font-weight: 500; letter-spacing: 0.16em; text-indent: 0.16em;
  color: rgba(var(--acc-rgb), 1);
  text-shadow: 0 0 12px rgba(var(--acc-rgb), 0.35);
}
.b-desc {
  /* 弹性区：空间紧张时优先在此收敛并裁切，确保下方徽章与阴影永不越界 */
  flex: 1 1 auto; min-height: 0;
  margin: 9px 0 7px;
  font-size: 11.5px; font-weight: 300; line-height: 1.8;
  letter-spacing: 0.05em;
  color: #d3cab4;
  text-align: justify;
  overflow: hidden;
}
.b-keys {
  flex: none;
  display: flex; gap: 5px; justify-content: center; flex-wrap: wrap;
  max-width: 100%;
  margin: 0 0 8px;
}
.chip {
  white-space: nowrap;
  font-size: 9.5px; line-height: 1.1;
  letter-spacing: 0.08em; text-indent: 0.08em;
  color: #e5dcc6;
  border: 1px solid rgba(var(--acc-rgb), 0.4);
  border-radius: 999px;
  padding: 2px 7px 2px calc(7px + 0.08em);
  background: rgba(var(--acc-rgb), 0.08);
}
.b-shadow {
  flex: none;
  width: 100%;
  padding-top: 7px;
  border-top: 1px solid rgba(198, 166, 103, 0.16);
  font-size: 10px; line-height: 1.6; letter-spacing: 0.06em;
  color: #9a90a3;
}
.b-shadow .lbl {
  display: inline-block;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 7.5px; letter-spacing: 0.36em;
  color: rgba(var(--acc-rgb), 0.85);
  margin-right: 8px;
  vertical-align: 1px;
}

/* ---------- 底部十二原型导航 ---------- */
.names {
  position: absolute; left: 0; right: 0; bottom: 20px; z-index: 30;
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 3px 7px; padding: 0 14px;
}
.n-item {
  background: none;
  border: 1px solid transparent;
  color: rgba(217, 209, 189, 0.4);
  font-family: 'Noto Serif SC', serif;
  font-size: 11px; letter-spacing: 0.18em; text-indent: 0.18em;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.n-item:hover {
  color: #f2ead6;
  border-color: rgba(var(--ar), 0.55);
}
.n-item.lit {
  color: #fff;
  border-color: rgba(var(--ar), 0.6);
  background: rgba(var(--ar), 0.09);
  box-shadow: 0 0 16px -4px rgba(var(--ar), 0.5);
}
.n-item .no {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 8.5px; color: rgba(198, 166, 103, 0.7); margin-right: 4px;
}

.credit {
  position: absolute; left: 20px; bottom: 24px; z-index: 30;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 8.5px; letter-spacing: 0.34em;
  color: rgba(217, 209, 189, 0.28);
  pointer-events: none;
}

/* 移动端更小卡片时帧/水印 svg 同样等比缩放 */
.face { -webkit-backface-visibility: hidden; }

/* ================= 移动端适配（≤760px） ================= */
@media (max-width: 760px) {
  .head { padding: 16px 10px 0; }
  .kicker { display: none; }
  .title { margin-top: 6px; }
  .title .zh { font-size: 29px; letter-spacing: 0.26em; text-indent: 0.26em; }
  .title .dot { font-size: 12px; margin: 0 13px; }
  .title .en { font-size: 11.5px; letter-spacing: 0.3em; text-indent: 0.3em; }
  .sub { display: none; }
  .head::after { margin: 13px auto 0; width: 56vw; }

  .world { top: 70px; }
  .credit { display: none; }
  .floor { width: 120vw; left: 50%; margin-left: -60vw; top: 55%; }

  .stage { perspective-origin: 50% 44%; }
  .carousel { top: 45%; }

  .card { width: 150px; height: 240px; margin-left: -75px; margin-top: -120px; }
  .face { border-radius: 10px; }

  /* 正面 */
  .f-top { top: 9px; padding: 0 12px; font-size: 7px; letter-spacing: 0.24em; }
  .f-top .f-cat { font-size: 7px; }
  .f-inner { padding-top: 36px; }
  .f-inner .sigil { width: 84px; height: 84px; margin-bottom: 12px; }
  .f-name { font-size: 20px; letter-spacing: 0.22em; text-indent: 0.22em; }
  .f-div { margin: 5px 0 7px; font-size: 8px; gap: 6px; }
  .f-div::before, .f-div::after { width: 15px; }
  .f-en { font-size: 7.5px; letter-spacing: 0.34em; text-indent: 0.34em; }
  .f-base { bottom: 9px; font-size: 7px; letter-spacing: 0.5em; text-indent: 0.5em; }

  /* 背面 */
  .b-inner { padding: 13px 12px 10px; }
  .b-kicker { font-size: 6.5px; letter-spacing: 0.4em; text-indent: 0.4em; }
  .b-title { margin-top: 4px; font-size: 19px; letter-spacing: 0.2em; text-indent: 0.2em; }
  .b-en { margin-top: 1px; font-size: 6.8px; letter-spacing: 0.3em; text-indent: 0.3em; }
  .b-en::after { width: 20px; margin: 5px auto 0; }
  .b-motto { margin-top: 6px; font-size: 11px; letter-spacing: 0.14em; text-indent: 0.14em; }
  .b-desc { margin: 6px 0 5px; font-size: 10px; line-height: 1.72; letter-spacing: 0.04em; }
  .b-keys { gap: 4px; margin: 0 0 5px; }
  .chip { font-size: 8px; line-height: 1.05; letter-spacing: 0.06em; text-indent: 0.06em;
          padding: 1.5px 6px 1.5px calc(6px + 0.06em); }
  .b-shadow { padding-top: 5px; font-size: 8.5px; line-height: 1.5; }
  .b-shadow .lbl { font-size: 6.5px; margin-right: 6px; }

  /* 底部导航：单行横滑 */
  .names {
    bottom: 6px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px 5px;
    padding: 0 8px 4px;
    -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
            mask-image: linear-gradient(90deg, #000 92%, transparent);
  }
  .names::-webkit-scrollbar { display: none; }
  .n-item { flex: none; font-size: 10px; letter-spacing: 0.12em; text-indent: 0.12em; padding: 5px 8px; }
  .n-item .no { font-size: 7px; margin-right: 3px; }

  .card, .n-item { touch-action: manipulation; }
}

/* 触屏设备：去掉 hover 放大/悬停辉光残留 */
@media (hover: none), (pointer: coarse) {
  .card:hover .lift { transform: none; }
  .card:hover .face {
    border-color: rgba(var(--acc-rgb), 0.5);
    box-shadow:
      0 22px 46px -22px rgba(0, 0, 0, 0.92),
      0 0 0 1px rgba(0, 0, 0, 0.75),
      inset 0 0 60px rgba(0, 0, 0, 0.6);
  }
}
