/* ============================================================
   YHGLXT 用户账号中心 · 清透冰蓝主题
   设计方向：精致极简 + 数据感
   - 多层光晕氛围背景 / 玻璃拟态顶栏 / 卡片淡入动效
   - 等宽数字（UID）/ 精致阴影层次 / 微交互细节
   ============================================================ */

:root {
  --primary: #2f80ed;
  --primary-dark: #1d64c4;
  --primary-light: #5ea2f5;
  --primary-soft: #e8f2fe;
  --ink: #1c2b3f;            /* 深海军蓝：标题 */
  --text: #33455c;           /* 正文 */
  --muted: #8595ab;
  --line: #e3ebf5;
  --card: #ffffff;
  --danger: #d93a4a;
  --danger-bg: #fdeef0;
  --ok: #16a05d;
  --ok-bg: #e8f8f0;
  --warn: #b07a10;
  --warn-bg: #fdf6e3;
  --font: 'HarmonyOS Sans SC', 'MiSans', 'Alibaba PuHuiTi 3', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: ui-monospace, 'SF Mono', Consolas, 'HarmonyOS Sans SC', monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* 保证 hidden 属性不被任何 display 样式覆盖 */

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 50% -180px, rgba(47, 128, 237, .16), transparent 70%),
    radial-gradient(820px 380px at 86% -70px, rgba(94, 162, 245, .13), transparent 65%),
    radial-gradient(680px 320px at 8% -40px, rgba(125, 184, 248, .10), transparent 60%),
    #f5f9fd;
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-dark); }

.container { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* ---------- 入场动效 ---------- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.card { animation: riseIn .45s cubic-bezier(.22, .8, .3, 1) both; }
.card:nth-of-type(2) { animation-delay: .07s; }
.card:nth-of-type(3) { animation-delay: .13s; }
.card:nth-of-type(4) { animation-delay: .19s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 顶栏（玻璃拟态） ---------- */
.topbar {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(227, 235, 245, .9);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(47, 128, 237, .04), 0 8px 24px -18px rgba(28, 70, 140, .35);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  letter-spacing: .01em;
}
.brand::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary) 70%);
  margin-right: 10px;
  box-shadow: 0 3px 9px -1px rgba(47, 128, 237, .5);
}
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: var(--text); font-size: 14px; position: relative; }
.nav a:hover { color: var(--primary); }
.nav-user { color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.nav-logout { color: var(--muted) !important; }
.nav-logout:hover { color: var(--danger) !important; }

.main { padding: 26px 0 48px; }

/* ---------- 提示条 ---------- */
.alert { border-radius: 12px; padding: 11px 16px; margin-bottom: 18px; font-size: 13.5px; border: 1px solid transparent; animation: riseIn .35s ease both; }
.alert-success { background: var(--ok-bg); border-color: #bfe8d2; color: var(--ok); }
.alert-error { background: var(--danger-bg); border-color: #f5c6cb; color: var(--danger); }
.alert-warn { background: var(--warn-bg); border-color: #f0dfae; color: var(--warn); }
.alert-info { background: var(--primary-soft); border-color: #cfe2fb; color: var(--primary-dark); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid rgba(227, 235, 245, .9);
  border-radius: 18px;
  padding: 26px;
  margin-bottom: 20px;
  box-shadow:
    0 1px 2px rgba(28, 70, 140, .04),
    0 12px 34px -20px rgba(28, 70, 140, .22);
}
.card h2 { margin: 0 0 6px; font-size: 17px; color: var(--ink); letter-spacing: .01em; }
.card .sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }

/* ---------- 登录 / 注册 / 找回 ---------- */
.auth-wrap { max-width: 440px; margin: 40px auto 64px; }
.auth-wrap .card {
  position: relative;
  overflow: hidden;
  padding: 34px 30px 30px;
  border-radius: 20px;
  box-shadow:
    0 2px 4px rgba(28, 70, 140, .05),
    0 30px 70px -28px rgba(47, 128, 237, .38);
}
.auth-wrap .card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #7db8f8, var(--primary) 55%, #4a90f2);
}
.auth-wrap .card h2 { font-size: 20px; margin-bottom: 4px; }
.auth-title-tip { color: var(--muted); font-size: 13px; margin: 0 0 22px; }

/* ---------- 表单 ---------- */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; color: #55677f; margin-bottom: 6px; }
.form-row label .req { color: var(--danger); margin-left: 2px; }
input[type=text], input[type=password], input[type=email], input[type=number], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d4e0ef;
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: #fbfdff;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 128, 237, .15);
}
input::placeholder { color: #a9b8cb; }
textarea { resize: vertical; min-height: 66px; }
.form-tip { font-size: 12px; color: var(--muted); margin-top: 5px; }
.form-actions { margin-top: 22px; }
.form-inline-2 { display: flex; gap: 14px; }
.form-inline-2 > * { flex: 1; }

/* 验证码行 */
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.code-row .btn { white-space: nowrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .1s;
  line-height: 1.4;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #4190f2, var(--primary));
  color: #fff;
  box-shadow: 0 4px 12px -3px rgba(47, 128, 237, .5);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #3585e8, var(--primary-dark)); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 2px 6px -2px rgba(47, 128, 237, .45); }
.btn-outline { background: #fff; border-color: #d4e0ef; color: var(--text); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: #f7fbff; }
.btn-danger { background: linear-gradient(180deg, #e05563, var(--danger)); color: #fff; box-shadow: 0 4px 12px -4px rgba(217, 58, 74, .5); }
.btn-danger:hover:not(:disabled) { background: #b8242c; }
.btn-ok { background: linear-gradient(180deg, #1fb26a, var(--ok)); color: #fff; box-shadow: 0 4px 12px -4px rgba(22, 160, 93, .5); }
.btn-ok:hover:not(:disabled) { background: #178a55; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; }

/* ---------- 信息列表 ---------- */
.kv { border-top: 1px solid var(--line); }
.kv > div { display: flex; padding: 11px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv .k { width: 110px; color: var(--muted); flex-shrink: 0; }
.kv .v { flex: 1; word-break: break-all; }

/* ---------- 徽章 ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; line-height: 1.7; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: #eef2f8; color: var(--muted); }
.badge-admin { background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- 封禁横幅 ---------- */
.banner-ban { background: var(--danger-bg); border: 1px solid #f5c6cb; border-radius: 14px; padding: 14px 18px; margin-bottom: 20px; color: var(--danger); }
.banner-ban b { font-size: 15px; }
.banner-ban p { margin: 6px 0 0; font-size: 13px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.list th, table.list td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { color: #5c7699; font-weight: 500; background: #f3f8fe; white-space: nowrap; }
table.list th:first-child { border-top-left-radius: 10px; }
table.list th:last-child { border-top-right-radius: 10px; }
table.list tbody tr { transition: background .12s; }
table.list tbody tr:hover td { background: #f8fbff; }
table.list td.actions { white-space: nowrap; }
/* UID 列等宽对齐：数据感 */
table.list td:first-child { font-family: var(--mono); font-size: 13px; font-feature-settings: 'tnum'; }

/* ---------- 行内展开操作面板 ---------- */
details.op { display: inline-block; position: relative; }
details.op > summary {
  list-style: none; cursor: pointer; display: inline-block;
  padding: 5px 12px; font-size: 12.5px; border-radius: 8px;
  border: 1px solid #d4e0ef; color: var(--text); background: #fff;
  transition: border-color .15s, color .15s, background .15s;
}
details.op > summary::-webkit-details-marker { display: none; }
details.op > summary:hover { border-color: var(--primary); color: var(--primary); background: #f7fbff; }
details.op[open] > summary { border-color: var(--primary); color: var(--primary); background: #f7fbff; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.op-panel {
  /* 通用内嵌面板：「添加账号」行内展开直接使用；
     每行「管理」面板默认 hidden，点击后由 JS 移入 .modal-body 展示（见下方裸化覆盖） */
  position: static;
  margin-top: 10px;
  width: 340px;
  max-width: 100%;
  white-space: normal; /* 覆盖 td.actions 的 nowrap，保证面板内文本正常换行 */
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px -20px rgba(28, 70, 140, .35);
  padding: 16px;
  animation: panelIn .18s ease both;
}
.op-panel h4 { margin: 0 0 12px; font-size: 14px; color: var(--ink); }
.op-panel .form-row { margin-bottom: 10px; }
.op-panel .btn { width: 100%; }
.op-panel form + form { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* ---------- 居中模态弹窗（管理账号） ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.modal {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 300; /* 高于顶栏(100)，且直接挂 body 下不受任何容器裁剪 */
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-mask {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(16, 30, 50, .46);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  animation: fadeIn .15s ease both;
}
.modal-panel {
  position: relative;
  width: 420px; max-width: 100%;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 70px -22px rgba(16, 43, 84, .55);
  animation: modalIn .2s cubic-bezier(.22, .8, .3, 1) both;
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.modal-head .modal-sub { font-size: 13px; font-weight: 400; color: var(--muted); }
.modal-close {
  flex: 0 0 auto; width: 30px; height: 30px; border: none; border-radius: 8px;
  background: none; cursor: pointer; line-height: 1; font-size: 15px; color: var(--muted);
  transition: background .15s, color .15s;
}
.modal-close:hover { background: #f0f5fb; color: var(--text); }
.modal-body { padding: 16px 18px 18px; overflow-y: auto; overscroll-behavior: contain; }
body.modal-open { overflow: hidden; } /* 打开模态时锁定背景滚动 */
/* 面板移入模态后裸化：容器视觉由模态提供 */
.modal-body .op-panel {
  margin: 0; width: 100%; max-width: none;
  border: none; border-radius: 0; box-shadow: none;
  padding: 0; background: transparent;
  animation: none;
}

/* ---------- 分页 ---------- */
.pagination { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 5px 12px; border-radius: 8px; border: 1px solid #d4e0ef;
  background: #fff; font-size: 13px; color: var(--text); transition: all .15s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .cur { background: linear-gradient(180deg, #4190f2, var(--primary)); border-color: var(--primary); color: #fff; box-shadow: 0 3px 10px -3px rgba(47, 128, 237, .5); }
.pagination .disabled { color: #c3cddc; }

/* ---------- 搜索栏 ---------- */
.search-bar { display: flex; gap: 10px; margin-bottom: 18px; }
.search-bar input { flex: 1; max-width: 360px; }

/* ---------- 仪表盘 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(227, 235, 245, .9);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 1px 2px rgba(28, 70, 140, .04), 0 12px 34px -20px rgba(28, 70, 140, .22);
  animation: riseIn .45s cubic-bezier(.22, .8, .3, 1) both;
}
.stat::after {
  content: '';
  position: absolute;
  right: -28px; top: -28px;
  width: 92px; height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 128, 237, .12), transparent 70%);
}
.stat .num { font-size: 26px; font-weight: 700; color: var(--primary); font-family: var(--mono); font-feature-settings: 'tnum'; }
.stat .label { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- 后台子导航 ---------- */
.subnav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.subnav a {
  padding: 6px 14px; border-radius: 9px; background: #fff;
  border: 1px solid var(--line); font-size: 13px; color: var(--text);
  transition: all .15s;
}
.subnav a:hover { border-color: var(--primary); color: var(--primary); }
.subnav a.cur {
  background: linear-gradient(180deg, #4190f2, var(--primary));
  border-color: var(--primary); color: #fff;
  box-shadow: 0 4px 12px -4px rgba(47, 128, 237, .55);
}

/* ---------- 安装向导步骤条 ---------- */
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.steps span { font-size: 12.5px; padding: 5px 14px; border-radius: 999px; background: #e9eff7; color: var(--muted); }
.steps span.cur { background: linear-gradient(180deg, #4190f2, var(--primary)); color: #fff; box-shadow: 0 4px 12px -4px rgba(47, 128, 237, .55); }
.steps span.done { background: var(--ok-bg); color: var(--ok); }

/* ---------- 环境检查列表 ---------- */
.check-list { border-top: 1px solid var(--line); }
.check-list > div { display: flex; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; gap: 12px; }
.check-list .res.ok { color: var(--ok); }
.check-list .res.fail { color: var(--danger); }

/* ---------- 代码块 ---------- */
.codeblock { background: #1e2a3a; color: #dbe6f5; border-radius: 10px; padding: 14px 16px; font-size: 12.5px; font-family: var(--mono); overflow-x: auto; white-space: pre; }

/* ---------- 页脚 ---------- */
.footer { padding: 22px 0 30px; color: var(--muted); font-size: 12.5px; text-align: center; }

/* ---------- 提示消息 ---------- */
.hint { font-size: 12.5px; margin-top: 6px; }
.hint-ok { color: var(--ok); }
.hint-err { color: var(--danger); }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8dbf1; border-radius: 8px; border: 2px solid #f5f9fd; }
::-webkit-scrollbar-thumb:hover { background: #a9c7ea; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .card { padding: 20px 16px; border-radius: 14px; }
  .form-inline-2 { flex-direction: column; gap: 0; }
  .code-row { flex-wrap: wrap; }
  .code-row .btn { width: 100%; }
  .nav { gap: 14px; }
  .nav-user { display: none; }
  .search-bar { flex-direction: column; }
  .search-bar input { max-width: none; }
  .auth-wrap { margin: 22px auto 48px; }

  /* 顶栏：品牌一行 + 导航一行，避免碎块折行 */
  .topbar-inner { height: auto; padding: 9px 0; flex-wrap: wrap; row-gap: 2px; }
  .brand { font-size: 15px; }
  .nav { width: 100%; }
  .nav a { font-size: 13px; }

  /* 模态：小屏铺满可用宽度（dvh 适配手机地址栏） */
  .modal { padding: 12px; }
  .modal-panel { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
}
