/* ============================================================
   门页皮肤 v3 — 对齐 2026-11-12 概念图（夜馆・铜框・实心金钮）
   只作用于 index.html，加载在 style.css / frame.css / realm.css 之后，按同名覆盖。
   馆内同一套方言在 css/hub-realm.css。
   像素字只走整数倍：12 / 24 / 36 / 48。副标题与署名允许 1.5 倍（18）。
   ============================================================ */

/* 色票与字栈见 css/realm.css（门页与馆内共用）。 */

/* ── 世界层：整幅铺满，不再 contain 留墨边 ── */
.gate-world-stage {
  left: 0; top: 0;
  width: 100%; height: 100%;
  transform: none;
}
.gate-world-base {
  object-fit: cover;
  object-position: 50% 58%;   /* 竖屏裁切时保住书桌与烛火 */
}
/* 面板四周压一点暗，让铜框从书架里浮出来 */
.gate-world::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 70% at 50% 52%, rgba(0,0,0,.30) 0%, rgba(0,0,0,.08) 60%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}

.gate-container {
  padding: 24px 16px;
}

/* ── 铜框面板 ── */
.gate-panel.lib-frame,
.gate-panel {
  width: min(640px, 100%);
  padding: 40px 48px 32px;
  color: var(--g-cream);
  background:
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.62  0 0 0 0 0.68  0 0 0 0 0.78  0 0 0 0.10 0'/%3E%3C/filter%3E%3Crect width='96' height='96' filter='url(%23n)'/%3E%3C/svg%3E") repeat,
    var(--g-slate);
  border: 10px solid var(--g-bronze);
  border-top-color: var(--g-bronze-hi);
  border-left-color: #553019;
  border-bottom-color: var(--g-bronze-lo);
  border-right-color: #2e170b;
  border-radius: 0;
  box-shadow:
    0 0 0 2px var(--g-brass),            /* 外沿亮铜线 */
    0 0 0 4px var(--g-ink),              /* 最外黑线 */
    8px 10px 0 4px rgba(0, 0, 0, .55),   /* 硬投影 */
    inset 0 0 0 1px #7a4523,             /* 框内沿暗铜线 */
    inset 2px 2px 0 1px rgba(255, 255, 255, .04),
    inset -2px -2px 0 1px rgba(0, 0, 0, .45);
}
/* 关掉 frame.css 那条 3px 内虚线，改成石板内凹 */
.gate-panel.lib-frame--ornate::before,
.gate-panel::before {
  content: "";
  position: absolute; inset: 0;
  border: 0;
  box-shadow: inset 0 0 48px rgba(0, 0, 0, .45);
  pointer-events: none;
}

/* 角帽：四个铜方块压在框角上 */
.gate-rivet {
  width: 22px; height: 22px;
  background: var(--g-brass);
  background-image: none;
  border: 2px solid var(--g-ink);
  box-shadow:
    inset 2px 2px 0 var(--g-brass-hi),
    inset -2px -2px 0 #6e3a1b;
  z-index: 3;
}
.gate-rivet-tl { top: -16px; left: -16px; }
.gate-rivet-tr { top: -16px; right: -16px; }
.gate-rivet-bl { bottom: -16px; left: -16px; }
.gate-rivet-br { bottom: -16px; right: -16px; }

/* 角花：石板内侧四个 L 形铜角 */
.gate-flourish {
  width: 14px; height: 14px;
  background-image: none;
  border: 0 solid rgba(217, 149, 90, .55);
  z-index: 2;
}
.gate-flourish-tl { top: 8px;    left: 8px;  border-top-width: 2px; border-left-width: 2px; }
.gate-flourish-tr { top: 8px;    right: 8px; border-top-width: 2px; border-right-width: 2px; }
.gate-flourish-bl { bottom: 8px; left: 8px;  border-bottom-width: 2px; border-left-width: 2px; }
.gate-flourish-br { bottom: 8px; right: 8px; border-bottom-width: 2px; border-right-width: 2px; }

/* ── 馆徽：—◇— 书 —◇— ── */
.gate-crest {
  display: flex; align-items: center; justify-content: center;
  gap: 14px;
  margin: 0 0 14px;
}
.gate-crest .gate-books {
  margin: 0;
  width: 48px; height: 48px;
}
.gate-crest__orn {
  position: relative;
  width: 44px; height: 2px;
  background: var(--g-rule);
}
.gate-crest__orn::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 7px; height: 7px;
  background: var(--g-slate);
  border: 2px solid var(--g-rule);
  transform: translate(-50%, -50%) rotate(45deg);
}

/* ── 字 ── */
.gate-title {
  font-family: var(--g-font-pixel);
  font-size: 48px; line-height: 56px;
  color: var(--g-title);
  text-shadow: 3px 3px 0 rgba(0, 0, 0, .6);
  margin: 0 0 18px;
}
.gate-subtitle {
  font-family: var(--g-font-pixel);
  font-size: 24px; line-height: 32px;
  color: var(--g-cream);
  margin: 0 0 28px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, .5);
}
/* 两行各自带短线。style.css 里那对 ::before/::after 关掉 */
.gate-subtitle::before,
.gate-subtitle::after { content: none; }
.gate-line { display: block; }
.gate-line::before,
.gate-line::after {
  content: "—";
  margin: 0 10px;
  color: var(--g-rule);
}

/* ── 输入井 ── */
.gate-input-wrap {
  min-height: 64px;
  background: var(--g-slate-deep);
  border: 2px solid #2a3148;
  border-radius: 4px;
  box-shadow:
    inset 0 3px 0 rgba(0, 0, 0, .55),
    inset 0 0 0 1px rgba(0, 0, 0, .35);
}
.gate-input-wrap:focus-within {
  border-color: var(--g-btn);
  outline: none;
  box-shadow:
    inset 0 3px 0 rgba(0, 0, 0, .55),
    0 0 0 2px rgba(220, 158, 92, .25);
}
.gate-input-wrap input {
  font-family: var(--g-font-pixel);
  font-size: 24px; line-height: 32px;
  padding: 14px 20px;
  color: var(--g-cream);
  font-synthesis: none;
}
.gate-input-wrap input::placeholder { color: var(--g-faint); }
.gate-toggle {
  width: 40px; height: 40px;
  margin-right: 10px;
  color: var(--g-faint);
}
.gate-toggle svg { width: 22px; height: 22px; }
.gate-toggle:hover { color: var(--g-title); }

/* ── CTA：实心金，斜切硬边 ── */
.gate-panel .gate-btn {
  margin-top: 16px;
  min-height: 64px;
  padding: 12px 24px;
  font-family: var(--g-font-pixel);
  font-size: 24px; line-height: 32px;
  color: var(--g-btn-text);
  background: var(--g-btn);
  border: 3px solid;
  border-color: #7a4f22 #2a1406 #130200 #5a3618;
  border-radius: 4px;
  box-shadow:
    inset 0 3px 0 var(--g-btn-hi),
    inset 0 -4px 0 var(--g-btn-lo),
    4px 4px 0 rgba(0, 0, 0, .55);
  text-shadow: 1px 1px 0 rgba(255, 230, 190, .35);
}
.gate-panel .gate-btn:hover {
  background: var(--g-btn-hover);
  border-color: #8a5a28 #2a1406 #130200 #6a4320;
  box-shadow:
    inset 0 3px 0 #f8d7a0,
    inset 0 -4px 0 var(--g-btn-lo),
    4px 4px 0 rgba(0, 0, 0, .55);
  color: var(--g-btn-text);
}
.gate-panel .gate-btn:active {
  background: #c98d4e;
  border-color: #2a1406 #7a4f22 #5a3618 #130200;
  box-shadow:
    inset 0 3px 0 rgba(0, 0, 0, .25),
    2px 2px 0 rgba(0, 0, 0, .55);
}
.gate-panel .gate-btn:disabled {
  opacity: .55;
  box-shadow: none;
}

.gate-error {
  font-family: var(--g-font-pixel);
  font-size: 18px; line-height: 24px;
  color: #e07a6a;
  padding-left: 2px;
}

/* ── 守则勾选 ── */
.gate-rules { margin-top: 22px; }
.gate-rules-check {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  font-family: var(--g-font-pixel);
  font-size: 18px; line-height: 24px;
  color: var(--g-muted);
}
.gate-rules-check input[type="checkbox"] {
  width: 22px; height: 22px;
  border: 2px solid var(--g-btn);
  border-radius: 3px;
  background: rgba(0, 0, 0, .35);
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .5);
}
.gate-rules-check input[type="checkbox"]:checked {
  background: var(--g-btn);
  border-color: var(--g-btn);
  box-shadow: inset 0 2px 0 var(--g-btn-hi);
}
.gate-rules-check input[type="checkbox"]:checked::after {
  left: 6px; top: 2px;
  width: 6px; height: 11px;
  border: 3px solid var(--g-btn-text);
  border-top: none; border-left: none;
}
.gate-rules-check a {
  font-size: 18px;
  white-space: nowrap;
  color: var(--g-link);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}
.gate-rules-check a:hover { color: var(--g-title); }
.gate-rules-content {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--g-muted);
  border-left-color: rgba(217, 149, 90, .45);
}

.gate-footer {
  margin-top: 22px;
  font-family: var(--g-font-pixel);
  font-size: 18px; line-height: 24px;
  color: var(--g-faint);
}

/* ── 窄屏：面板贴边浮在世界层上，字号退一档 ── */
@media (max-width: 600px) {
  .gate-container { align-items: center; padding: 28px 18px; }
  .gate-panel.lib-frame,
  .gate-panel { padding: 30px 22px 24px; border-width: 8px; }
  .gate-rivet { width: 18px; height: 18px; }
  .gate-rivet-tl { top: -13px; left: -13px; }
  .gate-rivet-tr { top: -13px; right: -13px; }
  .gate-rivet-bl { bottom: -13px; left: -13px; }
  .gate-rivet-br { bottom: -13px; right: -13px; }
  .gate-title { font-size: 36px; line-height: 44px; margin-bottom: 14px; }
  .gate-subtitle { font-size: 18px; line-height: 26px; margin-bottom: 22px; }
  .gate-line::before, .gate-line::after { margin: 0 6px; }
  .gate-input-wrap { min-height: 56px; }
  .gate-input-wrap input { font-size: 18px; line-height: 24px; padding: 12px 16px; }
  .gate-panel .gate-btn { min-height: 56px; font-size: 24px; }
  .gate-rules-check, .gate-rules-check a, .gate-footer { font-size: 16px; }
  .gate-rules-check { gap: 8px; }
  .gate-rules-check input[type="checkbox"] { width: 18px; height: 18px; }
  .gate-rules-check input[type="checkbox"]:checked::after { left: 4px; top: 1px; width: 5px; height: 9px; }
}

@media (prefers-reduced-motion: no-preference) {
  .gate-panel .gate-btn { transition: background var(--transition), border-color var(--transition), box-shadow var(--transition); }
}

/* ── 登录后的欢迎黑屏：和馆名同一张像素脸 ── */
.welcome-text {
  font-family: var(--g-font-pixel);
  font-size: 24px; line-height: 40px;
  color: var(--g-title);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, .6);
}

/* ── 游戏界面层：扫描线、对话框光标、按钮按压 ── */
.gate-world::before {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .14) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.gate-caret {
  display: inline-block;
  width: 12px; height: 22px;
  margin-left: 4px;
  vertical-align: -3px;
  background: var(--g-title);
  animation: g-blink 1s steps(1) infinite;
}
.gate-panel .gate-btn:active {
  transform: translate(2px, 2px);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, .25), 1px 1px 0 rgba(0, 0, 0, .55);
}
