/* Hygger Admin Control Center — Abyss Emerald Dark-Sidebar Theme & Silky Motion */
:root {
  --ink: #0f172a; --muted: #64748b; --green: #059669; --green-dark: #047857;
  --mint: #ecfdf5; --line: rgba(15, 23, 42, .08); --line-strong: rgba(15, 23, 42, .16);
  --bg: #f2f6f5; --card: #ffffff; --red: #b91c1c; --gold: #b45309;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 14px 30px -8px rgba(15, 23, 42, .12), 0 4px 10px -4px rgba(15, 23, 42, .06);
  --ease: cubic-bezier(.22, 1, .36, 1);
}
@keyframes adminFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes adminPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .55); } 60% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink);
  background:
    radial-gradient(860px 420px at 94% -10%, rgba(16, 185, 129, .09), transparent 60%),
    radial-gradient(620px 360px at 26% -8%, rgba(6, 182, 212, .06), transparent 60%),
    var(--bg);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
h1 { font-size: 22px; margin: 4px 0 0; letter-spacing: -.3px; }
h2.page { font-size: 21px; font-weight: 700; letter-spacing: -.4px; margin: 0 0 4px; color: var(--ink); }
h3.sec { font-size: 14px; font-weight: 700; margin: 18px 0 8px; color: var(--ink); }
.sub { color: var(--muted); font-size: 12.5px; }
.err { color: var(--red); font-size: 13px; }

/* 丝滑按钮体系 */
.primary, .ghost, .danger {
  border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px;
  transition: transform .16s var(--ease), box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.primary {
  background: linear-gradient(135deg, #059669 0%, #0d9488 100%); color: #fff; border: 0;
  padding: 9px 16px; box-shadow: 0 4px 12px rgba(5, 150, 105, .26), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(5, 150, 105, .34); filter: brightness(1.04); }
.primary:active:not(:disabled) { transform: scale(.98); }
.primary:disabled { opacity: .52; cursor: not-allowed; box-shadow: none; }
.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line-strong); padding: 8px 14px; box-shadow: var(--shadow-xs); }
.ghost:hover:not(:disabled) { background: #f8faf9; border-color: rgba(16, 185, 129, .45); color: var(--green-dark); transform: translateY(-1px); }
.danger { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; padding: 8px 14px; }
.danger:hover { background: #fee2e2; transform: translateY(-1px); }
.text-link { background: none; border: 0; color: var(--green-dark); cursor: pointer; padding: 3px 6px; border-radius: 6px; font-weight: 600; font-size: 12.5px; transition: background .14s ease; }
.text-link:hover { background: var(--mint); }
.text-link.danger-link { color: var(--red); }
.text-link.danger-link:hover { background: #fef2f2; }
.text-link:disabled { color: #94a3b8; cursor: not-allowed; }

/* 登录页 */
.login-body {
  display: grid; place-items: center; min-height: 100vh;
  background: radial-gradient(800px 420px at 85% 10%, rgba(16, 185, 129, .18), transparent 60%), linear-gradient(135deg, #071b19 0%, #0d2f29 55%, #091f22 100%);
}
.login-card {
  width: min(420px, calc(100% - 32px)); background: rgba(255, 255, 255, .97); padding: 30px;
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 18px; box-shadow: 0 28px 70px rgba(0, 0, 0, .38);
  animation: adminFadeIn .28s var(--ease) both;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 18px;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%); color: #03201b;
  box-shadow: 0 6px 20px rgba(16, 185, 129, .36), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.brand small { display: block; color: var(--muted); font-size: 11px; }
.login-card label { display: block; margin: 12px 0; font-size: 12.5px; color: #475569; font-weight: 500; }
.login-card input { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; }
.login-card input:focus { outline: none; border-color: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
.login-card .primary { width: 100%; margin-top: 10px; }
.foot { color: #94a3b8; font-size: 11.5px; margin-top: 16px; }

/* 暗色翡翠控制中心侧边栏 */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 232px; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #061816 0%, #0a2420 55%, #071917 100%);
  border-right: 1px solid rgba(255, 255, 255, .07); box-shadow: 4px 0 28px rgba(6, 24, 22, .16);
  padding: 20px 14px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .brand { padding: 4px 6px 18px; margin-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.side .brand b { color: #f8fafc; letter-spacing: .8px; font-size: 16px; }
.side .brand small { color: rgba(203, 213, 225, .72); margin-top: 2px; }
.side nav { display: grid; gap: 3px; flex: 1; align-content: start; }
.side nav button {
  position: relative; text-align: left; border: 0; background: none; padding: 9px 11px;
  border-radius: 9px; cursor: pointer; color: rgba(226, 232, 240, .78); font-size: 13px; font-weight: 500;
  transition: background .18s ease, color .18s ease, transform .18s var(--ease);
}
.side nav button:hover { background: rgba(255, 255, 255, .07); color: #ffffff; transform: translateX(2px); }
.nav-ico { width: 15px; height: 15px; flex: 0 0 15px; opacity: .82; }
.nav-label { display: inline-flex; align-items: center; gap: 8px; }
.nav-group {
  display: flex; align-items: center; justify-content: space-between; margin-top: 6px;
  font-size: 12px !important; letter-spacing: .4px; color: rgba(148, 163, 184, .9) !important; font-weight: 600 !important;
  padding: 9px 10px 7px !important;
}
.nav-group:hover { background: rgba(255, 255, 255, .04) !important; color: #e2e8f0 !important; transform: none !important; }
.nav-caret { font-size: 11px; transition: transform .2s var(--ease); opacity: .7; }
.nav-group.open .nav-caret { transform: rotate(180deg); }
.nav-sub { display: none; }
.nav-sub.open { display: grid; gap: 2px; margin: 0 0 6px 14px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .08); }
.nav-sub button { padding: 8px 11px !important; font-size: 12.5px; }
.side nav button.active {
  background: linear-gradient(90deg, rgba(16, 185, 129, .24) 0%, rgba(6, 182, 212, .1) 100%);
  color: #ecfdf5; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .32);
}
.side nav button.active::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #34d399, #22d3ee); box-shadow: 0 0 10px rgba(52, 211, 153, .8);
}
.side .who {
  margin-top: 16px; padding: 12px 10px 4px; border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 12px; color: rgba(203, 213, 225, .82); display: flex; flex-direction: column; gap: 6px;
}
.who-status { display: flex; align-items: center; gap: 7px; }
.who-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; animation: adminPulse 2.4s infinite; }
.who-logout { align-self: flex-start; color: #6ee7b7 !important; padding: 2px 0 !important; }
.who-logout:hover { background: transparent !important; color: #a7f3d0 !important; text-decoration: underline; }

/* 主内容区 */
.main { flex: 1; padding: 26px 32px 64px; min-width: 0; max-width: 1560px; }
.main > * { animation: adminFadeIn .26s var(--ease) both; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.grid { display: grid; gap: 13px; }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
  box-shadow: var(--shadow-xs); transition: transform .2s var(--ease), border-color .2s ease, box-shadow .2s ease;
}
.stat:hover { transform: translateY(-2px); border-color: rgba(16, 185, 129, .38); box-shadow: var(--shadow-md); }
.stat span { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat b { display: block; font-size: 26px; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.stat.warn b { color: var(--gold); }

/* 表格与徽章 */
.wrap, .table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; color: #475569; font-weight: 600; white-space: nowrap;
  padding: 10px 12px; background: #f8faf9; border-bottom: 1px solid var(--line);
}
td { padding: 11px 12px; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: middle; transition: background .12s ease; }
tbody tr:nth-child(even) td { background: #fafdfb; }
tbody tr:hover td { background: #edf7f3; }
td .row, td .actions { flex-wrap: nowrap; white-space: nowrap; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 11.5px; font-weight: 600;
  border-radius: 999px; padding: 3px 9px; background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.red { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge.gold { background: #fffbeb; color: #b45309; border-color: #fde68a; }

/* 图表与排行榜 */
.bars { display: grid; gap: 7px; }
.bar { display: grid; grid-template-columns: 110px 1fr 48px; gap: 8px; align-items: center; font-size: 12.5px; }
.bar i { display: block; height: 8px; background: linear-gradient(90deg, #10b981, #06b6d4); border-radius: 999px; min-width: 2px; }
.trend-wrap { padding: 4px 0 0; }
.timeline { display: flex; align-items: flex-end; gap: 5px; height: 138px; overflow-x: auto; }
.trend-col { flex: 1 0 28px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.trend-col b { font-size: 10px; color: #64748b; font-weight: 600; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.trend-col i { display: block; width: 100%; max-width: 34px; background: linear-gradient(180deg, #10b981, #0d9488); border-radius: 6px 6px 0 0; min-height: 4px; transition: transform .18s var(--ease), filter .18s ease; }
.trend-col:hover i { transform: scaleY(1.04); filter: brightness(1.1); }
.trend-col span { font-size: 9.5px; color: #94a3b8; margin-top: 5px; white-space: nowrap; }

/* 表单、筛选条、分段控件 */
.field { display: block; margin: 10px 0; font-size: 12.5px; color: #475569; font-weight: 500; }
.field input, .field select, .field textarea, .num-input, .text-input {
  border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.field input, .field select, .field textarea { width: 100%; margin-top: 5px; padding: 9px 11px; }
.field input:focus, .field textarea:focus, .num-input:focus, .text-input:focus {
  outline: none; border-color: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .16);
}
.field.check { display: flex; align-items: center; gap: 8px; }
.field.check input { width: auto; margin: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer, .grow { flex: 1; }
.num-input { width: 108px; padding: 7px 10px; }
.text-input { padding: 8px 11px; }
.mono { font-variant-numeric: tabular-nums; }
.filter-bar { padding: 13px 16px; }
.filter-bar select, .filter-bar input[type=date] { margin-left: 5px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 9px; }
.seg { display: inline-flex; background: #e8efed; border-radius: 10px; padding: 3px; gap: 2px; border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: #475569; transition: all .16s ease; }
.seg button.on { background: #fff; color: var(--green-dark); box-shadow: 0 2px 6px rgba(15, 23, 42, .08); }
.toast {
  position: fixed; right: 24px; bottom: 24px; background: #071d1b; color: #ecfdf5; border: 1px solid rgba(52, 211, 153, .3);
  padding: 11px 18px; border-radius: 11px; box-shadow: var(--shadow-md); opacity: 0; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s var(--ease); pointer-events: none; z-index: 900;
}
.toast.show { opacity: 1; transform: translateY(0); }
pre.detail { margin: 4px 0 0; font-size: 11.5px; color: #64748b; white-space: pre-wrap; word-break: break-all; }
.hint { background: var(--mint); color: #065f46; border: 1px solid #a7f3d0; border-radius: 10px; padding: 10px 13px; font-size: 12.5px; }
.mSteps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.mSteps li { font-size: 12.5px; padding: 9px 12px; border-radius: 9px; background: #f8faf9; border: 1px solid var(--line); }
.mSteps li.ok b { color: var(--green); }
.mSteps li.bad { background: #fef2f2; border-color: #fecaca; }
.mSteps li.bad b { color: var(--red); }
.prov-list { display: grid; gap: 11px; }
.prov-card { border: 1px solid var(--line); border-radius: 12px; padding: 15px 16px; background: #fcfdfd; transition: border-color .16s ease, box-shadow .16s ease; }
.prov-card:hover { border-color: rgba(16, 185, 129, .35); box-shadow: var(--shadow-xs); }
.prov-card.muted { background: #f8faf9; }
.prov-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prov-head b { font-size: 13.5px; }
.prov-meta { margin: 10px 0 12px; display: grid; gap: 4px; }
.prov-meta div { display: flex; gap: 10px; font-size: 12px; }
.prov-meta dt { color: var(--muted); flex: 0 0 72px; }
.prov-meta dd { margin: 0; word-break: break-all; }
.prov-card .how { color: #94a3b8; font-size: 11px; }
.empty-hint { padding: 20px; text-align: center; color: var(--muted); font-size: 12.5px; background: #f8faf9; border-radius: 10px; }
.switch { position: relative; display: inline-flex; width: 40px; height: 22px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track { position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px; transition: .18s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: .18s var(--ease); box-shadow: 0 1px 3px rgba(15, 23, 42, .2); }
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.route-path { font-size: 11.5px; background: #f1f5f4; color: #065f46; padding: 2px 7px; border-radius: 6px; font-family: ui-monospace, Consolas, monospace; }
.rank-list { display: grid; gap: 2px; }
.rank-row { display: grid; grid-template-columns: 22px minmax(90px, 1.1fr) 1.4fr auto; gap: 10px; align-items: center; padding: 6px 4px; border-top: 1px solid #f1f5f9; font-size: 12.5px; }
.rank-row:first-child { border-top: 0; }
.rank-no { color: #94a3b8; font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-track { display: block; height: 8px; background: #eef2f1; border-radius: 999px; overflow: hidden; }
.rank-track i { display: block; height: 100%; background: linear-gradient(90deg, #10b981, #06b6d4); border-radius: 999px; }
.rank-track i.bad { background: linear-gradient(90deg, #f87171, #ef4444); }
.rank-value { color: #475569; font-size: 11.5px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

dialog {
  width: min(460px, calc(100% - 28px)); padding: 22px 24px; border: 1px solid var(--line-strong);
  border-radius: 16px; background: #fff; box-shadow: 0 24px 60px -12px rgba(6, 24, 22, .35);
}
dialog::backdrop { background: rgba(6, 24, 22, .48); backdrop-filter: blur(5px); }
dialog h3 { margin: 0 0 10px; font-size: 17px; }
@media (max-width: 900px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.c2, .grid-2-form { grid-template-columns: 1fr; }
  .side { width: 68px; }
  .side nav button span { display: none; }
}
