/* ============================================================
   Descend Network · 完整样式表
   包含：基础、布局、仪表盘、域名管理、论坛、特殊功能、状态控制
   ============================================================ */

/* ============================================================
   CSS Variables
   ------------------------------------------------------------
   主题系统：所有颜色通过语义变量表达，切换主题只需覆盖变量。
   新增的语义变量（--glass-highlight、--divider 等）用于替代
   原先散落在各处的 rgba(255,255,255,…) / rgba(0,0,0,…) 硬编码，
   否则浅色模式下这些地方会显示错误。
   ============================================================ */
/* ------------------------------------------------------------
   深色主题（Vercel 风：纯黑底 + 明确灰边框 + 近零圆角）
   层次完全靠边框与背景明度差表达，不用阴影、不用玻璃模糊。
   ------------------------------------------------------------ */
:root {
  /* 背景 */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-card: #0a0a0a;
  --bg-card-hover: #141414;
  --bg-input: #0a0a0a;
  --bg-elevated: #111111;
  /* 内凹面：代码块、预览框等需要"凹陷感"的区域 */
  --bg-inset: #050505;
  --bg-inset-strong: #000000;
  /* 模态遮罩与浮层阴影 */
  --overlay-scrim: rgba(0, 0, 0, 0.85);
  --shadow-popover: 0 8px 30px rgba(0, 0, 0, 0.8);

  /* 品牌色：高饱和蓝，只用于关键交互 */
  --ion-blue: #0070f3;
  --ion-blue-dim: rgba(0, 112, 243, 0.15);
  --ion-blue-glow: rgba(0, 112, 243, 0.4);
  --plasma-purple: #7928ca;
  --plasma-purple-dim: rgba(121, 40, 202, 0.15);
  --energy-orange: #f5a623;

  /* 文字 */
  --text-primary: #ffffff;
  --text-secondary: #a1a1a1;
  --text-muted: #666666;
  --text-on-accent: #ffffff;

  /* 边框：明确可见的灰，而非半透明品牌色 */
  --glass-border: #333333;
  --glass-border-hover: #666666;
  --glass-shadow: none;
  /* 保留变量以兼容既有规则，但实际不再产生模糊 */
  --glass-blur: none;
  --glass-highlight: rgba(255, 255, 255, 0.06);
  --glass-highlight-strong: rgba(255, 255, 255, 0.12);
  --divider: #262626;
  --divider-strong: #404040;
  /* 悬停/激活态叠加层 */
  --overlay-subtle: rgba(255, 255, 255, 0.03);
  --overlay-hover: rgba(255, 255, 255, 0.08);

  /* 骨架屏 */
  --skeleton-base: rgba(255, 255, 255, 0.05);
  --skeleton-shine: rgba(255, 255, 255, 0.12);

  /* 几何与动效：近零圆角，短促过渡 */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-xl: 8px;
  --radius-full: 4px;
  --transition-fast: 0.1s ease;
  --transition-med: 0.15s ease;
  --transition-slow: 0.2s ease;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --font-sans: -apple-system, 'Segoe UI', 'Inter', system-ui, sans-serif;

  /* 滚动条 */
  --scrollbar-thumb: #333333;
  --scrollbar-thumb-hover: #555555;

  color-scheme: dark;
}

/* ------------------------------------------------------------
   浅色主题
   通过 <html data-theme="light"> 启用。
   仅覆盖变量，不改动任何组件规则。
   ------------------------------------------------------------ */
[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #f2f2f2;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  --bg-input: #ffffff;
  --bg-elevated: #ffffff;
  /* 浅色下"内凹面"不再是深色，而是比背景略深的灰 */
  --bg-inset: #f2f2f2;
  --bg-inset-strong: #eaeaea;
  --overlay-scrim: rgba(0, 0, 0, 0.4);
  --shadow-popover: 0 8px 30px rgba(0, 0, 0, 0.12);

  /* 浅色下品牌色需加深，否则在白底上看不清 */
  --ion-blue: #0070f3;
  --ion-blue-dim: rgba(0, 112, 243, 0.10);
  --ion-blue-glow: rgba(0, 112, 243, 0.18);
  --plasma-purple: #7928ca;
  --plasma-purple-dim: rgba(121, 40, 202, 0.10);
  --energy-orange: #d97706;

  --text-primary: #000000;
  --text-secondary: #666666;
  --text-muted: #888888;
  --text-on-accent: #ffffff;

  /* 边框：浅色下用明确的浅灰，而非半透明黑 */
  --glass-border: #eaeaea;
  --glass-border-hover: #999999;
  --glass-shadow: none;
  --glass-highlight: rgba(0, 0, 0, 0.03);
  --glass-highlight-strong: rgba(0, 0, 0, 0.06);
  --divider: #eaeaea;
  --divider-strong: #d4d4d4;
  --overlay-subtle: rgba(0, 0, 0, 0.02);
  --overlay-hover: rgba(0, 0, 0, 0.05);

  --skeleton-base: rgba(0, 0, 0, 0.05);
  --skeleton-shine: rgba(0, 0, 0, 0.10);

  --scrollbar-thumb: #d4d4d4;
  --scrollbar-thumb-hover: #a3a3a3;

  color-scheme: light;
}

/* 浅色模式下，深色背景光晕需要调淡，否则页面发灰 */
[data-theme="light"] body::before,
[data-theme="light"] #app::before {
  opacity: 0.5;
}

/* ============================================================
   Vercel 风格基因
   ------------------------------------------------------------
   以下规则无法靠变量表达，必须显式覆盖：
   去掉玻璃模糊、去掉渐变、去掉悬浮位移与彩色阴影。
   ============================================================ */

/* --- 移除所有玻璃模糊：层次改由边框 + 背景明度差承担 --- */
.sidebar,
.domain-grid,
.domain-row,
.special-card,
.modal,
.dropdown-menu,
.custom-select .select-dropdown,
.topic-item,
.home-card,
.auth-card,
.dashboard-activity,
.stat-card,
.empty-state,
.modal-overlay.active {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* --- 主按钮：实心，零渐变 --- */
.btn-primary,
.btn-action.primary,
.btn-cta,
.auth-submit {
  background: var(--ion-blue);
  color: #fff;
  border-color: var(--ion-blue);
  font-weight: 500;
  box-shadow: none;
}
.btn-primary:hover:not(:disabled),
.btn-action.primary:hover:not(:disabled) {
  background: #0060df;
  box-shadow: none;
}
[data-theme="light"] .btn-primary:hover:not(:disabled),
[data-theme="light"] .btn-action.primary:hover:not(:disabled) {
  background: #0059c7;
}

/* --- 标题不使用渐变文字 --- */
.home-title .grad,
.page-title .accent {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--ion-blue);
}

/* --- 徽章：方正的纯色小标签，不用大写与字距 --- */
.status-badge,
.domain-mode-badge {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  border-width: 1px;
}

/* --- 输入框聚焦：明确的边框，不要发光环 --- */
.form-control:focus,
.auth-input:focus {
  border-color: var(--text-primary);
  box-shadow: none;
}

/* ============================================================
   Reset & Base
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--ion-blue); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--plasma-purple); }

::selection { background: var(--ion-blue); color: #fff; }

/* ============================================================
   LOADER
   ============================================================ */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#loader canvas { width: 200px; height: 200px; display: block; }

.loader-status { margin-top: 32px; width: 260px; text-align: center; font-family: var(--font-mono); }
.loader-text {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 14px;
}
.loader-text .highlight { color: var(--ion-blue); }

.loader-progress-wrap {
  width: 100%;
  height: 3px;
  background: var(--overlay-hover);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.loader-progress-wrap .loader-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ion-blue), var(--plasma-purple));
  border-radius: 4px;
  transition: width 0.15s linear;
  box-shadow: 0 0 20px var(--ion-blue-glow);
}
/* OAuth 回跳时的“不确定态”进度条：不停留在一个会被误读的固定百分比 */
.loader-progress-wrap .loader-progress-bar.loader-indeterminate {
  width: 40% !important;
  transition: none;
  animation: loader-indeterminate 1.2s ease-in-out infinite;
}
@keyframes loader-indeterminate {
  0%   { margin-left: 0%;   opacity: 0.55; }
  50%  { margin-left: 60%;  opacity: 1; }
  100% { margin-left: 0%;   opacity: 0.55; }
}
.loader-progress-wrap .loader-progress-glow {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--ion-blue-glow));
  filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.loader-progress-wrap .loader-progress-glow.active { opacity: 1; }

.loader-progress-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  font-family: var(--font-mono);
  letter-spacing: 1px;
}
.loader-progress-label .pct { color: var(--ion-blue); }

/* ============================================================
   LOGIN BUTTON
   ============================================================ */
#login-container {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}
#login-container.visible { display: flex; }

#login-btn {
  position: relative;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  width: 240px;
  height: 60px;
}

#login-btn .btn-bg {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 2px solid var(--ion-blue);
  overflow: hidden;
  transition: border-color var(--transition-med);
}
#login-btn .btn-bg .btn-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--ion-blue-dim), var(--ion-blue-glow));
  border-radius: var(--radius-md);
  transition: width 0.05s linear;
}
#login-btn .btn-bg .btn-fill-glow {
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--ion-blue-glow));
  filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
#login-btn.pressing .btn-bg .btn-fill-glow { opacity: 1; }

#login-btn .btn-text {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 8px;
  text-transform: uppercase;
  color: var(--ion-blue);
  transition: color var(--transition-med);
}
#login-btn.pressing .btn-text { color: var(--text-primary); }

#login-btn .btn-shake { display: inline-block; transition: transform 0.05s linear; }
#login-btn.pressing .btn-shake { animation: shake 0.08s linear infinite alternate; }

#login-btn .progress-ring {
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--overlay-hover);
  border-radius: 4px;
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--transition-med);
  z-index: 3;
}
#login-btn.pressing .progress-ring { opacity: 1; }
#login-btn .progress-ring .progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ion-blue), var(--plasma-purple));
  border-radius: 4px;
  transition: width 0.05s linear;
  box-shadow: 0 0 20px var(--ion-blue-glow);
}

#login-btn .login-hint {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 1px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--transition-med);
  z-index: 3;
}
#login-btn.pressing .login-hint { opacity: 1; }

@keyframes shake {
  0% { transform: translateX(-1px) rotate(-0.5deg); }
  100% { transform: translateX(1px) rotate(0.5deg); }
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
#app {
  display: none;
  width: 100%;
  height: 100vh;
  background: var(--bg-primary);
}
#app.visible { display: flex; }

/* ===== Sidebar ===== */
.sidebar {
  width: 220px;
  min-width: 220px;
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  flex-shrink: 0;
  transition: width var(--transition-med), min-width var(--transition-med);
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 20px 8px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 20px;
}
.sidebar .brand .logo-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--ion-blue); }
.sidebar .brand .logo-icon svg { width: 28px; height: 28px; }
.sidebar .brand .logo-text {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.2;
}
.sidebar .brand .logo-text .accent { color: var(--ion-blue); }
.sidebar .brand .logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: block;
  margin-top: 1px;
}
.sidebar .nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar .nav .nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  width: 100%;
  position: relative;
}

/* ------------------------------------------------------------
   管理员入口的显隐
   ------------------------------------------------------------
   浏览器默认样式 [hidden] { display: none } 的特异性只有 0,1,0，
   而上方 .sidebar .nav .nav-item { display: flex } 是 0,3,0，
   后者完胜 —— 于是 navAdmin 上的 hidden 属性完全失效，
   所有用户都能看到「域名状态管理」入口。

   这里用同等特异性 + !important 确保 hidden 真正生效。
   ------------------------------------------------------------ */
.sidebar .nav .nav-item[hidden] {
  display: none !important;
}

.sidebar .nav .nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 0;
  background: var(--ion-blue);
  transition: height var(--transition-fast);
  border-radius: 0 2px 2px 0;
}
.sidebar .nav .nav-item:hover { color: var(--text-primary); background: var(--overlay-subtle); }
.sidebar .nav .nav-item.active { color: var(--ion-blue); background: var(--overlay-hover); }
.sidebar .nav .nav-item.active::before { height: 60%; }
.sidebar .nav .nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; color: currentColor; }
.sidebar .nav .nav-item .nav-icon svg { width: 100%; height: 100%; }
.sidebar .nav .nav-item .nav-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: var(--ion-blue-dim);
  color: var(--ion-blue);
  font-family: var(--font-mono);
}
.sidebar .nav-divider { height: 1px; background: var(--glass-border); margin: 8px 12px; }
.sidebar .sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  margin-top: auto;
}
.sidebar .sidebar-footer .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--overlay-subtle);
}
.sidebar .sidebar-footer .user-info .avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--ion-blue-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ion-blue);
  font-size: 12px;
  font-weight: 600;
}
.sidebar .sidebar-footer .user-info .user-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar .sidebar-footer .user-info .user-email {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar .sidebar-footer .logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  margin-top: 4px;
}
.sidebar .sidebar-footer .logout-btn:hover { color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.sidebar .sidebar-footer .logout-btn .nav-icon { width: 16px; height: 16px; }

/* ===== 主题切换按钮 ===== */
.sidebar .sidebar-footer .theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  margin-top: 4px;
}
.sidebar .sidebar-footer .theme-toggle-btn:hover {
  color: var(--ion-blue);
  background: var(--ion-blue-dim);
}
.sidebar .sidebar-footer .theme-toggle-btn .nav-icon { width: 16px; height: 16px; }

/* 按当前主题显示对应的图标：深色时展示"月亮"（点击切浅色），
   浅色时展示"太阳"。避免同时显示两个图标。 */
.theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light { display: inline-flex; }

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 32px 48px 32px;
  background: var(--bg-primary);
  /* 不使用 align-items:center —— 那会让不同 max-width 的页面
     各自居中，切换时标题左边缘横向跳动。
     改为块级流式布局，所有页面统一靠左对齐。 */
  display: block;
}

/* 所有页面共用同一个内容容器宽度，保证左边缘绝对对齐 */
.page {
  display: none;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;             /* 仅在超宽屏下居中整个容器，边缘仍对齐 */
}

/* ============================================================
   PAGE
   ============================================================ */
/* 用 content-visibility 让浏览器跳过不可见页面的渲染工作，
   大幅降低标签切换时的样式与布局开销。
   注意：只加在隐藏页上，避免影响可见页的即时显示。 */
.page:not(.active) { content-visibility: hidden; }

.page.active {
  display: block;
  /* 切换时只做透明度过渡：
     原实现同时对 opacity + transform 做动画，
     在包含大量内联 SVG 的页面上会触发整棵子树的重绘。
     仅用 opacity 可交给合成层处理，明显更流畅。 */
  animation: pageFadeIn 0.18s ease;
}
/* 尊重用户的减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .page.active { animation: none; }
}

@keyframes pageFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================================
   骨架屏占位
   ============================================================ */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skeleton-rows { display: flex; flex-direction: column; gap: 10px; }
.skeleton-row {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg,
    var(--overlay-hover) 25%,
    var(--ion-blue-glow) 37%,
    var(--overlay-hover) 63%);
  background-size: 400% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
}
.skeleton-line.w30 { width: 30%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w50 { width: 50%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }

@keyframes skeletonShimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-line { animation: none; }
}

.page-header { margin-bottom: 28px; }
.page-header .page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}
.page-header .page-title .accent { color: var(--ion-blue); }
.page-header .page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.page-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.page-header-actions .btn-sm { font-size: 12px; padding: 4px 14px; }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  font-weight: 500;
}
.form-group label .hint {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: all var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}
.form-control::placeholder { color: var(--text-muted); opacity: 0.6; }
.form-control:hover { border-color: var(--glass-border-hover); }
.form-control:focus {
  border-color: var(--ion-blue);
  box-shadow: 0 0 24px var(--ion-blue-dim), inset 0 0 20px var(--overlay-subtle);
  background: var(--bg-inset-strong);
}
.form-control:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='rgba(160,180,210,0.5)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
select.form-control option { background: var(--bg-secondary); color: var(--text-primary); padding: 8px; }
select.form-control:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='var(--ion-blue)'/%3E%3C/svg%3E");
}

textarea.form-control { resize: vertical; min-height: 80px; font-family: var(--font-sans); line-height: 1.6; }

.search-input {
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: all var(--transition-fast);
  width: 200px;
}
.search-input::placeholder { color: var(--text-muted); opacity: 0.6; }
.search-input:hover { border-color: var(--glass-border-hover); }
.search-input:focus { border-color: var(--ion-blue); box-shadow: 0 0 20px var(--ion-blue-dim); }

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ion-blue);
  cursor: pointer;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
input[type="checkbox"]:checked { background-color: var(--ion-blue); border-color: var(--ion-blue); }
input[type="checkbox"]:focus { outline: none; box-shadow: 0 0 12px var(--ion-blue-dim); }

.icon-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  user-select: none;
  -webkit-user-select: none;
}
.icon-checkbox:hover { color: var(--text-primary); }

/* ============================================================
   CUSTOM SELECT
   ============================================================ */
.custom-select {
  position: relative;
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
}
.custom-select .select-trigger {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all var(--transition-fast);
  min-height: 44px;
  position: relative;
}
.custom-select .select-trigger:hover { border-color: var(--glass-border-hover); }
.custom-select .select-trigger:focus {
  border-color: var(--ion-blue);
  box-shadow: 0 0 24px var(--ion-blue-dim);
  outline: none;
}
.custom-select .select-trigger .trigger-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.custom-select .select-trigger .trigger-placeholder { color: var(--text-muted); opacity: 0.6; }
.custom-select .select-trigger .trigger-arrow {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}
.custom-select .select-trigger .trigger-arrow svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.custom-select.open .select-trigger .trigger-arrow { transform: rotate(180deg); }
.custom-select .select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 6px 4px;
  z-index: 999;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.custom-select.open .select-dropdown {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
.custom-select .select-dropdown::-webkit-scrollbar { width: 4px; }
.custom-select .select-dropdown::-webkit-scrollbar-track { background: transparent; }
.custom-select .select-dropdown::-webkit-scrollbar-thumb { background: var(--ion-blue); border-radius: 4px; }
.custom-select .select-option {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.custom-select .select-option:hover { background: var(--overlay-hover); color: var(--text-primary); }
.custom-select .select-option.selected { background: var(--ion-blue-dim); color: var(--ion-blue); }
.custom-select .select-option .option-check {
  opacity: 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--ion-blue);
  transition: opacity var(--transition-fast);
}
.custom-select .select-option .option-check svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.custom-select .select-option.selected .option-check { opacity: 1; }
.custom-select .select-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  min-height: 40px;
  min-width: 80px;
}
.btn:hover:not(:disabled) { border-color: var(--glass-border-hover); color: var(--text-primary); background: var(--bg-card-hover); }
.btn .icon { width: 16px; height: 16px; flex-shrink: 0; }

/* 加载态：不要整按钮降透明度。
   实心主按钮降透明度后看起来像"被禁用/坏了"，而不是"正在加载"。
   改为保持原色，仅由 spinner 表达进行中状态。 */
.btn.loading { pointer-events: none; }
/* 仅对非实心按钮轻微降透明度，以示不可重复点击 */
.btn.loading:not(.btn-primary):not(.btn-danger) { opacity: 0.75; }

/* 旋转指示器。
   注意轨道颜色：Vercel 主题下 --glass-highlight-strong 只有 12% 白，
   压在实心蓝底上几乎不可见，只剩 border-top 一小段弧。
   因此轨道用 currentColor 的低透明度，保证任何底色上都看得见。 */
.btn .btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0.85;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.btn.loading .btn-spinner { display: inline-block; }
.btn.loading .btn-text,
.btn.loading .btn-icon,
.btn.loading .btn-label { display: none; }

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

.btn-primary { background: var(--ion-blue); color: #fff; border-color: var(--ion-blue); }
.btn-primary:hover:not(:disabled) { background: #0060df; border-color: #0060df; color: #fff; box-shadow: none; }

.btn-danger { background: #ef4444; color: white; border-color: #ef4444; }
.btn-danger:hover:not(:disabled) { background: #dc2626; border-color: #dc2626; box-shadow: none; }

.btn-outline { background: transparent; border: 1px solid var(--glass-border); color: var(--text-secondary); }
.btn-outline:hover:not(:disabled) { border-color: var(--divider-strong); color: var(--text-primary); }

.btn-sm {
  padding: 4px 12px;
  font-size: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  min-width: auto;
}
.btn-sm:hover:not(:disabled) { border-color: var(--glass-border-hover); color: var(--text-primary); }
.btn-sm.primary { border-color: var(--ion-blue-glow); color: var(--ion-blue); }
.btn-sm.primary:hover:not(:disabled) { background: var(--overlay-hover); border-color: var(--ion-blue); }
.btn-sm.danger:hover:not(:disabled) { border-color: rgba(239, 68, 68, 0.3); color: #ef4444; }
.btn-sm .icon { width: 12px; height: 12px; }
.btn-sm .btn-spinner { width: 14px; height: 14px; border-width: 2px; }

.btn-icon {
  padding: 4px 8px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 28px;
  min-width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover:not(:disabled) { background: var(--overlay-hover); color: var(--text-primary); }
.btn-icon.danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.08); color: #ef4444; }
.btn-icon .icon { width: 14px; height: 14px; }

.btn-refresh { padding: 4px 10px; font-size: 12px; }
.btn-refresh .icon { width: 14px; height: 14px; transition: transform 0.4s ease; }
.btn-refresh:hover .icon { transform: rotate(180deg); }
.btn-refresh.loading .icon { animation: spin 0.7s linear infinite; }

/* ============================================================
   BUTTONS - 操作按钮 (进度灌满)
   ============================================================ */
.btn-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 44px;
  min-width: 120px;
  overflow: hidden;
  font-weight: 500;
}
.btn-action:hover:not(:disabled) { border-color: var(--glass-border-hover); color: var(--text-primary); background: var(--bg-card-hover); }
.btn-action.primary { background: var(--ion-blue); color: #fff; border-color: var(--ion-blue); }
.btn-action.primary:hover:not(:disabled) { background: #0060df; border-color: #0060df; box-shadow: none; }
.btn-action.danger { background: #ef4444; color: white; border-color: #ef4444; }
.btn-action.danger:hover:not(:disabled) { background: #dc2626; border-color: #dc2626; box-shadow: none; }

/* 进度填充层：从左侧灌满。
   注意：主按钮（.primary）现在是实心蓝底，
   进度条若用黑色蒙层会几乎看不见（蓝底 + 黑 15% ≈ 无变化）。
   因此按「底色明暗」分别取高光色：
     - 实心蓝/红底 → 白色半透明叠加，越亮越明显
     - 透明/深色底 → 浅色叠加 */
.btn-action .btn-progress-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  height: 100%;
  border-radius: var(--radius-md);
  background: var(--overlay-hover);
  pointer-events: none;
  transition: width 0.1s linear;
}
.btn-action.primary .btn-progress-fill {
  background: rgba(255, 255, 255, 0.28);
}
.btn-action.primary:hover:not(:disabled) .btn-progress-fill {
  background: rgba(255, 255, 255, 0.32);
}
.btn-action.danger .btn-progress-fill {
  background: rgba(255, 255, 255, 0.28);
}

.btn-action .btn-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
/* 旋转指示器：与 .btn 同理，轨道不能用 12% 白（实心蓝底上不可见） */
.btn-action .btn-content .btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0.85;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.btn-action.loading .btn-content .btn-spinner { display: inline-block; }
.btn-action.loading .btn-content .btn-label { display: none; }

.btn-action.pulsing { animation: btnPulse 1s ease-in-out infinite; }
@keyframes btnPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }

.btn-action.completed { border-color: #10b981; box-shadow: 0 0 40px rgba(16, 185, 129, 0.3); }
.btn-action.completed .btn-content .btn-label { color: #10b981; }

/* ============================================================
   DROPDOWN MENU
   ============================================================ */
/* 只做定位参照。不要在此设 z-index：
   否则 .dropdown 会自建层叠上下文，菜单的 z-index 只在
   这个上下文内部比较，无法盖住行外的元素。
   行级抬升由 .domain-row.menu-open 统一负责。 */
.dropdown { position: relative; display: inline-block; }
.dropdown .dropdown-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dropdown .dropdown-toggle:hover { background: var(--overlay-hover); color: var(--text-primary); }
.dropdown .dropdown-toggle .icon { width: 18px; height: 18px; }

.dropdown .dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 180px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 6px 4px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.dropdown .dropdown-menu.open {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: all var(--transition-fast);
}
.dropdown .dropdown-item:hover { background: var(--overlay-hover); color: var(--text-primary); }
.dropdown .dropdown-item .item-icon { width: 16px; height: 16px; flex-shrink: 0; color: currentColor; }
.dropdown .dropdown-item .item-icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dropdown .dropdown-item.danger { color: #ef4444; }
.dropdown .dropdown-item.danger:hover { background: rgba(239, 68, 68, 0.08); color: #ef4444; }
/* 被状态锁阻止的操作：真正禁用（不是 pointer-events 障眼法），
   并用 cursor 与降透明度明确表达不可用。 */
.dropdown .dropdown-item:disabled,
.dropdown .dropdown-item[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.dropdown .dropdown-item.danger:disabled { color: #ef4444; }
.dropdown .dropdown-divider { height: 1px; background: var(--glass-border); margin: 4px 12px; }

/* ============================================================
   DOMAIN LIST（列表行形态）
   ------------------------------------------------------------
   每行一个域名：[状态点] [域名 + 元信息] [徽章] [操作]
   不使用卡片网格：行内固定列宽让所有行边缘对齐，
   扫读更快，也不再有"卡片宽度随内容跳动"的问题。
   ============================================================ */
.domain-grid {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  /* 关键：不能设 overflow:hidden。
     那会把行尾的三个点下拉菜单一起裁掉（菜单是绝对定位、溢出容器）。
     首尾行贴合圆角改由下方 :first-child / :last-child 自行负责。 */
}

.domain-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
  transition: background var(--transition-fast);
  position: relative;
  /* 行本身只做定位参照，层级由 .menu-open 提升 */
}
/* 首尾行自行圆角，替代容器的 overflow:hidden */
.domain-row:first-child {
  border-top-left-radius: calc(var(--radius-lg) - 1px);
  border-top-right-radius: calc(var(--radius-lg) - 1px);
}
.domain-row:last-child {
  border-bottom: none;
  border-bottom-left-radius: calc(var(--radius-lg) - 1px);
  border-bottom-right-radius: calc(var(--radius-lg) - 1px);
}
.domain-row:hover { background: var(--bg-card-hover); }

/* 菜单打开时把整行抬到其它行之上。
   JS 在 toggleDropdown 里加 .menu-open，行叠上下文升高后，
   内部 position:absolute 的菜单才能盖住后续行。
   注意：必须用 JS 实际添加的类名，且 z-index 要足够大。 */
.domain-row.menu-open {
  z-index: 50;
  background: var(--bg-card-hover);
}

/* --- 主列：域名 + 元信息，占据剩余空间 --- */
.domain-row-main {
  flex: 1 1 auto;
  min-width: 0;               /* 允许收缩，超长域名不撑破行 */
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.domain-row-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
  line-height: 1.4;
  overflow-wrap: anywhere;    /* 超长域名可断行 */
}
.domain-row-name .root {
  color: var(--text-muted);
  font-weight: 400;
}
.domain-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  min-width: 0;
}
.domain-row-meta .meta-sep { color: var(--divider-strong); }

/* --- 徽章列：固定最小宽度，让各行的操作按钮纵向对齐 --- */
.domain-row-badges {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

/* --- 操作列 --- */
.domain-row-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.domain-row-actions .btn-sm.primary {
  flex: 0 0 auto;
  white-space: nowrap;
}
.domain-row-actions .dropdown { flex: 0 0 auto; }

/* --- 空状态 --- */
.empty-state {
  padding: 56px 24px;
  text-align: center;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.empty-state-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}
.empty-state-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* --- 状态徽章与模式徽章（列表行内） --- */
.domain-mode-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  border: 1px solid transparent;
  flex-shrink: 0;
  white-space: nowrap;
}
.domain-mode-badge.ion {
  background: var(--ion-blue-dim);
  color: var(--ion-blue);
  border-color: var(--ion-blue-glow);
}
.domain-mode-badge.self {
  background: rgba(245, 166, 35, 0.12);
  color: var(--energy-orange);
  border-color: rgba(245, 166, 35, 0.3);
}

/* --- 窄屏：转成两行布局，操作按钮换到第二行 --- */
@media (max-width: 640px) {
  .domain-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .domain-row-main { flex: 1 1 100%; }
  .domain-row-badges { justify-content: flex-start; }
  .domain-row-actions { margin-left: auto; }
}

/* ============================================================
   DOMAIN STATUS BADGE
   ============================================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.status-badge.active {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.15);
}
.status-badge.client_push {
  background: rgba(245, 166, 35, 0.12);
  color: var(--energy-orange);
  border: 1px solid rgba(245, 166, 35, 0.3);
}
.status-badge.server_push {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.15);
}
.status-badge.server_hold {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
/* 初始注册保护：属于正常状态而非异常，用中性蓝以示区别 */
.status-badge.initial_lock {
  background: var(--ion-blue-dim);
  color: var(--ion-blue);
  border: 1px solid var(--ion-blue-glow);
}

/* ============================================================
   DOMAIN DETAIL
   ============================================================ */
.domain-detail-mode {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}
.domain-detail-mode .mode-label { font-size: 12px; color: var(--text-muted); }
.domain-detail-mode .mode-value { font-size: 13px; font-weight: 500; font-family: var(--font-mono); }
.domain-detail-mode .mode-value.ion { color: var(--ion-blue); }
.domain-detail-mode .mode-value.self { color: var(--energy-orange); }

.record-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.record-list-header .record-count { font-size: 12px; color: var(--text-muted); }

.record-list { margin-bottom: 20px; }
.record-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  transition: all var(--transition-fast);
}
.record-item:hover { border-color: var(--glass-border-hover); }
.record-item .record-info {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
}
.record-item .record-type {
  font-weight: 600;
  color: var(--ion-blue);
  font-family: var(--font-mono);
  font-size: 12px;
  min-width: 40px;
}
.record-item .record-domain { font-family: var(--font-mono); font-size: 13px; color: var(--text-primary); }
.record-item .record-arrow { color: var(--text-muted); }
.record-item .record-value { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.record-item .record-ttl { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.record-item .record-actions { display: flex; gap: 4px; flex-shrink: 0; }
.empty-records { text-align: center; padding: 32px; color: var(--text-muted); font-size: 13px; }

.add-record-form {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.add-record-form .form-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.add-record-form .form-title .edit-badge {
  font-size: 10px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--ion-blue-dim);
  color: var(--ion-blue);
  font-family: var(--font-mono);
  margin-left: 8px;
}
.add-record-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.add-record-form .form-group { margin-bottom: 12px; }
.add-record-form .form-group label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.add-record-form .form-group label .hint { font-size: 11px; color: var(--text-muted); font-weight: 400; text-transform: none; }
.add-record-form .form-control { padding: 8px 12px; font-size: 13px; }
.add-record-form .subhost-preview {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  margin-top: 4px;
}
.add-record-form .subhost-preview .highlight { color: var(--ion-blue); }
.add-record-form .form-actions { display: flex; gap: 10px; margin-top: 4px; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: all var(--transition-med);
}
.stat-card:hover { border-color: var(--glass-border-hover); background: var(--bg-card-hover); }
.stat-card .stat-value { font-size: 28px; font-weight: 600; color: var(--text-primary); font-family: var(--font-mono); }
.stat-card .stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

.dashboard-activity {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.dashboard-activity .activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.dashboard-activity .activity-header h3 { font-size: 14px; font-weight: 500; color: var(--text-secondary); letter-spacing: 0.5px; }
.dashboard-activity .activity-header .activity-count { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--divider);
}
.activity-item:last-child { border-bottom: none; }
.activity-item .activity-dot { width: 6px; height: 6px; border-radius: var(--radius-full); flex-shrink: 0; }
.activity-item .activity-dot.blue { background: var(--ion-blue); }
.activity-item .activity-dot.purple { background: var(--plasma-purple); }
.activity-item .activity-dot.orange { background: var(--energy-orange); }
.activity-item .activity-dot.green { background: #10b981; }

.activity-item .activity-text { flex: 1; font-size: 13px; color: var(--text-secondary); }
.activity-item .activity-text strong { color: var(--text-primary); }
.activity-item .activity-time { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); flex-shrink: 0; }

.quick-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============================================================
   DOMAIN LIST
   ============================================================ */
/* 搜索/操作行：与 page-header 使用同一左边缘 */
.domain-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.domain-list-header .domain-count { font-size: 13px; color: var(--text-secondary); }
.domain-list-header .domain-count strong { color: var(--text-primary); }
.domain-list-search { display: flex; gap: 10px; align-items: center; }
/* 空状态时外框由 .empty-state 自己提供，避免双层边框 */
.domain-grid:has(.empty-state) {
  border: none;
  background: transparent;
}

/* ============================================================
   SPECIAL FUNCTIONS
   ============================================================ */
.special-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  transition: all var(--transition-med);
}
.special-card:hover {
  border-color: var(--glass-border-hover);
  background: var(--bg-card-hover);
}
.special-card .special-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.special-card .special-card-header .special-card-icon {
  font-size: 24px;
}
.special-card .special-card-header .special-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.special-card .special-card-body .form-group:last-child {
  margin-bottom: 0;
}

/* ============================================================
   SPECIAL FUNCTIONS
   ============================================================ */
.special-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

/* ============================================================
   REGISTER & CLAIM & SETTINGS
   ------------------------------------------------------------
   这三个页面是「窄表单页」。原先各自 margin:0 auto 居中，
   导致切换到列表页时标题左边缘横向跳动。
   现在统一靠左、限制最大宽度，视觉基线与其它页面一致。
   ============================================================ */
.register-container,
.claim-container,
.settings-container {
  max-width: 560px;
  width: 100%;
  margin: 0;
}
.claim-container { max-width: 520px; }
.settings-container { max-width: 560px; }

.register-container .register-preview {
  margin-top: 16px;
  padding: 14px 20px;
  background: var(--bg-inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-secondary);
}
.register-container .register-preview .highlight { color: var(--ion-blue); }
.register-container .register-hint { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

.claim-container .claim-hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.claim-container .claim-hint .example { color: var(--ion-blue); font-family: var(--font-mono); }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-container .settings-group { margin-bottom: 24px; }
.settings-container .settings-group .settings-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: block;
}
.settings-container .settings-group+.settings-group { padding-top: 20px; border-top: 1px solid var(--glass-border); }

/* ============================================================
   MODALS
   ============================================================ */
/* ------------------------------------------------------------
   模态框显隐
   ------------------------------------------------------------
   关键：不能用 display 控制显隐。
   display:none → display:flex 是在同一帧内完成的二值跳变，
   浏览器不会为它播放 transition，导致「关闭有动画、打开没有」。

   改用 visibility + opacity：
   元素始终留在渲染树里，transition 才能正常插值。
   visibility 用延迟切换（关闭时等动画结束再变 hidden），
   避免不可见的模态框拦截鼠标事件。
   ------------------------------------------------------------ */
.modal-overlay {
  display: flex;                 /* 始终 flex，不再用 none */
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: transparent;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease,
              visibility 0s linear 0.28s,
              background 0.28s ease,
              backdrop-filter 0.28s ease;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: var(--overlay-scrim);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.28s ease,
              visibility 0s linear 0s,
              background 0.28s ease,
              backdrop-filter 0.28s ease;
}
.modal-overlay .modal {
  max-width: 560px;
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--glass-shadow);
  opacity: 0;
  transform: scale(0.92) translateY(20px);
  transition: opacity 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.active .modal { opacity: 1; transform: scale(1) translateY(0); }
.modal-overlay.closing { pointer-events: none; }
.modal-overlay.closing .modal {
  opacity: 0;
  transform: scale(0.92) translateY(20px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.modal-overlay.closing {
  opacity: 0;
  visibility: visible;
  background: transparent;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: opacity 0.22s ease,
              visibility 0s linear 0.22s,
              background 0.22s ease,
              backdrop-filter 0.22s ease;
}
.modal-overlay .modal.modal-lg { max-width: 700px; }
.modal-overlay .modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}
.modal-overlay .modal .modal-header .modal-title { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.modal-overlay .modal .modal-header .modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay .modal .modal-header .modal-close:hover { color: var(--text-primary); background: var(--overlay-hover); }
.modal-overlay .modal .modal-header .modal-close .icon { width: 22px; height: 22px; }
.modal-overlay .modal .modal-body { color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.modal-overlay .modal .modal-body .form-group:last-child { margin-bottom: 0; }

/* ============================================================
   PIN MODAL (锁定域名专用)
   ============================================================ */
.pin-modal .modal { max-width: 420px; }
.pin-modal .pin-display {
  text-align: center;
  padding: 8px 0 16px 0;
}
.pin-modal .pin-display .pin-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.pin-modal .pin-display .pin-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}
.pin-modal .pin-input-group {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 16px 0;
}
.pin-modal .pin-input-group .pin-box {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 28px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
  caret-color: var(--ion-blue);
}
.pin-modal .pin-input-group .pin-box:focus {
  border-color: var(--ion-blue);
  box-shadow: 0 0 20px var(--ion-blue-dim);
}
.pin-modal .pin-input-group .pin-box::placeholder {
  color: var(--text-muted);
  font-size: 14px;
}
.pin-modal .pin-warning {
  font-size: 12px;
  color: var(--energy-orange);
  padding: 10px 14px;
  background: var(--overlay-subtle);
  border-left: 2px solid var(--energy-orange);
  border-radius: var(--radius-sm);
  margin: 8px 0;
}
.pin-modal .pin-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}
.pin-modal .pin-actions .btn {
  min-width: 100px;
}

/* ============================================================
   TRANSFER CODE
   ============================================================ */
.transfer-code-display {
  text-align: center;
  padding: 20px;
  margin: 12px 0;
  background: var(--bg-inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}
.transfer-code-display .code {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  color: var(--ion-blue);
  letter-spacing: 4px;
  word-break: break-all;
  user-select: all;
}
.transfer-code-display .copy-btn {
  margin-top: 8px;
  padding: 6px 16px;
  background: var(--ion-blue-dim);
  border: 1px solid var(--ion-blue-glow);
  border-radius: var(--radius-sm);
  color: var(--ion-blue);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-mono);
  transition: all var(--transition-fast);
}
.transfer-code-display .copy-btn:hover { background: var(--ion-blue-glow); }

.transfer-warning {
  font-size: 13px;
  color: var(--energy-orange);
  padding: 12px 16px;
  background: var(--overlay-subtle);
  border-left: 2px solid var(--energy-orange);
  border-radius: var(--radius-sm);
  margin: 12px 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  margin-top: 16px;
}
.modal-footer .btn {
  padding: 8px 20px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  min-height: 36px;
}
.modal-footer .btn-primary { background: var(--ion-blue); color: #fff; }
.modal-footer .btn-primary:hover:not(:disabled) { box-shadow: 0 0 30px var(--ion-blue-glow); }
.modal-footer .btn-outline { background: transparent; border: 1px solid var(--glass-border); color: var(--text-secondary); }
.modal-footer .btn-outline:hover:not(:disabled) { border-color: var(--divider-strong); color: var(--text-primary); }
.modal-footer .btn-danger { background: #ef4444; color: white; }
.modal-footer .btn-danger:hover:not(:disabled) { box-shadow: 0 0 30px rgba(239, 68, 68, 0.3); }

/* ============================================================
   CONFIRM MODAL
   ============================================================ */
.confirm-modal .modal { max-width: 420px; }
.confirm-modal .confirm-icon { text-align: center; font-size: 48px; margin-bottom: 12px; }
.confirm-modal .confirm-title { text-align: center; font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.confirm-modal .confirm-message { text-align: center; font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.6; }
.confirm-modal .confirm-message .highlight { color: var(--ion-blue); font-family: var(--font-mono); }
.confirm-modal .confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* ============================================================
   AUTH SWITCH
   ============================================================ */
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.auth-switch a { color: var(--ion-blue); cursor: pointer; text-decoration: none; transition: color var(--transition-fast); }
.auth-switch a:hover { color: #00c4f0; text-decoration: underline; }

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}
.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 14px;
  box-shadow: var(--glass-shadow);
  animation: toastSlide 0.3s ease-out;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.toast.success { border-color: rgba(16, 185, 129, 0.3); color: #10b981; }
.toast.error { border-color: rgba(239, 68, 68, 0.3); color: #ef4444; }
.toast.warning { border-color: rgba(245, 166, 35, 0.4); color: var(--energy-orange); }
@keyframes toastSlide {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   MODE TOGGLE
   ============================================================ */
.mode-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  -webkit-user-select: none;
}
.mode-toggle:hover { border-color: var(--glass-border-hover); }
.mode-toggle .mode-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.mode-toggle .mode-track {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bg-card);
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
  transition: all var(--transition-med);
  flex-shrink: 0;
}
.mode-toggle .mode-track .mode-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
  transition: all var(--transition-med);
}
.mode-toggle .mode-track .mode-thumb .thumb-icon { width: 100%; height: 100%; padding: 3px; color: #fff; }
.mode-toggle .mode-track .mode-thumb .thumb-icon svg { width: 100%; height: 100%; }
.mode-toggle.active .mode-track { border-color: var(--ion-blue); background: var(--ion-blue-dim); }
.mode-toggle.active .mode-track .mode-thumb { left: 22px; background: var(--ion-blue); box-shadow: 0 0 16px var(--ion-blue-glow); }
.mode-toggle .mode-status { font-size: 11px; font-weight: 500; font-family: var(--font-mono); min-width: 48px; }
.mode-toggle .mode-status.ion { color: var(--ion-blue); }
.mode-toggle .mode-status.self { color: var(--energy-orange); }

/* ============================================================
   COMPLETION FLASH
   ============================================================ */
.flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease;
}
.flash-overlay.active { opacity: 1; }
.flash-overlay .flash-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--ion-blue-glow);
  animation: flashRing 0.8s ease-out forwards;
}
.flash-overlay.success .flash-ring { border-color: rgba(16, 185, 129, 0.6); }
.flash-overlay.danger .flash-ring { border-color: rgba(239, 68, 68, 0.6); }
@keyframes flashRing {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(20); opacity: 0; }
}
.flash-overlay .flash-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ion-blue-glow), transparent 70%);
  animation: flashGlow 0.8s ease-out forwards;
}
.flash-overlay.success .flash-glow { background: radial-gradient(circle, rgba(16, 185, 129, 0.15), transparent 70%); }
.flash-overlay.danger .flash-glow { background: radial-gradient(circle, rgba(239, 68, 68, 0.15), transparent 70%); }
@keyframes flashGlow {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(15); opacity: 0; }
}

/* ============================================================
   NODE STATUS INDICATOR
   ============================================================ */
.node-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}
/* 状态点：同时支持 .node-status 内嵌与域名列表行的直接子元素 */
.node-status .status-dot,
.domain-row > .status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.node-status .status-dot.online,
.domain-row > .status-dot.online { background: #10b981; box-shadow: 0 0 12px rgba(16, 185, 129, 0.4); }
.node-status .status-dot.standby,
.domain-row > .status-dot.standby { background: var(--energy-orange); box-shadow: 0 0 12px rgba(245, 166, 35, 0.4); }
.node-status .status-dot.offline,
.domain-row > .status-dot.offline { background: #6b7280; box-shadow: none; }
.node-status .status-dot.deploying,
.domain-row > .status-dot.deploying { background: var(--ion-blue); animation: dotPulse 0.8s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }

/* ============================================================
   FORUM - 讨论区
   ============================================================ */

/* 论坛头部 */
.forum-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.forum-header .forum-title-area h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
}
.forum-header .forum-title-area p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* 分类标签栏 */
.forum-categories {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
}
.forum-categories .cat-btn {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.forum-categories .cat-btn:hover {
  border-color: var(--glass-border-hover);
  color: var(--text-primary);
  background: var(--overlay-subtle);
}
.forum-categories .cat-btn.active {
  background: var(--ion-blue-dim);
  border-color: var(--ion-blue);
  color: var(--ion-blue);
}
.forum-categories .cat-btn .cat-icon { margin-right: 4px; }

/* 话题列表 */
.topic-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.topic-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.topic-item:hover {
  border-color: var(--glass-border-hover);
  background: var(--bg-card-hover);
}
.topic-item .topic-pin { color: var(--energy-orange); font-size: 14px; flex-shrink: 0; }
.topic-item .topic-status { font-size: 14px; flex-shrink: 0; color: var(--text-muted); }
.topic-item .topic-status.locked { color: #ef4444; }
.topic-item .topic-status.solved { color: #10b981; }

.topic-item .topic-content { flex: 1; min-width: 0; }
.topic-item .topic-content .topic-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.topic-item .topic-content .topic-title .topic-badge {
  font-size: 9px;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.topic-item .topic-content .topic-title .topic-badge.pinned {
  background: rgba(245, 166, 35, 0.12);
  color: var(--energy-orange);
}
.topic-item .topic-content .topic-title .topic-badge.locked {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}
.topic-item .topic-content .topic-title .topic-badge.solved {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.topic-item .topic-content .topic-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.topic-item .topic-content .topic-meta .topic-category {
  font-size: 10px;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: var(--overlay-hover);
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
}
.topic-item .topic-content .topic-meta .topic-author { color: var(--text-secondary); }
.topic-item .topic-content .topic-meta .topic-author strong { color: var(--text-primary); font-weight: 500; }
.topic-item .topic-content .topic-meta .topic-time { color: var(--text-muted); }
.topic-item .topic-content .topic-meta .topic-replies { color: var(--text-secondary); font-family: var(--font-mono); font-size: 11px; }
.topic-item .topic-content .topic-meta .topic-views { color: var(--text-muted); font-size: 11px; }
.topic-item .topic-content .topic-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.topic-item .topic-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--ion-blue-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ion-blue);
}

/* 分页 */
.forum-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}
.forum-pagination .page-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 36px;
  text-align: center;
}
.forum-pagination .page-btn:hover {
  border-color: var(--glass-border-hover);
  color: var(--text-primary);
}
.forum-pagination .page-btn.active {
  background: var(--ion-blue-dim);
  border-color: var(--ion-blue);
  color: var(--ion-blue);
}
.forum-pagination .page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ============================================================
   TOPIC DETAIL
   ============================================================ */

.topic-detail-header { margin-bottom: 20px; }
.topic-detail-header .back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: color var(--transition-fast);
  padding: 0;
  margin-bottom: 12px;
}
.topic-detail-header .back-btn:hover { color: var(--text-primary); }
.topic-detail-header .back-btn .icon { width: 16px; height: 16px; }

.topic-detail-header .topic-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.topic-detail-header .topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.topic-detail-header .topic-meta .meta-item { display: flex; align-items: center; gap: 4px; }
.topic-detail-header .topic-meta .meta-item strong { color: var(--text-secondary); font-weight: 500; }

/* 话题内容 */
.topic-content-body {
  padding: 20px 0;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 20px;
}
.topic-content-body .topic-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
}
.topic-content-body .topic-text p { margin-bottom: 12px; }
.topic-content-body .topic-text code {
  background: var(--bg-inset);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ion-blue);
}
.topic-content-body .topic-text pre {
  background: var(--bg-inset);
  padding: 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}
.topic-content-body .topic-text blockquote {
  border-left: 3px solid var(--ion-blue);
  padding-left: 16px;
  margin: 12px 0;
  color: var(--text-muted);
}
.topic-content-body .topic-text ul, .topic-content-body .topic-text ol { padding-left: 24px; margin: 8px 0; }
.topic-content-body .topic-text a { color: var(--ion-blue); text-decoration: none; }
.topic-content-body .topic-text a:hover { text-decoration: underline; }
.topic-content-body .topic-text img { max-width: 100%; border-radius: var(--radius-md); margin: 8px 0; }

.topic-content-body .topic-author-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}
.topic-content-body .topic-author-info .author-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--ion-blue-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--ion-blue);
}
.topic-content-body .topic-author-info .author-name { font-weight: 500; color: var(--text-primary); }
.topic-content-body .topic-author-info .author-time { font-size: 12px; color: var(--text-muted); }

/* 回复列表 */
.reply-list { margin: 16px 0 24px 0; }
.reply-list .reply-header { font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-bottom: 12px; }

.reply-item {
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: all var(--transition-fast);
}
.reply-item:hover { border-color: var(--glass-border-hover); }
.reply-item .reply-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.reply-item .reply-meta .reply-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--ion-blue-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ion-blue);
}
.reply-item .reply-meta .reply-author { font-weight: 500; font-size: 13px; color: var(--text-primary); }
.reply-item .reply-meta .reply-time { font-size: 12px; color: var(--text-muted); }
.reply-item .reply-meta .reply-solution {
  font-size: 10px;
  padding: 1px 10px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  font-weight: 500;
}
.reply-item .reply-content { font-size: 14px; line-height: 1.7; color: var(--text-secondary); }
.reply-item .reply-content p { margin-bottom: 8px; }
.reply-item .reply-content code {
  background: var(--bg-inset);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ion-blue);
}
.reply-item .reply-content pre {
  background: var(--bg-inset);
  padding: 12px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid var(--glass-border);
}
.reply-item .reply-actions { margin-top: 8px; display: flex; gap: 8px; }
.reply-item .reply-actions .btn-sm { font-size: 11px; padding: 2px 10px; }

/* 回复表单 */
.reply-form {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}
.reply-form .reply-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 10px; display: block; }
.reply-form .reply-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  resize: vertical;
  outline: none;
  transition: all var(--transition-fast);
  line-height: 1.6;
}
.reply-form .reply-textarea::placeholder { color: var(--text-muted); }
.reply-form .reply-textarea:focus { border-color: var(--ion-blue); box-shadow: 0 0 24px var(--ion-blue-dim); }
.reply-form .reply-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  align-items: center;
}
.reply-form .reply-actions .btn { min-width: auto; }
.reply-form .reply-actions .reply-hint { font-size: 11px; color: var(--text-muted); }
.reply-form .reply-actions .reply-hint code {
  background: var(--bg-inset);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

/* ============================================================
   NEW TOPIC
   ============================================================ */

.new-topic-form {
  max-width: 700px;
  margin: 0 auto;
}
.new-topic-form .form-group { margin-bottom: 20px; }
.new-topic-form .form-group label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  display: block;
  margin-bottom: 6px;
}
.new-topic-form .form-group .hint {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.new-topic-form .form-control { font-size: 14px; padding: 10px 14px; }
.new-topic-form .form-control.title-input { font-size: 18px; font-weight: 500; }
.new-topic-form .form-control.content-textarea {
  min-height: 200px;
  font-family: var(--font-sans);
  line-height: 1.7;
  resize: vertical;
}
.new-topic-form .form-actions { display: flex; gap: 12px; margin-top: 8px; }
.new-topic-form .form-actions .btn { min-width: 100px; }

/* ============================================================
   BUTTON ANIMATIONS
   ============================================================ */

.btn, .btn-action, .btn-sm, .btn-icon, .dropdown-item {
  position: relative;
  overflow: hidden;
}
.btn::after, .btn-action::after, .btn-sm::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), var(--glass-highlight-strong), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: inherit;
}
.btn:active::after, .btn-action:active::after, .btn-sm:active::after {
  opacity: 1;
  animation: rippleOut 0.6s ease-out forwards;
}
@keyframes rippleOut {
  0% { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ------------------------------------------------------------
   发送类按钮（发帖 / 回帖）
   ------------------------------------------------------------
   这类按钮的结构是 [纸飞机图标] + [文字]，没有 .btn-spinner。
   因此必须覆盖通用的 .btn.loading 规则：那条规则会把文字与图标
   全部 display:none，只等一个不存在的 spinner 出现，
   结果按钮在加载时变成一片空白。

   这里改为：加载时保留文字，仅让纸飞机脉动前进；
   完成后按钮转绿、图标放大，给出明确的结束反馈。
   ------------------------------------------------------------ */
.btn-send {
  position: relative;
  transition: all 0.3s ease;
}
.btn-send .send-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.btn-send .send-icon svg { width: 100%; height: 100%; }

.btn-send:hover:not(:disabled) .send-icon {
  transform: translateX(4px) rotate(-10deg);
}

/* 加载中：文字保持可见，图标脉动 */
.btn-send.loading .send-icon {
  animation: sendPulse 0.8s ease-in-out infinite;
}
/* 关键：撤销通用规则对文字/图标的隐藏 */
.btn-send.loading .btn-label,
.btn-send.loading .send-icon {
  display: inline-flex;
}
.btn-send.loading .btn-label { display: inline; }
/* 加载态不做半透明（实心主按钮降透明度会显得像被禁用） */
.btn-send.loading { opacity: 1; }

@keyframes sendPulse {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

/* 完成：短暂转绿，作为"已发送"的确认反馈 */
.btn-send.completed {
  background: #10b981 !important;
  border-color: #10b981 !important;
}
.btn-send.completed .send-icon {
  transform: translateX(0) scale(1.2);
}
.btn-send.completed .btn-label {
  color: white;
}

.btn-delete-anim {
  position: relative;
  transition: all 0.3s ease;
}
.btn-delete-anim .delete-icon {
  transition: transform 0.3s ease;
}
.btn-delete-anim:hover:not(:disabled) .delete-icon {
  transform: scale(1.2) rotate(-10deg);
}
.btn-delete-anim.loading .delete-icon {
  animation: deleteShake 0.4s ease-in-out infinite;
}
@keyframes deleteShake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}
.btn-delete-anim.confirming {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.15) !important;
  animation: confirmPulse 0.8s ease-in-out infinite;
}
@keyframes confirmPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2); }
  50% { box-shadow: 0 0 20px 8px rgba(239, 68, 68, 0.05); }
}

.btn-complete-flash {
  animation: completeFlash 0.6s ease;
}
@keyframes completeFlash {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.3); }
  50% { box-shadow: 0 0 40px 10px rgba(16, 185, 129, 0.15); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn-error-shake {
  animation: errorShake 0.5s ease;
}
@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.topic-item {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.topic-item:hover {
  transform: translateX(4px);
}

.forum-categories .cat-btn {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.forum-categories .cat-btn.active {
  transform: scale(1.02);
}

.modal-body .loading-skeleton {
  animation: skeletonPulse 1.2s ease-in-out infinite;
}
@keyframes skeletonPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.reply-item {
  animation: replyAppear 0.4s ease-out;
}
@keyframes replyAppear {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.topic-item {
  animation: topicAppear 0.35s ease-out forwards;
  opacity: 0;
}
.topic-item:nth-child(1) { animation-delay: 0.02s; }
.topic-item:nth-child(2) { animation-delay: 0.04s; }
.topic-item:nth-child(3) { animation-delay: 0.06s; }
.topic-item:nth-child(4) { animation-delay: 0.08s; }
.topic-item:nth-child(5) { animation-delay: 0.10s; }
.topic-item:nth-child(6) { animation-delay: 0.12s; }
.topic-item:nth-child(7) { animation-delay: 0.14s; }
.topic-item:nth-child(8) { animation-delay: 0.16s; }
.topic-item:nth-child(9) { animation-delay: 0.18s; }
.topic-item:nth-child(10) { animation-delay: 0.20s; }

@keyframes topicAppear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { width: 60px; min-width: 60px; padding: 16px 10px; }
  .sidebar .brand .logo-text, .sidebar .brand .logo-sub,
  .sidebar .nav .nav-item .nav-label, .sidebar .nav .nav-item .nav-badge,
  .sidebar .sidebar-footer .user-info .user-name,
  .sidebar .sidebar-footer .user-info .user-email,
  .sidebar .sidebar-footer .logout-btn .nav-label { display: none; }
  .sidebar .sidebar-footer .user-info .avatar { width: 32px; height: 32px; font-size: 14px; }
  .sidebar .nav .nav-item { justify-content: center; padding: 10px; }
  .sidebar .nav .nav-item .nav-icon { width: 20px; height: 20px; }
  .sidebar .sidebar-footer .logout-btn { justify-content: center; }

  .main-content { padding: 16px 16px 24px 16px; }
  .domain-grid { grid-template-columns: 1fr; }
  .add-record-form .form-row { grid-template-columns: 1fr; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; }
  .domain-list-search .search-input { width: 140px; }
  .modal-overlay .modal { padding: 20px; margin: 12px; }
  .transfer-code-display .code { font-size: 20px; letter-spacing: 2px; }
  .modal-overlay .modal.modal-lg { max-width: 100%; margin: 12px; }
  .custom-select .select-dropdown { max-height: 160px; }
  .btn-action { min-height: 40px; min-width: 80px; padding: 8px 16px; font-size: 12px; }
  .mode-toggle .mode-track { width: 38px; height: 20px; }
  .mode-toggle .mode-track .mode-thumb { width: 14px; height: 14px; }
  .mode-toggle.active .mode-track .mode-thumb { left: 20px; }
  .dropdown .dropdown-menu { min-width: 160px; }
  .register-container, .claim-container, .settings-container { max-width: 100%; }

  .forum-header { flex-direction: column; align-items: stretch; }
  .forum-header .forum-title-area h1 { font-size: 18px; }
  .topic-item { flex-wrap: wrap; padding: 10px 12px; }
  .topic-item .topic-avatar { display: none; }
  .topic-item .topic-content .topic-title { font-size: 13px; }
  .topic-item .topic-content .topic-meta { font-size: 11px; gap: 8px; }
  .forum-categories .cat-btn { font-size: 11px; padding: 4px 12px; }
  .topic-detail-header .topic-title { font-size: 18px; }
  .topic-content-body .topic-text { font-size: 14px; }
  .reply-item { padding: 12px; }
  .new-topic-form { max-width: 100%; }
  .pin-modal .pin-input-group .pin-box { width: 40px; height: 48px; font-size: 22px; }
}

@media (max-width: 480px) {
  .dashboard-stats { grid-template-columns: 1fr; }
  .domain-list-search { width: 100%; }
  .domain-list-search .search-input { flex: 1; width: 100%; }
  .domain-list-header { flex-direction: column; align-items: stretch; }
  .dropdown .dropdown-menu { right: -8px; min-width: 150px; }
  .register-container, .claim-container, .settings-container { max-width: 100%; padding: 0 4px; }

  .topic-item .topic-content .topic-meta .topic-views { display: none; }
  .topic-item .topic-content .topic-title .topic-badge { font-size: 8px; padding: 0px 6px; }
  .forum-categories { gap: 4px; }
  .forum-categories .cat-btn { font-size: 10px; padding: 3px 10px; }
  .reply-form .reply-actions { flex-wrap: wrap; }
  .pin-modal .pin-input-group { gap: 8px; }
  .pin-modal .pin-input-group .pin-box { width: 36px; height: 44px; font-size: 18px; }
}
/* ============================================================
   ADMIN（域名状态管理页）
   ------------------------------------------------------------
   仅管理员可见。视觉与控制台其它页面保持一致。
   ============================================================ */
.admin-panel {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  margin-bottom: 20px;
  overflow: hidden;
}
.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.admin-panel-body { padding: 18px; }

.admin-form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.admin-form-row .form-group { flex: 1 1 180px; margin-bottom: 0; }
.admin-form-row .btn { flex: 0 0 auto; }

.admin-hint { font-size: 12px; color: var(--text-muted); margin-top: 12px; }

.admin-result-domain {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 18px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--glass-border);
  word-break: break-all;
}
.admin-result-rows { display: flex; flex-direction: column; }
.admin-result-row {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--divider);
  font-size: 13px;
}
.admin-result-row:last-child { border-bottom: none; }
.admin-result-row .rk { width: 120px; flex-shrink: 0; color: var(--text-muted); }
.admin-result-row .rv { color: var(--text-secondary); word-break: break-all; }
.admin-result-row .rv.on { color: #ef4444; font-weight: 500; }
.admin-result-row .rv.off { color: var(--text-muted); }

.admin-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.admin-action-card {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.admin-action-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.admin-action-desc { font-size: 12px; color: var(--text-muted); line-height: 1.55; margin-bottom: 12px; }
.admin-action-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-action-controls .admin-note { flex: 1 1 140px; min-width: 0; margin-bottom: 0; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}
.admin-table td {
  padding: 11px 12px 11px 0;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .mono { font-family: var(--font-mono); }
.admin-table .muted { color: var(--text-muted); font-size: 12px; }

.admin-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
  margin-right: 4px;
}
.admin-tag.danger { background: rgba(239, 68, 68, 0.12); color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }
.admin-tag.warn { background: rgba(245, 166, 35, 0.12); color: var(--energy-orange); border-color: rgba(245, 166, 35, 0.3); }
.admin-tag.info { background: var(--ion-blue-dim); color: var(--ion-blue); border-color: var(--ion-blue-glow); }

.admin-empty { padding: 32px 12px; text-align: center; color: var(--text-muted); font-size: 13px; }
.admin-empty.error { color: #ef4444; }

@media (max-width: 640px) {
  .admin-form-row { flex-direction: column; align-items: stretch; }
  .admin-result-row .rk { width: 92px; }
  .admin-table th:nth-child(3), .admin-table td:nth-child(3),
  .admin-table th:nth-child(4), .admin-table td:nth-child(4) { display: none; }
}

/* 邮箱锁定提示（NodeLoc 等 OAuth 用户的合成邮箱不可改） */
.email-locked-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}
.form-control:disabled:read-only,
.form-control:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================
   公开分享开关（域名详情页）
   ============================================================ */
.share-toggle-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin: 14px 0;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--bg-inset);
}
.share-toggle-main { min-width: 0; flex: 1 1 240px; }
.share-toggle-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.share-toggle-desc { font-size: 12px; color: var(--text-muted); line-height: 1.55; }
.share-toggle-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.share-toggle-actions .btn-sm { white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }

/* ============================================================
   WORKSPACE — 顶栏 + 内容区
   ============================================================
   侧边栏只负责一级导航；顶栏承载当前语境（位置 / 搜索 / 刷新 / 账户），
   内容区只放当前页面的内容。切换页面时顶栏恒定，
   页面因此不再像八个互不相干的独立视图。
   ============================================================ */

.workspace {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace > .main-content {
  flex: 1;
  height: auto;
  min-height: 0;
  overflow-y: auto;
}

/* ===== Topbar ===== */
.topbar {
  height: 52px;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--glass-border);
  position: relative;
  z-index: 40;
}

.topbar-left { display: flex; align-items: center; min-width: 0; }
.topbar-center { flex: 1; display: flex; justify-content: center; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
}
.crumb-product { color: var(--text-muted); font-family: var(--font-mono); letter-spacing: -0.01em; }
.crumb-sep { color: var(--text-muted); opacity: 0.5; }
.crumb-current {
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Global search ===== */
.global-search {
  position: relative;
  width: 100%;
  max-width: 420px;
  display: flex;
  align-items: center;
}
.global-search-input {
  width: 100%;
  height: 30px;
  padding: 0 44px 0 30px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  outline: none;
  transition: border-color var(--transition-med), background var(--transition-med);
}
.global-search-input::placeholder { color: var(--text-muted); }
.global-search-input:focus {
  border-color: var(--ion-blue);
  background: var(--bg-elevated);
}
.search-glyph {
  position: absolute;
  left: 9px;
  display: flex;
  color: var(--text-muted);
  pointer-events: none;
}
.search-glyph svg { width: 13px; height: 13px; }
.search-kbd {
  position: absolute;
  right: 8px;
  min-width: 16px;
  padding: 1px 5px;
  background: var(--bg-inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 340px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
  z-index: 60;
  padding: 4px;
}
.search-results[hidden] { display: none; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 9px;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-med);
}
.search-result-item:hover,
.search-result-item.active { background: var(--bg-card-hover); }
.search-result-item .sr-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted); flex-shrink: 0;
}
.search-result-item .sr-dot.ok { background: #2ea043; }
.search-result-item .sr-dot.warn { background: #d29922; }
.search-result-item .sr-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.search-result-item .sr-mode {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--text-muted);
  padding: 1px 5px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.search-empty {
  padding: 14px 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* ===== Icon button ===== */
.icon-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-med);
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--glass-border);
  color: var(--text-primary);
}

/* ===== Account menu ===== */
.account-menu { position: relative; }
.account-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px 2px 2px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-med);
}
.account-trigger:hover { background: var(--bg-card-hover); border-color: var(--glass-border); }
.account-avatar {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ion-blue);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}
.account-chevron { display: flex; color: var(--text-muted); }
.account-chevron svg { width: 12px; height: 12px; }

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 232px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
  padding: 4px;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0s linear 0.14s;
}
.account-menu.open .account-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0s linear 0s;
}
.account-head { padding: 9px 10px 7px; }
.account-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-email {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-divider { height: 1px; background: var(--glass-border); margin: 4px 0; }
.account-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-med);
}
.account-item .item-icon { display: flex; color: var(--text-muted); }
.account-item .item-icon svg { width: 14px; height: 14px; }
.account-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.account-item:hover .item-icon { color: var(--text-primary); }
.account-item.danger:hover { color: #f85149; }
.account-item.danger:hover .item-icon { color: #f85149; }

/* ============================================================
   DRAWER — 域名详情右侧滑出面板
   ============================================================
   复用 .modal-overlay 的可见性状态机（.active / .closing），
   只改方向与尺寸：从右侧滑入，高度占满视口。

   特异性提示：基础弹窗用
     .modal-overlay .modal          (0,2,0)
     .modal-overlay.active .modal   (0,3,0)
     .modal-overlay.closing .modal  (0,3,0)
   所以这里逐条给出同等或更高的选择器，否则会被基础规则覆盖。
   ============================================================ */

.modal-overlay.drawer-overlay {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}

.modal-overlay.drawer-overlay .modal.drawer {
  width: min(560px, 100vw);
  max-width: 560px;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border-radius: 0;
  border: none;
  border-left: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1),
              opacity 0.2s ease;
}

.modal-overlay.drawer-overlay.active .modal.drawer {
  transform: translateX(0);
  opacity: 1;
}

.modal-overlay.drawer-overlay.closing .modal.drawer {
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.18s ease;
}

.modal-overlay.drawer-overlay .modal.drawer .modal-header {
  padding: 14px 18px;
  flex-shrink: 0;
}
.modal-overlay.drawer-overlay .modal.drawer .modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
}

/* 不模糊背景：抽屉要能看见背后的列表，模糊会打断上下文 */
.modal-overlay.drawer-overlay.active {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (max-width: 620px) {
  .modal-overlay.drawer-overlay .modal.drawer {
    width: 100vw;
    max-width: 100vw;
    border-left: none;
  }
}

@media (max-width: 720px) {
  .topbar { padding: 0 12px; gap: 10px; }
  .breadcrumb .crumb-product,
  .breadcrumb .crumb-sep { display: none; }
  .global-search { max-width: none; }
  .search-kbd { display: none; }
  .global-search-input { padding-right: 12px; }
}

@media (max-width: 480px) {
  .topbar-center { display: none; }
}
/* ============================================================
   THEME TRANSITION — 亮色 / 暗色平滑过渡
   ============================================================
   不在 * 上常驻 transition：那会让页面上每个元素都参与动画，
   主题切换瞬间同时进行数千次插值，明显掉帧，而且会干扰
   按钮、弹窗等已经自带过渡的组件。

   改为「只在切换的那一刻」临时挂上过渡类：
     html.theme-transition * { transition: ... }
   切换完成后立刻移除，稳定状态下零开销。
   过渡计时由 config.js 的 setTheme() 控制。
   ============================================================ */

html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition:
    background-color 0.34s ease,
    border-color 0.34s ease,
    color 0.34s ease,
    fill 0.34s ease,
    stroke 0.34s ease,
    box-shadow 0.34s ease !important;
  /* 切换期间禁用过渡的延迟差，避免颜色「追赶」感 */
  transition-delay: 0s !important;
}

/* 主题切换时不做任何布局动画，避免文字跳动 */
html.theme-transition * {
  animation-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
  html.theme-transition,
  html.theme-transition *,
  html.theme-transition *::before,
  html.theme-transition *::after {
    transition: none !important;
  }
}