/* ===== EHX 鑱氬悎宸ュ叿绠?路 绮夎摑娓愬彉涓婚 ===== */
:root {
  --p1: #ff8fc7;
  --p2: #ffb9de;
  --b1: #7fb0ff;
  --b2: #a9d4ff;
  --ink: #2c3554;
  --ink2: #6d7899;
  --card: #ffffff;
  --line: #e8edf9;
  --ok: #21b98a;
  --warn: #f0a23a;
  --bad: #f2637e;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(126, 150, 214, .16), 0 2px 8px rgba(126, 150, 214, .08);
  --shadow-soft: 0 6px 18px rgba(126, 150, 214, .12);
  --grad: linear-gradient(135deg, var(--p1) 0%, #c2a8ff 48%, var(--b1) 100%);
  --grad-soft: linear-gradient(135deg, #ffe1f1 0%, #eaf0ff 50%, #dff2ff 100%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  color: var(--ink);
  font: 14px/1.6 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, #ffe9f6 0%, #f2f0ff 38%, #e6f2ff 70%, #e2f7ff 100%) fixed;
  -webkit-font-smoothing: antialiased;
}
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .55;
  pointer-events: none;
  animation: floaty 18s ease-in-out infinite alternate;
}
body::before { width: 420px; height: 420px; left: -120px; top: -100px; background: radial-gradient(circle, #ffb6dd, transparent 70%); }
body::after { width: 520px; height: 520px; right: -160px; bottom: -160px; background: radial-gradient(circle, #a9d4ff, transparent 70%); animation-delay: -8s; }

@keyframes floaty {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(30px, 40px, 0) scale(1.08); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pop {
  0% { transform: scale(.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes ripple {
  from { transform: scale(0); opacity: .45; }
  to { transform: scale(2.6); opacity: 0; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

#loginView, #adminLogin, .wrap, .top { position: relative; z-index: 1; }

/* ---------- 椤舵爮 ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 22px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 4px 18px rgba(126, 150, 214, .08);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: .3px; font-size: 15px; }
.logo {
  width: 22px; height: 22px; border-radius: 8px;
  background: var(--grad);
  box-shadow: 0 6px 16px rgba(255, 143, 199, .45), inset 0 1px 2px rgba(255,255,255,.6);
}
.top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--ink2); }
.small { font-size: 12px; }

/* ---------- 閫氱敤 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; color: var(--ink2);
  background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
}
.chip.on { color: #0f9d76; border-color: rgba(33, 185, 138, .35); background: rgba(33, 185, 138, .08); }
.chip.warn { color: #c98121; border-color: rgba(240, 162, 58, .4); background: rgba(240, 162, 58, .1); }
.chip.off { color: var(--ink2); }
.chip.grad {
  color: #fff; border: 0; background: var(--grad);
  box-shadow: 0 8px 20px rgba(255, 143, 199, .35);
  font-weight: 600;
}

.card {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 750; letter-spacing: .2px; display: flex; align-items: center; gap: 8px; }
.card-head h2::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--grad); box-shadow: 0 0 0 3px rgba(255, 143, 199, .16);
}

.btn {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 16px; border-radius: 12px; cursor: pointer;
  font-weight: 600; font-size: 13.5px;
  transition: transform .12s ease, box-shadow .18s ease, filter .18s ease, border-color .18s;
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(126, 150, 214, .2); border-color: #dbe5fb; }
.btn:active { transform: translateY(0) scale(.99); }
.btn.primary { border: 0; color: #fff; background: var(--grad); box-shadow: 0 10px 24px rgba(255, 143, 199, .35); }
.btn.primary:hover { filter: brightness(1.04) saturate(1.05); }
.btn.danger { color: #d93a5c; border-color: rgba(242, 99, 126, .3); background: #fff6f8; }
.btn.danger:hover { background: #ffeef2; }
.btn.ghost { background: rgba(255, 255, 255, .6); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 10px; }
.btn.block { width: 100%; padding: 12px 16px; font-size: 14.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.ripple {
  position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .6);
  width: 12px; height: 12px; pointer-events: none; animation: ripple .6s ease-out forwards;
}

input, select, textarea {
  width: 100%; padding: 10px 13px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  font: inherit; outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
input::placeholder, textarea::placeholder { color: #aab4cc; }
input:focus, select:focus, textarea:focus {
  border-color: #f0a9d1;
  box-shadow: 0 0 0 4px rgba(255, 143, 199, .16), 0 0 0 1px rgba(127, 176, 255, .2) inset;
  background: #fffdfe;
}
textarea { resize: vertical; min-height: 68px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: #c98ae0; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--ink2); font-size: 12.5px; }
label > span { font-weight: 600; letter-spacing: .2px; }
.hint { color: #c98121; font-size: 12.5px; margin: 6px 0 0; min-height: 16px; }
.link { color: #8a6fe0; text-decoration: none; }
.link:hover { text-decoration: underline; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; color: var(--ink2); font-size: 12.5px; margin: 12px 0; }

/* ---------- 鐧诲綍 ---------- */
.auth { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card {
  width: min(430px, 100%); padding: 30px 28px 26px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.86));
  box-shadow: 0 24px 60px rgba(154, 138, 214, .22), 0 2px 6px rgba(154, 138, 214, .08);
  animation: pop .45s cubic-bezier(.2,.8,.3,1) both;
}
.auth-logo {
  width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 18px;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px; letter-spacing: .5px;
  background: var(--grad);
  box-shadow: 0 14px 30px rgba(255, 143, 199, .45);
}
.auth-title {
  margin: 0 0 6px; text-align: center; font-size: 22px; font-weight: 800; letter-spacing: .4px;
  background: linear-gradient(120deg, #ff7fbe, #8f7bff 55%, #6aa8ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-sub { margin: 0 0 22px; text-align: center; color: var(--ink2); font-size: 12.5px; letter-spacing: 1px; }
.auth-foot { display: flex; justify-content: center; gap: 8px; margin-top: 18px; color: var(--ink2); font-size: 12px; }

/* ---------- 鎺у埗鍙?---------- */
.wrap { max-width: 1320px; margin: 0 auto; padding: 20px 18px 40px; }
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 22px; margin-bottom: 16px;
  background: linear-gradient(120deg, rgba(255,255,255,.95), rgba(255, 240, 249, .9) 45%, rgba(233, 244, 255, .92));
}
.hero-title { font-size: 16px; font-weight: 800; letter-spacing: .3px; }
.hero-sub { color: var(--ink2); font-size: 12.5px; margin-top: 2px; }
.hero-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.grid {
  display: grid; gap: 16px;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-areas: "accounts modes" "logs logs" "log log";
  align-items: start;
}
.accounts { grid-area: accounts; }
.modes { grid-area: modes; }
.logs-card { grid-area: logs; }
.log-card { grid-area: log; }

/* 后台日志弹窗 */
.logs-modal { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; background: rgba(58, 46, 110, .28); backdrop-filter: blur(2px); }
.logs-box { width: min(620px, 92vw); max-height: 76vh; background: #fff; border-radius: 18px; box-shadow: 0 24px 70px rgba(90, 70, 160, .32); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.logs-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.logs-head strong { font-size: 15px; color: var(--ink); }
#logsBody { overflow: auto; }

.acc-timer { margin-left: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; color: #7a6bd6; font-size: 11.5px; }
.acc-lily { margin-left: 6px; font-size: 11px; color: #b58a2c; background: rgba(240, 190, 90, .14); border: 1px solid rgba(240, 190, 90, .35); border-radius: 999px; padding: 1px 7px; }
select[multiple] { min-height: 96px; padding: 6px; }

/* 计时记录 */
.timeline { max-height: 190px; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.tl-item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #5b6788; }
.tl-time { color: #a9b3cc; font-family: ui-monospace, Menlo, Consolas, monospace; }
.tl-tag { padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.tl-tag.pause { color: #b5761e; border-color: rgba(240, 162, 58, .4); background: rgba(240, 162, 58, .08); }
.tl-tag.resume, .tl-tag.start { color: #12916c; border-color: rgba(33, 185, 138, .35); background: rgba(33, 185, 138, .08); }
.tl-tag.stop, .tl-tag.expire { color: #d93a5c; border-color: rgba(242, 99, 126, .35); background: rgba(242, 99, 126, .08); }
.tl-tag.bind { color: #3b6fd4; border-color: rgba(90, 130, 240, .35); background: rgba(90, 130, 240, .08); }
.tl-tag.unbind { color: #8a6bd0; border-color: rgba(150, 110, 220, .35); background: rgba(150, 110, 220, .08); }
.tl-tag.abnormal { color: #d97706; border-color: rgba(240, 160, 60, .4); background: rgba(240, 160, 60, .1); }

.addrow { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-bottom: 14px; }
.table-wrap { overflow: auto; max-height: 46vh; border-radius: 14px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
  position: sticky; top: 0; z-index: 1;
  background: linear-gradient(180deg, #fff, #fbf7ff);
  color: var(--ink2); font-size: 12px; font-weight: 700; letter-spacing: .3px;
}
td { font-size: 13px; }
tbody tr:hover td { background: linear-gradient(90deg, rgba(255,238,248,.7), rgba(233,244,255,.6)); }
th.ck, td.ck { width: 34px; }
.acc-main { font-weight: 700; }
.acc-sub { color: var(--ink2); font-size: 12px; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; border: 1px solid var(--line); color: var(--ink2); background: #fff; }
.pill.ok { color: #0f9d76; border-color: rgba(33,185,138,.3); background: rgba(33,185,138,.08); }
.pill.bad { color: #d93a5c; border-color: rgba(242,99,126,.3); background: rgba(242,99,126,.08); }
.pill.busy { color: #5a76c9; border-color: rgba(127,176,255,.4); background: rgba(127,176,255,.12); }
.row-x { border: 0; background: transparent; color: #b9c3da; cursor: pointer; padding: 4px 7px; border-radius: 8px; font-size: 14px; }
.row-x:hover { color: #e2557a; background: rgba(242, 99, 126, .1); }
.row-ops { display: inline-flex; align-items: center; gap: 6px; }
.relogin-btn {
  border: 1px solid rgba(127, 176, 255, .5);
  background: rgba(127, 176, 255, .12);
  color: #3b6fd4;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
}
.relogin-btn:hover { background: rgba(127, 176, 255, .22); }
.empty { color: var(--ink2); text-align: center; padding: 22px 0; margin: 0; font-size: 13px; }
.notes { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.mojin-summary {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
  padding: 10px 12px; border-radius: 14px;
  background: linear-gradient(120deg, #fff2fa, #eef5ff);
  border: 1px solid #f0e6ff;
}
.ms-item { display: flex; flex-direction: column; gap: 2px; min-width: 92px; }
.ms-item span { font-size: 11.5px; color: var(--ink2); }
.ms-item b { font-size: 14px; font-weight: 800; color: #7a5fd0; }
.ms-item.bigs { flex: 1 1 220px; }
.ms-item.bigs b { font-weight: 600; font-size: 12.5px; color: #5b6788; }
.note {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  font-size: 12.5px; color: #9a6b1b;
  background: linear-gradient(90deg, #fff7e8, #fff2f8);
  border: 1px solid rgba(240, 162, 58, .28);
  border-radius: 12px; padding: 9px 12px;
}

/* 妯″紡鍒囨崲 */
.mode-tabs {
  display: flex; gap: 6px; padding: 5px; margin-bottom: 16px;
  background: #f6f3ff; border: 1px solid #efeafd; border-radius: 14px;
}
.mode-tab {
  flex: 1; padding: 9px 6px; border: 0; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--ink2); font-weight: 700; font-size: 13px;
  transition: background .18s, color .18s, box-shadow .18s, transform .12s;
}
.mode-tab:hover { color: var(--ink); }
.mode-tab.active { color: #fff; background: var(--grad); box-shadow: 0 8px 18px rgba(255, 143, 199, .35); }
.mode-panel { animation: fadeUp .28s ease both; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { margin: 0; }
.inline-checks { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--ink); font-size: 13px; }
.inline-checks span { display: inline-flex; align-items: center; gap: 6px; }
.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; margin: 14px 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.adv { margin-top: 14px; border: 1px dashed #e3ddff; border-radius: 14px; padding: 10px 14px; background: #fcfbff; }
.adv summary { cursor: pointer; color: #8a7bc7; font-size: 12.5px; font-weight: 700; }
.adv .form-grid { margin-top: 12px; }
.adv-group { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #ece6ff; }
.adv-group:first-of-type { margin-top: 10px; padding-top: 0; border-top: 0; }
.adv-title { font-size: 12.5px; font-weight: 700; color: #8a7bc7; margin-bottom: 8px; }
.like-row { display: grid; grid-template-columns: 1fr 90px auto; gap: 9px; margin-top: 14px; }

/* 鏃ュ織 */
.log {
  height: 220px; overflow: auto; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(180deg, #fbfbff, #f4f8ff);
  border: 1px solid var(--line);
  font: 12.5px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #5b6788;
}
.log .t { color: #a9b3cc; margin-right: 8px; }
.log .ok { color: #13946f; }
.log .err { color: #d93a5c; }
.log .warn { color: #b57a1e; }

/* ---------- 鍚庡彴 ---------- */
.admin-grid {
  display: grid; gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "up gen" "cards cards" "other other";
  align-items: start;
}
.admin-grid > .card:nth-child(1) { grid-area: up; }
.admin-grid > .card:nth-child(2) { grid-area: gen; }
.admin-grid > .card:nth-child(3) { grid-area: cards; }
.admin-grid > .card:nth-child(4) { grid-area: other; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  position: relative; overflow: hidden;
  background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.95);
  border-radius: 16px; padding: 13px 16px; box-shadow: var(--shadow-soft);
}
.stat::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--grad); opacity: .8;
}
.stat span { display: block; color: var(--ink2); font-size: 12px; }
.stat b { display: block; font-size: 18px; font-weight: 800; letter-spacing: .2px; margin-top: 2px; }
.stat.rate b { font-size: 14px; color: #b57a1e; }
.table-wrap.tall { max-height: 58vh; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .3px; }
.ops-cell { display: flex; flex-wrap: wrap; gap: 5px; }
.ops-cell .btn { padding: 5px 9px; font-size: 12px; }
.bind-cell { max-width: 230px; }
.bind-chip {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 2px 4px 2px 0; padding: 2px 9px;
  border-radius: 999px; background: #f6f1ff; border: 1px solid #e6dbff;
  font-size: 12px; color: #6b5aa8; white-space: nowrap;
}
.bind-x { border: 0; background: transparent; color: #b39ddb; cursor: pointer; font-size: 11px; padding: 0 2px; }
.bind-x:hover { color: #e2557a; }
.filter { width: auto; padding: 7px 10px; font-size: 12.5px; border-radius: 10px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar input { width: 220px; }
.new-cards { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bulk-extend {
  margin-top: 14px; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(120deg, #fff5fb, #eff6ff);
  border: 1px dashed #e6dbff;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
}
.bulk-extend .be-left { display: flex; flex-direction: column; gap: 2px; }
.bulk-extend .be-left b { font-size: 13px; }
.bulk-extend .be-right { display: flex; align-items: center; gap: 8px; }
.bulk-extend .be-right input { width: 96px; }
.new-card {
  background: linear-gradient(135deg, #fff0f9, #eef5ff);
  border: 1px solid #ecdfff; color: #8a5fd0;
  border-radius: 10px; padding: 6px 11px; font-size: 13px; font-weight: 700;
}
.small-log { height: 130px; margin-top: 12px; }
.banner {
  border-radius: 14px; padding: 11px 15px; margin-bottom: 14px; font-size: 13px;
  background: linear-gradient(90deg, #fff6e8, #fff0f7);
  border: 1px solid rgba(240, 162, 58, .3); color: #9a6b1b;
}

/* ---------- 公告 ---------- */
.site-notice {
  width: min(760px, 100%);
  margin: 0 auto 14px;
  padding: 11px 16px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #8a4f8f;
  background: linear-gradient(120deg, #fff1f9, #f0f4ff 60%, #eaf7ff);
  border: 1px solid #f3dff0;
  box-shadow: 0 8px 20px rgba(180, 140, 210, .12);
  white-space: pre-wrap;
  word-break: break-word;
}
.auth-stack { width: min(430px, 100%); }
.login-notice { margin-bottom: 12px; }

/* ---------- 登录页防护提示 ---------- */
.guard {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: rgba(44, 53, 84, .26);
  backdrop-filter: blur(4px);
  animation: fadeUp .18s ease both;
}
.guard-box {
  background: #fff; border-radius: 22px; padding: 26px 38px 24px; text-align: center;
  box-shadow: 0 26px 70px rgba(120, 110, 200, .35);
  animation: pop .25s cubic-bezier(.2,.8,.3,1) both;
}
.guard-emoji { font-size: 34px; line-height: 1; }
.guard-title {
  margin: 8px 0 16px; font-size: 20px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(120deg, #ff7fbe, #8f7bff 55%, #6aa8ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- 全局加载中 ---------- */
.loading-overlay {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(3px);
  animation: fadeUp .12s ease both;
}
.loading-box {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 24px; border-radius: 16px;
  background: #fff; box-shadow: 0 18px 50px rgba(120, 110, 200, .3);
  font-size: 14px; font-weight: 700; color: #5b4b8a;
}
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid #ffd9ec; border-top-color: #8f7bff;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60;
  transform: translate(-50%, 18px); opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 14px; max-width: min(560px, 92vw);
  background: rgba(44, 53, 84, .94); color: #fff; font-size: 13px;
  box-shadow: 0 16px 40px rgba(44, 53, 84, .3);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: linear-gradient(135deg, #e2537a, #c9457a); }

/* ---------- 鍔ㄧ敾 ---------- */
.fade-up { animation: fadeUp .45s cubic-bezier(.2,.8,.3,1) both; }

@media (max-width: 1080px) {
  .grid { grid-template-columns: 1fr; grid-template-areas: "accounts" "modes" "logs" "log"; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: 1fr; grid-template-areas: "up" "gen" "cards" "other"; }
}
@media (max-width: 600px) {
  .wrap { padding: 14px 10px 30px; }
  .top { padding: 10px 12px; }
  .addrow, .form-grid, .like-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 24px 18px 20px; }
  table { font-size: 12px; }
  th:nth-child(6), td:nth-child(6) { display: none; }
}


/* ================= 移动端 v7（统一排版） ================= */
html, body { max-width: 100%; overflow-x: hidden; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; }
.card, .hero, .stats, .grid, .admin-grid, .table-wrap, .site-notice, .log, .timeline { max-width: 100%; }
.hero, .hero-right, .card-head, .top { flex-wrap: wrap; }
table { table-layout: auto; }
th, td { white-space: normal; word-break: break-word; overflow: visible; text-overflow: clip; }
.table-wrap { width: 100%; max-height: none; overflow: auto; }
.mobile-only { display: none; }
.tl-tag.admin { color: #7a5cc4; border-color: rgba(140, 110, 220, .35); background: rgba(140, 110, 220, .08); }

/* PC: 账号表按内容排版, 只有勾选/操作固定宽 */
#accTable th, #accTable td { width: auto !important; }
#accTable th:nth-child(1), #accTable td:nth-child(1) { width: 44px !important; }
#accTable th:nth-child(7), #accTable td:nth-child(7) { width: 96px !important; }
#accTable .acc-main, #accTable .acc-sub { white-space: normal; overflow: visible; }

/* PC: 后台表格自适应列宽 */
#cardTable { min-width: 1040px; }
#cardTable th, #cardTable td { width: auto !important; }
#typeStatsTable { min-width: 640px; }
#typeStatsTable th, #typeStatsTable td { width: auto !important; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .mobile-only { display: block; }
  .top { padding: 10px 12px; gap: 8px; }
  .brand { font-size: 14px; gap: 8px; min-width: 0; max-width: 64%; }
  .brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-right { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .top-right .chip { font-size: 11.5px; padding: 4px 8px; }
  .top-right .btn { min-height: 32px; padding: 5px 9px; font-size: 12px; }

  .wrap { padding: 12px 10px calc(30px + env(safe-area-inset-bottom)); }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat b { font-size: 13.5px; word-break: break-all; }
  .hero { padding: 13px 14px; border-radius: 16px; }
  .hero-title { font-size: 17px; }
  .hero-sub { font-size: 12.5px; line-height: 1.55; }
  .card { padding: 13px 12px; border-radius: 16px; }
  .card-head h2 { font-size: 15px; }
  .grid, .admin-grid { gap: 12px; }
  .mode-tabs { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .mode-tab { flex: 0 0 auto; padding: 8px 14px; font-size: 13.5px; }
  .form-grid, .addrow, .like-row { grid-template-columns: 1fr !important; gap: 10px; }
  .addrow .btn { width: 100%; }
  input, select, textarea { font-size: 16px !important; }
  .btn { min-height: 40px; }
  .btn.sm { min-height: 34px; }
  select[multiple] { min-height: 130px; }
  .timeline { max-height: 210px; }
  .tl-item { font-size: 12px; flex-wrap: wrap; row-gap: 2px; }
  .logs-box { width: 94vw; max-height: 82vh; padding: 14px 12px; }
  .auth-card, .guard-card { width: min(92vw, 420px); }
  .toast { left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); text-align: center; }
  .loading-box { padding: 12px 18px; font-size: 13.5px; }

  /* 前台账号: 卡片式 */
  #accTable thead { display: none; }
  #accTable, #accTable tbody, #accTable tr, #accTable td { display: block; width: auto !important; }
  #accTable tr {
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 12px 10px 42px;
    margin: 8px 0;
    box-shadow: 0 2px 10px rgba(126, 150, 214, .07);
  }
  #accTable tr.pending-row { border-style: dashed; box-shadow: none; }
  #accTable td { border: 0; padding: 0; font-size: 13px; }
  #accTable td.ck { position: absolute; left: 13px; top: 13px; }
  #accTable td:nth-child(2) { padding: 0; margin: 0 0 2px; font-size: 13.5px; }
  #accTable td:nth-child(2) .acc-main { font-weight: 750; }
  #accTable td:nth-child(3) { display: inline-block; margin: 3px 0 5px; }
  #accTable td:nth-child(4), #accTable td:nth-child(5), #accTable td:nth-child(6) {
    display: inline-block;
    background: #f6f8ff;
    border: 1px solid #e8eefc;
    border-radius: 8px;
    padding: 2px 8px;
    margin: 4px 6px 0 0;
    font-size: 11.5px;
    color: #5b6788;
  }
  #accTable td:nth-child(4)::before { content: "地图 "; color: #a9b3cc; }
  #accTable td:nth-child(5)::before { content: "房号 "; color: #a9b3cc; }
  #accTable td:nth-child(6)::before { content: "票据 "; color: #a9b3cc; }
  #accTable td:nth-child(7) { display: block; text-align: right; margin-top: 8px; }
  #accTable .ops-cell { position: static; box-shadow: none; }
  #accTable .row-ops { gap: 6px; }
  #accTable .relogin-btn { padding: 4px 10px; font-size: 12px; }

  /* 后台: 卡密卡片式 */
  #cardTable { min-width: 0 !important; }
  #cardTable thead { display: none; }
  #cardTable, #cardTable tbody, #cardTable tr, #cardTable td { display: block; width: auto !important; }
  #cardTable tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    margin: 8px 0;
    box-shadow: 0 2px 10px rgba(126, 150, 214, .07);
  }
  #cardTable td { border: 0; padding: 3px 0; font-size: 13px; }
  #cardTable td.mono { font-weight: 750; font-size: 13.5px; }
  #cardTable td::before { color: #a9b3cc; margin-right: 6px; }
  #cardTable td:nth-child(1)::before { content: "卡密 "; }
  #cardTable td:nth-child(2)::before { content: "时长 "; }
  #cardTable td:nth-child(3)::before { content: "状态 "; }
  #cardTable td:nth-child(4)::before { content: "剩余 "; }
  #cardTable td:nth-child(5)::before { content: "耗时 "; }
  #cardTable td:nth-child(6)::before { content: "绑定工号 "; }
  #cardTable td:nth-child(7)::before { content: "激活时间 "; }
  #cardTable td:nth-child(8)::before { content: "最近登录 "; }
  #cardTable td:nth-child(9)::before { content: "备注 "; }
  #cardTable td:nth-child(10) { margin-top: 6px; }
  #cardTable td:nth-child(10)::before { content: "操作 "; }
  #cardTable .ops-cell { white-space: normal; }

  /* 后台: 套餐统计卡片式 */
  #typeStatsTable { min-width: 0 !important; }
  #typeStatsTable thead { display: none; }
  #typeStatsTable, #typeStatsTable tbody, #typeStatsTable tr, #typeStatsTable td { display: block; width: auto !important; }
  #typeStatsTable tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    margin: 8px 0;
  }
  #typeStatsTable td { border: 0; padding: 3px 0; font-size: 13px; }
  #typeStatsTable td::before { color: #a9b3cc; margin-right: 6px; }
  #typeStatsTable td:nth-child(1)::before { content: "套餐 "; }
  #typeStatsTable td:nth-child(2)::before { content: "总数 "; }
  #typeStatsTable td:nth-child(3)::before { content: "未使用 "; }
  #typeStatsTable td:nth-child(4)::before { content: "使用中 "; }
  #typeStatsTable td:nth-child(5)::before { content: "已过期 "; }
  #typeStatsTable td:nth-child(6)::before { content: "已作废 "; }
  #typeStatsTable td:nth-child(7)::before { content: "剩余总计 "; }
  #typeStatsTable td:nth-child(8)::before { content: "已用总计 "; }
}

@media (max-width: 420px) {
  .brand > span:last-child { display: none; }
  .stat { padding: 9px 10px; }
  .stat b { font-size: 12.5px; }
  #accTable tr { padding: 10px 10px 8px 38px; }
  #accTable td.ck { left: 11px; top: 11px; }
}

/* mobile v7 tweaks */
@media (max-width: 760px) {
  .log { height: 140px; }
  .site-notice { font-size: 12.5px; line-height: 1.6; }
}

/* mobile v7 final */
@media (max-width: 760px) {
  .log { height: 120px; }
  #accTable td:nth-child(7) .row-ops,
  #accTable td:nth-child(7) { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
  #accTable td:nth-child(7) .row-x { padding: 4px 8px; }
  #cardTable td:nth-child(10) .btn { margin: 2px 3px 2px 0; }
}

/* mobile popup fix */
@media (max-width: 760px) {
  .toast {
    left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom));
    max-width: none; width: auto;
    transform: translate(0, 18px);
    text-align: center; word-break: break-word; box-sizing: border-box;
    font-size: 13px; line-height: 1.5; padding: 12px 16px;
  }
  .toast.show { transform: translate(0, 0); }
  .guard-box { max-width: 92vw; padding: 22px 18px; box-sizing: border-box; }
  .guard-title { font-size: 18px; letter-spacing: 0; }
  .logs-box { width: 94vw; max-width: 94vw; box-sizing: border-box; }
  .loading-box { max-width: 88vw; box-sizing: border-box; text-align: center; }
}

/* select highlight */
#accTable tr.sel { background: #f3f7ff; }
#accTable tr.sel td { background: transparent; }
@media (max-width: 760px) {
  #accTable tr.sel { border-color: #b7cdf2; box-shadow: 0 0 0 2px rgba(127, 176, 255, .18); }
}

/* 摸金账本(按账号分开) */
.ms-group { padding: 10px 0; border-top: 1px dashed var(--line); }
.ms-group:first-child { border-top: 0; padding-top: 2px; }
.ms-acc { font-size: 12.5px; font-weight: 750; color: #5b6788; margin-bottom: 6px; }
.ms-items { display: flex; flex-wrap: wrap; gap: 8px 18px; }
@media (max-width: 760px) {
  .ms-items { gap: 6px 14px; }
  .ms-item { font-size: 12px; }
}

/* 点击优化: 防止移动端/部分浏览器点击被吞 */
#accBody button, #accBody input[type="checkbox"], #accTable label { touch-action: manipulation; }
#accBody button, #accBody input[type="checkbox"] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
#accBody tr[data-acc] { cursor: pointer; }
