/* ═══════════ 全局 ═══════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0f1220;
  --bg-soft: #171b2e;
  --card: #1b2036;
  --card-2: #212845;
  --border: rgba(255, 255, 255, .09);
  --text: #e8eaf3;
  --text-dim: #9aa1c0;
  --primary: #5b8cff;
  --primary-2: #7c5bff;
  --success: #34c98e;
  --danger: #ff5d73;
  --warning: #ffb454;
  --radius: 14px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { opacity: .85; }

code, .mono { font-family: "SF Mono", Consolas, "Courier New", monospace; }

/* ═══════════ 前台 ═══════════ */
.front-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(124, 91, 255, .22), transparent 60%),
    radial-gradient(800px 450px at 90% 0%, rgba(91, 140, 255, .18), transparent 55%),
    var(--bg);
}

.front-header {
  padding: 22px 6vw 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; color: #fff;
}

.front-main { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: 48px 20px 40px; }

.hero { text-align: center; margin-bottom: 34px; }
.hero h1 {
  font-size: clamp(26px, 4.5vw, 40px);
  font-weight: 800;
  background: linear-gradient(120deg, #fff 30%, #9db4ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { color: var(--text-dim); margin-top: 10px; font-size: 15px; }

.card-panel {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}

.query-box { display: flex; gap: 12px; }
.query-box input {
  flex: 1;
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, .25);
  color: var(--text);
  padding: 0 18px;
  font-size: 16px;
  letter-spacing: 1px;
  outline: none;
  transition: border-color .15s;
}
.query-box input:focus { border-color: var(--primary); }
.query-box input::placeholder { letter-spacing: 0; color: #6b7194; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; border-radius: 12px;
  font-size: 15px; font-weight: 600; color: #fff;
  padding: 0 26px; height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  transition: transform .12s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { opacity: .92; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 9px; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-danger { background: linear-gradient(135deg, #ff5d73, #ff7a5c); }
.btn-ok { background: linear-gradient(135deg, #2fb47e, #34c98e); }

.hint { color: var(--text-dim); font-size: 13px; margin-top: 14px; text-align: center; }

.pwd-row { display: none; margin-top: 12px; gap: 12px; }
.pwd-row.visible { display: flex; }
.pwd-row input {
  flex: 1; min-width: 0; height: 46px; border-radius: 12px; border: 1px solid var(--border);
  background: rgba(0, 0, 0, .25); color: var(--text); padding: 0 16px; outline: none; font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.pwd-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(91,140,255,.1); }

.alert {
  margin-top: 16px; padding: 12px 16px; border-radius: 10px; font-size: 14px;
  border: 1px solid transparent; display: none;
}
.alert.show { display: block; }
.alert-error { background: rgba(255, 93, 115, .12); border-color: rgba(255, 93, 115, .35); color: #ffb3be; }
.alert-info { background: rgba(91, 140, 255, .12); border-color: rgba(91, 140, 255, .35); color: #b3c6ff; }
.alert-success { background: rgba(52, 201, 142, .12); border-color: rgba(52, 201, 142, .35); color: #a4e8cd; }

/* 公告 */
.notice {
  margin-top: 18px; padding: 12px 16px; border-radius: 10px; font-size: 14px;
  background: rgba(255, 180, 84, .1); border: 1px solid rgba(255, 180, 84, .3);
  color: #ffd9a3;
}
.notice b { margin-right: 6px; }

/* 结果区 */
#result { margin-top: 30px; }

.result-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 10px;
}
.result-head .meta { color: var(--text-dim); font-size: 13px; }

.group { margin-bottom: 26px; }
.group-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 16px; font-weight: 700; margin-bottom: 12px; gap: 10px; flex-wrap: wrap;
}
.group-title .err { color: var(--danger); font-size: 14px; font-weight: 400; }

.account-list { display: grid; gap: 12px; }

.account {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 14px;
  align-items: center;
}
.account .fields { display: grid; gap: 8px; min-width: 0; }
.field { display: flex; align-items: center; gap: 10px; min-width: 0; }
.field .label {
  flex: 0 0 58px; color: var(--text-dim); font-size: 13px; text-align: justify;
  text-align-last: justify;
}
.field .val {
  font-family: Consolas, "SF Mono", monospace;
  font-size: 14.5px;
  word-break: break-all;
  flex: 1;
  min-width: 0;
}
.field .val.is-masked { filter: blur(5px); user-select: none; cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.chip {
  font-size: 12px; padding: 2px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); color: var(--text-dim);
}
.chip.ok { background: rgba(52, 201, 142, .15); color: #7fe0b8; }
.chip.warn { background: rgba(255, 180, 84, .15); color: #ffd9a3; }
.chip.bad { background: rgba(255, 93, 115, .15); color: #ffb3be; }
.chip.blue { background: rgba(91, 140, 255, .15); color: #b3c6ff; }

.acts { display: flex; flex-direction: column; gap: 8px; }
.mini-btn {
  border: 1px solid var(--border); background: rgba(255, 255, 255, .05);
  color: var(--text); border-radius: 9px; height: 32px; padding: 0 13px;
  font-size: 12.5px; cursor: pointer; white-space: nowrap; transition: background .15s;
}
.mini-btn:hover { background: rgba(255, 255, 255, .12); }

.empty-tip { text-align: center; color: var(--text-dim); padding: 30px 0; font-size: 14px; }

.spin {
  width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.front-footer {
  text-align: center; color: #565d80; font-size: 13px;
  padding: 22px 20px 30px;
}
.front-footer .admin-link { color: #565d80; }
.front-footer .admin-link:hover { color: var(--text-dim); }

/* ═══════════ 后台 ═══════════ */
.admin-shell { display: flex; min-height: 100vh; }

.admin-side {
  width: 220px; flex: 0 0 220px;
  background: #12162a;
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-side .side-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 4px 10px 18px; }
.admin-side .side-brand .logo {
  width: 30px; height: 30px; border-radius: 9px; font-size: 15px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.admin-side a.nav-item {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-dim); padding: 10px 12px; border-radius: 10px; font-size: 14.5px;
}
.admin-side a.nav-item:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.admin-side a.nav-item.active { background: linear-gradient(135deg, rgba(91, 140, 255, .2), rgba(124, 91, 255, .2)); color: #fff; }
.admin-side .side-bottom { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }

.admin-main { flex: 1; min-width: 0; padding: 26px 30px 50px; }

.admin-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 12px; flex-wrap: wrap; }
.admin-top h1 { font-size: 21px; }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 22px;
}
.panel h2 { font-size: 16px; margin-bottom: 16px; }
.panel h2 small { color: var(--text-dim); font-weight: 400; font-size: 12.5px; margin-left: 8px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
}
.stat .num { font-size: 26px; font-weight: 800; }
.stat .cap { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.stat.blue .num { color: #8fb0ff; }
.stat.green .num { color: #7fe0b8; }
.stat.orange .num { color: #ffd9a3; }
.stat.red .num { color: #ffb3be; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 14px; }
.tb th, .tb td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tb td.wrap { white-space: normal; word-break: break-all; }
.tb th { color: var(--text-dim); font-weight: 500; font-size: 13px; }
.tb tr:last-child td { border-bottom: none; }
.tb tr:hover td { background: rgba(255, 255, 255, .02); }

.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.tag.green { background: rgba(52, 201, 142, .15); color: #7fe0b8; }
.tag.red { background: rgba(255, 93, 115, .15); color: #ffb3be; }
.tag.blue { background: rgba(91, 140, 255, .15); color: #b3c6ff; }
.tag.gray { background: rgba(255, 255, 255, .08); color: var(--text-dim); }
.tag.orange { background: rgba(255, 180, 84, .15); color: #ffd9a3; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.icon-btn {
  border: 1px solid var(--border); background: transparent; color: var(--text-dim);
  border-radius: 8px; height: 28px; padding: 0 10px; font-size: 12.5px; cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.icon-btn.danger:hover { color: #ffb3be; border-color: rgba(255, 93, 115, .4); }

/* 表单控件 */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px 18px; }
.form-item { display: flex; flex-direction: column; gap: 7px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 13px; font-weight: 600; color: #b4bad4; }
.form-item label b { color: var(--danger); font-weight: 600; margin-left: 3px; }
.form-item input[type=text], .form-item input[type=password], .form-item input[type=number],
.form-item input[type=datetime-local], .form-item select, .form-item textarea,
.toolbar input[type=text], .toolbar select {
  width: 100%; height: 43px; border-radius: 11px; border: 1px solid rgba(255,255,255,.1);
  background: rgba(7, 10, 22, .5); color: var(--text); padding: 0 13px; font-size: 14px; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s, transform .2s; color-scheme: dark;
}
.form-item input:hover, .form-item select:hover, .form-item textarea:hover, .toolbar input:hover, .toolbar select:hover { border-color: rgba(255,255,255,.2); background: rgba(7,10,22,.68); }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus, .toolbar input:focus, .toolbar select:focus {
  border-color: var(--primary); background: rgba(10,14,32,.8); box-shadow: 0 0 0 4px rgba(91,140,255,.12), 0 8px 20px rgba(0,0,0,.12); transform: translateY(-1px);
}
.form-item input[type=number] { appearance: textfield; }
.form-item input[type=number]::-webkit-inner-spin-button, .form-item input[type=number]::-webkit-outer-spin-button { opacity: .7; }
.form-item input[type=datetime-local] { color: var(--text-dim); }
.form-item input[type=datetime-local]::-webkit-calendar-picker-indicator { filter: invert(70%) sepia(70%) saturate(500%) hue-rotate(190deg); cursor: pointer; opacity: .9; }
.form-item select, .toolbar select { appearance: none; cursor: pointer; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, #8ea8ff 50%), linear-gradient(135deg, #8ea8ff 50%, transparent 50%); background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.form-item textarea { height: auto; min-height: 92px; padding: 11px 13px; resize: vertical; line-height: 1.6; }
.form-item .tip { font-size: 12px; color: #737b9e; }
.checks { display: flex; flex-wrap: wrap; gap: 10px; padding: 2px 0; }
.checks label { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; color: var(--text); font-size: 14px; padding: 9px 12px; border: 1px solid transparent; border-radius: 10px; transition: background .2s, border-color .2s, color .2s; }
.checks label:hover { background: rgba(91,140,255,.08); border-color: rgba(91,140,255,.22); }
.checks input { appearance: none; width: 17px; height: 17px; margin: 0; border: 1px solid #667092; border-radius: 5px; background: rgba(0,0,0,.28); display: grid; place-content: center; cursor: pointer; transition: all .2s; }
.checks input::before { content: ''; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) scale(0); transition: transform .15s ease-in-out; }
.checks input:checked { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,140,255,.13); }
.checks input:checked::before { transform: rotate(-45deg) scale(1); }
.checks input[type=radio] { border-radius: 50%; }
.checks input[type=radio]::before { width: 6px; height: 6px; border: 0; border-radius: 50%; background: #fff; transform: scale(0); }
.checks input[type=radio]:checked::before { transform: scale(1); }
.form-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

/* 工具条 */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar input[type=text] { max-width: 310px; }
.toolbar select { width: 150px; height: 40px; }

/* 标题和操作图标 */
.admin-top h1 { display: inline-flex; align-items: center; gap: 9px; }
.admin-top h1 > [data-lucide] { width: 21px; height: 21px; color: var(--primary); }
.btn, .icon-btn, .mini-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn [data-lucide], .icon-btn [data-lucide], .mini-btn [data-lucide] { width: 15px; height: 15px; }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box {
  width: 100%; max-width: 380px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 34px 30px; box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
}
.login-box h1 { font-size: 20px; text-align: center; margin-bottom: 22px; }
.login-box .form-item { margin-bottom: 14px; }
.login-box .form-item input { width: 100%; }
.login-box .btn { width: 100%; height: 46px; }
.login-tip { text-align: center; color: var(--text-dim); font-size: 13px; margin-top: 16px; }

.flash { padding: 11px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 18px; }
.flash.success { background: rgba(52, 201, 142, .12); border: 1px solid rgba(52, 201, 142, .35); color: #a4e8cd; }
.flash.error { background: rgba(255, 93, 115, .12); border: 1px solid rgba(255, 93, 115, .35); color: #ffb3be; }

/* 分页 */
.pager { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 34px; height: 34px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid var(--border);
  color: var(--text-dim); font-size: 13.5px;
}
.pager span.cur { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.pager .disabled { opacity: .4; pointer-events: none; }

/* 生成的卡密展示 */
.gen-box {
  background: rgba(0, 0, 0, .25); border: 1px dashed var(--border); border-radius: 10px;
  padding: 14px 16px; font-family: Consolas, monospace; font-size: 14px; line-height: 2;
  user-select: all;
}

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 42px; transform: translateX(-50%) translateY(20px);
  background: #2a3152; color: #fff; padding: 10px 20px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 99;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4); border: 1px solid var(--border);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 首页视觉增强 */
.front-header { padding-top: 26px; }
.brand { color: var(--text); letter-spacing: .2px; }
.brand:hover { opacity: 1; }
.admin-link { display: inline-flex; align-items: center; gap: 7px; color: var(--text-dim); font-size: 13.5px; padding: 8px 12px; border: 1px solid transparent; border-radius: 999px; transition: all .2s; }
.admin-link:hover { color: var(--text); border-color: var(--border); background: rgba(255,255,255,.05); opacity: 1; }
.admin-link b { color: var(--primary); font-size: 16px; font-weight: 500; }
.front-main { max-width: 840px; padding-top: 76px; }
.hero { margin-bottom: 34px; animation: pageIn .55s ease both; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; margin-bottom: 18px; color: #b8c8ff; font-size: 12px; letter-spacing: .5px; border: 1px solid rgba(91,140,255,.25); border-radius: 999px; background: rgba(91,140,255,.08); box-shadow: 0 8px 24px rgba(33,52,120,.12); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(52,201,142,.12); animation: statusPulse 2.2s ease-in-out infinite; }
.hero h1 { letter-spacing: -1px; line-height: 1.15; }
.query-panel { padding: 30px; position: relative; overflow: hidden; animation: pageIn .6s .08s ease both; }
#result { animation: pageIn .4s ease both; }
.pwd-row .btn { flex: 0 0 auto; }
.pwd-row .btn:hover { box-shadow: 0 8px 20px rgba(255,255,255,.08); }


.query-panel::before { content: ''; position: absolute; width: 180px; height: 180px; top: -100px; right: -60px; border-radius: 50%; background: rgba(124,91,255,.16); filter: blur(8px); pointer-events: none; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; position: relative; }
.panel-heading h2 { font-size: 19px; margin-top: 3px; }
.eyebrow { color: #829eff; font-size: 10px; font-weight: 700; letter-spacing: 1.8px; }
.secure-mark { display: inline-flex; align-items: center; gap: 6px; color: #8fe0bf; font-size: 12px; padding: 6px 10px; border: 1px solid rgba(52,201,142,.16); border-radius: 8px; background: rgba(52,201,142,.1); }
.secure-mark [data-lucide] { width: 14px; height: 14px; }
.query-box { align-items: stretch; }
.input-wrap { flex: 1; display: flex; align-items: center; min-width: 0; height: 56px; border: 1px solid var(--border); border-radius: 13px; background: rgba(0,0,0,.25); transition: border-color .2s, box-shadow .2s, transform .2s; }
.input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(91,140,255,.1), 0 12px 26px rgba(0,0,0,.14); transform: translateY(-1px); }
.input-icon { width: 42px; color: var(--primary); text-align: center; }
.query-box .input-wrap input { height: 54px; border: 0; background: transparent; padding-left: 0; min-width: 0; font-size: 16px; }
.query-box .input-wrap input:focus { border: 0; box-shadow: none; transform: none; }
.query-box .btn { position: relative; height: 56px; min-width: 142px; overflow: hidden; box-shadow: 0 10px 24px rgba(91,140,255,.2); }
.query-box .btn::before { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 25%, rgba(255,255,255,.22) 50%, transparent 75%); transform: translateX(-130%); transition: transform .6s ease; }
.query-box .btn:hover::before { transform: translateX(130%); }
.query-box .btn > * { position: relative; z-index: 1; }
.query-box .btn [data-lucide] { width: 18px; height: 18px; transition: transform .25s ease; }
.query-box .btn:hover [data-lucide] { transform: translateX(4px); }
.query-box .btn:active { transform: translateY(1px) scale(.985); box-shadow: 0 4px 12px rgba(91,140,255,.18); }
.query-box .btn:disabled { opacity: .75; cursor: wait; transform: none; }
.query-box .btn:disabled .spin { border-top-color: #fff; }
.hint { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.notice { display: flex; gap: 10px; align-items: flex-start; }
.notice > [data-lucide] { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 3px; color: #ffca7b; }
.notice b { flex: 0 0 auto; color: #ffca7b; }

/* Lucide 图标统一规范 */
[data-lucide] { width: 16px; height: 16px; stroke-width: 1.9; vertical-align: middle; }
.logo [data-lucide] { width: 18px; height: 18px; }
.admin-link [data-lucide] { width: 15px; height: 15px; color: var(--primary); }
.hero-badge [data-lucide] { width: 15px; height: 15px; color: #9db4ff; }
.input-icon { display: inline-flex; align-items: center; justify-content: center; transform: none; }
.input-icon [data-lucide] { width: 18px; height: 18px; }
.nav-item [data-lucide] { width: 17px; height: 17px; flex: 0 0 17px; color: var(--text-dim); }
.nav-item.active [data-lucide], .nav-item:hover [data-lucide] { color: var(--primary); }
.side-user { display: flex; align-items: center; gap: 8px; padding: 6px 12px; color: var(--text-dim); font-size: 13px; }
.side-user [data-lucide] { width: 15px; height: 15px; }
.login-mark [data-lucide] { width: 28px; height: 28px; }
.group-name, .err { display: inline-flex; align-items: center; gap: 7px; }
.group-name [data-lucide], .err [data-lucide] { width: 16px; height: 16px; }
.mini-btn [data-lucide] { width: 14px; height: 14px; }

/* 动画与后台视觉增强 */
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sideIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes glowPulse { 0%, 100% { opacity: .35; transform: scale(1); } 50% { opacity: .65; transform: scale(1.08); } }
@keyframes statusPulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(52,201,142,.12); } 50% { box-shadow: 0 0 0 7px rgba(52,201,142,.03); } }
@keyframes progress { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.admin-shell { background: radial-gradient(900px 500px at 80% -10%, rgba(91,140,255,.1), transparent 60%), var(--bg); }
.admin-side { animation: sideIn .55s ease both; }
.admin-main { animation: pageIn .55s .08s ease both; }
.admin-side .side-brand { color: var(--text); text-decoration: none; }
.admin-side .side-brand:hover { opacity: 1; }
.admin-side .nav-item { transition: color .2s, background .2s, transform .2s; }
.admin-side .nav-item:hover { transform: translateX(4px); }
.nav-icon { width: 20px; text-align: center; color: var(--primary); font-size: 18px; }
.panel, .stat { transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.panel:hover, .stat:hover { transform: translateY(-3px); border-color: rgba(91,140,255,.3); box-shadow: 0 14px 34px rgba(0,0,0,.18); }
.stat .num { transition: color .2s, transform .2s; }
.stat:hover .num { color: #fff; transform: translateX(3px); }
.btn, .icon-btn, .mini-btn { transition: transform .2s, opacity .2s, background .2s, box-shadow .2s; }
.btn:hover { box-shadow: 0 8px 22px rgba(91,140,255,.2); }
.icon-btn:hover, .mini-btn:hover { transform: translateY(-1px); }
.page-progress { position: fixed; z-index: 100; top: 0; left: 0; width: 35%; height: 2px; opacity: 0; background: linear-gradient(90deg, transparent, var(--primary), #9d8bff); box-shadow: 0 0 12px var(--primary); pointer-events: none; }
.page-progress.active { opacity: 1; animation: progress .9s ease-in-out infinite; }
.login-page { position: relative; overflow: hidden; background: radial-gradient(600px 400px at 50% 40%, rgba(91,140,255,.12), transparent 65%), var(--bg); }
.login-box { position: relative; z-index: 1; text-align: center; animation: pageIn .6s ease both; }
.login-box form { text-align: left; }
.login-box .eyebrow { display: block; margin-bottom: 8px; }
.login-mark { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 15px; border: 1px solid rgba(126,157,255,.5); border-radius: 16px; color: #fff; font-size: 27px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 12px 30px rgba(91,140,255,.28); animation: glowPulse 3s ease-in-out infinite; }
.login-glow { position: absolute; width: 240px; height: 240px; border-radius: 50%; filter: blur(70px); pointer-events: none; animation: glowPulse 5s ease-in-out infinite; }
.login-glow-one { top: 12%; left: 12%; background: rgba(91,140,255,.2); }
.login-glow-two { right: 10%; bottom: 10%; background: rgba(52,201,142,.13); animation-delay: 1.5s; }

/* 管理端移动菜单默认隐藏，避免桌面端和重复脚本产生叠加层 */
.mobile-nav-toggle, .mobile-nav-backdrop { display: none; }

/* 响应式 */
/* 前台双端适配：桌面保持舒展，触屏设备优先保证可操作性 */
@media (min-width: 861px) {
  .front-header { max-width: 1280px; width: 100%; margin: 0 auto; padding-left: 34px; padding-right: 34px; }
  .front-main { padding-left: 28px; padding-right: 28px; }
}

@media (max-width: 860px) { 
  .front-page { overflow-x: hidden; }
  .front-header { padding-left: 20px; padding-right: 20px; }
  .front-main { width: 100%; max-width: 680px; padding: 52px 18px 34px; }
  .query-box { flex-direction: column; }
  .query-box .btn { width: 100%; }
  .pwd-row { flex-direction: column; }
  .pwd-row .btn { width: 100%; }
  .account { grid-template-columns: 1fr; }
  .acts { flex-direction: row; flex-wrap: wrap; }
  .field .label { flex: 0 0 52px; }
}

@media (max-width: 560px) {
  .front-header { padding-top: 18px; }
  .brand { max-width: 68%; font-size: 16px; }
  .brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .front-header .admin-link { padding: 8px; }
  .front-header .admin-link span { display: none; }
  .front-main { padding: 42px 14px 28px; }
  .hero { margin-bottom: 24px; }
  .hero h1 { font-size: clamp(26px, 9vw, 32px); }
  .hero-badge { margin-bottom: 15px; font-size: 11px; }
  .query-panel { padding: 20px 15px; border-radius: 12px; }
  .panel-heading { align-items: center; margin-bottom: 16px; }
  .panel-heading h2 { font-size: 17px; }
  .secure-mark { font-size: 11px; padding: 5px 7px; }
  .hint { text-align: left; font-size: 12px; }
  .notice { font-size: 13px; }
  .result-head { align-items: flex-start; flex-direction: column; }
  .group-title { align-items: flex-start; }
  .group-title .err { width: 100%; }
  .account { padding: 14px; }
  .acts .mini-btn { flex: 1; min-width: 110px; }
}

@media (max-width: 360px) {
  .front-main { padding-left: 10px; padding-right: 10px; }
  .query-panel { padding-left: 12px; padding-right: 12px; }
  .panel-heading { gap: 8px; }
  .secure-mark { max-width: 92px; text-align: right; }
  .acts .mini-btn { min-width: 100%; }
}

@media (hover: none) and (pointer: coarse) {
  .btn:hover::before { transform: translateX(-130%); }
  .btn:active::before { transform: translateX(130%); transition-duration: .25s; }
  .admin-link:active, .mini-btn:active { transform: scale(.97); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media (max-width: 860px) {
  .admin-shell { display: block; min-height: 100vh; }
  .admin-side { position: fixed; z-index: 80; inset: 0 auto 0 0; width: min(82vw, 290px); height: 100vh; padding: 18px 14px; transform: translateX(-105%); animation: none; transition: transform .25s ease, box-shadow .25s ease; box-shadow: 12px 0 30px rgba(0,0,0,.28); }
  .admin-side.mobile-open { transform: translateX(0); animation: none; box-shadow: 12px 0 40px rgba(0,0,0,.45); }
  .admin-side .side-bottom { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }
  .admin-main { width: 100%; min-width: 0; padding: 68px 18px 40px; }
  .mobile-nav-toggle { position: fixed; z-index: 90; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(18,22,42,.92); color: var(--text); box-shadow: 0 8px 22px rgba(0,0,0,.2); cursor: pointer; }
  .mobile-nav-backdrop { position: fixed; z-index: 70; inset: 0; display: block; width: 100%; height: 100%; border: 0; padding: 0; background: rgba(4,6,15,.58); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
  .mobile-nav-backdrop.visible { opacity: 1; pointer-events: auto; }
  .mobile-nav-toggle [data-lucide] { width: 17px; height: 17px; }
  .admin-top { align-items: flex-start; margin-bottom: 18px; }
  .admin-top h1 { max-width: 100%; font-size: 19px; line-height: 1.35; }
  .admin-top h1 small { display: block; margin: 3px 0 0 !important; }
  .admin-top > .btn, .admin-top > form { flex: 0 0 auto; }
  .panel { padding: 16px; margin-bottom: 16px; border-radius: 12px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
  .stat { min-width: 0; padding: 13px 14px; }
  .stat .num { font-size: 22px; overflow-wrap: anywhere; }
  .table-wrap { margin: 0 -16px; padding: 0 16px 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap::after { content: '左右滑动查看更多'; display: block; padding-top: 7px; color: #687194; font-size: 11px; text-align: right; }
  table.tb { min-width: 720px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .form-item.full { grid-column: auto; }
  .toolbar { align-items: stretch; }
  .toolbar input[type=text], .toolbar select, .toolbar .btn { width: 100%; max-width: none; height: 42px; }
  .row-actions { gap: 7px; }
  .row-actions .icon-btn { min-height: 34px; }
  .form-actions .btn { min-height: 42px; flex: 1 1 150px; }
  .checks label { min-height: 42px; }
}

@media (max-width: 480px) {
  .admin-main { padding-left: 12px; padding-right: 12px; }
  .admin-top { gap: 10px; }
  .admin-top h1 { font-size: 17px; }
  .admin-top > .btn, .admin-top > form, .admin-top > form .btn { width: 100%; }
  .panel { padding: 13px; }
  .table-wrap { margin-left: -13px; margin-right: -13px; padding-left: 13px; padding-right: 13px; }
  .stat .cap { font-size: 12px; }
  .stat .num { font-size: 20px; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; flex: none; }
}
