/* ============================================================================
   OPHET — 账户系统补充样式（登录 / 注册 / 账户中心 / 占位页）
   仅补充 main.css 未覆盖的表单与卡片排版，复用 main.css 全部 token 与组件。
   不新建配色，红金双主题、字体、圆角、角标一律沿用 main.css 变量。
   ============================================================================ */

/* 登录页头部精简：只留 brand + 返回 CTA + 主题切换 */
body[data-page="auth"] .site-head .wrap { justify-content: space-between; }

/* 居中容纳卡片的页面骨架 */
.auth-wrap {
  min-height: calc(100svh - var(--head-h));
  display: flex;
  align-items: center;
  padding-top: calc(var(--head-h) + clamp(32px, 6vw, 64px));
  padding-bottom: clamp(48px, 8vw, 96px);
  position: relative;
  overflow: hidden;
}
.auth-wrap::after {
  content: "";
  position: absolute;
  top: -10%; right: -10%;
  width: 55%; height: 120%;
  background: radial-gradient(ellipse 70% 60% at 70% 30%, rgba(var(--glow), 0.07), transparent 70%);
  pointer-events: none;
}
.auth-wrap .wrap { position: relative; z-index: 1; max-width: 760px; }
.auth-wrap .crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-3);
  margin-bottom: 24px;
}
.auth-wrap .crumb a { color: var(--bone-3); transition: color 0.2s; }
.auth-wrap .crumb a:hover { color: var(--laser); }
.auth-wrap .crumb .sep { color: var(--laser); }

/* 主卡片 */
.auth-card {
  background: var(--ink-1);
  border: 1px solid var(--line);
  padding: clamp(28px, 4vw, 52px);
  max-width: 540px;
}
.auth-h { font-size: clamp(26px, 3.2vw, 38px); margin-bottom: 12px; }
.auth-sub { color: var(--bone-2); font-size: 14.5px; margin-bottom: 28px; max-width: 46ch; }

/* 账户中心可放宽 */
.auth-card.wide { max-width: 640px; }

/* 表单字段 */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-2);
  margin-bottom: 9px;
}
.field label i { color: var(--laser); font-style: normal; margin-left: 3px; }
.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--bone);
  background: var(--ink-0);
  border: 1px solid var(--line-2);
  padding: 13px 15px;
  transition: border-color 0.25s, background 0.25s;
}
.field input::placeholder { color: var(--bone-3); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--laser);
  background: var(--ink-1);
  box-shadow: 0 0 0 1px var(--laser), 0 0 14px rgba(var(--glow), 0.18);
}
.field input.invalid { border-color: var(--laser); }
.field-err {
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--laser);
}
.field-hint {
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--bone-3);
}

/* 同意勾选（PIPL 告知同意） */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 6px 0 24px;
  font-size: 13.5px;
  color: var(--bone-2);
  line-height: 1.7;
}
.consent input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-top: 3px;
  border: 1px solid var(--line-2);
  background: var(--ink-0);
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}
.consent input[type="checkbox"]:checked {
  border-color: var(--laser);
  background: var(--laser);
}
.consent input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.consent input[type="checkbox"]:focus-visible { outline: 2px solid var(--laser); outline-offset: 2px; }
.consent a { color: var(--laser); }
.consent a:hover { text-decoration: underline; }

/* 表单内联行（忘记密码等） */
.form-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 22px;
}
.form-link {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--gold);
  transition: color 0.2s;
}
.form-link:hover { color: var(--laser); }

/* 提交按钮占满宽度 */
.auth-submit { width: 100%; justify-content: center; }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-foot {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--bone-2);
}

/* 全局提示条（成功 / 失败） */
.form-alert {
  border: 1px solid var(--laser);
  background: rgba(var(--glow), 0.06);
  color: var(--bone);
  font-size: 13.5px;
  line-height: 1.7;
  padding: 12px 16px;
  margin-bottom: 22px;
}
.form-alert.ok {
  border-color: var(--gold);
  background: rgba(140, 116, 64, 0.08);
}

/* 页面级注脚（小字法律 / 安全说明） */
.auth-legal {
  margin-top: 22px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--bone-3);
  text-align: center;
}

/* ---------- 账户中心专属 ---------- */
.acct-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 28px; }
.acct-row {
  background: var(--ink-1);
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
}
.acct-row .k {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-3);
}
.acct-row .v { font-size: 15px; color: var(--bone); word-break: break-all; }

/* 等级徽章 */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  padding: 5px 12px;
  border: 1px solid var(--line-2);
  color: var(--bone);
}
.level-badge::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(140, 116, 64, 0.5);
}
.level-badge.is-customer { border-color: var(--laser); color: var(--laser); }
.level-badge.is-customer::before { background: var(--laser); box-shadow: 0 0 8px rgba(var(--glow), 0.7); }
.level-badge.is-admin { border-color: var(--laser); color: var(--laser); }

/* 兑换框 */
.redeem {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.redeem input {
  flex: 1;
  min-width: 200px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  font-size: 14px;
  color: var(--bone);
  background: var(--ink-0);
  border: 1px solid var(--line-2);
  padding: 12px 15px;
  text-transform: uppercase;
}
.redeem input:focus {
  outline: none;
  border-color: var(--laser);
  box-shadow: 0 0 0 1px var(--laser);
}
.redeem .btn { white-space: nowrap; }

/* 资料权限说明列表 */
.perm-list { list-style: none; display: grid; gap: 12px; margin-top: 6px; }
.perm-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--bone-2);
}
.perm-list li .perm-tag {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  color: var(--gold);
  margin-top: 1px;
}
.perm-list li.locked { color: var(--bone-3); }
.perm-list li.locked .perm-tag { color: var(--bone-3); }
.perm-list li.unlocked .perm-tag { color: var(--laser); border-color: var(--laser); }

/* 账户中心小节标题 */
.acct-sec-h {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bone-2);
  margin: 32px 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.acct-sec-h::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* 邮箱验证状态文案 */
.acct-row .v.is-verified { color: var(--gold); }
.acct-row .v.is-unverified { color: var(--laser); }

/* 邮箱待验证提示条（温和告知 + 重发按钮） */
.verify-banner[hidden] { display: none; }   /* flex 会覆盖 [hidden] 默认 display:none，需显式声明 */
.verify-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  border: 1px solid var(--gold);
  background: rgba(140, 116, 64, 0.08);
  padding: 13px 16px;
  margin-bottom: 28px;
}
.verify-banner-txt {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--bone);
}
.verify-banner .btn { white-space: nowrap; }

/* 退出按钮（ghost 复用 .btn.ghost；这里仅给布局） */
.acct-actions { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- 占位页（privacy / terms） ---------- */
.placeholder-note {
  border: 1px dashed var(--line-2);
  background: var(--ink-1);
  padding: clamp(24px, 4vw, 40px);
  color: var(--bone-2);
  font-size: 15px;
  line-height: 1.9;
  margin: 24px 0 32px;
}
.placeholder-note strong { color: var(--bone); }

/* 门禁按钮三态着色（downloads.html，复用 .dl-btn 基底） */
.dl-btn.gate-locked { color: var(--bone-2); border-color: var(--line-2); }
.dl-btn.gate-upgrade { color: var(--gold); border-color: var(--gold); }
.dl-btn.gate-ok { color: var(--laser); border-color: var(--laser); }
.dl-btn[aria-busy="true"] { opacity: 0.5; pointer-events: none; }
.dl-btn.is-downloading { opacity: 0.7; pointer-events: none; }

@media (max-width: 560px) {
  .acct-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ============================================================================
   许可协议弹层（modal）—— 客户层资料首次下载需同意，正文用 textContent 渲染
   复用 main.css 全部 token；红金双主题、角标、字体一律沿用，不新建配色。
   ============================================================================ */
html.lic-open { overflow: hidden; }

.lic-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;                 /* 高于 site-head(100) / 进度条(120) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);
  background: rgba(10, 6, 7, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.2s var(--ease, ease);
}
.lic-overlay.is-in { opacity: 1; }

.lic-dialog {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: calc(100svh - clamp(32px, 8vw, 80px));
  display: flex;
  flex-direction: column;
  background: var(--ink-1);
  border: 1px solid var(--line-2);
  padding: clamp(24px, 3.5vw, 40px);
  box-shadow: 0 24px 80px rgba(10, 6, 7, 0.45);
  transform: translateY(14px) scale(0.985);
  transition: transform 0.22s var(--ease, ease);
}
.lic-overlay.is-in .lic-dialog { transform: none; }
.lic-dialog:focus { outline: none; }

.lic-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.lic-h {
  font-size: clamp(20px, 2.6vw, 27px);
  line-height: 1.25;
  margin-bottom: 18px;
}

/* 协议正文：可滚动区域，等宽便于阅读条款 */
.lic-body {
  flex: 1 1 auto;
  min-height: 80px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--bone-2);
  background: var(--ink-0);
  border: 1px solid var(--line);
  padding: 16px 18px;
  margin-bottom: 18px;
}
.lic-body:focus-visible { outline: 2px solid var(--laser); outline-offset: 2px; }

.lic-alert {
  border: 1px solid var(--laser);
  background: rgba(var(--glow), 0.06);
  color: var(--bone);
  font-size: 13px;
  line-height: 1.6;
  padding: 10px 14px;
  margin-bottom: 16px;
}

/* 勾选行：复用 .consent 视觉语言（自绘勾选框） */
.lic-agree {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 22px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--bone-2);
  cursor: pointer;
}
.lic-agree input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-top: 2px;
  border: 1px solid var(--line-2);
  background: var(--ink-0);
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}
.lic-agree input[type="checkbox"]:checked {
  border-color: var(--laser);
  background: var(--laser);
}
.lic-agree input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.lic-agree input[type="checkbox"]:focus-visible { outline: 2px solid var(--laser); outline-offset: 2px; }

.lic-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.lic-confirm:disabled { opacity: 0.5; cursor: not-allowed; }
.lic-confirm:disabled::before { display: none; }

@media (max-width: 480px) {
  .lic-actions { flex-direction: column-reverse; }
  .lic-actions .btn { width: 100%; justify-content: center; }
}
