/* ========== 幻方游戏工作室 · 协议签署中心（前台样式） ========== */
:root {
  --primary: #5b6cff;
  --primary-2: #8b5cf6;
  --grad-main: linear-gradient(135deg, #5b6cff 0%, #8b5cf6 100%);
  --grad-deep: linear-gradient(135deg, #161c38 0%, #252c52 100%);
  --cyan: #38bdf8;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;
  --ink: #1b2138;
  --ink-2: #55607a;
  --ink-3: #9aa3b8;
  --bg: #f3f5fb;
  --line: #e7eaf3;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(27, 33, 56, .08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* 背景柔和光斑装饰 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 12% -5%, rgba(91,108,255,.10), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(139,92,246,.08), transparent 60%),
    radial-gradient(500px 500px at 50% 110%, rgba(56,189,248,.07), transparent 60%);
}
a { text-decoration: none; color: var(--primary); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* ===== 顶栏 ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(231,234,243,.9);
}
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; height: 62px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; color: #141a33; letter-spacing: .5px; }
.logo-badge {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad-main); color: #fff;
  font-size: 17px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(91,108,255,.35); flex-shrink: 0;
}
.logo-sub {
  font-size: 12px; font-weight: 500; color: var(--ink-3); background: #f0f2fa;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.nav-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hi {
  font-size: 13px; color: var(--ink-2); background: #f4f6fd; border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.btn-mini {
  font-size: 13px; color: #4b5570; padding: 7px 16px; border: 1px solid #d9def0;
  border-radius: 999px; background: #fff; transition: .2s; white-space: nowrap;
}
.btn-mini:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.btn-mini-blue {
  background: var(--grad-main); color: #fff !important; border: none;
  box-shadow: 0 4px 12px rgba(91,108,255,.32);
}
.btn-mini-blue:hover { opacity: .92; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(91,108,255,.4); }

/* ===== 主体 ===== */
.main { padding: 28px 0 48px; }
.notice { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 14px; line-height: 1.6; }
.notice.warn { background: #fff8e6; border: 1px solid #fde4a6; color: #9a6b00; }

/* ===== 协议卡片 ===== */
.agreement-card {
  background: #fff; border-radius: 20px; box-shadow: var(--shadow);
  padding: 36px 42px; position: relative; overflow: hidden; border: 1px solid rgba(231,234,243,.8);
}
.agreement-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--grad-main); }
.agreement-card::after {
  content: ""; position: absolute; top: -60px; right: -60px; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(91,108,255,.08), transparent 70%); pointer-events: none;
}
.agreement-title {
  font-size: 26px; text-align: center; color: #141a38; letter-spacing: .5px;
  margin: 6px 0 6px; background: var(--grad-deep);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.agreement-meta { text-align: center; color: var(--ink-3); font-size: 13px; margin-bottom: 24px; }
.agreement-body {
  border: 1px solid #eef0f7; border-radius: 14px; padding: 22px 26px;
  background: linear-gradient(180deg, #fcfcff 0%, #f7f9ff 100%); position: relative; z-index: 1;
}
.agreement-body .block { margin-bottom: 14px; }
.agreement-body .block:last-child { margin-bottom: 0; }
.agreement-body .line { line-height: 2; font-size: 15px; color: #3a4260; text-align: justify; }
.agreement-body .line-title {
  font-weight: 700; color: #151b36; font-size: 16px; position: relative;
  padding-left: 14px; margin: 10px 0 2px;
}
.agreement-body .line-title::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 16px; border-radius: 4px; background: var(--grad-main);
}
.scroll-body { max-height: 480px; overflow: auto; }

/* ===== 签署区 ===== */
.sign-area { margin-top: 28px; border-top: 1px dashed #dfe3f0; padding-top: 26px; position: relative; z-index: 1; }
.sign-tip { font-size: 14px; color: #68728c; text-align: center; margin-bottom: 16px; }
.sign-tip.ok { color: var(--green); font-weight: 700; }
.sign-tip.err { color: var(--red); }
.sign-btns { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.btn-main {
  display: inline-block; background: var(--grad-main); color: #fff !important; border: none;
  border-radius: 12px; padding: 14px 38px; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: .2s; box-shadow: 0 6px 18px rgba(91,108,255,.35); text-align: center;
}
.btn-main:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(91,108,255,.45); }
.btn-main:active { transform: translateY(0); }
.btn-outline {
  display: inline-block; background: #fff; color: var(--primary) !important; border: 1.5px solid var(--primary);
  border-radius: 12px; padding: 13px 36px; font-size: 16px; font-weight: 600; cursor: pointer;
  transition: .2s; text-align: center;
}
.btn-outline:hover { background: #f0f2ff; transform: translateY(-2px); }
.btn-block { display: block; width: 100%; margin-top: 8px; }
.agree-check {
  display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: #3f4964;
  margin-bottom: 16px; line-height: 1.7; justify-content: center;
  background: #f6f8ff; border: 1px solid #e6e9fb; border-radius: 12px; padding: 14px 16px;
}
.agree-check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--primary); flex-shrink: 0; }
.sign-ok {
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857;
  border-radius: 12px; padding: 14px 16px; text-align: center; font-weight: 600; font-size: 14px;
}

/* ===== 签署记录 ===== */
.card-list {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow);
  padding: 24px 28px; margin-top: 20px; border: 1px solid rgba(231,234,243,.8);
}
.card-list h3 { font-size: 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-list table { width: 100%; border-collapse: collapse; }
.card-list th {
  text-align: left; padding: 10px 12px; background: #f6f8fd; font-size: 13px;
  color: #6a7590; border-bottom: 1px solid #eef0f7; font-weight: 600;
}
.card-list td { padding: 11px 12px; font-size: 14px; border-bottom: 1px solid #f3f5fb; color: #3a4260; }
.card-list tr:last-child td { border-bottom: none; }
.card-list tbody tr:hover td { background: #fafbff; }
.empty { color: var(--ink-3); font-size: 14px; padding: 18px 0; text-align: center; }

.foot-tip { text-align: center; color: #a2abc0; font-size: 12px; margin-top: 30px; }

/* ===== 登录 / 注册页 ===== */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; overflow: hidden;
  background:
    radial-gradient(800px 600px at 15% 0%, #333e86 0%, transparent 55%),
    radial-gradient(700px 500px at 100% 100%, #6d3fbf 0%, transparent 55%),
    linear-gradient(135deg, #12162e 0%, #1c2350 60%, #1a1f45 100%);
}
.auth-page::before {
  content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.08); top: -140px; right: -120px;
}
.auth-page::after {
  content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.06); bottom: -100px; left: -90px;
}
.auth-card {
  background: rgba(255,255,255,.97); border-radius: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.35);
  padding: 38px 38px 32px; width: 100%; max-width: 420px; position: relative; z-index: 1;
}
.auth-logo {
  width: 56px; height: 56px; border-radius: 16px; background: var(--grad-main); color: #fff;
  font-size: 26px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; box-shadow: 0 8px 20px rgba(91,108,255,.4);
}
.auth-card h2 { text-align: center; color: #161c38; font-size: 23px; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--ink-3); font-size: 13px; margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: #4b5570; margin-bottom: 7px; }
.field input {
  width: 100%; padding: 12px 14px; border: 1.5px solid #dde2f2; border-radius: 11px;
  font-size: 15px; outline: none; transition: .2s; background: #fbfcff; color: var(--ink);
}
.field input::placeholder { color: #b4bcd0; }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(91,108,255,.14); background: #fff; }
.row { display: flex; gap: 10px; }
.row input { flex: 1; }
.row .btn-mini-blue { flex-shrink: 0; }
.auth-error {
  background: #fff1f0; border: 1px solid #ffd5d2; color: #c62828;
  border-radius: 10px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px;
}
.auth-links { display: flex; justify-content: space-between; margin-top: 22px; font-size: 13px; color: #8b93ab; }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9cfdf; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #aab2c9; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .wrap { padding: 0 12px; }
  .agreement-card { padding: 24px 18px; border-radius: 16px; }
  .agreement-title { font-size: 21px; }
  .logo-sub { display: none; }
  .logo { font-size: 16px; }
  .hi { display: none; }
  .btn-main { padding: 13px 26px; font-size: 15px; }
  .auth-card { padding: 30px 22px; }
  .agree-check { flex-direction: column; align-items: center; text-align: center; }
}

/* ============================================================
   P3 动态背景美化层 — 柔和光晕 + 光斑粒子 + 点阵网格 + 进度条
   说明：仅追加视觉样式，不影响任何功能与配置；配合 js/bg.js 使用
   ============================================================ */
#bg-anim {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none; overflow: hidden;
}
#bg-anim canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}
.bg-blob {
  position: absolute; border-radius: 50%; filter: blur(58px); will-change: transform;
  animation: bgBlobDrift var(--dur,26s) ease-in-out infinite;
  animation-delay: var(--delay,0s);
}
@keyframes bgBlobDrift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  33%  { transform: translate3d(var(--tx1,4vw),var(--ty1,-3vh),0) scale(1.1); }
  66%  { transform: translate3d(var(--tx2,-4vw),var(--ty2,3vh),0) scale(.92); }
  100% { transform: translate3d(0,0,0) scale(1); }
}
#bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(91,108,255,.14) 1px, transparent 1px);
  background-size: 32px 32px;
  animation: bgGridPan 40s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 0%, transparent 78%);
  opacity: .4;
}
@keyframes bgGridPan {
  from { background-position: 0 0; }
  to   { background-position: 32px 32px; }
}
#scroll-progress {
  position: fixed; top: 0; left: 0; width: 100%; height: 3px;
  z-index: 2000; pointer-events: none;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, #5b6cff, #8b5cf6, #38bdf8);
  box-shadow: 0 0 10px rgba(91,108,255,.45);
  transition: transform .12s linear;
}

/* ---- 协议卡片：顶部流光条 + 悬停浮起 ---- */
.agreement-card { transition: transform .3s cubic-bezier(.4,0,.2,1), box-shadow .3s ease; }
.agreement-card::before {
  background: linear-gradient(90deg, #5b6cff, #8b5cf6, #38bdf8, #5b6cff);
  background-size: 200% 100%;
  animation: agreeBarFlow 5s linear infinite;
}
@keyframes agreeBarFlow {
  from { background-position: 0 0; }
  to   { background-position: 200% 0; }
}
.agreement-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(91,108,255,.16);
}

/* ---- 协议标题流光 ---- */
.agreement-title {
  background-size: 200% auto;
  animation: agreeTitleShimmer 8s linear infinite;
}
@keyframes agreeTitleShimmer {
  to { background-position: 200% center; }
}

/* ---- 主按钮扫光 + 呼吸光晕 ---- */
.btn-main { position: relative; overflow: hidden; }
.btn-main::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -70%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-18deg); transition: left .65s ease;
}
.btn-main:hover::after { left: 130%; }
.btn-main:hover { animation: btnPulse 2.4s ease-in-out infinite; }
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(91,108,255,.35); }
  50% { box-shadow: 0 8px 30px rgba(91,108,255,.55), 0 0 24px rgba(139,92,246,.3); }
}

/* ---- 签署记录卡悬停 ---- */
.card-list { transition: transform .3s ease, box-shadow .3s ease; }
.card-list:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(91,108,255,.14);
}

/* ---- 登录/注册深色页：光环脉动 + 卡片入场 ---- */
.auth-page::before { animation: authRing 9s ease-in-out infinite; }
.auth-page::after { animation: authRing 12s ease-in-out infinite reverse; }
@keyframes authRing {
  0%, 100% { transform: translate(0,0) scale(1); opacity: .8; }
  50% { transform: translate(30px, 24px) scale(1.12); opacity: .45; }
}
.auth-card { animation: cardIn .55s cubic-bezier(.34,1.56,.64,1); }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- 提示框呼吸 ---- */
.notice.warn { animation: warnPulse 2.6s ease-in-out infinite; }
@keyframes warnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,.14); }
  50% { box-shadow: 0 0 0 6px rgba(245,158,11,0); }
}

/* ---- 减弱动态支持 ---- */
@media (prefers-reduced-motion: reduce) {
  .bg-blob, #bg-grid, .agreement-card::before, .agreement-title,
  .btn-main:hover, .auth-page::before, .auth-page::after, .notice.warn {
    animation: none !important;
  }
}

/* ============================================================
   多协议签署中心（前台协议列表）
   ============================================================ */
.center-head { text-align: center; margin-bottom: 26px; }
.center-title {
  font-size: 28px; font-weight: 800; letter-spacing: .5px;
  background: var(--grad-deep);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.center-sub { color: var(--ink-3); font-size: 14px; margin-top: 6px; }

.agree-list { display: flex; flex-direction: column; gap: 14px; }
.agree-item {
  display: flex; align-items: stretch; justify-content: space-between; gap: 18px;
  background: #fff; border: 1px solid rgba(231,234,243,.9); border-radius: 18px;
  box-shadow: var(--shadow); padding: 22px 26px; position: relative; overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.agree-item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--grad-main); border-radius: 0 4px 4px 0; opacity: .9;
}
.agree-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(91,108,255,.16);
  border-color: rgba(91,108,255,.28);
}
.agree-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.agree-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.agree-name { font-size: 18px; font-weight: 800; color: #141a38; }
.agree-badge {
  font-size: 12px; font-weight: 700; color: var(--primary); background: #eef0ff;
  border: 1px solid #dbe0ff; padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.agree-meta { color: #4b5570; font-size: 14px; line-height: 1.7; }
.agree-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.agree-date { color: var(--ink-3); font-size: 12px; }
.status-badge {
  font-size: 12px; font-weight: 700; padding: 3px 11px; border-radius: 999px; white-space: nowrap;
}
.status-badge.ok {
  color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0;
}
.status-badge.todo {
  color: #9a6b00; background: #fffbeb; border: 1px solid #fde68a;
}
.agree-side { display: flex; align-items: center; flex-shrink: 0; }
.btn-sm { padding: 11px 22px; font-size: 14px; border-radius: 11px; }
.code-tag {
  font-size: 11px; color: #8a94ad; background: #f0f2fa; border-radius: 6px;
  padding: 1px 7px; margin-left: 6px; vertical-align: 1px; font-family: ui-monospace, monospace;
}
.muted { color: var(--ink-3); font-size: 13px; }

@media (max-width: 640px) {
  .agree-item { flex-direction: column; padding: 18px 16px; gap: 14px; }
  .agree-side { justify-content: flex-start; }
  .center-title { font-size: 23px; }
}
