/* ============================================================================
 * auth.css —— 名帖闸门（入宫前）与名帖窗（入宫后）
 * 依据：art-bible §2（色板 · 只引语义层）§7.5（动效纪律：只动 transform / opacity）
 *
 * 🔒 只用 tokens.css 的语义层变量，不写第二套色。
 * 🔒 闸门是 body 直属层（不在 #app 内）：它要盖住整屏，且在游戏渲染之前就能出现。
 * 🔒 全局禁红：校验不通过用「低亮 + 一句话」表达，不用红框红字（§7.4）。
 * ========================================================================== */

/* ============================ 通用：遮罩层 ============================ */
.auth-layer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.auth-layer[data-open="1"] { display: flex; }

/* 名帖窗浮在游戏之上，闸门则要彻底盖死 */
.auth-layer .auth-veil {
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: .96;
}
#auth-modal .auth-veil { opacity: .82; }

/* 夜色：一层极轻的自上而下渐变，呼应首页夜景，不喧宾夺主 */
.auth-layer .auth-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% -8%, var(--lingguang-glow), transparent 62%);
  opacity: .5;
}

/* ============================ 名帖卡 ============================ */
.auth-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 20px 18px;
  animation: authRise var(--dur-progress) var(--ease-enter) both;
}
@keyframes authRise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-cap {
  font-family: var(--font-sutra);
  font-size: 22px;
  letter-spacing: .16em;
  text-align: center;
  color: var(--text-1);
}
.auth-sub {
  margin: 6px 0 16px;
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
}

/* ---------- 双联签（新立 / 持帖） ---------- */
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  margin-bottom: 16px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
}
.auth-tab {
  flex: 1 1 0;
  min-height: 36px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--dur-inter) var(--ease-standard);
}
.auth-tab[data-on="1"] {
  background: var(--surface);
  color: var(--text-1);
  border: 1px solid var(--border);
}

/* ---------- 字段 ---------- */
.auth-field { margin-bottom: 12px; }
.auth-field > label {
  display: block;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--text-2);
  margin-bottom: 5px;
}
.auth-input {
  width: 100%;
  min-height: var(--tap);
  padding: 0 14px;
  font: inherit;
  font-size: 15px;
  color: var(--text-1);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  -webkit-appearance: none;
  appearance: none;
}
.auth-input::placeholder { color: var(--text-3); }
.auth-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

/* ---------- 提示条（🔒 无红：不成立只是「暗」，不是「错」） ---------- */
.auth-msg {
  min-height: 20px;
  margin: 2px 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--waning);
}
.auth-msg[data-tone="ok"] { color: var(--ok-text); }
.auth-msg:empty { margin-bottom: 4px; }

.auth-submit { width: 100%; }

/* ---------- 名录（本机已有的名帖，一点即填） ---------- */
.auth-known {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.auth-known-cap {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.auth-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.auth-chip {
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  transition: transform var(--dur-micro) var(--ease-standard);
}
.auth-chip:active { transform: scale(.97); }

.auth-foot {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-3);
  text-align: center;
}

/* ============================ 名帖窗（入宫后） ============================ */
.auth-rows {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.auth-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 12px;
  font-size: 14px;
  background: var(--surface);
}
.auth-row + .auth-row { border-top: 1px solid var(--border); }
.auth-row .k { flex: 0 0 66px; color: var(--text-2); font-size: 12px; letter-spacing: .08em; }
.auth-row .v { color: var(--text-1); word-break: break-all; }

.auth-sec {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.auth-sec-cap {
  font-family: var(--font-sutra);
  font-size: 14px;
  letter-spacing: .1em;
  color: var(--text-1);
  margin-bottom: 8px;
}
.auth-sec-note {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-3);
  margin: 0 0 8px;
}
.auth-inline { display: flex; gap: 8px; align-items: center; }
.auth-inline .auth-input { flex: 1 1 auto; }
.auth-inline .btn { flex: 0 0 auto; padding: 0 14px; min-height: 40px; }

.auth-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.auth-actions .btn { flex: 1 1 0; }

/* 销号：不用红，用「褪色 + 虚线框」表达不可逆的重量 */
.btn-grave {
  border: 1px dashed var(--hairline);
  color: var(--waning);
  background: transparent;
  font-weight: 600;
}

.auth-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-3);
}

/* 销号确认区 */
.auth-danger {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed var(--hairline);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.auth-danger p {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-2);
}

/* ============================ 顶栏名帖钮 ============================ */
.icon-btn.tight.auth-entry {
  font-family: var(--font-sutra);
  font-size: 15px;
  letter-spacing: 0;
}

@media (prefers-reduced-motion: reduce) {
  .auth-card { animation: none; }
}
