/* ============================================================
   御风创新统一身份认证 · 后台管理终端
   iOS 深色风格设计系统
   ============================================================ */

:root {
  --bg: #000000;
  --bg-elevated: #0b0b0d;
  --card: #1c1c1e;
  --card-2: #161618;
  --grouped: #1c1c1e;
  --fill: rgba(120, 120, 128, 0.24);
  --fill-2: rgba(120, 120, 128, 0.16);
  --separator: rgba(84, 84, 88, 0.65);
  --hairline: rgba(255, 255, 255, 0.08);

  --label: #ffffff;
  --label-2: rgba(235, 235, 245, 0.60);
  --label-3: rgba(235, 235, 245, 0.30);

  --blue: #1488fb;
  --blue-press: #056ede;
  --green: #30d158;
  --red: #ff0000;
  --orange: #ff9f0a;
  --yellow: #ffd60a;
  --purple: #bf5af2;
  --teal: #64d2ff;
  --indigo: #5e5ce6;
  --pink: #ff0033;

  --radius-card: 16px;
  --radius-control: 10px;
  --radius-sheet: 22px;

  --sidebar-w: 248px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Helvetica Neue", "Microsoft YaHei UI", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Cascadia Code", monospace;

  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--label);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

::selection { background: rgba(10, 132, 255, 0.35); }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--blue); text-decoration: none; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(120,120,128,.35); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(120,120,128,.55); }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   登录页
   ============================================================ */

.login-stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #000;
  overflow: hidden;
}
.login-orb {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.5;
  pointer-events: none;
}
.login-orb.o1 { width: 520px; height: 520px; left: -140px; top: -160px;
  background: radial-gradient(circle, #3a44d8, transparent 65%); }
.login-orb.o2 { width: 460px; height: 460px; right: -160px; bottom: -140px;
  background: radial-gradient(circle, #0a84ff, transparent 65%); opacity: .35; }
.login-orb.o3 { width: 300px; height: 300px; right: 12%; top: 8%;
  background: radial-gradient(circle, #bf5af2, transparent 65%); opacity: .22; }

.login-card {
  position: relative; z-index: 1;
  width: 380px; max-width: calc(100vw - 32px);
  padding: 36px 32px 28px;
  border-radius: 28px;
  background: rgba(22, 22, 25, 0.72);
  border: 0.5px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: 0 40px 90px rgba(0,0,0,.6);
  animation: pop-in .6s var(--spring);
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.login-icon {
  width: 72px; height: 72px;
  border-radius: 18px;
  display: block; margin: 0 auto 18px;
  box-shadow: 0 10px 30px rgba(10,132,255,.35), 0 0 0 0.5px rgba(255,255,255,.12);
  object-fit: cover;
  background: linear-gradient(160deg,#3a44d8,#0a84ff);
}
.login-title { text-align: center; font-size: 21px; font-weight: 700; letter-spacing: .2px; }
.login-subtitle { text-align: center; font-size: 13px; color: var(--label-2); margin-top: 6px; }

.login-form { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.field { position: relative; }
.field .field-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--label-2); display: flex; pointer-events: none;
}
.field input {
  width: 100%; height: 48px;
  padding: 0 14px 0 42px;
  border-radius: 14px;
  background: rgba(120,120,128,.14);
  border: 0.5px solid transparent;
  outline: none;
  transition: border-color .2s, background .2s;
}
.field input::placeholder { color: var(--label-3); }
.field input:focus {
  border-color: rgba(10,132,255,.55);
  background: rgba(120,120,128,.20);
  box-shadow: 0 0 0 3px rgba(10,132,255,.18);
}

.btn-primary {
  height: 50px; border-radius: 14px;
  background: var(--blue);
  color: #fff; font-size: 16px; font-weight: 600;
  transition: transform .15s var(--spring), background .15s, opacity .15s;
  margin-top: 6px;
}
.btn-primary:hover { background: #2393ff; }
.btn-primary:active { transform: scale(.97); background: var(--blue-press); }
.btn-primary:disabled { opacity: .55; cursor: default; }

.login-hint {
  margin-top: 18px; text-align: center;
  font-size: 12px; color: var(--label-3);
}
.login-error {
  font-size: 13px; color: var(--red);
  background: rgba(255,69,58,.12);
  border: 0.5px solid rgba(255,69,58,.3);
  border-radius: 10px; padding: 8px 12px;
  display: none;
}
.login-error.show { display: block; animation: shake .4s var(--spring); }
@keyframes shake {
  0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)}
}

/* ============================================================
   应用外壳
   ============================================================ */

.app-shell {
  display: flex; height: 100vh; height: 100dvh;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex; flex-direction: column;
  padding: 16px 12px 12px;
  background: rgba(14,14,17,.78);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-right: 0.5px solid var(--hairline);
  z-index: 20;
  position: fixed; top: 0; bottom: 0; left: 0;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 10px 18px;
}
.brand img {
  width: 40px; height: 40px; border-radius: 10px;
  box-shadow: 0 4px 12px rgba(10,132,255,.35);
  object-fit: cover;
}
.brand .b-title { font-size: 13.5px; font-weight: 700; line-height: 1.25; }
.brand .b-sub { font-size: 11px; color: var(--label-2); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label {
  font-size: 11px; font-weight: 600; letter-spacing: .6px;
  color: var(--label-3); text-transform: uppercase;
  padding: 14px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  height: 38px; padding: 0 11px;
  border-radius: 9px;
  color: var(--label-2);
  font-size: 14.5px; font-weight: 500;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-item svg { flex-shrink: 0; }
.nav-item:hover { background: rgba(120,120,128,.14); color: var(--label); }
.nav-item.active {
  background: rgba(10,132,255,.18);
  color: #fff;
}
.nav-item.active svg { color: var(--blue); }
.nav-badge {
  margin-left: auto;
  font-size: 11px; font-weight: 600;
  min-width: 20px; height: 18px; padding: 0 6px;
  border-radius: 9px;
  background: var(--fill);
  color: var(--label-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-item.active .nav-badge { background: rgba(10,132,255,.35); color: #fff; }

.sidebar-foot { padding-top: 10px; border-top: 0.5px solid var(--hairline); }
.admin-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 12px;
  transition: background .15s; width: 100%;
}
.admin-chip:hover { background: rgba(120,120,128,.14); }
.admin-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, var(--indigo), var(--blue));
  color: #fff; flex-shrink: 0;
}
.admin-meta { flex: 1; text-align: left; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.admin-meta .m-name { font-size: 13.5px; font-weight: 600; display: block; }
.admin-meta .m-role { font-size: 11px; color: var(--label-2); display: block; }
.admin-chip .m-go { color: var(--label-3); flex-shrink: 0; }

/* ---------- 主区域 ---------- */
.main {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
  position: relative; height: 100vh; height: 100dvh;
  margin-left: var(--sidebar-w);
  overflow-y: auto;
}

.topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 28px;
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
}
.topbar-title {
  display: flex; align-items: baseline; gap: 10px;
  min-width: 0; flex: 1;
}
.topbar-title h6 {
  font-size: 36px; font-weight: 800; letter-spacing: .2px;
  transform-origin: 6% bottom; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
/* 吸顶折叠：滚动 #view 时由 JS 给 #topbarTitle 切换 .stuck 驱动（非循环） */
.topbar-title.stuck h6 { animation: collapse .12s ease-out forwards; }
.topbar-title:not(.stuck) h6 { animation: clpExpand .1s var(--spring) both; }
/* 徽章常驻顶栏右侧（刷新键旁），不随标题折叠 */
.topbar-nb {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--teal); background: rgba(100,210,255,.12);
  border: 0.5px solid rgba(100,210,255,.25);
  padding: 4px 10px; border-radius: 20px; white-space: nowrap;
  animation: nbIn .4s var(--ease) both;
}
.topbar-nb:empty { display: none; }
.topbar-row {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  flex-shrink: 0;
  /* 刷新按钮 + 徽章独立液态玻璃透明卡片背景 */
  padding: 6px 10px; border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 0.5px solid rgba(255,255,255,.12);
  backdrop-filter: blur(14px) saturate(1.8);
  -webkit-backdrop-filter: blur(14px) saturate(1.8);
  box-shadow: 0 4px 16px rgba(0,0,0,.25), inset 0 .5px 0 rgba(255,255,255,.18);
}
.topbar-actions { display: flex; gap: 8px; align-items: center; }
/* 全局刷新按钮的旋转反馈 */
#globalRefresh.spinning svg { animation: spin360 .6s var(--ease); }
@keyframes spin360 { to { transform: rotate(360deg); } }

.view {
  flex: 1;
  padding: 20px 28px 40px;
}

/* 移动端导航（窄屏显示） */
.mobile-nav { display: none; }

/* ============================================================
   通用组件
   ============================================================ */

.card {
  background: var(--card);
  border-radius: var(--radius-card);
  border: 0.5px solid rgba(255,255,255,.06);
  overflow: hidden;
}
.card-pad { padding: 18px; }
.card + .card { margin-top: 16px; }
.section-stack { display: flex; flex-direction: column; gap: 16px; }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 0;
}
.card-title { font-size: 15px; font-weight: 700; }
.card-sub { font-size: 12.5px; color: var(--label-2); margin-top: 2px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border-radius: 9px;
  font-size: 13.5px; font-weight: 600;
  transition: filter .15s, background .15s, transform .12s var(--spring), opacity .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn svg { width: 16px; height: 16px; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { filter: brightness(1.12); }
.btn-tinted { background: rgba(10,132,255,.16); color: #5aa9ff; }
.btn-tinted:hover { background: rgba(10,132,255,.26); }
.btn-gray { background: var(--fill); color: var(--label); }
.btn-gray:hover { background: rgba(120,120,128,.34); }
.btn-danger-tint { background: rgba(255,69,58,.15); color: #ff7070; }
.btn-danger-tint:hover { background: rgba(255,69,58,.25); }
.btn-green-tint { background: rgba(48,209,88,.15); color: #5ce079; }
.btn-green-tint:hover { background: rgba(48,209,88,.25); }
.btn-orange-tint { background: rgba(255,159,10,.15); color: #ffb340; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { width: 30px; padding: 0; }
.btn[disabled] { opacity: .45; cursor: default; pointer-events: none; }

/* 搜索栏 */
.searchbar {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 10px;
  border-radius: 10px;
  background: var(--card);
  border: 0.5px solid rgba(255,255,255,.06);
  color: var(--label-2);
  min-width: 240px;
}
.searchbar input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 13.5px;
}
.searchbar input::placeholder { color: var(--label-3); }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--label-2); margin-bottom: 6px;
}
.form-item input[type=text], .form-item input[type=password],
.form-item input[type=number], .form-item input[type=url],
.form-item input[type=email], .form-item select, .form-item textarea {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 0.5px solid rgba(255,255,255,.10);
  border-radius: 12px;
  padding: 0 12px;
  height: 42px;
  outline: none;
  color: var(--label);
  backdrop-filter: blur(10px) saturate(1.6);
  -webkit-backdrop-filter: blur(10px) saturate(1.6);
  box-shadow: 0 2px 8px rgba(0,0,0,.18), inset 0 .5px 0 rgba(255,255,255,.06);
  transition: border-color .25s var(--spring), box-shadow .25s var(--spring), transform .25s var(--spring), background .25s var(--spring);
}
.form-item input[type=text]:hover, .form-item input[type=password]:hover,
.form-item input[type=number]:hover, .form-item input[type=url]:hover,
.form-item input[type=email]:hover, .form-item select:hover, .form-item textarea:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
}
.form-item textarea {
  height: auto; min-height: 110px; padding: 10px 12px;
  resize: vertical; line-height: 1.55;
}
.form-item select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  background-size: 12px;
  /* 自定义下拉动画：focus 时下拉箭头旋转 180° + 容器轻微上浮 */
  background-origin: content-box;
  transition: background-position .25s var(--spring), transform .25s var(--spring), border-color .25s var(--spring), box-shadow .25s var(--spring), background .25s var(--spring);
}
.form-item select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m18 15-6-6-6 6'/%3E%3C/svg%3E");
  transform: translateY(-1px);
}
.form-item select option { background: #1c1c1e; color: var(--label); }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: rgba(10,132,255,.55);
  box-shadow: 0 0 0 3px rgba(10,132,255,.18), 0 6px 18px rgba(0,0,0,.28);
  background-color: rgba(255,255,255,.10);
}
.form-item .hint { font-size: 11.5px; color: var(--label-3); margin-top: 5px; }
.form-item input.invalid, .form-item textarea.invalid {
  border-color: rgba(255,69,58,.6);
  box-shadow: 0 0 0 3px rgba(255,69,58,.15);
}

/* iOS 开关 */
.switch { position: relative; display: inline-block; width: 48px; height: 29px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0;
  background: rgba(120,120,128,.32);
  border-radius: 20px; transition: .25s var(--spring);
}
.switch .slider::before {
  content: ''; position: absolute;
  width: 25px; height: 25px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%;
  transition: .25s var(--spring);
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(19px); }

.switch-row { display: flex; align-items: center; gap: 12px; }
.switch-row .sr-label { flex: 1; }
.switch-row .sr-title { font-size: 14px; font-weight: 500; }
.switch-row .sr-sub { font-size: 12px; color: var(--label-2); margin-top: 2px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th {
  text-align: left; font-size: 11.5px; font-weight: 600;
  color: var(--label-3); text-transform: uppercase; letter-spacing: .4px;
  padding: 10px 14px; border-bottom: 0.5px solid var(--hairline);
  white-space: nowrap;
}
.tbl tbody td {
  padding: 11px 14px; border-bottom: 0.5px solid rgba(255,255,255,.05);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(255,255,255,.025); }
.tbl .col-actions { text-align: right; white-space: nowrap; }
.tbl .col-actions .btn { margin-left: 6px; }
.tbl .mono, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--label-2); }
.dim { color: var(--label-3); }
.nowrap { white-space: nowrap; }
.row-gap { display: flex; gap: 8px; align-items: center; }
.right { margin-left: auto; }

/* 用户单元格 */
.user-cell { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: #fff;
  flex-shrink: 0;
}
.user-cell .u-name { font-size: 14px; font-weight: 600; }
.user-cell .u-sub { font-size: 11.5px; color: var(--label-2); font-family: var(--mono); }

/* 状态徽标 */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  border-radius: 7px;
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green  { background: rgba(48,209,88,.15);  color: #5ce079; }
.pill.red    { background: rgba(255,69,58,.15);  color: #ff7070; }
.pill.gray   { background: rgba(120,120,128,.2); color: var(--label-2); }
.pill.blue   { background: rgba(10,132,255,.16);  color: #5aa9ff; }
.pill.orange { background: rgba(255,159,10,.15);  color: #ffb340; }
.pill.yellow { background: rgba(255,214,10,.15);  color: #ffdf4d; }
.pill.purple { background: rgba(191,90,242,.16);  color: #d08cff; }
.pill.teal   { background: rgba(100,210,255,.14); color: #87defe; }
.pill.pink   { background: rgba(255,55,95,.15);   color: #ff6f8b; }

.dot-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); display: inline-block;
  box-shadow: 0 0 0 0 rgba(48,209,88,.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(48,209,88,.55); }
  70% { box-shadow: 0 0 0 6px rgba(48,209,88,0); }
  100% { box-shadow: 0 0 0 0 rgba(48,209,88,0); }
}

/* 分页 */
.pagination {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 14px; justify-content: space-between;
}
.pagination .pages { display: flex; gap: 4px; }
.page-btn {
  min-width: 30px; height: 30px; padding: 0 8px;
  border-radius: 8px;
  background: transparent; color: var(--label-2);
  font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.page-btn:hover:not(:disabled) { background: var(--fill-2); color: var(--label); }
.page-btn.active { background: var(--blue); color: #fff; }
.page-btn:disabled { opacity: .35; cursor: default; }

/* 空状态 */
.empty {
  padding: 56px 20px; text-align: center; color: var(--label-3);
}
.empty svg { margin: 0 auto 12px; opacity: .5; }
.empty .e-title { font-size: 15px; font-weight: 600; color: var(--label-2); }
.empty .e-sub { font-size: 13px; margin-top: 5px; }

/* 加载 */
.loading { padding: 70px 0; display: flex; justify-content: center; }
.spinner {
  width: 26px; height: 26px;
  border: 2.5px solid rgba(120,120,128,.25);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   总览面板
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius-card);
  border: 0.5px solid rgba(255,255,255,.06);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: transform .2s var(--spring);
}
.stat-card:hover { transform: translateY(-2px); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.stat-num { font-size: 30px; font-weight: 700; margin-top: 14px; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12.5px; color: var(--label-2); margin-top: 2px; }
.stat-foot { font-size: 11.5px; color: var(--label-3); margin-top: 8px; }
.stat-foot .up { color: var(--green); }

.dash-grid {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-top: 16px;
}

/* 折线图 */
.chart-wrap { padding: 8px 8px 4px; }
.chart-svg { width: 100%; height: 210px; display: block; }
.chart-legend {
  display: flex; gap: 16px; padding: 4px 12px 12px;
  font-size: 12px; color: var(--label-2);
}
.chart-legend .lg { display: flex; align-items: center; gap: 6px; }
.chart-legend .lg i { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }

.mini-list { padding: 6px 0; }
.mini-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px;
}
.mini-row:not(:last-child) { border-bottom: 0.5px solid rgba(255,255,255,.05); }
.mini-row .m-main { flex: 1; min-width: 0; }
.mini-row .m-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row .m-sub { font-size: 11.5px; color: var(--label-2); margin-top: 1px; }
.mini-row .m-time { font-size: 11.5px; color: var(--label-3); white-space: nowrap; }

/* 工具栏行 */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ============================================================
   弹窗 / Toast
   ============================================================ */

.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade-in .2s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 520px; max-width: 100%;
  max-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
  background: #1c1c1e;
  border-radius: var(--radius-sheet);
  border: 0.5px solid rgba(255,255,255,.10);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: sheet-in .38s var(--spring);
  overflow: hidden;
}
.sheet.sm { width: 400px; }
.sheet.lg { width: 680px; }
@keyframes sheet-in {
  from { opacity: .4; transform: translateY(26px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 10px;
}
.sheet-title { font-size: 17px; font-weight: 700; }
.sheet-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--fill); color: var(--label-2);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.sheet-close:hover { background: rgba(120,120,128,.36); color: #fff; }
.sheet-body { padding: 8px 20px 16px; overflow-y: auto; }
.sheet-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px 18px;
  border-top: 0.5px solid var(--hairline);
}
/* 按钮位置统一：等宽对齐 */
.sheet-foot .btn { min-width: 96px; }

/* 弹窗关闭动画 */
.sheet.closing { animation: sheet-out .22s cubic-bezier(.4,0,1,1) forwards; }
@keyframes sheet-out {
  to { opacity: 0; transform: translateY(14px) scale(.96); }
}

/* 惯性回弹（橡皮筋收尾） */
.view.bounce { animation: overscroll .7s cubic-bezier(.25,.9,.3,1); }
@keyframes overscroll {
  0%  { transform: translateY(7px); }
  52% { transform: translateY(-9px); }   /* 冲过头 */
  72% { transform: translateY(4px); }    /* 幅度递减 */
  86% { transform: translateY(-2px); }
  100%{ transform: translateY(0); }
}

/* 下拉刷新指示器 */
.pull-ind {
  height: 0; overflow: hidden; flex: 0 0 auto;
  display: flex; align-items: flex-end; justify-content: center;
}
.pull-ind .ar {
  display: block; margin-bottom: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.16); border-top-color: var(--blue);
  opacity: 0;
}
.pull-ind.on .ar { opacity: .95; animation: arspin .7s linear infinite; }
@keyframes arspin { to { transform: rotate(360deg); } }
.pull-ind.release .ar { animation: pull .7s cubic-bezier(.3,.9,.3,1) forwards; }
@keyframes pull {
  0%     { transform: translateY(-13px) rotate(0); opacity: 0; }
  22%    { transform: translateY(0) rotate(0); opacity: 1; }
  42%    { transform: translateY(0) rotate(180deg); }
  95%,100%{ transform: translateY(13px) rotate(180deg); opacity: 0; }
}

/* 描述列表 */
.desc-list { display: grid; grid-template-columns: 96px 1fr; gap: 0; }
.desc-list dt {
  font-size: 13px; color: var(--label-2);
  padding: 10px 0; border-bottom: 0.5px solid rgba(255,255,255,.05);
}
.desc-list dd {
  font-size: 13.5px; padding: 10px 0;
  border-bottom: 0.5px solid rgba(255,255,255,.05);
  word-break: break-all;
}
.desc-list dt:nth-last-child(2), .desc-list dd:last-child { border-bottom: none; }

/* 密钥展示 */
.secret-box {
  background: #000; border: 0.5px solid rgba(255,255,255,.1);
  border-radius: 12px; padding: 14px;
  display: flex; align-items: center; gap: 10px;
}
.secret-box code {
  flex: 1; font-family: var(--mono); font-size: 13px;
  color: #5ce079; word-break: break-all; user-select: all;
}
.secret-warning {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 12.5px; color: var(--orange);
  background: rgba(255,159,10,.1);
  border-radius: 10px; padding: 10px 12px;
  margin-top: 10px;
}

#toast-root {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 18px;
  background: rgba(44,44,46,.92);
  backdrop-filter: blur(20px);
  border: 0.5px solid rgba(255,255,255,.1);
  border-radius: 20px;
  font-size: 13.5px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  animation: toast-in .35s var(--spring);
}
.toast.success svg { color: var(--green); }
.toast.error svg { color: var(--red); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-16px) scale(.94); }
  to { opacity: 1; transform: none; }
}
.toast.leave { animation: toast-out .25s var(--ease) forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

/* ============================================================
   文档页
   ============================================================ */

.docs-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
.doc-endpoint { padding: 0; }
.ep-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 0.5px solid rgba(255,255,255,.06);
  flex-wrap: wrap;
}
.method-badge {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  height: 22px; padding: 0 8px; border-radius: 6px;
  display: inline-flex; align-items: center;
}
.method-GET    { background: rgba(10,132,255,.18); color: #5aa9ff; }
.method-POST   { background: rgba(48,209,88,.16);  color: #5ce079; }
.method-PUT    { background: rgba(255,159,10,.16); color: #ffb340; }
.method-DELETE { background: rgba(255,69,58,.16);  color: #ff7070; }
.ep-path { font-family: var(--mono); font-size: 13.5px; font-weight: 600; }
.ep-desc { font-size: 12.5px; color: var(--label-2); margin-left: auto; }
.ep-body { padding: 14px 18px 16px; }
.ep-body h4 { font-size: 12px; color: var(--label-3); text-transform: uppercase; letter-spacing: .5px; margin: 12px 0 7px; font-weight: 600; }
.ep-body h4:first-child { margin-top: 0; }

.code-block {
  position: relative;
  background: #0a0a0c;
  border: 0.5px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--mono); font-size: 12.5px;
  line-height: 1.6; overflow-x: auto;
  color: #d7d7dc; white-space: pre;
}
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  height: 26px; padding: 0 10px; border-radius: 7px;
  background: rgba(120,120,128,.25); color: var(--label-2);
  font-size: 11.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
  opacity: 0; transition: opacity .15s, background .15s;
}
.code-block:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(120,120,128,.4); color: #fff; }

.params-table th, .params-table td { font-size: 12.5px !important; }
.params-table code { color: var(--teal); }

.doc-callout {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(10,132,255,.1);
  border: 0.5px solid rgba(10,132,255,.25);
  border-radius: 12px; padding: 12px 14px;
  font-size: 13px; color: #9cc8ff; line-height: 1.55;
}
.doc-callout b { color: #cfe6ff; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
  background: var(--fill-2); color: var(--label-2);
}
.tag.app { background: rgba(191,90,242,.16); color: #d08cff; }
.tag.user { background: rgba(100,210,255,.14); color: #87defe; }
.tag.none { background: rgba(120,120,128,.2); color: var(--label-2); }

/* OTA 附加 */
.platform-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
}
.platform-icon {
  width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.changelog-text { white-space: pre-wrap; font-size: 13px; color: var(--label-2); line-height: 1.6; }

/* 公告卡片 */
.ann-item { padding: 16px 18px; }
.ann-item + .ann-item { border-top: 0.5px solid rgba(255,255,255,.06); }
.ann-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ann-meta { font-size: 12px; color: var(--label-3); margin-top: 5px; display: flex; gap: 12px; flex-wrap: wrap; }
.ann-content {
  font-size: 13.5px; color: var(--label-2); margin-top: 9px; line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ann-actions { margin-top: 12px; display: flex; gap: 6px; }

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .mobile-nav {
    display: flex; gap: 6px; overflow-x: auto;
    padding: 8px 16px;
    border-bottom: 0.5px solid var(--hairline);
  }
  .mobile-nav .nav-item { height: 34px; font-size: 13px; flex-shrink: 0; }
  .topbar { padding: 10px 16px; }
  .view { padding: 14px 16px 32px; }
  .topbar-title h6 { font-size: 28px; }
  .form-grid { grid-template-columns: 1fr; }
  .searchbar { min-width: 0; flex: 1; }
  .topbar-row { flex-direction: row; align-items: center; }
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-num { font-size: 24px; }
  .sheet { border-radius: 18px; }
}

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

/* ============================================================
   v2.0 动效与新组件
   ============================================================ */

/* ---------- 按钮涟漪（.rp） ---------- */
.btn, .page-btn, .segmented button, .nav-item { position: relative; }
.btn, .page-btn { overflow: hidden; }
.rip {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.38);
  transform: translate(-50%,-50%) scale(0);
  animation: rip .62s cubic-bezier(.2,.7,.3,1) forwards;
  pointer-events: none; z-index: 0;
}
.btn > *:not(.rip), .page-btn > *:not(.rip) { position: relative; z-index: 1; }
@keyframes rip {
  to { transform: translate(-50%,-50%) scale(1); opacity: 0; }
}

/* ---------- 页面切换动画（.pa 出 / .pb 入，尺寸无关） ---------- */
.view-anim { transform-origin: 50% 0; will-change: transform, opacity; }
.view-in  { animation: pageIn .46s cubic-bezier(.3,.9,.3,1) both; }
.view-out { animation: pageOut .22s cubic-bezier(.3,.9,.3,1) both; pointer-events: none; }
@keyframes pageOut {
  0%   { transform: translateX(0) scale(1); opacity: 1; }
  100% { transform: translateX(-26%) scale(.92); opacity: .4; }
}
@keyframes pageIn {
  0%   { transform: translateX(100%); opacity: 0; }
  55%  { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(0); opacity: 1; }
}

/* ---------- 分段控件（滑块由 JS 实测按钮 offsetLeft/offsetWidth 驱动） ---------- */
.segmented {
  position: relative; display: inline-flex; align-items: center;
  padding: 3px; gap: 0;
  background: var(--fill-2); border-radius: 10px;
  isolation: isolate; flex-shrink: 0;
}
.segmented .sl {
  position: absolute; top: 3px; bottom: 3px; left: 0; width: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.13);
  box-shadow: 0 1px 4px rgba(0,0,0,.35), inset 0 0 0 .5px rgba(255,255,255,.10);
  transition: left .42s cubic-bezier(.65,0,.35,1), width .42s cubic-bezier(.65,0,.35,1);
  z-index: 0; pointer-events: none;
}
@keyframes sg {
  0%,22%  { transform: translateX(0); }
  33%,55% { transform: translateX(100%); }
  66%,88% { transform: translateX(200%); }
  100%    { transform: translateX(200%); }
}
.segmented button {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 14px;
  background: transparent !important; border: none;
  border-radius: 8px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  color: var(--label-2);
  transition: color .28s ease;
}
.segmented button.active { color: #fff; }
.segmented button .rip { background: rgba(255,255,255,.22); }

/* ---------- 折线绘制动画（dash 长度由 getTotalLength 实时计算） ---------- */
.chart-draw {
  animation: draw 1.8s cubic-bezier(.4,0,.2,1) both;
}
@keyframes draw {
  from { stroke-dashoffset: var(--path-len, 118); }
  to   { stroke-dashoffset: 0; }
}

/* ---------- 吸顶折叠（iOS 大标题：吸顶时缩小，序号浮现） ---------- */
.clp {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: flex-end; gap: 10px;
  padding: 14px 4px 12px; margin: 0 -4px;
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  transform-origin: left bottom;
}
.clp h6 {
  font-size: 36px; font-weight: 800; letter-spacing: .2px;
  transform-origin: left bottom; white-space: nowrap;
}
.clp .nb {
  margin-left: auto; align-self: center;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--teal); background: rgba(100,210,255,.12);
  border: 0.5px solid rgba(100,210,255,.25);
  padding: 2px 8px; border-radius: 20px; opacity: 0;
}
/* 保持透明，无背景无边框 */
/* 关键帧(0%,42%/72%,100%)：停留区间长于移动区间——同时供 .topbar-title.stuck 与 .clp.stuck 使用 */
@keyframes collapse {
  0%    { transform: translateY(0) scale(1); }
  30%,100% { transform: translateY(-30px) scale(.62); }
}
@keyframes nbIn {
  0%,42%  { opacity: 0; transform: translateY(-9px); }
  72%,100%{ opacity: 1; transform: translateY(0); }
}
@keyframes clpExpand {
  0%   { transform: translateY(-30px) scale(.62); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes nbOut {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-9px); }
}

/* ---------- 登录：三重验证 ---------- */
.login-steps { display: flex; justify-content: center; gap: 6px; margin: 14px 0 16px; }
.login-steps i {
  width: 26px; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,.14); transition: all .3s ease;
}
.login-steps i.on { background: var(--blue); width: 34px; box-shadow: 0 0 10px rgba(10,132,255,.6); }
.login-steps i.ok { background: var(--green); width: 26px; }
.captcha-badge {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--label-3); margin-top: 12px; justify-content: center;
}
.captcha-badge .dot-c { width: 7px; height: 7px; border-radius: 50%; background: var(--label-3); }
.captcha-badge.ok { color: #7ee29a; } .captcha-badge.ok .dot-c { background: var(--green); }
.captcha-badge.err { color: var(--orange); } .captcha-badge.err .dot-c { background: var(--orange); }
.captcha-field {
  display: flex; justify-content: center;
  margin: 4px 0 2px; min-height: 78px;
}
.captcha-field > div { transform: scale(.92); transform-origin: center top; }
.captcha-field .cap-fallback {
  font-size: 12px; color: var(--label-3);
  padding: 14px 10px; border: 1px dashed var(--hairline);
  border-radius: 10px; text-align: center; width: 100%;
}
.pin-hero { text-align: center; padding: 8px 0 4px; }
.pin-hero .pin-ring {
  width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 32% 28%, rgba(10,132,255,.5), rgba(10,132,255,.08) 72%);
  border: 0.5px solid rgba(10,132,255,.4);
  color: #8fc4ff; animation: pulse-ring 2.4s ease-in-out infinite;
}
@keyframes pulse-ring {
  0%,100% { box-shadow: 0 0 0 0 rgba(10,132,255,.35); }
  50%     { box-shadow: 0 0 0 14px rgba(10,132,255,0); }
}
.pin-hero h3 { font-size: 18px; font-weight: 700; }
.pin-hero p { font-size: 13px; color: var(--label-2); margin-top: 7px; line-height: 1.6; }

/* ---------- 通用徽标 / 机器码 ---------- */
.mono-id { font-family: var(--mono); font-size: 11.5px; color: var(--teal);
  background: rgba(100,210,255,.08); border: 0.5px solid rgba(100,210,255,.16);
  padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.sec-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: #7ee29a;
  background: rgba(48,209,88,.12); border: 0.5px solid rgba(48,209,88,.25);
  padding: 2px 8px; border-radius: 20px;
}

/* ---------- 上传区 ---------- */
.dropzone {
  border: 1.5px dashed rgba(255,255,255,.18);
  border-radius: 14px; padding: 22px 16px; text-align: center;
  color: var(--label-2); font-size: 13px; cursor: pointer;
  transition: all .25s ease; background: rgba(255,255,255,.02);
}
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: rgba(10,132,255,.08); color: #bcdcff; }
.dropzone .dz-icon { color: var(--blue); margin-bottom: 8px; display: flex; justify-content: center; }
.up-file {
  display: flex; align-items: center; gap: 10px;
  background: rgba(100,210,255,.08); border: 0.5px solid rgba(100,210,255,.22);
  border-radius: 12px; padding: 10px 12px; margin-top: 10px;
}
.up-file .uf-name { font-size: 13px; font-weight: 600; word-break: break-all; }
.up-file .uf-meta { font-size: 11.5px; color: var(--label-3); margin-top: 2px; }
.progress { height: 6px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; width: 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--blue), var(--teal)); transition: width .2s ease; }
.local-tag { display:inline-flex; align-items:center; gap:3px; font-size:10.5px; font-weight:700;
  color:#87defe; background:rgba(100,210,255,.12); padding:1px 6px; border-radius:5px; }

/* ---------- 头像 ---------- */
.avatar-edit { position: relative; width: 72px; height: 72px; cursor: pointer; }
.avatar-edit img, .avatar-edit span { width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  display:flex; align-items:center; justify-content:center; font-size:26px; font-weight:700; color:#fff; }
.avatar-edit::after {
  content: '更换'; position: absolute; inset: auto 0 0 0; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); color: #fff; font-size: 10.5px; font-weight: 600;
  border-radius: 0 0 36px 36px; opacity: 0; transition: opacity .2s;
}
.avatar-edit:hover::after { opacity: 1; }

/* ---------- 权限网格 ---------- */
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.perm-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 0.5px solid rgba(255,255,255,.08);
  cursor: pointer; transition: all .2s ease;
}
.perm-chip:hover { background: rgba(255,255,255,.07); }
.perm-chip.on { background: rgba(10,132,255,.12); border-color: rgba(10,132,255,.4); }
.perm-chip .pc-t { font-size: 13px; font-weight: 600; }
.perm-chip .pc-s { font-size: 11px; color: var(--label-3); }
.perm-chip > span:first-child { flex: 1; min-width: 0; }
.perm-chip .pc-t, .perm-chip .pc-s { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perm-chip .switch { margin-left: 0; flex-shrink: 0; }

/* ---------- 管理员卡片 ---------- */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.admin-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.admin-card .ac-top { display: flex; align-items: center; gap: 12px; }
.admin-card .ac-name { font-size: 15px; font-weight: 700; }
.admin-card .ac-user { font-size: 12px; color: var(--label-3); font-family: var(--mono); }
.admin-card .ac-perms { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.admin-card .ac-foot { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 10px; border-top: 0.5px solid var(--hairline); }
.avatar-img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.role-super { font-size: 10.5px; font-weight: 700; color: #ffd479; background: rgba(255,159,10,.14);
  border: .5px solid rgba(255,159,10,.3); padding: 1px 7px; border-radius: 20px; }
.role-staff { font-size: 10.5px; font-weight: 700; color: #9cc8ff; background: rgba(10,132,255,.14);
  border: .5px solid rgba(10,132,255,.3); padding: 1px 7px; border-radius: 20px; }

/* ---------- 弹窗：保证永远可主动关闭 ---------- */
.overlay { cursor: pointer; }
.sheet { cursor: default; }
.sheet-close { transition: transform .18s ease, background .18s ease; }
.sheet-close:hover { background: rgba(255,255,255,.14); transform: rotate(90deg); }
.sheet .sheet-body { animation: sheet-body-in .3s var(--spring); }
@keyframes sheet-body-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* 文档页增强 */
.doc-cat { margin-top: 18px; }
.doc-cat:first-child { margin-top: 0; }
.resp-fields td:first-child code { color: #87defe; }
.doc-trybar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.doc-trybar select, .doc-trybar input {
  background: rgba(255,255,255,.06); border: .5px solid var(--separator);
  border-radius: 9px; padding: 7px 10px; font-size: 12.5px; color: var(--label);
}
.doc-trybar input { width: 130px; }
.flow-steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.flow-steps span { font-size: 12px; background: rgba(255,255,255,.06); border-radius: 8px; padding: 5px 10px; color: var(--label-2); }
.flow-steps b { color: var(--teal); font-weight: 700; }

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

/* ============================================================
   Liquid Glass 玻璃质感覆层（提取自 Optical System v27）
   仅做视觉升级：半透明 + 模糊饱和 + 0.5px 边缘 + 内顶高光
   不改布局、不引 SVG 折射滤镜，保证后台信息密度与性能
   ============================================================ */
:root {
  color-scheme: dark;
  --lg-edge: rgba(255,255,255,.10);
  --lg-spec: rgba(255,255,255,.16);
  --lg-blur: 18px;
  --lg-sat: 1.7;
  --lg-bounce: cubic-bezier(.34,1.56,.64,1);
  --lg-ease: cubic-bezier(.16,1,.3,1);
}

/* 主背景：纯黑，无光晕 */
body {
  background: #000;
}

/* ---------- 玻璃卡片 ---------- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.026));
  border-color: var(--lg-edge);
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  box-shadow: 0 12px 34px rgba(0,0,0,.34), inset 0 .5px 0 rgba(255,255,255,.12);
}

/* ---------- 玻璃按钮 ---------- */
.btn {
  border: 0.5px solid rgba(255,255,255,.12);
  box-shadow: inset 0 .5px 0 rgba(255,255,255,.16), 0 2px 8px rgba(0,0,0,.28);
  backdrop-filter: blur(10px) saturate(1.6);
  -webkit-backdrop-filter: blur(10px) saturate(1.6);
  transition: transform .16s var(--lg-bounce), box-shadow .2s var(--lg-ease), background .2s var(--lg-ease), filter .2s;
}
.btn:active { transform: scale(.95); }
.btn-blue {
  background: linear-gradient(180deg, #2393ff, #0a84ff);
  border-color: rgba(140,190,255,.35);
  box-shadow: inset 0 .5px 0 rgba(255,255,255,.38), 0 5px 16px rgba(10,132,255,.42);
}
.btn-blue:active { background: linear-gradient(180deg, #0a84ff, #0066d6); }
.btn-gray { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.12); }
.btn-gray:hover { background: rgba(255,255,255,.15); }
.btn-tinted, .btn-green-tint, .btn-orange-tint, .btn-danger-tint {
  border-color: rgba(255,255,255,.08);
  box-shadow: inset 0 .5px 0 rgba(255,255,255,.10), 0 2px 8px rgba(0,0,0,.22);
}

/* ---------- 玻璃弹窗 / 遮罩 / Toast ---------- */
.overlay { background: rgba(0,0,0,.42); backdrop-filter: blur(6px) saturate(1.3); -webkit-backdrop-filter: blur(6px) saturate(1.3); }
.sheet {
  background: rgba(26,26,30,.72);
  backdrop-filter: blur(44px) saturate(1.9);
  -webkit-backdrop-filter: blur(44px) saturate(1.9);
  border-color: rgba(255,255,255,.14);
  box-shadow: 0 40px 90px rgba(0,0,0,.62), inset 0 .5px 0 rgba(255,255,255,.16);
}
.sheet-close { background: rgba(255,255,255,.09); border: 0.5px solid rgba(255,255,255,.1); }
.toast {
  background: rgba(40,40,46,.72);
  backdrop-filter: blur(28px) saturate(1.9);
  -webkit-backdrop-filter: blur(28px) saturate(1.9);
  border-color: rgba(255,255,255,.14);
  box-shadow: 0 12px 36px rgba(0,0,0,.46), inset 0 .5px 0 rgba(255,255,255,.18);
}

/* ---------- 玻璃输入框（内凹质感） ---------- */
.form-item input[type=text], .form-item input[type=password],
.form-item input[type=number], .form-item input[type=url],
.form-item input[type=email], .form-item input[type=datetime-local],
.form-item select, .form-item textarea {
  background: rgba(255,255,255,.065);
  border-color: rgba(255,255,255,.1);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.22);
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  background: rgba(10,132,255,.08);
  border-color: rgba(10,132,255,.6);
  box-shadow: 0 0 0 3px rgba(10,132,255,.2), inset 0 1px 4px rgba(0,0,0,.18);
}
.searchbar {
  background: rgba(255,255,255,.06);
  border: 0.5px solid rgba(255,255,255,.1);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.2);
  backdrop-filter: blur(12px) saturate(1.5);
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
}

/* ---------- 侧边栏选中态：玻璃胶囊（用 inset 描边避免布局位移） ---------- */
.nav-item { border-radius: 12px; }
.nav-item.active {
  background: linear-gradient(180deg, rgba(10,132,255,.34), rgba(10,132,255,.16));
  box-shadow: inset 0 0 0 .5px rgba(120,180,255,.28), inset 0 .5px 0 rgba(255,255,255,.16), 0 4px 14px rgba(10,132,255,.22);
}

/* ---------- 分段控件：玻璃槽 + 高光滑块（滑块定位已由 JS 驱动，这里只补玻璃质感） ---------- */
.segmented {
  background: rgba(255,255,255,.06);
  border: 0.5px solid rgba(255,255,255,.1);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.28);
  backdrop-filter: blur(12px) saturate(1.6);
  -webkit-backdrop-filter: blur(12px) saturate(1.6);
}
.segmented .sl {
  background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.1));
  box-shadow: 0 2px 8px rgba(0,0,0,.32), inset 0 0 0 .5px rgba(255,255,255,.22), inset 0 .5px 0 rgba(255,255,255,.28);
  /* left/width 由 JS 设置；不覆盖 top/bottom/transition */
}

/* ---------- iOS 开关：玻璃轨道 + 弹性拇指 ---------- */
.switch .slider {
  background: rgba(255,255,255,.08);
  border: 0.5px solid rgba(255,255,255,.12);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.3);
  backdrop-filter: blur(8px) saturate(1.6);
  -webkit-backdrop-filter: blur(8px) saturate(1.6);
  transition: background .3s var(--lg-ease), box-shadow .3s var(--lg-ease);
}
.switch .slider::before {
  transition: transform .34s var(--lg-bounce), width .18s var(--lg-ease);
  box-shadow: 0 3px 8px rgba(0,0,0,.4), inset 0 0 0 .5px rgba(0,0,0,.05);
}
.switch input:checked + .slider {
  background: linear-gradient(180deg, rgba(52,199,89,.55), rgba(40,180,77,.42));
  border-color: rgba(120,230,150,.4);
}

/* ---------- 吸顶大标题条：同步清理 ---------- */

/* ============================================================
   终端文档 · 管理端 API 分区
   ============================================================ */
.doc-admin { margin-top: 30px; }
.doc-admin-head {
  margin: 0 4px 14px; padding: 16px 18px;
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(10,132,255,.1), rgba(10,132,255,.03));
  border: 0.5px solid rgba(10,132,255,.22);
  box-shadow: inset 0 .5px 0 rgba(255,255,255,.1);
}
.doc-admin-head h3 { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.doc-admin-head p { font-size: 12.5px; color: var(--label-2); line-height: 1.75; margin-top: 6px; }
.admin-api-card { padding: 4px 6px; }
.admin-api-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 8px; border-radius: 11px;
  border-bottom: 0.5px solid rgba(255,255,255,.04);
}
.admin-api-row:last-child { border-bottom: none; }
.admin-api-row:hover { background: rgba(255,255,255,.045); }
.admin-api-path { font-family: var(--mono); font-size: 12.5px; color: var(--label); }
.admin-api-desc {
  flex-basis: 100%; padding-left: 56px;
  font-size: 12px; color: var(--label-2); line-height: 1.55;
}
.admin-step-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .2px;
  padding: 2px 8px; border-radius: 20px; white-space: nowrap;
  color: #ffb340; background: rgba(255,159,10,.14);
  border: 0.5px solid rgba(255,159,10,.3);
}
.admin-pub-badge {
  font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap;
  color: var(--teal); background: rgba(100,210,255,.12);
  border: 0.5px solid rgba(100,210,255,.26);
}
.admin-auth-badge {
  font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap;
  color: var(--label-2); background: rgba(255,255,255,.07);
  border: 0.5px solid rgba(255,255,255,.12);
}
@media (min-width: 960px) {
  .admin-api-desc { flex-basis: auto; flex: 1; margin-left: auto; padding-left: 0; text-align: right; max-width: 48%; }
}

/* 尊重系统"减少动态效果"设置 */
@media (prefers-reduced-motion: reduce) {
  .btn, .switch .slider, .switch .slider::before, .segmented .sl, .card, .sheet { transition: none !important; }
  .clp h6, .clp .nb, .topbar-title h6, .topbar-title .nb, .topbar-nb { animation: none !important; }
  .topbar-title.stuck h6 { transform: translateY(-30px) scale(.62); }
}

/* ============================================================
   富文本编辑器（公告 / OTA 正文）
   ============================================================ */
.rte { border-radius: 14px; overflow: hidden; border: 0.5px solid rgba(255,255,255,.10); background: rgba(255,255,255,.03); }
.rte-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  padding: 8px 10px; border-bottom: 0.5px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
}
.rte-bar button, .rte-bar select, .rte-bar input[type=color] {
  height: 30px; min-width: 30px; padding: 0 8px; border-radius: 8px;
  border: 0.5px solid rgba(255,255,255,.10); background: rgba(255,255,255,.06);
  color: var(--label); font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  transition: background .18s var(--spring), border-color .18s var(--spring);
}
.rte-bar button:hover, .rte-bar select:hover { background: rgba(255,255,255,.13); }
.rte-bar input[type=color] { width: 30px; padding: 2px; }
.rte-bar .rte-sep { width: 1px; height: 20px; background: rgba(255,255,255,.14); margin: 0 4px; flex-shrink: 0; }
.rte-bar select { appearance: none; padding-right: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 5px center; background-size: 10px;
}
.rte-bar select option { background: #1c1c1e; color: var(--label); }
.rte-body {
  min-height: 160px; max-height: 420px; overflow-y: auto; padding: 12px 14px;
  font-size: 14px; line-height: 1.65; color: var(--label); outline: none;
}
.rte-body:empty::before { content: attr(data-ph); color: var(--label-3); }
.rte-body img { max-width: 100%; border-radius: 8px; }
.rte-body a { color: var(--blue); text-decoration: underline; }

/* 富文本渲染（列表预览） */
.rt-view img { max-width: 100%; border-radius: 8px; }
.rt-view a { color: var(--blue); text-decoration: underline; }
.rt-view ul, .rt-view ol { padding-left: 22px; margin: 4px 0; }

/* ============================================================
   iOS 风格自定义下拉（手风琴展开动画）
   ============================================================ */
.ios-select { position: relative; }
.ios-select .is-btn {
  display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 12px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 0.5px solid rgba(255,255,255,.10);
  backdrop-filter: blur(10px) saturate(1.6); -webkit-backdrop-filter: blur(10px) saturate(1.6);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: border-color .25s var(--spring), background .25s var(--spring);
}
.ios-select .is-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); }
.ios-select .is-btn .is-text { flex: 1; font-size: 14px; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ios-select .is-btn .is-text.is-ph { color: var(--label-3); }
.ios-select .is-btn u {
  display: inline-flex; align-items: center; justify-content: center;
  width: 12px; height: 12px; flex-shrink: 0;
  font-style: normal; text-decoration: none; font-size: 16px; line-height: 1;
  color: var(--label-2); transition: transform .26s var(--spring);
}
.ios-select.open .is-btn u { transform: rotate(90deg); }
.ios-select .is-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60;
  max-height: 0; overflow: hidden;
  border-radius: 12px; background: rgba(30,30,34,.92);
  border: 0.5px solid rgba(255,255,255,.12);
  backdrop-filter: blur(24px) saturate(1.8); -webkit-backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
  transition: max-height .32s cubic-bezier(.3,.9,.3,1);
}
.ios-select.open .is-menu { max-height: 260px; overflow-y: auto; }
.ios-select .is-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; font-size: 14px; color: var(--label-2); cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ios-select .is-opt:hover { background: rgba(255,255,255,.08); color: var(--label); }
.ios-select .is-opt.on { color: var(--label); font-weight: 600; }
.ios-select .is-opt .is-check { margin-left: auto; color: var(--blue); opacity: 0; }
.ios-select .is-opt.on .is-check { opacity: 1; }

/* 操作权限开关统一右对齐：.form-item label 的 display:block 特异性高于 .perm-chip 的 flex，需显式覆盖 */
.form-item .perm-chip { display: flex; align-items: center; gap: 9px; margin-bottom: 0; }
.form-item .perm-chip .switch { margin-left: auto; }