/* 昵称迁移系统 · 后台与链接页共用样式
   纯静态资源，无构建步骤：所有页面直接 <link rel="stylesheet" href="/app.css"> */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --border: #e6eaf2;
  --border-strong: #d6dbe7;
  --text: #1b2333;
  --text-2: #4a5468;
  --muted: #7b8497;
  --primary: #3b6ef6;
  --primary-d: #2c58d4;
  --primary-soft: #eaf0ff;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --ok: #12a150;
  --ok-soft: #e7f7ee;
  --warn: #c2740b;
  --warn-soft: #fdf3e2;
  --purple: #7c5cf0;
  --purple-soft: #f0ecff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 28px rgba(16, 24, 40, .06);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --sidebar: 224px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
        system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 布局 ---------- */

.layout { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  background: #151b2b;
  color: #c8d0e0;
  padding: 20px 14px;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 22px;
}

.brand .logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #4c7bff, #7f5cff);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex: none;
}

.brand b { display: block; color: #fff; font-size: 14px; line-height: 1.3; }
.brand small { display: block; color: #7d879c; font-size: 11px; letter-spacing: .2px; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #b9c2d4;
  font-size: 13.5px;
  text-decoration: none;
  transition: background .15s, color .15s;
}

.nav a:hover { background: #1e2637; color: #fff; text-decoration: none; }
.nav a.active { background: #26314a; color: #fff; }
.nav a.active .ico { color: #7ea0ff; }

.nav .ico { width: 17px; height: 17px; stroke: currentColor; fill: none;
            stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.sidebar-foot {
  margin-top: auto;
  padding: 12px 10px 2px;
  font-size: 11px;
  color: #5d6780;
  border-top: 1px solid #232b3d;
}

.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  height: 62px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.page-title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12.5px;
}

.user-chip::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

.content { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 18px; }

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}

.card-hd h2 { margin: 0; font-size: 14px; font-weight: 600; }
.card-hd .hint { color: var(--muted); font-size: 12.5px; }
.card-bd { padding: 18px; }
.card-bd.tight { padding: 0; }

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

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field .tip { font-size: 12px; color: var(--muted); }

.input, .select, .table input, .table select {
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.input:focus, .select:focus, .table input:focus, .table select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 110, 246, .14);
}

.input::placeholder { color: #a7afc0; }
.select { padding-right: 28px; cursor: pointer; }
.input.wide { min-width: 190px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}

.btn:hover { background: var(--surface-2); border-color: #c3cadb; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(59, 110, 246, .3);
}
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #cf3b40; border-color: #cf3b40; }

.btn-danger-ghost { color: var(--danger); border-color: #f2c9cb; background: #fff; }
.btn-danger-ghost:hover { background: var(--danger-soft); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #eef1f7; border-color: transparent; }

.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 表格 ---------- */

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: auto;
}

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }

table.data th, table.data td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}

table.data th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 600;
  font-size: 12.5px;
  z-index: 1;
}

table.data tbody tr:hover { background: #f8faff; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.wrap { white-space: normal; min-width: 220px; }

table.data .row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hint-text { color: var(--muted); font-size: 12px; }

.empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- 状态徽标 ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1px;
  border: 1px solid transparent;
}

.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge-blue    { background: var(--primary-soft); color: #2f5bd0; border-color: #d8e3ff; }
.badge-green   { background: var(--ok-soft); color: #0e8a45; border-color: #cdeeda; }
.badge-amber   { background: var(--warn-soft); color: var(--warn); border-color: #f6e3c4; }
.badge-red     { background: var(--danger-soft); color: #c53a3f; border-color: #f7d4d5; }
.badge-purple  { background: var(--purple-soft); color: #6244d8; border-color: #e2dbff; }
.badge-neutral { background: #f1f3f8; color: #5d6678; border-color: #e3e7f0; }

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

.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  border: 1px solid #d8e3ff;
  color: #2f5bd0;
  font-size: 13px;
}

.alert:empty { display: none; }
.alert.warn { background: var(--warn-soft); border-color: #f6e3c4; color: var(--warn); }
.alert.err { background: var(--danger-soft); border-color: #f7d4d5; color: #c53a3f; }

/* ---------- 分页 ---------- */

.pager { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.pager .spacer { flex: 1; }

/* ---------- 详情抽屉 / 弹窗 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 23, 38, .42);
  backdrop-filter: blur(2px);
}

.modal.open { display: flex; }

.modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(16, 24, 40, .28);
  overflow: hidden;
}

.modal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-hd h3 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.modal-bd { padding: 18px 20px; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-ft {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
  padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
}

.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: none; background: transparent; color: var(--muted);
  border-radius: 8px; cursor: pointer; font-size: 16px; line-height: 1;
}
.icon-btn:hover { background: #eef1f7; color: var(--text); }

/* 键值网格 */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0; }
.kv > div { min-width: 0; }
.kv dt { color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.kv dd { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.kv .full { grid-column: 1 / -1; }

/* 时间线 */
.timeline { list-style: none; margin: 0; padding: 2px 0 2px 4px; }
.timeline li {
  position: relative;
  padding: 0 0 14px 20px;
  font-size: 12.5px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.timeline li::before {
  content: "";
  position: absolute; left: 0; top: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff; border: 2px solid var(--primary);
}
.timeline li::after {
  content: "";
  position: absolute; left: 3.5px; top: 16px; bottom: 0;
  width: 1px; background: var(--border-strong);
}
.timeline li:last-child::after { display: none; }
.timeline li.applied::before { border-color: var(--warn); }

/* ---------- 分析页 ---------- */

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.kpi .kpi-label { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.kpi .kpi-value { font-size: 24px; font-weight: 650; letter-spacing: -.4px; line-height: 1.1; }
.kpi .kpi-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }

.chart-box { padding: 6px 4px 0; }
.chart-box svg { width: 100%; height: 150px; display: block; }

.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); padding: 8px 4px 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }

.donut-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }

.donut {
  width: 132px; height: 132px; border-radius: 50%;
  flex: none;
  position: relative;
  background: #e9edf5;
}
.donut::after {
  content: "";
  position: absolute; inset: 26px;
  border-radius: 50%;
  background: var(--surface);
}

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

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 15% 0%, #dfe9ff 0%, transparent 60%),
    radial-gradient(800px 500px at 100% 100%, #ece4ff 0%, transparent 55%),
    var(--bg);
}

.auth-card {
  width: min(392px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 34px 32px 30px;
  box-shadow: 0 20px 50px rgba(16, 24, 40, .12);
}

.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.auth-logo .logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, #4c7bff, #7f5cff);
  color: #fff; display: grid; place-items: center; font-weight: 700;
}
.auth-title { margin: 14px 0 4px; font-size: 20px; font-weight: 650; letter-spacing: -.2px; }
.auth-sub { margin: 0 0 22px; color: var(--muted); font-size: 12.5px; }

.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-form .input { height: 42px; font-size: 14px; }
.auth-form .btn { height: 42px; font-size: 14px; margin-top: 4px; }

.link-row { margin-top: 16px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* 改密码的折叠块 */
details.inline-form { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
details.inline-form summary {
  cursor: pointer; padding: 10px 14px; font-size: 12.5px; color: var(--text-2);
  list-style: none; display: flex; align-items: center; gap: 8px;
}
details.inline-form summary::-webkit-details-marker { display: none; }
details.inline-form summary::before { content: "▸"; color: var(--muted); }
details.inline-form[open] summary::before { content: "▾"; }
details.inline-form .inline-body { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 14px; }

/* ---------- 响应式 ---------- */

@media (max-width: 1080px) {
  .kv { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar {
    position: static;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    overflow-x: auto;
  }
  .brand { padding: 0 10px 0 0; }
  .brand small { display: none; }
  .nav { flex-direction: row; }
  .nav a { padding: 8px 10px; }
  .sidebar-foot { display: none; }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; height: 56px; }
  .content { padding: 16px 16px 40px; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
}


/* ============================================================
   游戏账号登录页（/pair/{uuid}）—— 对齐网易游戏账号登录的观感
   ============================================================ */

.login-app {
  min-height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  background: #f2f3f5;
  color: #1f2329;
  font: 15px/1.5 "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

.phone-frame {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: #fff;
  padding: 10px 22px 26px;
  position: relative;
  display: flex;
  flex-direction: column;
}

@media (min-width: 560px) {
  .login-app { align-items: center; padding: 28px 0; }
  .phone-frame {
    min-height: 0;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(16, 24, 40, .12);
    padding-bottom: 30px;
  }
}

.lg-top { display: flex; align-items: center; justify-content: space-between; height: 44px; }

.lg-back, .lg-close {
  border: none; background: transparent; color: #9aa1ad;
  font-size: 22px; line-height: 1; cursor: pointer; padding: 6px 4px;
}
.lg-back:hover, .lg-close:hover { color: #4a5468; }

.lg-logo { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px 0 26px; }
.lg-logo svg { width: 40px; height: 40px; }
.lg-logo .wordmark {
  font-size: 25px; font-weight: 700; letter-spacing: 1px; color: #222;
  font-family: "Microsoft YaHei", system-ui, sans-serif;
}

.lg-status {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 12px; margin-bottom: 14px;
  background: #f7f8fa; border-radius: 10px;
  font-size: 12.5px; color: #5a6274;
}
.lg-status:empty { display: none; }
.lg-status b { color: #1f2329; font-weight: 600; }

.lg-phone {
  display: flex; align-items: center;
  height: 52px; border: 1px solid #e3e5e9; border-radius: 4px;
  background: #fff; overflow: hidden;
}
.lg-phone .cc {
  flex: none; padding: 0 14px; color: #333; font-size: 16px;
  border-right: 1px solid #e3e5e9; height: 100%;
  display: flex; align-items: center; gap: 4px;
}
.lg-phone .cc::after { content: "⌄"; font-size: 12px; color: #9aa1ad; transform: translateY(-1px); }
.lg-phone input {
  flex: 1; min-width: 0; height: 100%; border: none; outline: none;
  padding: 0 14px; font-size: 16px; color: #1f2329; background: transparent;
}
.lg-phone input::placeholder { color: #b3b8c2; letter-spacing: .5px; }

.lg-field {
  height: 52px; border: 1px solid #e3e5e9; border-radius: 4px; background: #fff;
  display: flex; align-items: center; overflow: hidden;
}
.lg-field input {
  flex: 1; min-width: 0; height: 100%; border: none; outline: none;
  padding: 0 14px; font-size: 16px;
}
.lg-field input::placeholder { color: #b3b8c2; letter-spacing: .5px; }

.lg-primary {
  display: block; width: 100%; height: 52px; margin-top: 18px;
  border: none; border-radius: 4px;
  background: linear-gradient(180deg, #f0524f, #e33b38);
  color: #fff; font-size: 18px; letter-spacing: 2px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(227, 59, 56, .24);
  transition: filter .15s, transform .05s;
}
.lg-primary:hover { filter: brightness(1.04); }
.lg-primary:active { transform: translateY(1px); }
.lg-primary:disabled { opacity: .6; cursor: not-allowed; }

.lg-msg { min-height: 18px; margin: 10px 0 0; font-size: 12.5px; color: #8a90a0; overflow-wrap: anywhere; white-space: pre-line; }
.lg-msg.err { color: #d9363e; }
.lg-msg.ok { color: #12a150; }

.lg-pills {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 26px;
}
.pill {
  flex: 1; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; border: none; border-radius: 999px;
  font-size: 13px; color: #fff; cursor: pointer; white-space: nowrap;
  padding: 0 12px;
}
.pill svg { width: 15px; height: 15px; fill: currentColor; flex: none; }
.pill-mail { background: #e8302f; }
.pill-qq { background: #2b7cf6; }
.pill-wx { background: #22b14c; }
.pill:hover { filter: brightness(1.05); }

.lg-agree {
  display: flex; align-items: flex-start; gap: 7px;
  margin: 20px 0 0; font-size: 12px; color: #8a90a0; line-height: 1.5;
}
.lg-agree input { width: 14px; height: 14px; margin: 2px 0 0; accent-color: #e33b38; flex: none; }
.lg-agree em { font-style: normal; color: #5a6274; }

.lg-panel { padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.lg-panel .lg-field + .lg-field { margin-top: 0; }
.lg-qr-title { margin: 0 0 2px; font-size: 14px; color: #4a5468; text-align: center; }
.lg-panel img { width: 200px; height: 200px; object-fit: contain; align-self: center; background: #fff; }
.lg-panel img:not([src]), .lg-panel img[src=""] { display: none; }

.lg-uplink {
  margin-top: 14px; padding: 14px; border-radius: 10px; background: #fff7e8;
  border: 1px solid #ffe0b2; font-size: 13px; color: #8a5a00;
}
.lg-uplink p { margin: 0 0 10px; overflow-wrap: anywhere; }
.lg-uplink .lg-primary { height: 42px; font-size: 15px; margin-top: 0; background: #ff9a2e; box-shadow: none; letter-spacing: 1px; }

.lg-done { text-align: center; padding: 18px 0 6px; }
.lg-done .tick {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
  background: #e7f7ee; color: #12a150; display: grid; place-items: center; font-size: 30px;
}
.lg-done h2 { margin: 0 0 6px; font-size: 18px; }
.lg-done p { margin: 0; color: #8a90a0; font-size: 13px; }

.lg-ghost {
  display: block; width: 100%; height: 44px; margin-top: 12px;
  border: 1px solid #e3e5e9; border-radius: 4px; background: #fff;
  color: #4a5468; font-size: 14px; cursor: pointer;
}
.lg-ghost:hover { background: #fafbfc; }
/* 登录按钮的加载态：转圈 + 禁止二次点击 */
.lg-primary.is-busy,
.lg-btn.is-busy {
  opacity: .8;
  cursor: progress;
}

.spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: dsh-spin .8s linear infinite;
}

@keyframes dsh-spin {
  to { transform: rotate(360deg); }
}