/* ============================================================================
   UC · 设计系统（源自 demo/ 前端原型，落地到服务端渲染）
   纯 CSS / 无构建依赖 / 浅色主题
   覆盖：后台管理 + 用户中心 + 登录注册
   ============================================================================ */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
table { border-collapse: collapse; width: 100%; }
code, pre, .mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }

/* ---------- 2. Design Tokens ---------- */
:root {
  --bg:            #f8fafc;
  --surface:       #ffffff;
  --surface-2:     #f8fafc;
  --surface-3:     #f1f5f9;

  --border:        #e2e8f0;
  --border-strong: #cbd5e1;

  --text:          #0f172a;
  --text-2:        #475569;
  --text-3:        #94a3b8;

  --primary:       #0f172a;
  --primary-hover: #1e293b;

  --accent:        #10b981;
  --accent-strong: #059669;
  --accent-bg:     #ecfdf5;

  --link:          #2563eb;

  --danger:        #dc2626;
  --danger-bg:     #fef2f2;
  --danger-border: #fecaca;

  --success:       #15803d;
  --success-bg:    #f0fdf4;
  --success-border:#bbf7d0;

  --warn:          #b45309;
  --warn-bg:       #fffbeb;
  --warn-border:   #fde68a;

  --violet:        #7c3aed;
  --violet-bg:     #f5f3ff;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow:    0 4px 16px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .16);

  --sidebar-w: 224px;
}

/* ---------- 3. Layout: App Shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar__brand {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}
.sidebar__brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .15);
}
.sidebar__brand span {
  color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .02em;
}
.sidebar__nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar__group {
  padding: 16px 20px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 13.5px;
  color: #94a3b8;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: rgba(30, 41, 59, .6); color: #fff; }
.nav-item.is-active {
  background: #1e293b;
  color: #fff;
  font-weight: 500;
  border-left-color: var(--accent);
}
.nav-item--sub { padding-left: 42px; font-size: 13px; }
.sidebar__foot { padding: 12px; border-top: 1px solid #1e293b; flex-shrink: 0; }
.sidebar__foot .who { padding: 0 8px 10px; }
.sidebar__foot .who .name { color: #e2e8f0; font-size: 13px; }
.sidebar__foot .who .role { color: #64748b; font-size: 11px; }

.app__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-size: 15px; font-weight: 600; }
.topbar__crumb { color: var(--text-3); font-size: 13px; margin-left: 8px; font-weight: 400; }
.topbar__actions { display: flex; align-items: center; gap: 12px; }

.page { padding: 28px 32px 56px; max-width: 1280px; }
.page--wide { max-width: none; }

/* ---------- 4. Page header ---------- */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-head h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.page-head .desc { color: var(--text-2); font-size: 13px; margin-top: 4px; max-width: 760px; }

/* ---------- 5. Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }
.card__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card__head h2 { font-size: 15px; font-weight: 600; }
.card__head .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.card__body { padding: 20px; }
.card__body--tight { padding: 0; }

/* ---------- 6. Grid ---------- */
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
@media (max-width: 1024px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .page { padding: 20px 16px 48px; }
  .sidebar { position: fixed; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.is-open { transform: none; }
  .app__main { width: 100%; }
  .mobile-only { display: inline-flex !important; }
}
.mobile-only { display: none; }

/* ---------- 7. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }

.btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn--accent { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn--accent:hover { background: #047857; border-color: #047857; }

.btn--danger { border-color: var(--danger-border); color: var(--danger); background: var(--surface); }
.btn--danger:hover { background: var(--danger-bg); }

.btn--warn { border-color: var(--warn-border); color: var(--warn); background: var(--surface); }
.btn--warn:hover { background: var(--warn-bg); }

.btn--ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-3); }

.btn--sm { padding: 5px 11px; font-size: 12.5px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.link { color: var(--link); cursor: pointer; }
.link:hover { text-decoration: underline; }
.link--danger { color: var(--danger); }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- 8. Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.label .req { color: var(--danger); }
.hint { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--focus-ring, rgba(16, 185, 129, .14));
}
.input::placeholder, .textarea::placeholder { color: #b6c2d1; }
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
.textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
.input--mono, .textarea--mono { font-family: "SFMono-Regular", Consolas, Menlo, monospace; font-size: 12.5px; }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--accent-strong); }

.form-grid { display: grid; gap: 16px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) { .form-grid--2, .form-grid--3, .form-grid--4 { grid-template-columns: 1fr; } }

.form-actions {
  display: flex; gap: 10px; align-items: center;
  padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--border);
}

/* ---------- 9. Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { font-size: 13.5px; }
.table thead th {
  text-align: left;
  padding: 11px 16px;
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 500;
  font-size: 12.5px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table .nowrap { white-space: nowrap; }
.table .right { text-align: right; }
.table .cell-main { font-weight: 500; }
.table .cell-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.table .actions { display: flex; gap: 14px; align-items: center; }
.table--top td { vertical-align: top; }

/* ---------- 10. Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.7;
  white-space: nowrap;
}
.badge--gray   { background: var(--surface-3); color: var(--text-2); }
.badge--green  { background: var(--success-bg); color: var(--success); }
.badge--red    { background: var(--danger-bg); color: var(--danger); }
.badge--amber  { background: var(--warn-bg); color: var(--warn); }
.badge--blue   { background: #eff6ff; color: #1d4ed8; }
.badge--violet { background: var(--violet-bg); color: var(--violet); }
.badge--dark   { background: var(--primary); color: #fff; }
.badge--mono   { font-family: "SFMono-Regular", Consolas, Menlo, monospace; font-size: 11px; }

.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11.5px;
  margin-right: 4px;
}

/* ---------- 11. Stats ---------- */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat__num { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.stat__label { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.stat__delta { font-size: 12px; margin-top: 4px; }
.stat--green  .stat__num { color: var(--accent-strong); }
.stat--violet .stat__num { color: var(--violet); }
.stat--blue   .stat__num { color: #1d4ed8; }
.stat--red    .stat__num { color: var(--danger); }

/* ---------- 12. Bars (chart) ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 8px; }
.bars__col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.bars__bar {
  width: 100%;
  max-width: 34px;
  border-radius: 4px 4px 0 0;
  background: var(--primary);
  min-height: 3px;
  transition: height .4s ease;
  cursor: default;
}
.bars__bar--violet { background: var(--violet); }
.bars__bar--blue { background: #2563eb; }
.bars__bar--green { background: var(--accent-strong); }
.bars__x { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }

/* horizontal rank bar */
.rank { display: flex; align-items: center; gap: 12px; }
.rank__label { width: 190px; flex-shrink: 0; overflow: hidden; }
.rank__label .t { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank__label .s { font-size: 11px; color: var(--text-3); font-family: "SFMono-Regular", Consolas, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank__track { flex: 1; height: 16px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.rank__fill { height: 100%; border-radius: 999px; background: var(--violet); }
.rank__fill--dark { background: var(--primary); }
.rank__val { width: 64px; text-align: right; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rank + .rank { margin-top: 14px; }

/* ---------- 13. Alerts ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid transparent;
  margin-bottom: 16px;
  word-break: break-all;
}
.alert--error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.alert--ok    { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.alert--warn  { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.alert--info  { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ---------- 14. Toast ---------- */
.toast-wrap {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--primary);
  color: #fff;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toast-in .22s ease;
  max-width: 360px;
}
.toast--ok { background: #065f46; }
.toast--err { background: #991b1b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 15. Modal ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade-in .15s ease;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px;
  overflow: hidden;
  animation: modal-in .2s ease;
}
.modal--wide { max-width: 720px; }
.modal__head { padding: 20px 24px 0; }
.modal__head h3 { font-size: 16px; font-weight: 600; }
.modal__body { padding: 12px 24px 20px; color: var(--text-2); font-size: 13.5px; }
.modal__foot {
  padding: 16px 24px; background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- 16. Misc ---------- */
.empty { padding: 44px 20px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.break-all { word-break: break-all; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; } .mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { flex: 1; }

/* ---------- 17. Login / Register (center pages) ---------- */
/* 认证页统一为「表单居中单列卡片」；配色由后台「站点设置」在 <body style> 注入
   CSS 变量（--primary / --accent / --auth-bg / --focus-ring 等，见 internal/brand）。 */
.auth-center {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(720px 340px at 50% -120px, var(--accent-bg, #ecfdf5), transparent 70%),
    var(--auth-bg, var(--bg));
}
.auth-box { width: 100%; max-width: 410px; }
.auth-brand {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin-bottom: 18px;
  font-size: 17px; font-weight: 650; letter-spacing: -.01em;
}
.auth-brand .dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 0 4px var(--accent-bg, #ecfdf5);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 30px 30px 26px;
}
@media (max-width: 480px) { .auth-card { padding: 24px 18px 20px; } }

.auth__form { width: 100%; }
.auth__form h2 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.auth__form .lead { color: var(--text-2); font-size: 13.5px; margin-top: 4px; margin-bottom: 24px; }
.auth__sep {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-3); font-size: 12px; margin: 20px 0;
}
.auth__sep::before, .auth__sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.social-list { display: flex; flex-direction: column; gap: 10px; }
.social-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  transition: background .15s, border-color .15s;
}
.social-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.social-btn .ico {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.social-btn .arrow { margin-left: auto; color: var(--text-3); }

.auth__foot { margin-top: 22px; text-align: center; font-size: 13px; color: var(--text-2); }
/* 卡片外的页脚（© 站名），认证页底部 */
.auth-copy { margin-top: 18px; text-align: center; font-size: 12px; color: var(--text-3); }

/* ---------- 18. Center pages (verify / logout / confirm) ---------- */
.center-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px; background: var(--auth-bg, var(--bg));
}
.center-box { width: 100%; max-width: 520px; }
.center-box--narrow { max-width: 420px; }
.center-hero { text-align: center; margin-bottom: 22px; }
.center-hero h1 { font-size: 22px; font-weight: 650; }
.center-hero p { color: var(--text-2); font-size: 13.5px; margin-top: 6px; }
.big-ico {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.big-ico svg { width: 26px; height: 26px; }
.big-ico--warn  { background: var(--warn-bg); color: var(--warn); }
.big-ico--ok    { background: var(--success-bg); color: var(--success); }
.big-ico--error { background: var(--danger-bg); color: var(--danger); }

/* ---------- 19. Misc utilities ---------- */
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.dot-status { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-status--on { background: var(--accent); box-shadow: 0 0 0 3px rgba(16,185,129,.16); }
.dot-status--off { background: #cbd5e1; }
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px;
  background: #cbd5e1; transition: background .18s; cursor: pointer;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: transform .18s; box-shadow: var(--shadow-sm);
}
.switch input:checked + .track { background: var(--accent-strong); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* ---------- 20. User Center (account) ---------- */
.acct-head {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.acct-head__inner {
  max-width: 1080px; margin: 0 auto;
  padding: 0 24px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.acct-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 650; letter-spacing: -.01em;
}
.acct-brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .16);
}

.acct-wrap {
  max-width: 1080px; margin: 0 auto; padding: 28px 24px 72px;
  display: grid; grid-template-columns: 264px 1fr; gap: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .acct-wrap { grid-template-columns: 1fr; }
  .acct-side { position: static; }
}

.acct-side { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 16px; }

.acct-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.acct-avatar {
  width: 62px; height: 62px; border-radius: 50%;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #0f172a, #334155);
  color: #fff; font-size: 24px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.acct-avatar--img { padding: 0; overflow: hidden; background: #e2e8f0; }
.acct-avatar--img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-edit { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.avatar-edit__preview {
  width: 84px; height: 84px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, #0f172a, #334155);
  color: #fff; font-size: 32px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.avatar-edit__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-edit__body { display: flex; flex-direction: column; gap: 8px; }
.avatar-edit__hint { font-size: 12.5px; color: var(--text-3); }
.acct-name { font-size: 16px; font-weight: 650; }
.acct-sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; word-break: break-all; }
.acct-badges { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

.acct-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.acct-nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  font-size: 13.5px; color: var(--text-2);
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.acct-nav__item + .acct-nav__item { border-top: 1px solid var(--border); }
.acct-nav__item svg { width: 16px; height: 16px; opacity: .8; }
.acct-nav__item .chev { margin-left: auto; width: 14px; height: 14px; opacity: .4; }
.acct-nav__item:hover { background: var(--surface-2); color: var(--text); }
.acct-nav__item.is-active {
  background: var(--accent-bg);
  color: var(--accent-strong);
  font-weight: 600;
  border-left-color: var(--accent-strong);
}

.acct-main { min-width: 0; }

/* info list */
.info-list { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.info-row { display: flex; padding: 11px 16px; font-size: 13.5px; }
.info-row + .info-row { border-top: 1px solid var(--border); }
.info-row:nth-child(odd) { background: var(--surface-2); }
.info-row__k { width: 190px; flex-shrink: 0; color: var(--text-2); }
.info-row__v { flex: 1; color: var(--text); word-break: break-all; }

/* security items */
.sec-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0;
}
.sec-item + .sec-item { border-top: 1px solid var(--border); }
.sec-item .hint { margin-top: 2px; }

/* device icon */
.dev-ico {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--surface-3); color: var(--text-2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dev-ico svg { width: 17px; height: 17px; }

/* bind grid */
.bind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.bind-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13.5px; cursor: pointer;
  transition: background .15s, border-color .15s;
  text-align: left;
}
.bind-btn:hover { background: var(--surface-2); border-color: var(--accent-strong); }
.bind-btn .plus { margin-left: auto; color: var(--text-3); }
.bind-btn .plus svg { width: 16px; height: 16px; }
.ico-badge { flex-shrink: 0; }

/* ---------- 21. Server extras（模板专用补充） ---------- */
/* 卡片头内的搜索/筛选行 */
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-row .input, .filter-row .select { width: auto; min-width: 160px; }
/* 卡片头里放 form 时的对齐 */
.card__head form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* 表格行内的内联小表单（撤销 / 删除 / 解绑等单个按钮） */
.inline-form { display: inline; }
/* 表格内的紧凑内联表单行 */
.subrow-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.subrow-form .field { gap: 4px; }
.subrow-form .label { font-size: 11.5px; }
/* 通用宽度助手（原 Tailwind w-* 的语义替代） */
.w-40 { width: 10rem; } .w-44 { width: 11rem; } .w-48 { width: 12rem; }
.w-56 { width: 14rem; } .w-64 { width: 16rem; } .w-72 { width: 18rem; }
.w-80 { width: 20rem; }
.w-auto { width: auto; }
.flex-1 { flex: 1; min-width: 0; }
.hidden { display: none; }
[x-cloak] { display: none !important; }

/* 私信会话气泡（我的消息 / 私信） */
.chat {
  display: flex; flex-direction: column; gap: 12px;
  max-height: 460px; overflow-y: auto;
  padding: 4px 2px;
}
.chat__msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 76%; }
.chat__msg--mine { align-self: flex-end; align-items: flex-end; }
.chat__body {
  padding: 9px 13px;
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--text);
  font-size: 13.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.chat__msg--mine .chat__body { background: var(--accent-bg); border: 1px solid var(--success-border); }
.chat__meta { margin-top: 4px; font-size: 11.5px; color: var(--text-3); }

/* ---------- 顶栏「消息通知」铃铛（个人中心右上角） ---------- */
.bell { position: relative; }
.bell > summary { list-style: none; }
.bell > summary::-webkit-details-marker { display: none; }
.bell__btn {
  position: relative;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.bell__btn:hover { background: var(--surface-3); color: var(--text); }
.bell__btn svg { width: 19px; height: 19px; }
.bell__badge {
  position: absolute; top: 0; right: -1px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px;
  background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 600; line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.bell__panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 272px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 40;
}
.bell__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.bell__item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--text);
}
.bell__item:hover { background: var(--surface-2); }
.bell__item svg { width: 16px; height: 16px; color: var(--text-3); flex-shrink: 0; }
.bell__item .badge { margin-left: auto; }
.bell__foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.bell__foot button { background: none; border: none; padding: 0; cursor: pointer; font-size: 12px; font-family: inherit; }

/* ---------- 语言切换（中文 / English，见 /lang/:code） ---------- */
.lang-switch {
  display: flex; justify-content: flex-end; gap: 6px;
  margin-bottom: 14px;
  font-size: 12px;
}
.lang-switch a {
  padding: 2px 10px; border-radius: 999px; line-height: 1.7;
  color: var(--text-3); border: 1px solid transparent;
}
.lang-switch a:hover { color: var(--text-2); }
.lang-switch a.on {
  color: var(--accent-strong); background: var(--accent-bg);
  border-color: var(--accent-soft, var(--success-border)); font-weight: 600;
}
/* 个人中心顶栏内嵌版：与按钮行同排 */
.lang-switch--head { margin-bottom: 0; margin-right: 2px; align-items: center; }
.lang-switch--head a { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.lang-switch--head a.on { border-color: var(--accent-soft, var(--success-border)); color: var(--accent-strong); background: var(--accent-bg); }

/* ---------- 站点设置：认证页配色预设选择 ---------- */
.theme-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) { .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .theme-grid { grid-template-columns: 1fr; } }
.theme-option {
  position: relative;
  display: flex; flex-direction: column; gap: 9px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.theme-option:hover { box-shadow: var(--shadow-sm); }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option:has(input:checked),
.theme-option.is-on {
  border-color: var(--accent-strong, #059669);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, .05);
}
.theme-swatch { display: flex; gap: 6px; }
.theme-swatch span {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, .08);
}
.theme-opt__name { font-size: 13.5px; font-weight: 600; }
.theme-opt__desc { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
