/* Dorothy 空间设计系统 · 2026-11
   半沉浸语言：锁屏容器、拱门=空间、道具=付费物、双子守望。
   被 index.html（枢纽）、pricing/（道具商店）与三个空间页共用。 */

:root {
  --space-bg: #0b0817;
  --space-bg-2: #17102e;
  --space-ink: #fbf3e8;
  --space-muted: rgba(251, 243, 232, .64);
  --space-line: rgba(244, 205, 154, .16);
  --space-gold: #d9a45c;
  --space-rose: #e8b6c8;
  --space-rose-deep: #c82858;
  --space-violet: #8d75d6;
  --space-panel: rgba(20, 15, 38, .62);
  --space-panel-strong: rgba(22, 16, 42, .9);
}

/* ── 空间底色 ── */
.space-scene {
  min-height: 100svh;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(141, 117, 214, .16), transparent 55%),
    radial-gradient(90% 70% at 85% 110%, rgba(200, 40, 88, .10), transparent 60%),
    linear-gradient(180deg, var(--space-bg) 0%, var(--space-bg-2) 100%);
  color: var(--space-ink);
  overflow: hidden;
}

/* ── 拱门 ── */
.arch-door {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--space-ink);
  border-radius: 999px 999px 14px 14px;
  padding: 7px 7px 12px;
  background: linear-gradient(180deg, rgba(244, 205, 154, .32), rgba(141, 117, 214, .16) 55%, rgba(20, 15, 38, .4));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(244, 205, 154, .18);
  transition: transform .35s ease, box-shadow .35s ease, filter .35s ease;
}
.arch-door .arch-img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4.1;
  border-radius: 999px 999px 10px 10px;
  overflow: hidden;
  background: #120b24;
}
.arch-door .arch-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .92;
  transition: transform .5s ease, opacity .35s ease;
}
.arch-door .arch-name {
  margin-top: 10px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 19px;
  letter-spacing: .04em;
}
.arch-door .arch-line {
  margin: 3px 0 4px;
  font-size: 12.5px;
  color: var(--space-muted);
  text-align: center;
  padding: 0 8px 2px;
  line-height: 1.35;
}
.arch-door::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(251, 243, 232, .14), transparent 30%);
  opacity: 0;
  transition: opacity .4s ease;
}
.arch-door:hover, .arch-door:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 26px 64px rgba(0, 0, 0, .55), 0 0 34px rgba(217, 164, 92, .18), inset 0 0 0 1px rgba(244, 205, 154, .34);
  filter: saturate(1.08);
}
.arch-door:hover .arch-img img { transform: scale(1.05); opacity: 1; }
.arch-door:hover::after { opacity: 1; }

/* ── 空间返回键（每个空间左上角） ── */
.space-return {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--space-ink);
  font-size: 14px;
  background: var(--space-panel);
  border: 1px solid var(--space-line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color .3s ease, transform .3s ease;
}
.space-return:hover { border-color: rgba(244, 205, 154, .5); transform: translateX(-2px); }
.space-return .glyph {
  font-family: "Great Vibes", cursive;
  font-size: 19px;
  color: var(--space-gold);
  line-height: 1;
}

/* ── 道具卡（道具商店用） ── */
.prop-card {
  position: relative;
  border-radius: 18px;
  padding: 22px;
  background: var(--space-panel);
  border: 1px solid var(--space-line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prop-card .prop-kicker {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--space-gold);
}
.prop-card .prop-name {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 22px;
  line-height: 1.25;
}
.prop-card .prop-desc { font-size: 14px; color: var(--space-muted); line-height: 1.55; }
.prop-card .prop-price {
  font-size: 24px;
  font-family: "Playfair Display", Georgia, serif;
  color: var(--space-ink);
}
.prop-card .prop-buy {
  margin-top: auto;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 12px 20px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  color: #1c1026;
  background: linear-gradient(135deg, #e9c98d, var(--space-gold));
  transition: transform .25s ease, box-shadow .25s ease;
}
.prop-card .prop-buy:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(217, 164, 92, .28); }
.prop-card .prop-buy[disabled] { opacity: .55; cursor: wait; transform: none; box-shadow: none; }

/* ── 卡背（卡组扇形用，纯 CSS 无需图片） ── */
.card-back {
  width: 74px;
  height: 118px;
  border-radius: 9px;
  background:
    radial-gradient(80% 60% at 50% 32%, rgba(232, 182, 200, .5), transparent 62%),
    repeating-linear-gradient(45deg, rgba(141, 117, 214, .22) 0 2px, transparent 2px 9px),
    linear-gradient(160deg, #241740, #171029 70%, #1d1136);
  border: 1px solid rgba(244, 205, 154, .34);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
  display: grid;
  place-items: center;
}
.card-back::before {
  content: "✦";
  font-size: 22px;
  color: rgba(244, 205, 154, .8);
  text-shadow: 0 0 14px rgba(217, 164, 92, .5);
}

/* ── 面板切换 ── */
.panel-swap { animation: panelIn .45s ease both; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 枢纽场景（首页主视口） ── */
.space-hub {
  position: relative;
  min-height: calc(100svh - var(--nav-h, 88px));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 2.2vh, 26px) 20px clamp(12px, 2vh, 32px);
}
/* 首页沿用 .hero 外壳：.hero .wrap 的双列网格与 .hero p.sub 的版式要靠更高优先级压过 */
.space-hub .wrap.hub-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2.4vh, 28px);
  padding-top: 0;
  padding-bottom: 0;
  text-align: center;
  max-width: 1020px;
  width: 100%;
}
.hub-avatar {
  width: clamp(64px, 11.5vh, 128px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(244, 205, 154, .45);
  box-shadow: 0 0 38px rgba(141, 117, 214, .38), 0 16px 44px rgba(0, 0, 0, .5);
}
.hub-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.92); }
.space-hub .hub-head { display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1.2vh, 12px); }
.space-hub h1.headline { font-size: clamp(1.9rem, min(5vw, 6vh), 3.4rem); }
.space-hub p.sub.hub-sub { margin-top: 0; max-width: 620px; font-size: clamp(.92rem, 2.1vh, 1.05rem); line-height: 1.6; }
.arch-row {
  display: flex;
  gap: clamp(12px, 2.6vw, 28px);
  justify-content: center;
  align-items: stretch;
  width: 100%;
}
/* 拱门宽度跟随视口高度收缩，传送门行才能始终落在首屏内 */
.space-hub .arch-row .arch-door { width: clamp(120px, min(21vw, calc((100svh - 355px) * .44)), 232px); }
.portal-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.portal-row a {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(244, 205, 154, .26);
  background: rgba(20, 15, 38, .5);
  color: var(--space-ink);
  text-decoration: none;
  font-size: 14px;
  transition: border-color .3s ease, transform .3s ease, background .3s ease;
}
.portal-row a:hover {
  border-color: rgba(244, 205, 154, .6);
  background: rgba(30, 22, 56, .7);
  transform: translateY(-2px);
}

@media (min-width: 721px) and (max-height: 780px) {
  .space-hub .arch-door .arch-line { display: none; }
  .space-hub .arch-row .arch-door { width: clamp(120px, min(21vw, calc((100svh - 320px) * .48)), 232px); }
}

@media (max-width: 720px) {
  .space-hub { --nav-h: 94px; min-height: calc(var(--app-height, 100svh) - var(--nav-h)); padding: 12px 4px 16px; }
  .space-hub .wrap.hub-wrap { gap: clamp(10px, 1.9vh, 18px); padding-left: 14px; padding-right: 14px; }
  .space-hub .hub-avatar { width: clamp(56px, 8.5vh, 88px); }
  .space-hub h1.headline { font-size: clamp(1.75rem, 7.6vw, 2.2rem); }
  .space-hub p.sub.hub-sub { font-size: .88rem; line-height: 1.5; }
  .space-hub .arch-row { gap: 10px; }
  .space-hub .arch-row .arch-door { width: clamp(96px, min(29vw, calc((100svh - 500px) * .6)), 132px); }
  .space-hub .arch-door .arch-name { font-size: clamp(13px, 3.7vw, 15px); }
  .portal-row { flex-wrap: nowrap; justify-content: flex-start; max-width: 100%; overflow-x: auto; gap: 8px; scrollbar-width: none; }
  .portal-row::-webkit-scrollbar { display: none; }
  .portal-row a { flex: none; padding: 7px 11px; font-size: 12px; }
  .portal-row a:first-child { margin-left: auto; }
  .portal-row a:last-child { margin-right: auto; }
}

@media (max-width: 720px) {
  .arch-door .arch-line { display: none; }
  .arch-door .arch-name { font-size: 15px; margin-top:  7px; }
  .prop-card { padding: 17px; }
}
