/* AI自媒体全量运营 - 沉浸式游戏UI */
:root {
  --bg: #05060f;
  --bg2: #0a0e24;
  --neon: #00f0ff;
  --neon2: #7b5cff;
  --neon3: #ff3df0;
  --gold: #ffd166;
  --text: #e8f0ff;
  --muted: #8a97c4;
  --card: rgba(18, 24, 56, 0.55);
  --card-brd: rgba(0, 240, 255, 0.25);
  --ok: #2bff88;
  --err: #ff4d6d;
  --grad: linear-gradient(135deg, #00f0ff 0%, #7b5cff 50%, #ff3df0 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#bg-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}

/* 扫描线叠层 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, transparent 0, transparent 3px,
    rgba(0, 240, 255, 0.018) 3px, rgba(0, 240, 255, 0.018) 4px);
  mix-blend-mode: screen;
}

.app { position: relative; z-index: 2; min-height: 100vh; }

/* ------- 顶部导航 ------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px);
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(5,6,15,0.85), rgba(5,6,15,0.35));
  border-bottom: 1px solid rgba(0,240,255,0.12);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: clamp(15px, 2.4vw, 20px);
  letter-spacing: 1px;
}
.logo .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad);
  display: grid; place-items: center;
  box-shadow: 0 0 22px rgba(0,240,255,0.6);
  animation: pulse 2.6s ease-in-out infinite;
}
.logo .mark svg { width: 20px; height: 20px; }
.logo .ai { background: var(--grad); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.nav-right { display: flex; gap: 10px; align-items: center; }

/* ------- 按钮 ------- */
.btn {
  position: relative; cursor: pointer; border: none; outline: none;
  padding: 11px 22px; border-radius: 12px; font-size: 14px; font-weight: 700;
  color: var(--text); background: rgba(255,255,255,0.04);
  border: 1px solid rgba(0,240,255,0.3);
  transition: transform .15s ease, box-shadow .2s ease, background .2s;
  letter-spacing: .5px;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(0,240,255,0.25); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--grad); color: #06070f; border: none;
  box-shadow: 0 6px 24px rgba(123,92,255,0.45);
}
.btn-primary:hover { box-shadow: 0 12px 36px rgba(255,61,240,0.5); }
.btn-ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ------- 容器 ------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: clamp(20px, 4vw, 56px) clamp(16px, 4vw, 40px); }

/* ------- Hero ------- */
.hero { text-align: center; padding: clamp(40px, 8vw, 90px) 0 clamp(30px, 5vw, 60px); }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: 12px;
  background: rgba(0,240,255,0.08); border: 1px solid rgba(0,240,255,0.3);
  color: var(--neon); margin-bottom: 22px;
  animation: fadeUp .8s ease both;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 10px var(--ok); animation: pulse 1.5s infinite; }
.hero h1 {
  font-size: clamp(32px, 7vw, 72px); font-weight: 900; line-height: 1.08;
  letter-spacing: -1px; margin-bottom: 18px;
  animation: fadeUp .9s ease .05s both;
}
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text;
  background-clip: text; color: transparent;
  background-size: 200% 200%; animation: gradShift 6s ease infinite; }
.hero p.sub {
  font-size: clamp(15px, 2.2vw, 20px); color: var(--muted); max-width: 720px;
  margin: 0 auto 30px; line-height: 1.7;
  animation: fadeUp 1s ease .15s both;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  animation: fadeUp 1.1s ease .25s both; }

/* 数据条 */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin: clamp(36px, 6vw, 64px) 0;
}
.stat {
  background: var(--card); border: 1px solid var(--card-brd);
  border-radius: 16px; padding: 20px 14px; text-align: center;
  backdrop-filter: blur(10px); position: relative; overflow: hidden;
  transition: transform .25s, border-color .25s;
}
.stat:hover { transform: translateY(-4px); border-color: var(--neon); }
.stat::before {
  content: ""; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0,240,255,0.12), transparent);
  animation: sweep 4s infinite;
}
.stat .num {
  font-size: clamp(22px, 4vw, 34px); font-weight: 900;
  background: var(--grad); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ------- 功能卡片 ------- */
.section-title {
  text-align: center; font-size: clamp(22px, 4vw, 38px); font-weight: 900;
  margin-bottom: 8px;
}
.section-title .grad { background: var(--grad); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 36px;
  font-size: clamp(13px, 1.8vw, 16px); }

.features {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.fcard {
  position: relative; background: var(--card);
  border: 1px solid var(--card-brd); border-radius: 20px;
  padding: 26px 22px; cursor: pointer; overflow: hidden;
  backdrop-filter: blur(12px);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s;
  animation: fadeUp .8s ease both;
}
.fcard:nth-child(2) { animation-delay: .08s; }
.fcard:nth-child(3) { animation-delay: .16s; }
.fcard:nth-child(4) { animation-delay: .24s; }
.fcard::after {
  content: ""; position: absolute; inset: -1px; border-radius: 20px;
  padding: 1px; background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s;
}
.fcard:hover { transform: translateY(-6px) scale(1.01); box-shadow: 0 20px 50px rgba(123,92,255,0.25); }
.fcard:hover::after { opacity: 1; }
.fcard .icon {
  width: 56px; height: 56px; border-radius: 16px; font-size: 28px;
  display: grid; place-items: center; margin-bottom: 16px;
  background: rgba(0,240,255,0.08); border: 1px solid rgba(0,240,255,0.25);
  box-shadow: inset 0 0 20px rgba(0,240,255,0.15);
}
.fcard h3 { font-size: 19px; margin-bottom: 8px; }
.fcard .tag { color: var(--neon); font-size: 13px; margin-bottom: 10px; font-weight: 600; }
.fcard p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.fcard .go {
  margin-top: 18px; display: inline-flex; align-items: center; gap: 6px;
  color: var(--neon); font-weight: 700; font-size: 13px;
}
.fcard:hover .go { gap: 12px; }

/* ------- 弹窗/模态 ------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(3,5,15,0.7); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 16px;
}
.modal-mask.show { display: flex; animation: fadeIn .25s ease; }
.modal {
  width: 100%; max-width: 440px; background: linear-gradient(160deg, #0d1230, #070a1c);
  border: 1px solid rgba(0,240,255,0.3); border-radius: 22px;
  padding: 30px 26px; position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 60px rgba(0,240,255,0.12);
  animation: pop .35s cubic-bezier(.2,.9,.3,1.2);
}
.modal.wide { max-width: 560px; }
.modal h2 { font-size: 22px; margin-bottom: 6px; }
.modal .mh-sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.modal .close {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text); font-size: 14px; outline: none; transition: border-color .2s;
}
.field input:focus, .field textarea:focus { border-color: var(--neon); }
.field .cap-row { display: flex; gap: 10px; }
.field .cap-q {
  flex: 0 0 auto; padding: 12px 16px; border-radius: 12px; font-weight: 800;
  background: rgba(0,240,255,0.1); border: 1px solid rgba(0,240,255,0.3);
  color: var(--neon); font-size: 16px; min-width: 90px; text-align: center;
}
.modal .switch { text-align: center; margin-top: 14px; color: var(--muted); font-size: 13px; }
.modal .switch a { color: var(--neon); cursor: pointer; font-weight: 600; }
.modal .err-msg { color: var(--err); font-size: 13px; margin-top: 10px; min-height: 18px; }
.modal .btn { width: 100%; margin-top: 6px; }

/* ------- 体验流程页 ------- */
.flow { max-width: 760px; margin: 0 auto; }
.steps {
  display: flex; justify-content: space-between; margin-bottom: 36px;
  position: relative; gap: 6px;
}
.steps::before {
  content: ""; position: absolute; top: 18px; left: 5%; right: 5%; height: 2px;
  background: rgba(0,240,255,0.15); z-index: 0;
}
.step {
  position: relative; z-index: 1; text-align: center; flex: 1;
  font-size: 12px; color: var(--muted);
}
.step .dot {
  width: 38px; height: 38px; border-radius: 50%; margin: 0 auto 8px;
  display: grid; place-items: center; font-weight: 800;
  background: #0c1130; border: 2px solid rgba(0,240,255,0.25);
  transition: all .3s;
}
.step.active .dot {
  background: var(--grad); color: #06070f; border-color: transparent;
  box-shadow: 0 0 22px rgba(0,240,255,0.7);
}
.step.done .dot { background: var(--ok); color: #06070f; border-color: transparent; }
.step.active { color: var(--text); }

.panel {
  background: var(--card); border: 1px solid var(--card-brd);
  border-radius: 22px; padding: clamp(22px, 4vw, 38px);
  backdrop-filter: blur(14px); text-align: center;
}
.panel h2 { font-size: clamp(20px, 3.4vw, 28px); margin-bottom: 10px; }
.panel p { color: var(--muted); line-height: 1.7; margin-bottom: 20px; }

.qr-box {
  width: 240px; height: 240px; margin: 18px auto; border-radius: 18px;
  background: #fff; padding: 14px; position: relative;
  box-shadow: 0 0 50px rgba(0,240,255,0.4);
  animation: qrPulse 2s ease-in-out infinite;
}
.qr-box img { width: 100%; height: 100%; object-fit: cover; background:#fff; border-radius:8px; display:block; }
.qr-box img.qr-broken { object-fit:contain; padding:20px; opacity:.7; }
.qr-loading { display:grid; place-items:center; height:100%; color:#8aa0c8; font-size:14px; }
.qr-loading .dots { display:inline-block; width:24px; text-align:left; }
.qr-loading .dots i { animation: qrdot 1.2s infinite; font-style:normal; }
.qr-loading .dots i:nth-child(2) { animation-delay:.2s; }
.qr-loading .dots i:nth-child(3) { animation-delay:.4s; }
@keyframes qrdot { 0%,60%,100%{opacity:.2;} 30%{opacity:1;} }
.qr-box .scan {
  position: absolute; left: 8%; right: 8%; height: 3px;
  background: linear-gradient(90deg, transparent, var(--neon), transparent);
  box-shadow: 0 0 14px var(--neon); animation: scan 1.8s linear infinite;
}
.qr-hint { color: var(--neon); font-weight: 700; margin-top: 10px; font-size: 14px; }

/* 运行中动画 */
.running-anim {
  width: 180px; height: 180px; margin: 20px auto; position: relative;
}
.running-anim .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--neon); border-right-color: var(--neon2);
  animation: spin 1.2s linear infinite;
}
.running-anim .ring.r2 { inset: 18px; border-top-color: var(--neon3);
  border-right-color: var(--gold); animation-duration: 1.8s; animation-direction: reverse; }
.running-anim .core {
  position: absolute; inset: 42px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center;
  font-size: 40px; box-shadow: 0 0 40px rgba(123,92,255,0.7);
}
.log-stream {
  text-align: left; background: rgba(0,0,0,0.4); border-radius: 12px;
  padding: 14px 16px; margin: 18px 0; font-family: ui-monospace, "Cascadia Code",
    "Consolas", monospace; font-size: 12.5px; max-height: 180px; overflow-y: auto;
  border: 1px solid rgba(0,240,255,0.15);
}
.log-stream .line { color: var(--muted); margin: 3px 0; }
.log-stream .line .t { color: var(--neon); margin-right: 8px; }
.log-stream .line.ok { color: var(--ok); }
.log-stream .line.act { color: var(--gold); }

/* 结果展示 */
.result-box { text-align: left; }
.result-box h3 { color: var(--neon); margin-bottom: 14px; font-size: 18px; }
.result-html {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(0,240,255,0.15);
  border-radius: 14px; padding: 20px; line-height: 1.8; color: #d6e0ff;
}
.result-html h4 { color: var(--gold); margin: 14px 0 8px; font-size: 15px; }
.result-html h4:first-child { margin-top: 0; }
.result-html ul { padding-left: 20px; }
.result-html li { margin: 5px 0; color: #c4cff0; }
.result-html .score {
  font-size: 42px; font-weight: 900; text-align: center;
  background: var(--grad); -webkit-background-clip: text;
  background-clip: text; color: transparent; margin: 8px 0;
}
.result-meta { color: var(--muted); font-size: 12px; margin-top: 14px; text-align: center; }

/* ------- 联系提示 ------- */
.contact-card {
  text-align: center; padding: 28px 20px;
}
.contact-card .phone {
  font-size: clamp(24px, 5vw, 34px); font-weight: 900; letter-spacing: 2px;
  background: var(--grad); -webkit-background-clip: text;
  background-clip: text; color: transparent; margin: 14px 0;
  user-select: all;
}

/* ------- 管理后台 ------- */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 18px; }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.admin-tabs .tab {
  padding: 9px 18px; border-radius: 10px; cursor: pointer; font-size: 14px;
  background: rgba(255,255,255,0.04); border: 1px solid transparent;
  color: var(--muted); font-weight: 600; white-space: nowrap;
}
.admin-tabs .tab.active { color: var(--neon); border-color: rgba(0,240,255,0.4);
  background: rgba(0,240,255,0.08); }
.admin-tabs .tab.spacer { margin-left: auto; background: transparent; border: none; cursor: default; color: var(--muted); padding: 0; pointer-events: none; }
.table-wrap {
  background: var(--card); border: 1px solid var(--card-brd);
  border-radius: 16px; overflow-x: auto; overflow-y: hidden;
  backdrop-filter: blur(10px); -webkit-overflow-scrolling: touch;
}
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-thumb { background: rgba(0,240,255,0.3); border-radius: 3px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: rgba(0,0,0,0.2); position: sticky; top: 0; }
tbody td { white-space: normal; }
tbody td.nowrap { white-space: nowrap; }
tr:hover td { background: rgba(0,240,255,0.04); }

/* 移动端卡片列表（由 JS 渲染 .user-cards） */
.user-cards { display: none; }
.ucard {
  background: var(--card); border: 1px solid var(--card-brd);
  border-radius: 14px; padding: 14px; margin-bottom: 12px;
  backdrop-filter: blur(10px);
}
.ucard.is-active { border-color: rgba(0,240,255,0.6); box-shadow: 0 0 18px rgba(0,240,255,0.2); }
.ucard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.ucard-name { font-size: 16px; font-weight: 700; }
.ucard-phone { color: var(--muted); font-size: 12px; margin-top: 2px; }
.ucard-body { font-size: 13px; color: var(--muted); line-height: 1.8; }
.ucard-body b { color: var(--text); font-weight: 600; }
.ucard-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ucard-actions .mini-btn { flex: 1; min-width: 0; padding: 10px 8px; font-size: 13px; text-align: center; }
.pill { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pill.on { background: rgba(43,255,136,0.15); color: var(--ok); }
.pill.off { background: rgba(255,255,255,0.06); color: var(--muted); }
.pill.run { background: rgba(0,240,255,0.15); color: var(--neon); }
.pill.err { background: rgba(255,77,109,0.15); color: var(--err); }
.mini-btn {
  padding: 5px 12px; border-radius: 8px; font-size: 12px; cursor: pointer;
  background: rgba(0,240,255,0.12); border: 1px solid rgba(0,240,255,0.3);
  color: var(--neon); font-weight: 600;
}
.mini-btn.danger { background: rgba(255,77,109,0.12); border-color: rgba(255,77,109,0.3); color: var(--err); }
.mini-btn:disabled { opacity: .4; cursor: default; }
.muted { color: var(--muted); }

/* ------- 通知 toast ------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, #111638, #0a0e24);
  border: 1px solid rgba(0,240,255,0.4); color: var(--text);
  padding: 13px 22px; border-radius: 12px; z-index: 200; font-size: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5); opacity: 0; transition: all .35s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--err); }
.toast.ok { border-color: var(--ok); }

/* ------- footer ------- */
.footer {
  text-align: center; color: var(--muted); font-size: 12px;
  padding: 40px 20px 30px; border-top: 1px solid rgba(255,255,255,0.05); margin-top: 40px;
}

/* ------- 响应式 ------- */
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .nav { padding: 12px 16px; }
  .btn { padding: 10px 16px; font-size: 13px; }
  .modal { padding: 24px 18px; }
  .qr-box { width: 200px; height: 200px; }
  .steps .dot { width: 32px; height: 32px; font-size: 13px; }
  .step { font-size: 10.5px; }
  th, td { padding: 9px 8px; font-size: 12px; }
  .admin-wrap { padding: 16px 12px; }
  .admin-tabs .tab { padding: 8px 12px; font-size: 13px; flex: 1 1 auto; text-align: center; }
  .admin-tabs .tab[style*="margin-left:auto"] { margin-left: 0 !important; flex: 1 1 100%; }
  /* 用户管理：移动端用卡片，隐藏表格 */
  #userTableWrap { display: none; }
  .user-cards { display: block; }
  /* 其他表格允许横向滚动 */
  .table-wrap table { min-width: 560px; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px 8px; }
  .logo { font-size: 15px; }
  .logo .mark { width: 28px; height: 28px; }
  .nav-right .btn { padding: 8px 12px; font-size: 12px; }
}

/* ------- 动画 ------- */
@keyframes fadeUp { from { opacity:0; transform: translateY(20px);} to {opacity:1; transform:none;} }
@keyframes fadeIn { from { opacity:0;} to {opacity:1;} }
@keyframes pop { from {opacity:0; transform: scale(.92) translateY(10px);} to {opacity:1; transform:none;} }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.65;} }
@keyframes gradShift { 0%,100%{background-position:0% 50%;} 50%{background-position:100% 50%;} }
@keyframes sweep { 0%{left:-100%;} 60%,100%{left:100%;} }
@keyframes spin { to { transform: rotate(360deg);} }
@keyframes scan { 0%{top:10%;} 50%{top:88%;} 100%{top:10%;} }
@keyframes qrPulse {
  0%,100%{box-shadow:0 0 40px rgba(0,240,255,0.4);}
  50%{box-shadow:0 0 70px rgba(123,92,255,0.7);}
}
