/* ===== Zaka 卡密系统 · 视觉系统 v2（浅色高级版）===== */
:root {
  --bg: #f6f7fb;
  --bg-2: #eef1f8;
  --card: #ffffff;
  --line: #e8ebf3;
  --line-2: #dfe4ef;
  --txt: #0f172a;
  --txt-2: #334155;
  --sub: #64748b;
  --sub-2: #94a3b8;
  --pri: #4f46e5;
  --pri-2: #7c3aed;
  --cyan: #06b6d4;
  --ok: #10b981;
  --warn: #f59e0b;
  --err: #ef4444;
  --radius: 22px;
  --radius-sm: 13px;
  --shadow: 0 28px 64px -34px rgba(15, 23, 42, .34), 0 2px 8px rgba(15, 23, 42, .05);
  --shadow-sm: 0 8px 24px -16px rgba(15, 23, 42, .35);
  --ring: 0 0 0 4px rgba(79, 70, 229, .14);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(720px 420px at 8% -8%, rgba(99, 102, 241, .17), transparent 62%),
    radial-gradient(680px 400px at 96% 2%, rgba(168, 85, 247, .14), transparent 60%),
    radial-gradient(620px 420px at 50% 106%, rgba(6, 182, 212, .11), transparent 64%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, .035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, .035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
}

a { color: var(--pri); text-decoration: none; transition: .18s; }
a:hover { color: #4338ca; }

.wrap { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 0 20px 72px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(232, 235, 243, .9);
}
.topbar-in {
  max-width: 1080px; margin: 0 auto; padding: 0 20px;
  height: 66px; display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 750; color: var(--txt); letter-spacing: -.2px; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 12px;
  background: linear-gradient(140deg, #6366f1, #a855f7 55%, #06b6d4);
  display: grid; place-items: center; font-size: 17px; color: #fff;
  box-shadow: 0 10px 20px -10px rgba(99, 102, 241, .95);
  overflow: hidden; flex: 0 0 36px;
}
.brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.brand span { font-size: 16.5px; }
.topbar .spacer { flex: 1; }
.top-link {
  color: var(--sub); font-size: 14px; padding: 8px 14px; border-radius: 11px;
  border: 1px solid transparent; transition: .18s; font-weight: 500;
}
.top-link:hover { color: var(--txt); background: #f4f5fa; border-color: var(--line); }
.top-link.primary {
  color: #fff; background: linear-gradient(135deg, var(--pri), var(--pri-2));
  border: 0; box-shadow: 0 12px 22px -12px rgba(79, 70, 229, .95);
}
.top-link.primary:hover { transform: translateY(-1px); color: #fff; }

/* ---------- 英雄区 ---------- */
.hero { padding: 56px 0 34px; text-align: center; }
.hero h1 {
  margin: 0 0 14px; font-size: 40px; line-height: 1.2; letter-spacing: -1.2px; font-weight: 800;
  background: linear-gradient(115deg, #1e1b4b 10%, #4f46e5 52%, #a855f7 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 0; color: var(--sub); font-size: 15.5px; }
.hero .badges { margin-top: 22px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.badge {
  font-size: 13px; color: #475569; padding: 7px 15px; border-radius: 999px;
  background: rgba(255, 255, 255, .85); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); display: inline-flex; align-items: center; gap: 7px;
}
.badge i { font-style: normal; color: var(--ok); font-size: 9px; }

/* ---------- 卡片 ---------- */
.panel {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise .5s cubic-bezier(.22, .61, .36, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.tabs {
  display: flex; gap: 6px; padding: 14px 16px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); background: #fbfcfe;
}
.tab {
  border: 1px solid transparent; background: transparent; color: #475569;
  padding: 9px 17px; border-radius: 12px; font-size: 14px; cursor: pointer;
  transition: .18s; font-family: inherit; font-weight: 550;
}
.tab:hover { color: var(--txt); background: #f1f3f9; }
.tab.on {
  color: #4338ca;
  background: #eef2ff;
  border-color: #dbe3fb;
  box-shadow: none;
  font-weight: 650;
}
.pane { display: none; padding: 30px 32px 34px; }
.pane.on { display: block; animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.pane h3 {
  margin: 0 0 6px; font-size: 19px; letter-spacing: -.4px; font-weight: 750;
  position: relative; padding-left: 13px;
}
.pane h3::before {
  content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; border-radius: 3px;
  background: linear-gradient(180deg, #6366f1, #a855f7);
}
.panel::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 2;
  background: linear-gradient(90deg, #6366f1, #a855f7 45%, #06b6d4);
  opacity: .95;
}
.pane .desc { color: #64748b; font-size: 13.5px; margin: 0 0 24px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 13px; color: var(--txt-2); margin-bottom: 8px; font-weight: 600;
}
.field label em { font-style: normal; color: var(--err); margin-left: 2px; }
.input, select.input, textarea.input {
  width: 100%; padding: 13px 15px; border-radius: var(--radius-sm);
  background: #f8fafc; border: 1.5px solid #d3dae8; color: var(--txt); box-shadow: none;
  font-size: 14.5px; font-family: inherit; transition: .18s; outline: none;
}
.input::placeholder { color: #64748b; }
.input:hover { border-color: #cfd6e6; }
.input:focus {
  border-color: #6366f1; background: #fff; box-shadow: var(--ring);
}
select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position: calc(100% - 21px) 51%, calc(100% - 15px) 51%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
  padding-right: 38px;
}
textarea.input { resize: vertical; min-height: 86px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row .input { flex: 1; }
.captcha-row img {
  height: 48px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1.5px solid var(--line-2); background: #fff; object-fit: cover;
  transition: .18s;
}
.captcha-row img:hover { border-color: #c7cdf5; }

.btn {
  width: 100%; padding: 14px 20px; border-radius: var(--radius-sm); border: 0; cursor: pointer;
  font-size: 15px; font-weight: 700; font-family: inherit; color: #fff; letter-spacing: .2px;
  background: linear-gradient(135deg, #4338ca, #6d28d9);
  box-shadow: 0 10px 22px -14px rgba(55, 48, 163, .95);
  transition: .2s;
}
.btn:hover { transform: translateY(-1.5px); box-shadow: 0 20px 34px -16px rgba(79, 70, 229, .98); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .65; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost {
  background: #fff; border: 1.5px solid var(--line-2); box-shadow: none; color: var(--txt-2);
}
.btn.ghost:hover { border-color: #c7cdf5; color: var(--pri); background: #fafbff; }
.btn.sm { padding: 9px 16px; font-size: 13px; width: auto; }
.btn.danger { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 14px 26px -16px rgba(220, 38, 38, .9); }
.btn.ok { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 14px 26px -16px rgba(5, 150, 105, .9); }

.hint { font-size: 12.5px; color: var(--sub-2); margin-top: 12px; line-height: 1.75; }
.hint b { color: var(--sub); font-weight: 600; }

/* ---------- 结果提示 ---------- */
.result {
  display: none; margin-top: 18px; padding: 14px 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; border: 1.5px solid; line-height: 1.75;
}
.result.show { display: block; animation: fade .22s ease; }
.result.ok { background: #f0fdf6; border-color: #bbf7d0; color: #047857; }
.result.err { background: #fef5f5; border-color: #fecaca; color: #b91c1c; }

/* ---------- 卡密结果 ---------- */
.codes { margin-top: 16px; display: grid; gap: 9px; max-height: 280px; overflow: auto; }
.code-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 11px; background: #f8faff; border: 1.5px dashed #d6dcf2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: #4338ca;
}
.code-item button {
  background: #fff; border: 1.5px solid var(--line-2); color: var(--sub); border-radius: 8px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; transition: .18s; font-family: inherit;
}
.code-item button:hover { border-color: #c7cdf5; color: var(--pri); }

/* ---------- 统计卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat {
  background: linear-gradient(180deg, #fff, #fbfcff);
  border: 1px solid var(--line); border-radius: 17px; padding: 17px 18px;
  box-shadow: var(--shadow-sm); transition: .2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .k { font-size: 12.5px; color: var(--sub); font-weight: 500; }
.stat .v { font-size: 25px; font-weight: 800; margin-top: 5px; letter-spacing: -.8px; color: var(--txt); }
.stat .v small { font-size: 12.5px; font-weight: 500; color: var(--sub-2); margin-left: 3px; }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
table.tbl th {
  text-align: left; padding: 12px 14px; background: #fafbfe; color: var(--sub);
  font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
table.tbl td { padding: 12px 14px; border-bottom: 1px solid #f1f3f9; color: var(--txt-2); white-space: nowrap; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr { transition: .15s; }
table.tbl tbody tr:hover td { background: #fafbff; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.tag { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.tag.ok { background: #e8f9f1; color: #047857; }
.tag.warn { background: #fef6e7; color: #b45309; }
.tag.err { background: #fdecec; color: #b91c1c; }
.tag.sub { background: #f1f5f9; color: #64748b; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center;
  padding: 22px; background: rgba(15, 23, 42, .42); backdrop-filter: blur(6px);
}
.modal.show { display: flex; animation: fade .2s ease; }
.modal .box {
  width: 100%; max-width: 470px; background: #fff; border: 1px solid var(--line);
  border-radius: 20px; padding: 26px; box-shadow: 0 40px 80px -30px rgba(15, 23, 42, .5);
  animation: rise .3s cubic-bezier(.22, .61, .36, 1);
}
.modal .box h3 { margin: 0 0 12px; font-size: 18px; font-weight: 750; }
.modal .box .body { color: var(--txt-2); font-size: 14px; max-height: 52vh; overflow: auto; line-height: 1.8; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(16px);
  background: #0f172a; color: #fff; padding: 12px 22px; border-radius: 14px;
  font-size: 13.5px; opacity: 0; transition: .26s; z-index: 100; pointer-events: none;
  box-shadow: 0 24px 50px -20px rgba(15, 23, 42, .7); max-width: 90vw; font-weight: 500;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #b91c1c; }
.toast.ok { background: #047857; }

/* ---------- 页脚 ---------- */
.footer { text-align: center; color: var(--sub-2); font-size: 12.5px; padding: 38px 0 8px; }
.footer a { color: var(--sub); }

/* ---------- 加载 ---------- */
.spin {
  display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite;
  vertical-align: -2px; margin-right: 7px;
}
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- 代理页专用 ---------- */
.agent-hero { padding: 42px 0 26px; }
.agent-hero h1 { font-size: 30px; margin: 0 0 8px; letter-spacing: -.9px; font-weight: 800; }
.agent-hero p { color: var(--sub); margin: 0; font-size: 14.5px; }
.split { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: start; }
.mini-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px;
  box-shadow: var(--shadow-sm);
}
.mini-card h4 { margin: 0 0 14px; font-size: 15px; font-weight: 700; }
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed #eef1f8; font-size: 13.5px; }
.kv:last-of-type { border-bottom: 0; }
.kv span:first-child { color: var(--sub); }
.kv span:last-child { font-weight: 600; color: var(--txt-2); }
.login-wrap { max-width: 440px; margin: 7vh auto 0; }

/* ---------- 移动端 ---------- */
@media (max-width: 760px) {
  .hero { padding: 36px 0 22px; }
  .hero h1 { font-size: 27px; letter-spacing: -.6px; }
  .hero p { font-size: 14px; }
  .pane { padding: 22px 20px 26px; }
  .row, .row-3 { grid-template-columns: 1fr; gap: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .topbar-in { height: 58px; gap: 6px; padding: 0 14px; }
  .brand span { font-size: 15px; }
  .brand .logo { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; }
  .top-link { padding: 7px 10px; font-size: 12.5px; }
  .tab { padding: 8px 13px; font-size: 13px; }
  .wrap { padding: 0 14px 56px; }
  .split { grid-template-columns: 1fr; }
  .stat .v { font-size: 21px; }
}
