/* ============================================================
   CZTQ · 全局样式
   ============================================================ */

:root {
  --bg: #070a0f;
  --bg-soft: #0c1117;
  --card: rgba(19, 26, 35, .72);
  --card-solid: #121922;
  --line: rgba(120, 152, 186, .16);
  --line-strong: rgba(120, 152, 186, .28);
  --txt: #e8eef6;
  --dim: #8b9aad;
  --dim2: #5d6b7d;
  --brand: #2ee6a8;
  --brand2: #35b8ff;
  --red: #ff5470;
  --orange: #ffb020;
  --pink: #ff79c6;
  --indigo: #8b8bff;
  --radius: 16px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .85);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--txt);
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 背景动效 ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(1200px 700px at 50% -10%, #101a26 0%, #070a0f 60%); }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; animation: drift 22s ease-in-out infinite alternate; }
.o1 { width: 460px; height: 460px; background: #14c98a; top: -140px; left: -80px; }
.o2 { width: 520px; height: 520px; background: #1e7fff; top: 120px; right: -180px; animation-delay: -7s; }
.o3 { width: 380px; height: 380px; background: #6f4bff; bottom: -160px; left: 40%; animation-delay: -13s; opacity: .35; }
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(40px, 30px, 0) scale(1.08); }
  100% { transform: translate3d(-30px, 60px, 0) scale(.96); }
}
.grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(120,152,186,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(120,152,186,.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 0, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 0, #000 0%, transparent 72%);
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

/* ---------- 顶栏 ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(7, 10, 15, .72);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.logo {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  font-weight: 800; font-size: 17px; letter-spacing: -1px; color: #04140e;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 0 24px -6px var(--brand);
}
.brand-txt strong { display: block; font-size: 15.5px; letter-spacing: .5px; }
.brand-txt small { color: var(--dim2); font-size: 10.5px; letter-spacing: 2.2px; text-transform: uppercase; }

.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--dim); text-decoration: none; padding: 8px 15px; border-radius: 10px;
  font-size: 13px; transition: .2s;
}
.nav a:hover { color: var(--txt); background: rgba(120, 152, 186, .1); }
.nav a.on { color: #04140e; background: var(--brand); font-weight: 600; box-shadow: 0 0 18px -6px var(--brand); }

/* ---------- Hero ---------- */
.hero { padding: 44px 2px 26px; animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
.hero h1 { font-size: 30px; line-height: 1.3; font-weight: 700; letter-spacing: -.5px; }
.hero h1 .grad {
  background: linear-gradient(100deg, var(--brand), var(--brand2) 60%, #8b8bff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--dim); margin-top: 10px; font-size: 13.5px; max-width: 640px; }
.hero p code {
  background: rgba(120, 152, 186, .12); padding: 2px 7px; border-radius: 6px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--brand);
}
.hero-metrics { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.metric {
  flex: 1 1 120px; padding: 12px 16px; border-radius: 13px;
  background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(8px);
}
.metric b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.metric span { color: var(--dim2); font-size: 11.5px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 16px 0; box-shadow: var(--shadow);
  animation: rise .55s cubic-bezier(.2,.8,.2,1) both;
}
.card:nth-of-type(2) { animation-delay: .06s; }
.card:nth-of-type(3) { animation-delay: .12s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { font-size: 14.5px; font-weight: 600; letter-spacing: .3px; }
.tip { color: var(--dim2); font-size: 11.5px; text-align: right; }

/* ---------- 游戏选择 ---------- */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.game {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; border-radius: 13px; cursor: pointer;
  background: rgba(255, 255, 255, .02); border: 1px solid var(--line);
  transition: .22s cubic-bezier(.2,.8,.2,1); overflow: hidden;
  font-size: 13.5px; color: var(--dim); user-select: none;
}
.game:hover { transform: translateY(-2px); border-color: var(--line-strong); color: var(--txt); background: rgba(255,255,255,.045); }
.game .g-icon { font-size: 19px; filter: grayscale(.4); transition: .22s; }
.g-badge {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 9px;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  color: var(--brand); background: rgba(46,230,168,.1);
  border: 1px solid rgba(46,230,168,.28); transition: .22s;
}
.game.on {
  color: #04140e; font-weight: 600;
  background: linear-gradient(135deg, var(--brand), #43d9ff);
  border-color: transparent; box-shadow: 0 10px 26px -12px var(--brand);
}
.game.on .g-icon { filter: none; transform: scale(1.08); }
.game.on .g-badge { color: #04140e; background: rgba(255,255,255,.35); border-color: rgba(255,255,255,.5); }
.game.on::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(-120%); animation: sheen 2.6s ease-in-out infinite;
}
@keyframes sheen { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* ---------- 通用行 ---------- */
.row { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-end; margin-top: 16px; }
.row.between { justify-content: space-between; align-items: center; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.narrow { width: 132px; }
.field > label { color: var(--dim2); font-size: 11.5px; letter-spacing: .3px; }

/* ---------- 分段控件 ---------- */
.seg {
  position: relative; display: inline-flex; padding: 4px; border-radius: 12px;
  background: rgba(0, 0, 0, .35); border: 1px solid var(--line);
}
.seg button {
  position: relative; z-index: 2; background: none; border: 0; cursor: pointer;
  color: var(--dim); padding: 8px 16px; border-radius: 9px; font-size: 13px;
  transition: color .22s; white-space: nowrap;
}
.seg button.on { color: #04140e; font-weight: 600; }
.seg-ind {
  position: absolute; top: 4px; left: 4px; height: calc(100% - 8px);
  border-radius: 9px; background: linear-gradient(135deg, var(--brand), #43d9ff);
  transition: transform .32s cubic-bezier(.36,1.4,.4,1), width .32s cubic-bezier(.36,1.4,.4,1);
  box-shadow: 0 6px 18px -8px var(--brand); z-index: 1;
}
.seg.small button { padding: 6px 13px; font-size: 12.5px; }

/* ---------- 步进器 ---------- */
.stepper {
  display: inline-flex; align-items: center; border-radius: 12px;
  background: rgba(0, 0, 0, .35); border: 1px solid var(--line); padding: 3px; gap: 2px;
}
.stepper button {
  width: 30px; height: 30px; border: 0; border-radius: 9px; cursor: pointer;
  background: rgba(120,152,186,.1); color: var(--dim); font-size: 15px; transition: .18s;
}
.stepper button:hover { background: rgba(120,152,186,.2); color: var(--txt); }
.stepper input {
  width: 40px; background: none; border: 0; color: var(--txt); text-align: center;
  font: 600 14px/1 inherit; outline: none; font-variant-numeric: tabular-nums;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- 编辑器 ---------- */
.editor { border-radius: 13px; overflow: hidden; border: 1px solid var(--line); background: rgba(0, 0, 0, .32); transition: border-color .2s; }
.editor:focus-within { border-color: rgba(46, 230, 168, .5); box-shadow: 0 0 0 3px rgba(46, 230, 168, .09); }
.editor textarea {
  width: 100%; min-height: 148px; resize: vertical; display: block;
  background: transparent; border: 0; outline: none; color: var(--txt);
  padding: 14px 16px; font: 12.5px/1.8 ui-monospace, Consolas, "Courier New", monospace;
}
.editor textarea::placeholder { color: #465364; }
.editor-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-top: 1px solid var(--line); background: rgba(255,255,255,.015);
}
.chips-mini { color: var(--dim2); font-size: 11.5px; }
.chips-mini b { color: var(--brand); font-variant-numeric: tabular-nums; }

.filebox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  color: var(--txt); border-radius: 11px; padding: 9px 16px; font-size: 13px;
  cursor: pointer; text-decoration: none; transition: .2s cubic-bezier(.2,.8,.2,1);
  white-space: nowrap;
}
.btn:hover { border-color: var(--line-strong); background: rgba(255,255,255,.06); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.99); }
.btn.ghost { color: var(--dim); }
.btn.ghost:hover { color: var(--txt); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn.lg { padding: 12px 34px; font-size: 14.5px; font-weight: 700; }
.btn.primary {
  background: linear-gradient(135deg, var(--brand), #3ad2ff);
  border-color: transparent; color: #04140e;
  box-shadow: 0 12px 30px -14px var(--brand);
}
.btn.primary:hover { box-shadow: 0 16px 38px -14px var(--brand); }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.danger { color: var(--red); border-color: rgba(255, 84, 112, .3); }
.btn.danger:hover { background: rgba(255, 84, 112, .12); }

/* ---------- 运行行 ---------- */
.run-row { display: flex; align-items: center; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.progress-wrap { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 220px; }
.progress { flex: 1; height: 7px; border-radius: 6px; background: rgba(0, 0, 0, .45); overflow: hidden; }
.progress i {
  display: block; height: 100%; width: 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  transition: width .35s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 0 12px -2px var(--brand);
}
#progText { color: var(--dim2); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- 统计 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 9px; margin-bottom: 16px; }
.stat {
  padding: 11px 13px; border-radius: 12px; background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line); animation: rise .3s both;
}
.stat b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.stat span { color: var(--dim2); font-size: 11px; }
.s-normal b { color: var(--brand); }
.s-face b { color: var(--orange); }
.s-banned b { color: var(--red); }
.s-authfail b { color: var(--dim); }
.s-highrisk b { color: var(--red); }
.s-observe b { color: var(--indigo); }
.s-mute b { color: var(--pink); }

/* ---------- 结果条 ---------- */
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--line); max-height: 560px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th {
  position: sticky; top: 0; z-index: 2; text-align: left; white-space: nowrap;
  padding: 10px 12px; background: #0e151d; color: var(--dim2);
  font-weight: 500; font-size: 11.5px; border-bottom: 1px solid var(--line);
}
tbody td { padding: 10px 12px; white-space: nowrap; border-bottom: 1px solid rgba(120,152,186,.07); }
tbody tr { animation: fadeRow .3s both; }
tbody tr:hover { background: rgba(255, 255, 255, .03); }
tbody tr:last-child td { border-bottom: 0; }
@keyframes fadeRow { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; background: rgba(139,154,173,.14); color: var(--dim);
  white-space: nowrap;
}
.badge.normal { background: rgba(46,230,168,.13); color: var(--brand); }
.badge.face { background: rgba(255,176,32,.14); color: var(--orange); }
.badge.banned, .badge.highrisk { background: rgba(255,84,112,.14); color: var(--red); }
.badge.observe { background: rgba(139,139,255,.16); color: var(--indigo); }
.badge.mute { background: rgba(255,121,198,.14); color: var(--pink); }
.badge.authfail, .badge.error { background: rgba(139,154,173,.12); color: var(--dim2); }

.mono { font-family: ui-monospace, Consolas, monospace; color: var(--dim2); font-size: 11.5px; }
.name { color: var(--txt); font-weight: 500; }

/* ---------- 页脚 ---------- */
.foot { text-align: center; color: #3d4856; font-size: 11.5px; padding: 30px 0 46px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px);
  background: #131c26; border: 1px solid var(--line-strong); color: var(--txt);
  padding: 11px 20px; border-radius: 12px; font-size: 13px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: .3s cubic-bezier(.2,.8,.2,1); z-index: 99;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   后台
   ============================================================ */

.login-wrap { min-height: calc(100vh - 150px); display: grid; place-items: center; padding: 30px 0; }
.login-card {
  width: 100%; max-width: 372px; background: var(--card); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow);
  animation: rise .5s both;
}
.login-card h1 { font-size: 19px; margin-bottom: 6px; }
.login-card p { color: var(--dim2); font-size: 12.5px; margin-bottom: 20px; }
.field-row { margin-bottom: 13px; }
.field-row label { display: block; color: var(--dim2); font-size: 11.5px; margin-bottom: 6px; }
.input {
  width: 100%; background: rgba(0, 0, 0, .34); border: 1px solid var(--line);
  color: var(--txt); border-radius: 11px; padding: 11px 13px; font-size: 13.5px;
  outline: none; transition: .2s;
}
.input:focus { border-color: rgba(46,230,168,.5); box-shadow: 0 0 0 3px rgba(46,230,168,.09); }
.captcha-row { display: flex; gap: 9px; align-items: stretch; }
.captcha-row .input { flex: 1; }
.captcha-img {
  width: 132px; height: 44px; border-radius: 11px; cursor: pointer; flex: 0 0 auto;
  border: 1px solid var(--line); background: #eef4f8; display: block;
}
.err-line { color: var(--red); font-size: 12.5px; min-height: 18px; margin-top: 10px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0 14px; }
.tabs button {
  background: rgba(255,255,255,.03); border: 1px solid var(--line); color: var(--dim);
  padding: 8px 15px; border-radius: 10px; cursor: pointer; font-size: 13px; transition: .2s;
}
.tabs button:hover { color: var(--txt); border-color: var(--line-strong); }
.tabs button.on { background: var(--brand); border-color: transparent; color: #04140e; font-weight: 600; }

.pane { display: none; }
.pane.on { display: block; animation: rise .32s both; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.form-line { margin-bottom: 12px; }
.form-line label { display: block; color: var(--dim2); font-size: 11.5px; margin-bottom: 6px; }
.form-line .hint2 { color: #43506180; font-size: 11px; margin-top: 5px; }

.toolbar { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 190px; padding: 8px 12px; font-size: 13px; }
select.input { border-radius: 10px; padding-right: 26px; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; color: var(--dim2); font-size: 12.5px; }
.pager button {
  background: rgba(255,255,255,.03); border: 1px solid var(--line); color: var(--txt);
  border-radius: 9px; padding: 6px 13px; cursor: pointer; font-size: 12.5px;
}
.pager button:disabled { opacity: .35; cursor: not-allowed; }

.chart { display: flex; flex-direction: column; gap: 9px; }
.chart-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.chart-row .lbl { width: 64px; color: var(--dim2); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-row .track { flex: 1; height: 8px; background: rgba(0,0,0,.4); border-radius: 6px; overflow: hidden; }
.chart-row .fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand), var(--brand2)); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.chart-row .val { width: 42px; text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; }

.log-list { display: flex; flex-direction: column; gap: 7px; max-height: 480px; overflow: auto; }
.log-item {
  display: flex; gap: 10px; align-items: baseline; font-size: 12px;
  padding: 8px 11px; border-radius: 9px; background: rgba(0,0,0,.22); border: 1px solid var(--line);
}
.log-item .t { color: var(--dim2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-item .ty { color: var(--brand); min-width: 74px; }
.log-item .msg { color: var(--dim); flex: 1; }
.log-item .ip { color: #43506b; }

@media (max-width: 720px) {
  .hero { padding-top: 30px; }
  .hero h1 { font-size: 23px; }
  .top-inner { height: 58px; }
  .brand-txt small { display: none; }
  .card { padding: 15px; }
  .games { grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); }
  .btn.lg { width: 100%; }
  .progress-wrap { order: 2; flex-basis: 100%; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); }
  .table-wrap { max-height: 460px; }
}
