/* ==========================================================================
   TG 接码面板
   视觉层：深色液态玻璃（结构照搬 纯CSS液态玻璃，只调亮度适配深底）
   ========================================================================== */

:root {
  --bg:        #0b0c0d;
  --grid:      rgba(255, 255, 255, .05);

  --ink:       #eceef0;
  --ink-2:     #a4aaaf;
  --ink-3:     #6f757a;
  --ink-4:     #4d5357;

  --line:      rgba(255, 255, 255, .07);
  --line-2:    rgba(255, 255, 255, .11);

  --accent:     #3ddc97;
  --accent-dim: #2aa876;
  --accent-ink: #05201a;
  --danger:     #f16a64;
  --warn:       #e8b44a;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;

  --pad: 16px;
  --tap: 42px;

  --tr: 25%;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 400 14px/1.55 ui-sans-serif, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "PingFang SC", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;

  /* 网格底，照搬演示页，只是换成深色 */
  background-color: var(--bg);
  background-image:
    linear-gradient(0deg,
      transparent 24%, var(--grid) 25%, var(--grid) 26%, transparent 27%,
      transparent 74%, var(--grid) 75%, var(--grid) 76%, transparent 77%, transparent),
    linear-gradient(90deg,
      transparent 24%, var(--grid) 25%, var(--grid) 26%, transparent 27%,
      transparent 74%, var(--grid) 75%, var(--grid) 76%, transparent 77%, transparent);
  background-size: 55px 55px;
  background-attachment: fixed;
}

body.center {
  display: grid;
  place-items: center;
  padding: 24px;
}

a { color: inherit; text-decoration: none; }

code, pre, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line);
  color: var(--ink-2);
  word-break: break-all;
}

pre {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line);
  overflow-x: auto;
  line-height: 1.7;
}

pre code {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
}

/* ==========================================================================
   玻璃基件
   内高光 + 内暗框(blur 8) + 45° 双向高光(blur 3)，三层照搬示例
   ========================================================================== */

.glass,
.card,
.list,
.tk,
.login,
.stats {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px double rgba(255, 255, 255, .06);

  box-shadow:
    inset 2px -2px 1px -1px rgba(255, 255, 255, .28),
    inset -2px 2px 1px -1px rgba(255, 255, 255, .28),
    inset 6px -6px 1px -6px rgba(255, 255, 255, .18),
    inset -6px 6px 1px -6px rgba(255, 255, 255, .18),
    inset 0 0 2px rgba(0, 0, 0, .95),
    0 14px 38px rgba(0, 0, 0, .55);

  background: rgba(255, 255, 255, .055);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* 内层暗框：制造边缘折射 */
.glass::before,
.card::before,
.list::before,
.tk::before,
.login::before,
.stats::before {
  content: '';
  position: absolute;
  inset: 8px;
  z-index: 1;
  border-radius: inherit;
  border: 1px solid rgba(0, 0, 0, .55);
  filter: blur(8px);
  pointer-events: none;
}

/* 45° 双向高光 */
.glass::after,
.card::after,
.list::after,
.tk::after,
.login::after,
.stats::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  filter: blur(3px);
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, .42) 0%,
    transparent var(--tr),
    transparent calc(100% - var(--tr)),
    rgba(255, 255, 255, .42) 100%
  );
  pointer-events: none;
}

/* 内容压在两层装饰之上 */
.card > *,
.list > *,
.stats > *,
.login > *,
.tk .tk-head,
.tk .tk-cut,
.tk .tk-body {
  position: relative;
  z-index: 3;
}

/* ==========================================================================
   侧边栏（分组 + 滑动高亮块 + 手风琴）
   ========================================================================== */

.side {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 224px;
  display: flex;
  flex-direction: column;
  padding: 14px 10px 12px;
  background: rgba(11, 12, 13, .84);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-right: 1px solid rgba(255, 255, 255, .06);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(61, 220, 151, .6);
  flex: none;
}

.dot.big { width: 10px; height: 10px; }

.side-nav {
  position: relative;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 8px;
}

/* 高亮块：只动 transform / height，切换时续接，不闪 */
.nav-pill {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 0;
  height: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    inset 0 0 0 1px rgba(255, 255, 255, .05);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition:
    transform .28s cubic-bezier(.32, .72, 0, 1),
    height .28s cubic-bezier(.32, .72, 0, 1),
    opacity .18s;
}

.nav-group { margin-bottom: 2px; }

.nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 10px 7px;
  background: none;
  border: 0;
  color: var(--ink-4);
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .15s;
}

.nav-head:hover { color: var(--ink-2); }

.caret {
  width: 5px;
  height: 5px;
  margin-right: 3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform .2s;
}

.nav-group.closed .caret { transform: rotate(-45deg) translateX(-1px); }

/* 折叠：用 grid 行高的原生插值，容器高度和后面栏目严格同步 */
.nav-sub {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .32s cubic-bezier(.32, .72, 0, 1);
}

.nav-group.closed .nav-sub {
  grid-template-rows: 0fr;
}

.nav-sub > .nav-inner {
  overflow: hidden;
  min-height: 0;
}

/* 子项错峰：展开时自上而下逐个淡入上移 */
.nav-sub .nav-item {
  opacity: 1;
  transform: none;
  transition:
    opacity .22s ease,
    transform .26s cubic-bezier(.32, .72, 0, 1);
  transition-delay: 0s;
}

.nav-group.closed .nav-item {
  opacity: 0;
  transform: translateY(-6px);
  transition-delay: 0s;
}

.nav-group:not(.closed) .nav-item:nth-child(1) { transition-delay: .04s; }
.nav-group:not(.closed) .nav-item:nth-child(2) { transition-delay: .08s; }
.nav-group:not(.closed) .nav-item:nth-child(3) { transition-delay: .12s; }
.nav-group:not(.closed) .nav-item:nth-child(4) { transition-delay: .16s; }

.nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-3);
  font-size: 13px;
  transition: color .15s;
}

.nav-item:hover { color: var(--ink); }
.nav-item.active { color: var(--ink); }

.nav-item b {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

.nav-item.active b { color: var(--ink-2); }

.side-foot {
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .05);
}

.nav-item.quit { color: var(--ink-4); font-size: 12.5px; }
.nav-item.quit:hover { color: var(--danger); }

/* 遮罩 */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s;
}

/* ---------- 主壳 ---------- */

.shell {
  margin-left: 224px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 54px;
  padding: 0 var(--pad);
  background: rgba(11, 12, 13, .74);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.top-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions { display: flex; gap: 8px; flex: none; }

.burger {
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  flex: none;
}

.burger:hover { background: rgba(255, 255, 255, .06); }

.burger span {
  display: block;
  width: 16px;
  height: 1.5px;
  margin: 3px 0;
  border-radius: 1px;
  background: var(--ink-2);
}

.brand { display: none; }

/* ---------- 版心 ---------- */

main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 22px var(--pad) 40px;
}

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--pad) 22px;
  color: var(--ink-4);
  font-size: 11.5px;
  letter-spacing: .02em;
}

.page-head { margin: 0 0 16px; }

.page-head h2 {
  margin: 0 0 3px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.page-head p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
}

/* ---------- 卡片 ---------- */

.card {
  padding: 18px;
  margin-bottom: 12px;
}

.card h1 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}

.card .sub {
  margin: 0 0 20px;
  color: var(--ink-3);
  font-size: 13px;
}

.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  font-size: 13.5px;
}

.kv:first-child { padding-top: 0; }
.kv:last-child { padding-bottom: 0; border-bottom: 0; }

.kv span {
  flex: none;
  color: var(--ink-3);
  font-size: 12.5px;
}

.kv b {
  min-width: 0;
  text-align: right;
  font-weight: 500;
  word-break: break-all;
}

.hint {
  margin: 10px 0 0;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.7;
}

.hint b { color: var(--ink-2); font-weight: 500; }
.hint + .hint { margin-top: 6px; }
.dim { color: var(--ink-4); font-weight: 400; }

/* ---------- 表单 ---------- */

.field { display: block; margin-bottom: 14px; }

.field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
}

input[type=password],
input[type=tel],
input[type=text],
input[type=file],
select {
  width: 100%;
  min-height: var(--tap);
  padding: 0 13px;
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  outline: none;
  appearance: none;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .32);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, .55),
    inset 0 0 0 1px rgba(255, 255, 255, .02);
  transition: border-color .14s, background .14s;
}

input[type=file] {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.3;
}

input::placeholder { color: var(--ink-4); }

input:hover, select:hover { border-color: rgba(255, 255, 255, .14); }

input:focus, select:focus {
  border-color: var(--accent-dim);
  background: rgba(0, 0, 0, .42);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, .55),
    0 0 0 3px rgba(61, 220, 151, .1);
}

select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

/* ---------- 按钮 ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 16px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  border-radius: var(--r-md);
  border: 1px double rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .05);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow:
    inset 1px -1px 1px -1px rgba(255, 255, 255, .18),
    inset -1px 1px 1px -1px rgba(255, 255, 255, .18),
    inset 0 0 2px rgba(0, 0, 0, .7),
    0 4px 12px rgba(0, 0, 0, .3);
  transition: background .14s, border-color .14s, transform .08s;
}

.btn:hover { background: rgba(255, 255, 255, .085); }
.btn:active { transform: translateY(1px); }

.btn.primary {
  width: 100%;
  color: var(--accent-ink);
  font-weight: 600;
  border-color: rgba(61, 220, 151, .5);
  background: linear-gradient(180deg, #4ae7a4, #2ec98a);
  box-shadow:
    inset 1px -1px 1px -1px rgba(255, 255, 255, .55),
    inset -1px 1px 1px -1px rgba(255, 255, 255, .45),
    inset 0 0 2px rgba(0, 60, 40, .5),
    0 8px 22px rgba(46, 201, 138, .22);
}

.btn.primary:hover { background: linear-gradient(180deg, #55eeae, #35d295); }

.btn.primary:disabled {
  color: var(--ink-4);
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .07);
  box-shadow: inset 0 0 2px rgba(0, 0, 0, .6);
  cursor: not-allowed;
  transform: none;
}

.btn.ghost {
  color: var(--ink-2);
  background: transparent;
  border-color: rgba(255, 255, 255, .07);
  box-shadow: none;
  backdrop-filter: none;
}

.btn.ghost:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }

.btn.sm {
  min-height: 34px;
  padding: 0 13px;
  font-size: 12.5px;
  border-radius: var(--r-sm);
}

.btn.mini {
  min-height: 30px;
  padding: 0 11px;
  font-size: 12.5px;
  border-radius: var(--r-sm);
}

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn { flex: 1; min-width: 128px; }
.actions.center { justify-content: center; }

.page-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

/* ---------- 提示条 ---------- */

.flash {
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: var(--r-md);
  border: 1px solid;
  font-size: 13px;
  line-height: 1.6;
  backdrop-filter: blur(2px);
}

.flash.ok   { background: rgba(61,220,151,.08); border-color: rgba(61,220,151,.26); color: #86eec1; }
.flash.bad  { background: rgba(241,106,100,.08); border-color: rgba(241,106,100,.28); color: #f2a5a1; }
.flash.warn { background: rgba(232,180,74,.08); border-color: rgba(232,180,74,.26); color: #eec981; }
.flash code { font-size: 11.5px; }

.flash .cmd {
  display: block;
  margin-top: 6px;
  padding: 6px 9px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .38);
  border: 1px solid rgba(255, 255, 255, .06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--ink-2);
  overflow-x: auto;
  white-space: nowrap;
}

/* ---------- 统计 ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 18px;
  overflow: hidden;
}

.stat {
  padding: 13px 12px;
  text-align: left;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, .05);
}

.stat:last-child { border-right: 0; }

.stat b {
  display: block;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  margin-top: 1px;
  color: var(--ink-4);
  font-size: 10.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.ok-t   { color: var(--accent); }
.warn-t { color: var(--warn); }
.bad-t  { color: var(--danger); }

/* ---------- 账号列表 ---------- */

.list { overflow: hidden; }

.rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-head {
  margin: 0 2px 10px;
  color: var(--ink-4);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border-radius: var(--r-lg);
  transition: background .14s, transform .12s;
}

.row:hover { background: rgba(255, 255, 255, .085); }
.row:active { transform: scale(.995); }

/* 小尺寸玻璃件的内暗框收紧一点 */
.row.glass::before { inset: 4px; }
.row.glass::after  { opacity: .55; }

.row > * {
  position: relative;
  z-index: 3;
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 11px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow:
    inset 1px -1px 1px -1px rgba(255, 255, 255, .16),
    inset 0 0 2px rgba(0, 0, 0, .6);
}

.meta { flex: 1; min-width: 0; }

.line1 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  overflow: hidden;
}

.line1 b {
  flex: 0 1 auto;
  min-width: 0;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line2 {
  margin-top: 0;
  color: var(--ink-4);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ops {
  display: flex;
  align-items: center;
  gap: 0;
  flex: none;
  padding: 2px;
  border-radius: 9px;
  background: rgba(0, 0, 0, .3);
  box-shadow: inset 0 0 2px rgba(0, 0, 0, .7);
}

.ops form { display: flex; margin: 0; }

.icon {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  max-width: 26px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-4);
  font: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  overflow: hidden;
  transition: background .14s, color .14s;
}

.icon:hover { background: rgba(255, 255, 255, .08); color: var(--ink); }
.icon.txt { font-size: 12px; }
.icon.danger:hover { background: rgba(241,106,100,.14); color: var(--danger); }

/* ---------- 徽章 ---------- */

.badge {
  display: inline-block;
  flex: none;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid transparent;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: .02em;
}

.badge.ok   { color: #7ce9bb; background: rgba(61,220,151,.10); border-color: rgba(61,220,151,.22); }
.badge.warn { color: #eec981; background: rgba(232,180,74,.10); border-color: rgba(232,180,74,.22); }
.badge.bad  { color: #f2a5a1; background: rgba(241,106,100,.10); border-color: rgba(241,106,100,.22); }
.badge.mute { color: var(--ink-4); background: rgba(0,0,0,.22); border-color: rgba(255,255,255,.06); }

/* ---------- 空态 ---------- */

.empty {
  padding: 56px 20px;
  text-align: center;
  border-radius: var(--r-lg);
  border: 1px dashed rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .02);
}

.empty .dot.big { margin: 0 auto 16px; }

.empty h2 {
  margin: 0 0 5px;
  font-size: 16px;
  font-weight: 600;
}

.empty p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
}

/* ---------- 导出 ---------- */

.ex-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.ex-grid .btn {
  width: 100%;
  min-height: 38px;
  font-size: 12.5px;
}

/* ---------- 登录页 ---------- */

.login {
  width: 100%;
  max-width: 340px;
  padding: 32px 24px 24px;
  text-align: center;
  --tr: 20%;
}

.login .logo {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.login .logo .dot {
  width: 12px;
  height: 12px;
  box-shadow: 0 0 0 7px rgba(61, 220, 151, .1), 0 0 16px rgba(61, 220, 151, .5);
}

.login h1 {
  margin: 0 0 5px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.login .sub {
  margin: 0 0 22px;
  color: var(--ink-3);
  font-size: 13px;
}

.login input {
  text-align: center;
  letter-spacing: .18em;
  font-size: 15px;
  margin-bottom: 12px;
}

/* ---------- 窄屏 ---------- */

@media (max-width: 860px) {
  .side {
    width: 264px;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.32, .72, 0, 1);
    box-shadow: 14px 0 48px rgba(0, 0, 0, .55);
  }
  body.side-open .side { transform: none; }
  body.side-open .scrim { opacity: 1; pointer-events: auto; }
  .shell { margin-left: 0; }
  .burger { display: grid; }
}

@media (max-width: 520px) {
  :root { --pad: 14px; }

  main { padding: 16px var(--pad) 32px; }

  .top { height: 50px; }
  .top nav a { padding: 6px 8px; font-size: 12.5px; }
  .brand span:last-child { font-size: 13px; }

  .stat { padding: 11px 8px; }
  .stat b { font-size: 15px; }
  .stat span { font-size: 9.5px; letter-spacing: .04em; }

  .row { padding: 11px 12px; gap: 10px; }
  .avatar { width: 34px; height: 34px; font-size: 13px; }

  .card { padding: 15px; }
  .page-head h2 { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 老设备不支持 backdrop-filter 时，用更实的底 */
@supports not (backdrop-filter: blur(2px)) {
  .card, .list, .stats, .tk, .login { background: rgba(22, 24, 26, .92); }
}

/* ==========================================================================
   接码页 —— 一张玻璃票
   ========================================================================== */

.tk-wrap {
  max-width: 400px;
  margin: 0 auto;
  padding: 34px 18px 40px;
}

.tk-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 20px;
  color: var(--ink-4);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tk-phone {
  margin-bottom: 14px;
  text-align: center;
  color: var(--ink-2);
  font-size: 13px;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}

.tk {
  --tr: 22%;
  border-radius: 20px;
}

/* 缺口：压在撕线上 */
.tk-cut {
  position: relative;
  height: 1px;
  margin: 0 14px;
  background-image: linear-gradient(90deg, rgba(255,255,255,.16) 0 6px, transparent 6px 12px);
  background-size: 12px 1px;
}

.tk-cut::before,
.tk-cut::after {
  content: "";
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 15px;
  height: 15px;
  margin-top: -7.5px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .8);
}

.tk-cut::before { left: -8px;  border-right-color: transparent; }
.tk-cut::after  { right: -8px; border-left-color: transparent; }

.tk-head {
  padding: 24px 20px 20px;
  text-align: center;
}

.tk-label {
  color: var(--ink-4);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.tk-code {
  margin: 12px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 52px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .14em;
  text-indent: .16em;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(61, 220, 151, .28);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.tk-code.empty {
  color: var(--ink-4);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: .06em;
  text-indent: 0;
  text-shadow: none;
}

.tk-body { padding: 16px 20px 20px; }

.tk-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-4);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.tk-meta b { color: var(--ink-2); font-weight: 500; }

.tk-bar {
  height: 2px;
  margin-top: 10px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
}

.tk-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width 1s linear;
}

.tk-pwd {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6);
}

.tk-pwd-label {
  color: var(--ink-4);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.tk-pwd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tk-pwd-row b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  word-break: break-all;
}

.tk-msg {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .26);
  border: 1px solid rgba(255, 255, 255, .05);
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.65;
  word-break: break-word;
  max-height: 96px;
  overflow: auto;
}

.tk-status {
  margin-top: 14px;
  text-align: center;
  color: var(--ink-4);
  font-size: 11.5px;
  min-height: 16px;
}

.tk-status.bad { color: var(--danger); }

.tk-copy {
  width: 100%;
  margin-top: 16px;
}
