/* ============================================================
   admin.css —— 后台「简洁绿」设计系统（独立样式，不依赖任何第三方 CSS 框架）
   数值对照参考站点 eell.net/admin 的 admin.css 校准（侧栏 284px、卡片圆角 20px、统计卡/面板圆角 16px …）
   ------------------------------------------------------------
   结构：
     1. 变量 / 重置
     2. 外壳：侧栏 + 悬浮白色主面板（四角圆角）
     3. 页面组件（写页面时只用这些语义类，不再堆工具类）
        工具栏   .toolbar  .toolbar-grow  .toolbar-end  .toolbar-meta
        表格     .table-wrap  .data-table  .cell-main  .cell-sub  .row-actions  .pager
        标签页   .seg-tabs  .seg-tab(.active)
        表单     .form-narrow  .form-section  .field  .field-label  .field-hint  .field-row  .setting-row  .input-group
        数据     .stat-grid  .stat-card  .panel  .panel-title  .two  .bar-chart  .rank-list  .meter  .kv
        布局     .split  .grid-2  .grid-3  .stack  .stack-lg  .section-title
        其它     .badge(-success/-warning/-danger/-neutral/-accent)  .avatar  .empty  .btn-*  .icon-btn
     4. 弹窗 / 提示 / 动画
     5. 登录页
     6. 页面专属样式
   ============================================================ */

/* ---------- 1. 变量 / 重置 ---------- */
:root {
  --color-bg: #f3f4f6;
  --color-surface: #ffffff;
  --color-border: #e9ebef;
  --color-line: #f1f2f5;
  --color-soft: #f7f8fa;
  --color-text-primary: #111827;
  --color-text-secondary: #374151;
  --color-text-muted: #9ca3af;

  --color-accent: #28a745;
  --color-accent-dark: #218838;
  --color-accent-light: #a7d7a9;
  --color-accent-soft: #eaf7ed;
  --color-accent-line: #cdebd4;
  --color-success: #1f9d46;
  --color-warning: #d98a0b;
  --color-danger: #dc2626;

  --radius-card: 16px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 30px rgba(16, 24, 40, .05);
  --sidebar-w: 284px;
}

*, *::before, *::after { box-sizing: border-box; border: 0 solid #e5e7eb; }
html { -webkit-text-size-adjust: 100%; background: var(--color-bg); }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, pre, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: none; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; margin: 0; }
button { background: none; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
table { border-collapse: collapse; border-spacing: 0; text-indent: 0; }
th { font-weight: inherit; text-align: inherit; }
textarea { resize: vertical; }
code, pre, kbd, samp { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
hr { border-top-width: 1px; }
[hidden] { display: none !important; }
::selection { background: #cdeed7; }
::placeholder { color: #b0b6c0; opacity: 1; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #d4d7dd; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #b8bdc7; }
::-webkit-scrollbar-track { background: transparent; }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.only-mobile { display: none !important; }
@media (max-width: 820px) { .only-mobile { display: inline-flex !important; } .only-desktop { display: none !important; } }

/* ---------- 2. 外壳 ---------- */
.admin-shell { display: flex; min-height: 100vh; align-items: flex-start; }

.admin-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
  display: none; flex-direction: column;
  padding: 26px 16px 16px;
}
@media (min-width: 821px) { .admin-sidebar { display: flex; } }
body.sidebar-collapsed .admin-sidebar, html.sidebar-collapsed-pre .admin-sidebar { display: none; }

.brand { padding: 4px 12px 24px; flex-shrink: 0; }
.brand-name { display: block; font-size: 17px; font-weight: 700; color: #111827; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-sub { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: #9ca3af; }

.admin-sidebar nav, .drawer-nav { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
/* 左右留出内边距：选中项的描边/阴影不再被 overflow 裁掉；滚动条细且离开内容卡片 */
.admin-sidebar nav { margin-left: -6px; padding: 4px 14px 10px 6px; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.admin-sidebar nav:hover { scrollbar-color: #d4d7dd transparent; }
.admin-sidebar nav::-webkit-scrollbar { width: 6px; }
.admin-sidebar nav::-webkit-scrollbar-thumb { background: transparent; }
.admin-sidebar nav:hover::-webkit-scrollbar-thumb { background: #d4d7dd; }
.drawer-nav { padding: 4px 16px 12px; }
.nav-section { padding: 16px 12px 6px; font-size: 12px; letter-spacing: .08em; color: #9ca3af; }
.nav-section:first-child { padding-top: 0; }

.nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; margin: 3px 0;
  border-radius: 12px;
  font-size: 15px; font-weight: 500; color: #374151;
  cursor: pointer; user-select: none;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.nav-item .nav-icon { width: 22px; font-size: 16px; text-align: center; flex-shrink: 0; color: #9ca3af; transition: color .15s; }
.nav-item:hover { background: rgba(40, 167, 69, .08); }
.nav-item.active { background: var(--color-accent-soft); color: var(--color-accent-dark); box-shadow: 0 0 0 1px rgba(40, 167, 69, .22), 0 4px 10px -4px rgba(40, 167, 69, .22); }
.nav-item.active .nav-icon { color: var(--color-accent); }
.nav-item-sub { font-size: 14px; padding: 10px 16px; }
.nav-item-sub .nav-icon { font-size: 14px; }
.nav-group-children { max-height: 0; overflow: hidden; padding-left: 14px; transition: max-height .25s ease; }
.nav-group.expanded .nav-group-children { max-height: 480px; }
.nav-group.expanded .nav-group-arrow { transform: rotate(180deg); }
.nav-group-arrow { transition: transform .2s ease; }

.sidebar-user { margin: 0; padding: 12px 6px 0; border-top: 1px solid var(--color-border); display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.drawer-foot { margin: 0 16px; padding: 12px 6px 16px; }
.user-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; transition: background-color .15s; }
.user-link:hover { background: rgba(17, 24, 39, .045); }
.user-avatar, .user-initial {
  width: 34px; height: 34px; border-radius: 999px; flex-shrink: 0; border: 1px solid var(--color-border);
  background: linear-gradient(135deg, #e5e7eb, #f9fafb); object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; color: #374151;
}
.user-name { font-weight: 600; font-size: 14px; color: #111827; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-sub { font-size: 12px; font-weight: 400; color: #9ca3af; line-height: 1.3; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: #6b7280; background: transparent; border: 0; font-size: 14px; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: rgba(40, 167, 69, .1); color: var(--color-accent-dark); }
.icon-btn.accent:hover { background: var(--color-accent-soft); color: var(--color-accent-dark); }
.icon-btn.danger { color: #9ca3af; }
.icon-btn.danger:hover { background: #fef2f2; color: var(--color-danger); }
.icon-btn:disabled { opacity: .4; }

/* 右侧悬浮面板：四个角都是圆角，四周留缝 */
.admin-main { flex: 1; min-width: 0; padding: 16px 16px 16px 0; }
body.sidebar-collapsed .admin-main, html.sidebar-collapsed-pre .admin-main { padding-left: 16px; }
.admin-card {
  display: flex; flex-direction: column;
  min-height: calc(100vh - 32px);
  background: #fff; border: 1px solid rgba(233, 235, 239, .8); border-radius: 20px;
  box-shadow: var(--shadow-card);
}
.admin-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 22px 32px;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--color-line);
  border-radius: 20px 20px 0 0;
}
.admin-header h1 { font-size: 19px; font-weight: 600; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.admin-content { flex: 1; min-width: 0; padding: 28px 32px 40px; }
#mainContent { min-width: 0; }
.admin-footer { flex-shrink: 0; padding: 0 24px 22px; text-align: center; font-size: 12px; color: #a0a6b1; }

#sidebarMobile { background: #f6f7f9; box-shadow: 0 20px 50px rgba(0, 0, 0, .18); }
#drawerBackdrop { background: rgba(17, 24, 39, .35); }
@media (max-width: 820px) {
  .admin-main { padding: 10px; }
  .admin-card { border-radius: 16px; min-height: calc(100vh - 20px); }
  .admin-header { padding: 16px 18px; border-radius: 16px 16px 0 0; }
  .admin-content { padding: 20px 18px 32px; }
}

/* ---------- 3. 页面组件 ---------- */
.page-fade-enter { animation: pageFadeIn .28s ease both; }

.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.75rem; }
.grid-2, .grid-3 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.split { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1024px) { .split { grid-template-columns: minmax(0, 1fr) 20rem; gap: 2.5rem; } }
.two { display: grid; gap: 22px; grid-template-columns: 1.2fr 1fr; margin-bottom: 22px; }
@media (max-width: 1100px) { .two { grid-template-columns: 1fr; } }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: #111827; margin-bottom: 14px; }
.section-title i { font-size: 14px; color: var(--color-accent); }
.section-title .extra { margin-left: auto; font-size: 12.5px; font-weight: 400; color: #9ca3af; }
.muted { color: #9ca3af; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.divider { height: 1px; background: var(--color-line); margin: 1.5rem 0; }

/* 卡片：统计块 / 面板，细边框，无阴影 */
.card, .stat-card {
  background: linear-gradient(180deg, #fff, #fbfbfc);
  border: 1px solid var(--color-border); border-radius: var(--radius-card);
}
.panel { padding: 20px 22px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: transparent; }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: #111827; margin-bottom: 14px; }
.panel-title i { font-size: 14px; color: var(--color-accent); }
.panel-title .panel-extra, .panel-title .spacer + * { margin-left: auto; }
.panel-title .panel-extra { font-size: 12.5px; font-weight: 400; color: #9ca3af; }
.panel-title .spacer { flex: 1; }
.flat-panel { background: transparent; border: 0; border-radius: 0; }

.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); margin-bottom: 26px; }
.stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .stat-grid, .stat-grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) { .stat-grid, .stat-grid.cols-3 { gap: 12px; } }
.stat-card { display: block; padding: 20px; }
a.stat-card { color: inherit; transition: border-color .15s, box-shadow .15s; }
a.stat-card:hover { border-color: #d6dae0; box-shadow: 0 6px 18px -8px rgba(16, 24, 40, .12); }
.stat-head { display: flex; align-items: center; gap: 8px; }
.stat-icon { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--color-soft); color: #4b5563; font-size: 12px; }
/* 仪表盘统计卡：左文右图标 */
.stat-card.dash { position: relative; padding-right: 76px; min-height: 118px; }
.stat-card.dash .stat-head { display: block; }
.stat-card.dash .stat-icon { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; border-radius: 12px; font-size: 18px; background: var(--color-accent-soft); color: var(--color-accent-dark); }
.stat-label { font-size: 13px; color: #6b7280; }
.stat-value { margin-top: 12px; font-size: 30px; line-height: 1.1; font-weight: 650; letter-spacing: -.02em; color: #111827; }
.stat-sub { margin-top: 6px; font-size: 12.5px; color: #9ca3af; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.toolbar .toolbar-grow { flex: 1; min-width: 12rem; position: relative; }
.toolbar .toolbar-grow > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #b0b6c0; font-size: 13px; pointer-events: none; }
.toolbar .toolbar-grow > i + .form-input { padding-left: 38px; }
.toolbar select.form-input { width: auto; min-width: 8.5rem; }
.toolbar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.toolbar-meta { font-size: 13px; color: #9ca3af; margin-left: auto; }

.seg-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; width: max-content; max-width: 100%; background: var(--color-soft); border: 1px solid var(--color-line); border-radius: 12px; }
.seg-tab { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 9px; font-size: 14px; font-weight: 500; color: #6b7280; background: transparent; cursor: pointer; white-space: nowrap; transition: color .15s, background-color .15s; }
.seg-tab i { font-size: 13px; color: #9ca3af; }
.seg-tab:hover { color: #111827; }
.seg-tab.active { background: #fff; color: var(--color-accent-dark); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 0 0 1px var(--color-border); }
.seg-tab.active i { color: var(--color-accent); }
.tab-bar { margin-bottom: 22px; overflow-x: auto; }

.table-wrap { overflow-x: auto; margin: 0 -14px; }
.data-table, #mainContent table { width: 100%; font-size: 14px; }
.data-table thead th, #mainContent thead th { padding: 10px 14px; font-size: 12.5px; font-weight: 500; color: #9ca3af; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--color-border); background: transparent; }
.data-table tbody td, #mainContent tbody td { padding: 14px; vertical-align: middle; border-bottom: 1px solid var(--color-line); }
.data-table tbody tr:last-child td, #mainContent tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td, #mainContent tbody tr.table-row-hover:hover td { background: #fafbfc; }
.data-table .num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .center { text-align: center; }
.cell-main { font-weight: 600; color: #111827; line-height: 1.35; }
.cell-sub { margin-top: 2px; font-size: 12.5px; color: #9ca3af; line-height: 1.3; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 2px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 14px 14px 0; font-size: 13px; color: #9ca3af; border-top: 1px solid var(--color-line); }

.form-narrow { max-width: 52rem; }
.form-section + .form-section { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--color-line); }
.form-section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 4px; }
.form-section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: #111827; }
.form-section-title i { font-size: 14px; color: var(--color-accent); }
.form-section-desc { font-size: 13px; color: #9ca3af; margin-bottom: 18px; }
.field { margin-bottom: 20px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field-label, label.field-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: #374151; }
.field-hint { margin-top: 6px; font-size: 12.5px; color: #9ca3af; }
.field-row, .field-row-3 { display: grid; gap: 0 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.input-group { display: flex; gap: 8px; align-items: stretch; }
.input-group .form-input { flex: 1; min-width: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--color-line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .setting-text { min-width: 0; }
.setting-row .setting-title { font-size: 14px; color: #1f2937; }
.setting-row .setting-desc { font-size: 12.5px; color: #9ca3af; margin-top: 2px; }

.form-input {
  display: block; width: 100%;
  padding: 10px 12px; font-size: 14px; line-height: 1.6; color: #111827;
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input.form-input, select.form-input { height: 40px; padding-top: 0; padding-bottom: 0; line-height: 38px; }
.form-input:hover { border-color: #d9dce1; }
.form-input:focus { outline: none; border-color: var(--color-accent-light); box-shadow: 0 0 0 4px rgba(40, 167, 69, .12); }
.form-input:disabled { background: #f9fafb; color: #9ca3af; cursor: not-allowed; }
select.form-input { appearance: none; -webkit-appearance: none; padding-right: 34px; background-repeat: no-repeat; background-position: right 12px center;
  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='%236b7280' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
textarea.form-input { min-height: 6.5rem; resize: vertical; }

.btn-primary, .btn-secondary, .btn-ghost, .btn-danger-ghost, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 13.5px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.btn-primary { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.btn-primary:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(40, 167, 69, .28); }
.btn-primary:active { transform: none; box-shadow: none; }
.btn-primary:disabled, .btn-secondary:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary, .btn-ghost { background: #fff; color: #374151; border-color: var(--color-border); }
.btn-secondary:hover, .btn-ghost:hover { background: #f9fafb; border-color: #d9dce1; color: #111827; }
.btn-danger { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-danger-ghost { color: var(--color-danger); background: transparent; }
.btn-danger-ghost:hover { background: #fef2f2; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }

.switch-track { width: 38px; height: 22px; border-radius: 999px; background: #d9dce1; position: relative; flex-shrink: 0; cursor: pointer; transition: background-color .2s; }
.switch-track.on { background: var(--color-accent); }
.switch-thumb { width: 18px; height: 18px; background: #fff; border-radius: 50%; position: absolute; top: 2px; left: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform .2s; }
.switch-track.on .switch-thumb { transform: translateX(16px); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border: 1px solid var(--color-border); border-radius: 99px; font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; background: var(--color-soft); color: #374151; }
.badge-dot { display: none; }
.badge-success { background: #ecfdf5; color: #047857; border-color: #c8f1de; }
.badge-accent { background: var(--color-accent-soft); color: #1e7e34; border-color: var(--color-accent-line); }
.badge-warning { background: #fffbeb; color: #b45309; border-color: #fde9bd; }
.badge-danger { background: #fef2f2; color: #b91c1c; border-color: #f9d0d0; }
.badge-neutral { background: var(--color-soft); color: #374151; border-color: var(--color-border); }

.avatar { width: 38px; height: 38px; border-radius: 999px; object-fit: cover; background: #e5e7eb; flex-shrink: 0; }
.avatar-lg { width: 80px; height: 80px; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 56px 16px; color: #9ca3af; font-size: 13.5px; }
.empty i { font-size: 28px; color: #d1d5db; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 20px; font-size: 14px; }
.kv dt { color: #9ca3af; }
.kv dd { color: #1f2937; min-width: 0; word-break: break-all; }

.meter { height: 6px; border-radius: 999px; background: #eff0f2; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--color-accent); }
.meter.warn > i { background: #f0a020; }
.meter.danger > i { background: var(--color-danger); }

/* 柱状图（顶部数值 + 底部日期）：面板为纵向 flex，图表区域 flex:1 填满剩余高度，柱子贴底 */
.panel-chart { display: flex; flex-direction: column; }
.panel-chart .chart-fill { flex: 1; display: flex; flex-direction: column; min-height: 220px; }
.bar-chart { flex: 1; display: flex; align-items: stretch; justify-content: space-between; gap: 10px; min-height: 220px; width: 100%; padding-top: 6px; }
.bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar-track { flex: 1; width: 100%; min-height: 0; padding-top: 22px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; position: relative; }
.bar-num { font-size: 11.5px; color: #6b7280; line-height: 1.4; margin-bottom: 4px; }
.bar-fill { width: 100%; max-width: 34px; min-height: 3px; flex: 0 0 auto; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #1f2937, #4b5563); transition: opacity .15s; }
.bar-col:hover .bar-fill { opacity: .85; }
.bar-label { font-size: 11.5px; color: #9ca3af; line-height: 1.4; }

/* 列表（热门内容 / 最近操作） */
.rank-list { display: flex; flex-direction: column; }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-line); }
.rank-item:last-child { border-bottom: 0; }
.rank-item .rank-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-item a.rank-title { color: var(--color-accent); }
.rank-item a.rank-title:hover { color: var(--color-accent-dark); text-decoration: underline; }
.rank-item small, .rank-count { font-size: 12.5px; color: #9ca3af; white-space: nowrap; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--color-line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }

/* ---------- 4. 弹窗 / 提示 / 动画 ---------- */
.modal-backdrop { background: rgba(17, 24, 39, 0.35); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal-panel { border-radius: 20px; box-shadow: 0 24px 60px -16px rgba(17, 24, 39, 0.3); }
.toast-item { border-radius: 14px; box-shadow: 0 10px 28px rgba(17, 24, 39, 0.12); }
.spin-loader { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(40, 167, 69, 0.18); border-top-color: var(--color-accent); animation: spinLoader .75s linear infinite; }

@keyframes pageFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spinLoader { to { transform: rotate(360deg); } }
@keyframes modalBackdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalBackdropOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes modalPanelIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes modalPanelOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(0.96) translateY(8px); } }
@keyframes drawerSlideIn { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes drawerSlideOut { from { transform: none; } to { transform: translateX(-100%); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-6px); } }
.modal-backdrop { animation: modalBackdropIn .2s ease both; }
.modal-panel { animation: modalPanelIn .25s cubic-bezier(.2, .8, .3, 1) both; }
.modal-backdrop.closing { animation: modalBackdropOut .18s ease both; }
.modal-panel.closing { animation: modalPanelOut .18s ease both; }
.drawer-backdrop { animation: modalBackdropIn .2s ease both; }
.drawer-panel { animation: drawerSlideIn .26s cubic-bezier(.2, .8, .3, 1) both; }
.drawer-panel.closing, .drawer-backdrop.closing { animation: drawerSlideOut .2s ease both; }
.toast-item { animation: toastIn .25s cubic-bezier(.2, .8, .3, 1) both; }
.toast-item.closing { animation: toastOut .18s ease both; }

/* 数据中心：主 IP hover 展开多 IP 下拉 */
.ip-hover-wrap { position: relative; }
.ip-hover-dropdown { opacity: 0; visibility: hidden; transform: translateY(-8px) scale(0.98); transform-origin: top center; pointer-events: none;
  transition: opacity .28s cubic-bezier(.2,.8,.3,1), transform .28s cubic-bezier(.2,.8,.3,1), visibility 0s linear .28s; }
.ip-hover-wrap:hover .ip-hover-dropdown, .ip-hover-dropdown:hover { opacity: 1; visibility: visible; transform: none; pointer-events: auto;
  transition: opacity .22s cubic-bezier(.2,.8,.3,1), transform .22s cubic-bezier(.2,.8,.3,1), visibility 0s linear 0s; }
.ip-hover-dropdown .card { box-shadow: 0 8px 24px rgba(17, 24, 39, 0.10); }

/* ---------- 5. 登录页 ---------- */
body.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background: radial-gradient(900px 500px at 50% -10%, #ffffff 0%, transparent 70%), var(--color-bg); }
.auth-card { width: 100%; max-width: 30rem; background: #fff; border: 1px solid #eceef1; border-radius: 28px; padding: 2.75rem 2.75rem 2.25rem;
  box-shadow: 0 24px 60px -24px rgba(17, 24, 39, 0.14), 0 2px 6px rgba(17, 24, 39, 0.03); }
@media (max-width: 480px) { .auth-card { padding: 2rem 1.5rem 1.75rem; border-radius: 22px; } }
.auth-title { text-align: center; font-size: 1.6rem; font-weight: 800; color: #111827; }
.auth-sub { text-align: center; margin: 0.4rem 0 2rem; color: #6b7280; font-size: 1rem; }
.auth-card .form-input { padding: 0.85rem 1rem; border-radius: 14px; }
.auth-card .btn-primary { width: 100%; padding: 0.9rem 1rem; border-radius: 14px; font-size: 1rem; margin-top: 0.4rem; }
.auth-note { margin-top: 1.5rem; text-align: center; font-size: 0.82rem; color: #9ca3af; }
.auth-note i { margin-right: 0.3rem; }
.auth-links { margin-top: 1.1rem; display: flex; justify-content: center; gap: 1.25rem; }
.auth-tab { font-size: 0.85rem; color: #6b7280; transition: color .15s; }
.auth-tab:hover { color: var(--color-accent-dark); }
.auth-card[data-active-tab="login"] .auth-tab[data-tab="login"],
.auth-card[data-active-tab="register"] .auth-tab[data-tab="register"],
.auth-card[data-active-tab="forgot"] .auth-tab[data-tab="forgot"] { display: none; }
.auth-panel-enter { animation: authPanelIn .25s ease both; }
@keyframes authPanelIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ================= 页面专属样式（原 assets/css/pages/*.css 合并） ================= */

/* ---- apimgr.css ---- */
/* 接口管理页面专属样式 */
.trend-foot { margin-top: 0.6rem; padding-top: 0.7rem; border-top: 1px solid var(--color-line); font-size: 0.8rem; color: #9ca3af; }
.trend-foot b { color: #111827; font-weight: 700; }
.rate-input { width: 5.5rem; padding: 0.35rem 0.6rem; }
.cell-perm { font-size: 0.8rem; color: #6b7280; }
.cell-num { color: #374151; font-variant-numeric: tabular-nums; }
.cell-time { font-size: 0.8rem; color: #9ca3af; white-space: nowrap; }
.key-ak { display: flex; align-items: center; gap: 0.4rem; }
.copy-ak-btn { color: #c3c8d0; font-size: 0.75rem; }
.copy-ak-btn:hover { color: var(--color-accent); }
.toolbar-note-text { font-size: 0.85rem; color: #6b7280; }
.inline-code, .doc-body code { padding: 0.1rem 0.4rem; border-radius: 6px; background: #f4f5f6; font-size: 0.78rem; }
.doc-fold { border-bottom: 1px solid var(--color-line); padding-bottom: 0.9rem; }
.doc-fold summary { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; list-style: none; font-size: 0.92rem; font-weight: 700; color: #111827; }
.doc-fold summary::-webkit-details-marker { display: none; }
.doc-fold summary > i:first-child { font-size: 0.85rem; color: var(--color-accent); }
.doc-fold .fold-arrow { margin-left: auto; font-size: 0.7rem; color: #9ca3af; transition: transform .2s; }
.doc-fold[open] .fold-arrow { transform: rotate(180deg); }
.doc-body { margin-top: 0.8rem; font-size: 0.82rem; line-height: 1.7; color: #4b5563; }
.doc-body p + p, .doc-body pre + p { margin-top: 0.5rem; }
.doc-code { margin: 0.6rem 0; padding: 0.9rem 1rem; border-radius: 10px; background: #1f2937; color: #e5e7eb; font-size: 0.78rem; line-height: 1.6; overflow-x: auto; }
.modal-form { padding: 1.6rem; }
.modal-title { display: flex; align-items: center; gap: 0.5rem; font-size: 1.06rem; font-weight: 700; color: #111827; margin-bottom: 1.1rem; }
.modal-title .warn-ico { color: var(--color-warning); }
.modal-sub { font-size: 0.8rem; color: #6b7280; margin: -0.5rem 0 1.1rem; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.3rem; }
.badge-accent { background: var(--color-accent-soft); color: var(--color-accent-dark); border-color: var(--color-accent-line); }

/* ---- cloud_browser.css ---- */
/* 云浏览器（用户页 / 管理页）专属样式 */
.cb-note { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.1rem; font-size: 0.8rem; color: #9ca3af; }
.cb-note i { color: #b0b6c0; margin-right: 0.35rem; }
.cb-stat-head { justify-content: space-between; }
.cb-stat-head .left { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.cb-value { margin-top: 0.6rem; display: flex; align-items: baseline; gap: 0.4rem; font-size: 1.6rem; font-weight: 800; line-height: 1.2; color: #111827; min-width: 0; }
.cb-value .main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cb-value .unit { font-size: 0.85rem; font-weight: 400; color: #9ca3af; white-space: nowrap; }
.cb-stat-card .meter { margin-top: 0.75rem; }
.cb-stat-card .stat-sub { display: flex; justify-content: space-between; gap: 0.5rem; }
.cb-stat-card .stat-sub span:last-child { text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-section { margin-top: 1.9rem; }
.cb-section .toolbar { margin-bottom: 0.6rem; }
.cb-section .section-title { margin-bottom: 0; }
.cb-copy { display: inline-flex; align-items: center; gap: 0.35rem; }
.cb-copy .icon-btn { width: 1.7rem; height: 1.7rem; font-size: 0.78rem; }
.cb-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; }
.cb-pick { display: grid; gap: 0.5rem; }
.cb-pick.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cb-pick-item { text-align: left; padding: 0.7rem 0.85rem; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; transition: border-color .15s, background-color .15s; }
.cb-pick-item:hover { border-color: #d0d5dc; background: #fafbfa; }
.cb-pick-item.active { border-color: var(--color-accent); background: var(--color-accent-soft); }
.cb-pick-item .t { display: flex; justify-content: space-between; align-items: center; font-size: 0.88rem; font-weight: 600; color: #111827; }
.cb-pick-item.active .t i { color: var(--color-accent); }
.cb-pick-item .d { margin-top: 2px; font-size: 0.76rem; color: #9ca3af; line-height: 1.4; }
.cb-user-list { margin-top: 0.5rem; max-height: 12rem; overflow-y: auto; border: 1px solid #eceef0; border-radius: 10px; }
.cb-user-option { width: 100%; text-align: left; display: flex; align-items: center; gap: 0.65rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid #f1f2f4; background: #fff; }
.cb-user-option:last-child { border-bottom: 0; }
.cb-user-option:hover { background: #f6faf7; }
.cb-user-option .info { min-width: 0; flex: 1; }
.cb-user-option .n { font-size: 0.85rem; font-weight: 500; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-user-option .s { font-size: 0.75rem; color: #9ca3af; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-chip { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; padding: 0.25rem 0.6rem 0.25rem 0.3rem; border-radius: 999px; background: var(--color-accent-soft); border: 1px solid var(--color-accent-line); font-size: 0.8rem; color: var(--color-accent-dark); }
.cb-chip .ava { width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--color-accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.68rem; font-weight: 600; }
.cb-chip button { color: var(--color-accent); }
.cb-modal-title { font-size: 1.06rem; font-weight: 700; color: #111827; }
.cb-modal-sub { margin-top: 2px; font-size: 0.8rem; color: #9ca3af; }
.cb-modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.5rem; }
.cb-inline-input { width: 7.5rem; padding: 0.4rem 0.65rem; }
.cb-pkg-name { max-width: 22rem; }
@media (max-width: 560px) { .cb-pick.cols-3 { grid-template-columns: 1fr; } }
.badge-accent { background: var(--color-accent-soft); color: var(--color-accent-dark); border-color: var(--color-accent-line); }

/* ---- dashboard.css ---- */
/* 仪表盘页面专属样式 */
.dash-loading { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 2rem 0; font-size: 0.85rem; color: #9ca3af; }
.dash-note { padding: 1.5rem 0; text-align: center; font-size: 0.8rem; color: #9ca3af; }
.dash-error { grid-column: 1 / -1; }
.meter-list { display: flex; flex-direction: column; gap: 1rem; }
.meter-row-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.4rem; font-size: 0.88rem; color: #4b5563; }
.meter-row-head b { font-weight: 700; color: #111827; }

/* ---- files.css ---- */
.fc-crumbs { display: flex; align-items: center; gap: 0.35rem; min-width: 0; font-size: 0.9rem; }
.fc-crumbs .breadcrumb-item { color: #9ca3af; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-crumbs .breadcrumb-item:hover { color: var(--color-accent-dark); }
.fc-crumbs .breadcrumb-item.current { color: #111827; font-weight: 600; }
.fc-crumbs .sep { font-size: 0.6rem; color: #d1d5db; }
.fc-icon { width: 2.2rem; height: 2.2rem; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: #f4f5f6; color: #9ca3af; }
.fc-name { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.fc-name .cell-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 32rem; }
.file-row[data-type="folder"] { cursor: pointer; }
.fc-upload { position: relative; cursor: pointer; }
.fc-upload input { display: none; }

/* ---- menus.css ---- */
/* 菜单管理：无卡片的树形行，行间细线，子菜单缩进 + 左侧引导线 */
.menu-tree { display: flex; flex-direction: column; }
.menu-group + .menu-group { border-top: 1px solid var(--color-line); }
.menu-row { display: flex; align-items: center; gap: 0.85rem; padding: 0.8rem 0.4rem; }
.menu-row:hover { background: #fafbfa; }
.menu-row.child { margin-left: 1.4rem; padding-left: 1.1rem; border-left: 2px solid var(--color-accent-line); }
.menu-row.child + .menu-row.child { border-top: 1px solid #f4f5f6; }
.menu-icon { width: 2rem; height: 2rem; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--color-accent-soft); color: var(--color-accent-dark); font-size: 0.8rem; }
.menu-row.child .menu-icon { background: #f1f2f4; color: #6b7280; }
.menu-info { flex: 1; min-width: 0; }
.menu-name { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: #111827; line-height: 1.35; }
.menu-name .menu-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-lock { font-size: 0.72rem; font-weight: 400; color: #b0b6c0; }
.menu-meta { margin-top: 2px; font-size: 0.78rem; color: #9ca3af; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-actions { display: flex; align-items: center; gap: 0.1rem; flex-shrink: 0; }
.menu-actions .switch-track { margin: 0 0.6rem; }
@media (max-width: 640px) { .menu-row { flex-wrap: wrap; } .menu-info { flex-basis: calc(100% - 3rem); } }

/* ---- packages.css ---- */
/* 套餐管理页面专属样式 */
.toolbar-note { flex: 1; min-width: 16rem; max-width: 46rem; display: flex; gap: 0.5rem; font-size: 0.82rem; line-height: 1.6; color: #9ca3af; }
.toolbar-note i { margin-top: 0.3rem; color: #c3c8d0; flex-shrink: 0; }
.pkg-name { max-width: 20rem; word-break: break-all; }
.pkg-price { font-weight: 700; color: #111827; font-variant-numeric: tabular-nums; }
.pkg-cycle { color: #4b5563; white-space: nowrap; }
.pkg-desc { max-width: 18rem; font-size: 0.82rem; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pkg-badges { display: flex; flex-wrap: nowrap; gap: 0.35rem; white-space: nowrap; }
.modal-form { padding: 1.6rem; }
.modal-title { font-size: 1.06rem; font-weight: 700; color: #111827; margin-bottom: 0.3rem; }
.modal-sub { font-size: 0.8rem; color: #9ca3af; margin-bottom: 1.2rem; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.3rem; }
.badge-accent { background: var(--color-accent-soft); color: var(--color-accent-dark); border-color: var(--color-accent-line); }

/* ---- permissions.css ---- */
/* 权限管理：矩阵布局——左侧角色列表 + 右侧分组权限，全部用细线分隔，不使用卡片 */
.perm-layout { display: grid; gap: 1.5rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .perm-layout { grid-template-columns: 13rem minmax(0, 1fr); gap: 2rem; } }
.perm-roles { display: flex; flex-direction: column; gap: 2px; }
@media (min-width: 900px) { .perm-roles { padding-right: 1.5rem; border-right: 1px solid var(--color-line); } }
@media (max-width: 899px) { .perm-roles { flex-direction: row; flex-wrap: wrap; gap: 0.4rem; } }
.perm-side-title { padding: 0 0.7rem 0.5rem; font-size: 0.75rem; color: #9ca3af; letter-spacing: 0.04em; }
.role-tab { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; border-radius: 9px; font-size: 0.9rem; color: #4b5563; cursor: pointer; user-select: none; transition: background-color .15s, color .15s; }
.role-tab i { font-size: 0.8rem; color: #b0b6c0; width: 1rem; text-align: center; }
.role-tab .grow { flex: 1; min-width: 0; }
.role-tab:hover { background: #f6f7f8; color: #111827; }
.role-tab.active { background: var(--color-accent-soft); color: var(--color-accent-dark); font-weight: 600; }
.role-tab.active i { color: var(--color-accent); }
.role-tab .lock { font-size: 0.65rem; color: #c4c9d1; }
.perm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.perm-head h3 { font-size: 1.1rem; font-weight: 800; color: #111827; }
.perm-head p { margin-top: 3px; font-size: 0.8rem; color: #9ca3af; }
.perm-group + .perm-group { margin-top: 1.6rem; padding-top: 1.6rem; border-top: 1px solid var(--color-line); }
.perm-group-title { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; font-size: 0.95rem; font-weight: 800; color: #111827; }
.perm-group-title i { font-size: 0.85rem; color: var(--color-accent); }
.perm-grid { display: grid; gap: 0 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 1200px) { .perm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.perm-check { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid #f1f2f4; cursor: pointer; }
.perm-check .perm-text { min-width: 0; }
.perm-check .perm-name { font-size: 0.9rem; color: #1f2937; }
.perm-check .perm-desc { margin-top: 1px; font-size: 0.76rem; color: #a0a6b1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perm-check.readonly { pointer-events: none; opacity: .7; }
.perm-super { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; padding: 3rem 1rem; color: #6b7280; font-size: 0.88rem; text-align: center; }
.perm-super i { font-size: 1.8rem; color: var(--color-warning); }

/* ---- profile ---- */
/* 个人中心：身份区 + 分段标签 + 窄栏表单 */

/* ---- 身份区 ---- */
.pf-ident { display: flex; align-items: center; gap: 20px; padding: 4px 0 26px; margin-bottom: 26px; border-bottom: 1px solid var(--color-line); }
.pf-avatar { position: relative; flex-shrink: 0; }
.pf-avatar img { display: block; width: 80px; height: 80px; border-radius: 999px; object-fit: cover; background: #e5e7eb; border: 1px solid var(--color-border); }
.pf-avatar-btn { position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 999px; background: var(--color-accent); color: #fff; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 11px; }
.pf-avatar-btn:hover { background: var(--color-accent-dark); }
.pf-avatar-btn input { display: none; }
.pf-who { flex: 1; min-width: 0; }
.pf-name { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 22px; font-weight: 650; letter-spacing: -.01em; color: #111827; line-height: 1.3; }
.pf-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 13px; color: #9ca3af; }
.pf-stats { display: flex; flex-shrink: 0; }
.pf-stat { padding: 2px 26px; text-align: left; }
.pf-stat + .pf-stat { border-left: 1px solid var(--color-line); }
.pf-stat:last-child { padding-right: 0; }
.pf-stat-value { font-size: 20px; font-weight: 650; line-height: 1.2; color: #111827; letter-spacing: -.01em; }
.pf-stat-value.on { color: var(--color-accent-dark); }
.pf-stat-label { margin-top: 4px; font-size: 12.5px; color: #9ca3af; }

/* ---- 双栏卡片布局：铺满右侧 ---- */
.pf-ident { padding: 22px 26px; margin-bottom: 22px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: linear-gradient(135deg, var(--color-accent-soft), #fff 55%); }
.pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.pf-grid .pf-group, .pf-grid .pf-group + .pf-group { margin: 0; padding: 22px 24px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: #fff; }
.pf-grid .field-row, .pf-grid .field-row-3 { grid-template-columns: 1fr; }
.pf-grid .pf-actions { justify-content: flex-end; }
/* 资料 / 安全 / 登录设备 合并为一张大卡片，分区用细线隔开 */
.pf-card { padding: 4px 28px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: #fff; }
.pf-card .pf-pane + .pf-pane { border-top: 1px solid var(--color-line); }
.pf-card .pf-grid { gap: 0 56px; }
.pf-card .pf-grid .pf-group, .pf-card .pf-grid .pf-group + .pf-group { padding: 26px 0; border: 0; border-radius: 0; background: transparent; }
@media (max-width: 1100px) { .pf-grid { grid-template-columns: 1fr; } .pf-card .pf-grid .pf-group + .pf-group { border-top: 1px solid var(--color-line); } }

/* ---- 分组 ---- */
.pf-group + .pf-group { margin-top: 32px; padding-top: 30px; border-top: 1px solid var(--color-line); }
.pf-group-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.pf-group-head .section-title { margin-bottom: 0; }
.pf-note { font-size: 13px; color: #9ca3af; }
.pf-note b { font-weight: 500; color: #4b5563; }
.pf-group-head + .form-section-desc { margin-top: 4px; }
.pf-actions { display: flex; gap: 10px; margin-top: 14px; }

/* ---- 2FA ---- */
.pf-2fa-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 4px 0; }
.pf-2fa-text { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pf-2fa-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--color-soft); color: #9ca3af; flex-shrink: 0; }
.pf-2fa-icon.on { background: var(--color-accent-soft); color: var(--color-accent-dark); }
.pf-setup { margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--color-border); }
.pf-setup-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pf-setup-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #111827; margin: 0; }
.pf-setup-title i { color: var(--color-accent); }
.pf-setup-grid { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 640px) { .pf-setup-grid { grid-template-columns: 8rem 1fr; } }
.pf-qr { width: 128px; height: 128px; display: flex; align-items: center; justify-content: center; background: var(--color-soft); border-radius: 12px; color: #b0b6c0; font-size: 36px; overflow: hidden; margin-bottom: 6px; }
.pf-secret { display: flex; align-items: center; flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--color-border); border-radius: 10px; font-size: 13px; font-weight: 600; letter-spacing: .05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-code-input { text-align: center; letter-spacing: .3em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
#enable2FaForm { margin-top: 16px; }

/* ---- 设备 ---- */
.pf-device-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--color-soft); color: #6b7280; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.pf-device-name { display: flex; align-items: center; gap: 8px; }
.pf-device-name .badge { flex-shrink: 0; }
.pf-device-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 危险操作 ---- */
.pf-danger-title, .pf-danger-title i { color: var(--color-danger); }
.pf-danger-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pf-danger-desc { margin: 2px 0 0; font-size: 13px; color: var(--color-danger); opacity: .85; }
.pf-danger-row .btn-danger-ghost { border: 1px solid #f9d0d0; }
.pf-danger-row .btn-danger-ghost:disabled { color: #9ca3af; border-color: var(--color-border); cursor: not-allowed; background: transparent; }

/* ---- 移动端 ---- */
@media (max-width: 820px) {
  .pf-ident { flex-direction: column; align-items: flex-start; gap: 16px; }
  .pf-who { width: 100%; }
  .pf-stats { width: 100%; }
  .pf-stat { flex: 1; padding: 2px 14px; }
  .pf-stat:first-child { padding-left: 0; }
  .pf-stat:last-child { padding-right: 0; }
}

/* ---- realm_forward.css ---- */
/* 端口转发（用户页 / 管理页）专属样式 */
.rf-note { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.1rem; font-size: 0.8rem; color: #9ca3af; }
.rf-note i { color: #b0b6c0; margin-right: 0.35rem; }
.rf-stat-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.rf-stat-head .left { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.rf-value { margin-top: 0.6rem; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.2rem 0.9rem; font-size: 1.5rem; font-weight: 800; line-height: 1.25; color: #111827; min-width: 0; }
.rf-value .main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.rf-value .unit { font-size: 0.85rem; font-weight: 400; color: #9ca3af; white-space: nowrap; }
.rf-stat .meter { margin-top: 0.75rem; }
.rf-stat .stat-sub { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.rf-section { margin-top: 1.9rem; }
.rf-section .toolbar { margin-bottom: 0.6rem; }
.rf-section .section-title { margin-bottom: 0; }
.rf-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; }
.rf-addr { display: inline-flex; align-items: center; gap: 0.3rem; max-width: 16rem; }
.rf-addr .rf-mono { word-break: break-all; }
.rf-addr .icon-btn { width: 1.7rem; height: 1.7rem; font-size: 0.78rem; flex-shrink: 0; }
.rf-traffic { min-width: 9rem; }
.rf-traffic .top { font-size: 0.85rem; font-variant-numeric: tabular-nums; color: #111827; }
.rf-traffic .meter { margin: 0.35rem 0; }
.rf-reason { margin-top: 0.3rem; font-size: 0.74rem; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-reason.err { color: var(--color-danger); }
.rf-reason.warn { color: var(--color-warning); }
.rf-name-line { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.rf-modal { padding: 1.5rem; }
.rf-modal-title { font-size: 1.06rem; font-weight: 700; color: #111827; }
.rf-modal-sub { margin-top: 2px; margin-bottom: 1.25rem; font-size: 0.8rem; color: #9ca3af; }
.rf-modal-close { margin-left: auto; }
.rf-modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.5rem; }
.rf-hint-box { margin-bottom: 1.25rem; padding: 0.55rem 0.8rem; border-radius: 10px; background: #f6f7f8; font-size: 0.78rem; color: #6b7280; line-height: 1.5; }
.rf-hint-box code { font-family: ui-monospace, monospace; color: #374151; }
.rf-adv { margin-top: 0.25rem; padding-top: 0.9rem; border-top: 1px solid var(--color-line); }
.rf-adv summary { cursor: pointer; font-size: 0.85rem; color: #6b7280; margin-bottom: 0.9rem; }
.rf-adv:not([open]) summary { margin-bottom: 0; }
.rf-chart { display: flex; align-items: flex-end; gap: 3px; height: 10rem; }
.rf-chart .col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.rf-chart .bar { width: 100%; border-radius: 3px 3px 0 0; overflow: hidden; display: flex; flex-direction: column-reverse; }
.rf-chart .up { background: #86d19a; }
.rf-chart .down { background: var(--color-accent); flex: 1; }
.rf-chart-axis { display: flex; justify-content: space-between; margin-top: 0.3rem; font-size: 0.7rem; color: #9ca3af; }
.rf-legend { display: flex; gap: 1.2rem; margin-top: 0.8rem; font-size: 0.8rem; color: #6b7280; }
.rf-legend i.up { color: #86d19a; }
.rf-legend i.down { color: var(--color-accent); }
.rf-token { display: block; padding: 0.7rem 0.9rem; border-radius: 10px; background: #f6f7f8; border: 1px solid #eceef0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; line-height: 1.55; color: #1f2937; word-break: break-all; white-space: pre-wrap; user-select: all; }
.rf-limit-input { width: 6.5rem; padding: 0.4rem 0.65rem; }
.rf-limit-input.wide { width: 9rem; }
.rf-cell-wrap { max-width: 18rem; }
@media (max-width: 560px) { .rf-addr { max-width: 12rem; } }
/* 管理页补充 */
.badge-accent { background: var(--color-accent-soft); color: var(--color-accent-dark); border-color: var(--color-accent-line); }
.rf-note code { font-family: ui-monospace, monospace; color: #6b7280; }
.rf-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.rf-trunc { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-break { word-break: break-all; max-width: 18rem; }
.rf-pkg { min-width: 11rem; }
.rf-pkg .cell-main { white-space: normal; word-break: break-word; }
.rf-pager-btns { display: flex; align-items: center; gap: 0.6rem; }
.rf-warn-box { margin-bottom: 1.1rem; padding: 0.7rem 0.9rem; border-radius: 10px; background: #fff7e6; border: 1px solid #f6e0b0; }
.rf-warn-box .t { font-size: 0.8rem; color: #b7791f; margin-bottom: 0.45rem; }
.rf-token-line { display: flex; align-items: center; gap: 0.6rem; }
.rf-token-line code { flex: 1; min-width: 0; word-break: break-all; font-size: 0.8rem; }
pre.rf-token { margin: 0; font-size: 0.78rem; max-height: 50vh; overflow: auto; }
.rf-events { max-height: 55vh; overflow-y: auto; font-family: ui-monospace, monospace; font-size: 0.78rem; line-height: 1.6; }
.rf-events .ev { color: #6b7280; padding: 0.15rem 0; border-bottom: 1px solid #f4f5f6; }
.rf-events .ev.warn { color: var(--color-warning); }
.rf-events .ev.error { color: var(--color-danger); }
.rf-events .time { color: #b0b6c0; }
.rf-checks { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.rf-check { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.75rem; border: 1px solid #e5e7eb; border-radius: 999px; font-size: 0.82rem; color: #4b5563; cursor: pointer; }
.rf-check input { accent-color: var(--color-accent); }
.rf-traffic { min-width: 11rem; white-space: nowrap; }
.rf-traffic .cell-sub { white-space: nowrap; }
.rf-addr { max-width: 24rem; }
.rf-addr .rf-mono { word-break: normal; white-space: nowrap; }
.data-table td .cell-sub.rf-mono { white-space: nowrap; }
#rfaRoot .data-table td:first-child { min-width: 12rem; }

/* ---- servers.css ---- */
/* 数据中心页面专属样式 */
#serverTableWrap { overflow: visible; }
@media (max-width: 1180px) { #serverTableWrap { overflow-x: auto; } }
.srv-name { display: flex; align-items: center; gap: 0.7rem; min-width: 10rem; }
.srv-os { width: 2rem; height: 2rem; border-radius: 9px; background: #f4f5f6; display: inline-flex; align-items: center; justify-content: center; color: #6b7280; flex-shrink: 0; }
.srv-os .os-ubuntu { color: #e95420; } .srv-os .os-debian { color: #d70a53; } .srv-os .os-centos { color: #932279; }
.srv-os .os-windows { color: #0078d4; } .srv-os .os-alpine { color: #0d597f; } .srv-os .os-other { color: #9ca3af; }
.srv-spec { font-size: 0.82rem; color: #4b5563; min-width: 6rem; }
.srv-expire { font-size: 0.82rem; white-space: nowrap; color: #6b7280; }
.srv-expire.ok { color: var(--color-accent-dark); } .srv-expire.warn { color: var(--color-warning); } .srv-expire.bad { color: var(--color-danger); }
.srv-ip { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.2rem 0.3rem 0.2rem 0.6rem; border-radius: 8px; background: #f6f7f8; font-size: 0.8rem; color: #374151; cursor: default; }
.srv-ip .ip-ver { font-size: 0.68rem; color: #9ca3af; }
.srv-ip .ip-more { font-size: 0.7rem; color: var(--color-accent-dark); font-weight: 600; }
.copy-ip-btn { width: 1.5rem; height: 1.5rem; border-radius: 6px; color: #9ca3af; display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; }
.copy-ip-btn:hover { background: #e5e7eb; color: var(--color-accent-dark); }
.ip-hover-dropdown { position: absolute; left: 0; top: 100%; min-width: 16rem; padding-top: 6px; z-index: 30; }
.ip-hover-dropdown .card { padding: 0.35rem; max-height: 14rem; overflow-y: auto; background: #fff; }
.ip-item { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.3rem 0.5rem; border-radius: 8px; }
.ip-item:hover { background: #f6f7f8; }
.ip-item .ip-tags { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; font-size: 0.68rem; color: #9ca3af; }
.ip-item .ip-main-tag { color: var(--color-accent-dark); font-weight: 600; }
.chip-links { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip-link { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.12rem 0.6rem; border-radius: 999px; border: 1px solid #e5e7eb; background: #fff; font-size: 0.74rem; color: #4b5563; white-space: nowrap; transition: all .15s; }
.chip-link i { font-size: 0.68rem; color: #9ca3af; }
.chip-link:hover { border-color: var(--color-accent-line); background: var(--color-accent-soft); color: var(--color-accent-dark); }
.chip-link:hover i { color: var(--color-accent); }
.sort-ctl { display: inline-flex; flex-direction: column; }
.sort-ctl .icon-btn { width: 1.6rem; height: 1.05rem; border-radius: 5px; font-size: 0.7rem; }
.ip-row-line { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.ip-row-line .ip-address-input { flex: 1; min-width: 0; }
.ip-row-line .ip-label-input { width: 7rem; }
.modal-form { padding: 1.6rem; }
.modal-title { font-size: 1.06rem; font-weight: 700; color: #111827; margin-bottom: 1.1rem; }
.modal-sub { font-size: 0.8rem; color: #9ca3af; margin: -0.7rem 0 1.2rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.3rem; }
.link-item { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.6rem 0; border-bottom: 1px solid #f1f2f4; }
.link-item:last-child { border-bottom: 0; }
.link-item .grow { min-width: 0; flex: 1; }
.link-item .ellipsis, .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-section { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--color-line); }
