/* ==========================================================================
   设计系统 —— 浅色主题
   所有颜色、圆角、阴影都以 CSS 变量定义，改主题只需改这一处。
   ========================================================================== */

:root {
  /* 主色：TikTok 品牌色系的克制版本，避免大面积高饱和造成视觉疲劳 */
  --brand:          #16181c;
  --brand-soft:     #f1f2f4;
  --accent:         #2f6feb;
  --accent-hover:   #2559c4;
  --accent-soft:    #eef4ff;
  --accent-ring:    rgba(47, 111, 235, .18);

  --pink:           #fe2c55;
  --cyan:           #25f4ee;

  /* 中性色阶 */
  --bg:             #f7f8fa;
  --surface:        #ffffff;
  --surface-2:      #fbfbfc;
  --border:         #e6e8eb;
  --border-strong:  #d4d7dc;

  --text:           #16181c;
  --text-soft:      #5b6270;
  --text-muted:     #8a909c;
  --text-invert:    #ffffff;

  /* 语义色 */
  --success:        #12a150;
  --success-soft:   #e8f7ee;
  --warning:        #b7791f;
  --warning-soft:   #fdf6e3;
  --danger:         #d93025;
  --danger-soft:    #fdecea;
  --info:           #2f6feb;
  --info-soft:      #eef4ff;

  /* 圆角 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  /* 阴影：浅色主题下要克制，靠边框而不是重阴影分隔 */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .07);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .10);
  --shadow-xl: 0 24px 56px rgba(16, 24, 40, .14);

  /* 布局尺寸 */
  --nav-h: 64px;
  --sidebar-w: 236px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ==========================================================================
   基础重置
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.3; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
}

/* 键盘可达性：只在键盘导航时显示焦点环 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ==========================================================================
   布局
   ========================================================================== */

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding-inline: 24px;
}

.container-narrow { max-width: 900px; }

/* 顶部导航 */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

/*
 * 三栏 grid：左品牌 / 中导航 / 右操作。
 * 用 grid 的 1fr auto 1fr 而不是 flex + margin:auto ——
 * 后者会让中间导航在「剩余空间」里居中，两侧宽度不等时就会偏。
 */
.navbar-inner {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

/* 左：Logo */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.01em;
}
.brand:hover { color: var(--text); }

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  flex-shrink: 0;
}
.brand-mark svg { width: 18px; height: 18px; }

/* 中：导航链接（grid 中间列，天然居中） */
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--r-md);
  color: var(--text-soft);
  font-weight: 500;
  transition: all .15s var(--ease);
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: var(--brand-soft); }
.nav-links a.is-active { color: var(--text); background: var(--brand-soft); }

/* 右：操作区（grid 第三列，靠右对齐） */
.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--brand-soft);
  border-radius: var(--r-full);
}
.lang-switch a {
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* 移动端汉堡按钮 */
.nav-toggle {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-md);
  cursor: pointer;
  padding: 0;
  place-items: center;
}
.nav-toggle svg { width: 18px; height: 18px; }

/* ==========================================================================
   按钮
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s var(--ease);
  text-decoration: none;
  background: none;
}

.btn:disabled, .btn.is-loading { opacity: .55; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-dark { background: var(--brand); color: #fff; }
.btn-dark:hover { background: #2b2f36; color: #fff; }

.btn-default {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-default:hover { background: var(--surface-2); border-color: var(--text-muted); color: var(--text); }

.btn-ghost { color: var(--text-soft); }
.btn-ghost:hover { background: var(--brand-soft); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b7261c; color: #fff; }

.btn-danger-ghost { color: var(--danger); border-color: transparent; }
.btn-danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }

.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: var(--r-sm); }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; }

/* ==========================================================================
   卡片
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-title { font-size: 15px; font-weight: 600; }
.card-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: 20px; }
.card-body-flush { padding: 0; }
.card-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/*
 * 可折叠卡片：把 <details> 的 summary 当标题栏用。
 * 收起时不画分割线，展开时才画，否则卡片下沿会多出一条悬空的线。
 */
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }

details.card > summary.card-head {
  border-bottom: 0;
  border-radius: var(--r-lg);
  cursor: pointer;
  user-select: none;
}
details.card[open] > summary.card-head {
  border-bottom: 1px solid var(--border);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
/* 右侧的展开箭头 */
details.card > summary.card-head::after {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform .2s;
}
details.card[open] > summary.card-head::after {
  transform: rotate(-135deg);
}

/* ==========================================================================
   表单
   ========================================================================== */

.field { margin-bottom: 16px; }

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.label .req { color: var(--danger); margin-left: 2px; }
.label .opt { color: var(--text-muted); font-weight: 400; margin-left: 4px; }

.input, .select, .textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
  appearance: none;
}

.input::placeholder, .textarea::placeholder { color: var(--text-muted); }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.input.is-error, .select.is-error, .textarea.is-error { border-color: var(--danger); }
.input.is-error:focus { box-shadow: 0 0 0 3px rgba(217, 48, 37, .15); }

.textarea { resize: vertical; min-height: 96px; line-height: 1.65; }
.textarea-mono { font-family: var(--font-mono); font-size: 13px; }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a909c' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.input-hint { margin-top: 5px; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.input-error { margin-top: 5px; font-size: 12px; color: var(--danger); }

/*
 * 分段选择：把「单选」从下拉框改成按钮组。
 * 选项全部摊开，少一次点击，也不用点开才知道有哪些选项。
 * 用原生 radio 实现，无 JS，禁用时的降级也正常。
 */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.segmented label {
  padding: 7px 14px;
  border-radius: calc(var(--r-md) - 3px);
  font-size: 13px;
  font-weight: 550;
  color: var(--text-soft);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background .15s, color .15s, box-shadow .15s;
}
.segmented label:hover { color: var(--text); }
.segmented input:checked + label {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
}
.segmented input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.segmented input:disabled + label {
  cursor: not-allowed;
  color: var(--text-muted);
  opacity: .6;
}
/* 未确定可用范围前整组隐藏；JS 通过 hidden 属性逐个控制 */
.segmented[hidden],
.segmented [hidden] { display: none !important; }

/* 标签行右侧的小计数器（如标题字数） */
.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.field-head .label { margin-bottom: 0; }
.char-count { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.char-count.is-over { color: var(--danger); font-weight: 600; }

/* 输入框内嵌前缀/后缀 */
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 40px; }
.input-group .input-icon {
  position: absolute;
  left: 13px;
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

/* 复选框 */
.checkbox {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
}
.checkbox input {
  width: 16px; height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.checkbox a { font-weight: 500; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 42px; height: 24px;
  background: var(--border-strong);
  border-radius: var(--r-full);
  position: relative;
  transition: background .2s var(--ease);
  flex-shrink: 0;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--accent-ring); }
.switch-label { font-size: 13px; font-weight: 500; }

/* 表单网格 */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .field-full { grid-column: 1 / -1; }

/* ==========================================================================
   徽标 / 状态
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-info    { background: var(--info-soft);    color: var(--info); }
.badge-neutral { background: var(--brand-soft);   color: var(--text-soft); }

/* ==========================================================================
   提示条
   ========================================================================== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid transparent;
}
.alert svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-soft); color: #0b6b35; border-color: #bfe6cd; }
.alert-danger  { background: var(--danger-soft);  color: #9c1f16; border-color: #f6c9c4; }
.alert-warning { background: var(--warning-soft); color: #8a5a0b; border-color: #f0dfae; }
.alert-info    { background: var(--info-soft);    color: #1a4fa8; border-color: #c7dbfb; }

/* 浮动提示（由 JS 注入） */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 380px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  pointer-events: auto;
  animation: toast-in .25s var(--ease);
}
.toast.is-out { animation: toast-out .2s var(--ease) forwards; }
.toast-success { border-left-color: var(--success); }
.toast-error   { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }

@keyframes toast-in  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

/* ==========================================================================
   表格
   ========================================================================== */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.table th {
  text-align: left;
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table .td-nowrap { white-space: nowrap; }
.table .td-right { text-align: right; }
.table .td-mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-soft); }

.table-empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-muted);
}
.table-empty svg { width: 40px; height: 40px; margin: 0 auto 12px; opacity: .4; }
.table-empty p { font-size: 14px; margin-bottom: 4px; color: var(--text-soft); font-weight: 500; }
.table-empty span { font-size: 13px; }

/* ==========================================================================
   分页
   ========================================================================== */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.pagination-info { font-size: 13px; color: var(--text-muted); }
.pagination-links { display: flex; gap: 6px; }

.pagination-links a, .pagination-links span {
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  background: var(--surface);
}
.pagination-links a:hover { border-color: var(--text-muted); color: var(--text); }
.pagination-links .is-current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination-links .is-disabled { opacity: .45; pointer-events: none; }

/* ==========================================================================
   统计卡片
   ========================================================================== */

.stat-grid {
  display: grid;
  /*
   * 必须是 auto-fit 而不是 auto-fill：
   * auto-fill 会保留空轨道 —— 5 个卡片放在能容纳 6 列的容器里时，
   * 会多出一条空轨道，卡片各占 1/6 宽，右侧就空出一截。
   * auto-fit 会把没有内容的轨道收起来，卡片自动撑满整行。
   */
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

/* 固定六列：一屏铺满一行，窄屏逐级回落 */
.stat-grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1200px) { .stat-grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .stat-grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stat {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.stat:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); }

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.stat-label { font-size: 13px; color: var(--text-soft); font-weight: 500; }
.stat-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--text-soft);
  flex-shrink: 0;
}
.stat-icon svg { width: 16px; height: 16px; }
.stat-icon.is-accent  { background: var(--accent-soft);  color: var(--accent); }
.stat-icon.is-success { background: var(--success-soft); color: var(--success); }
.stat-icon.is-warning { background: var(--warning-soft); color: var(--warning); }
.stat-icon.is-danger  { background: var(--danger-soft);  color: var(--danger); }

.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stat-foot { margin-top: 6px; font-size: 12px; color: var(--text-muted); }

/* ==========================================================================
   用户中心布局（侧边栏）
   ========================================================================== */

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

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-head {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
}

.sidebar-section {
  padding: 14px 12px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all .15s var(--ease);
}
.sidebar-link:hover { background: var(--brand-soft); color: var(--text); }
.sidebar-link.is-active { background: var(--brand); color: #fff; }
.sidebar-link.is-active:hover { background: var(--brand); color: #fff; }
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-link .count {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--text-soft);
}
.sidebar-link.is-active .count { background: rgba(255,255,255,.2); color: #fff; }

.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 13px;
}
.sidebar-user:hover { background: var(--brand-soft); color: var(--text); }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--brand-soft);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-soft);
  overflow: hidden;
}
.avatar-sm { width: 26px; height: 26px; font-size: 11px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }

.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role { font-size: 11px; color: var(--text-muted); }

/* 主内容区 */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.main-head {
  padding: 22px 28px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.main-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.main-title { font-size: 20px; font-weight: 700; letter-spacing: -.015em; }
.main-subtitle { margin-top: 3px; font-size: 13.5px; color: var(--text-muted); }
.main-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.main-body { padding: 22px 28px 40px; flex: 1; }

/* ==========================================================================
   首页英雄区
   ========================================================================== */

.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

/* 背景装饰：极淡的双色光斑，暗示品牌色但不喧宾夺主 */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}
.hero::before {
  width: 460px; height: 460px;
  background: rgba(37, 244, 238, .10);
  top: -180px; right: 8%;
}
.hero::after {
  width: 380px; height: 380px;
  background: rgba(254, 44, 85, .07);
  bottom: -200px; right: 26%;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 56px;
  align-items: center;
  padding: 64px 0 72px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero-badge svg { width: 14px; height: 14px; }

.hero-title {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.03em;
  margin-bottom: 18px;
}

.hero-subtitle {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-soft);
  margin-bottom: 28px;
  max-width: 540px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 34px; }

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.hero-points li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--text-soft);
  font-weight: 500;
}
.hero-points svg { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; }

/* 右侧登录卡片 */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  padding: 30px;
  position: relative;
  z-index: 2;
}
.auth-card-head { margin-bottom: 22px; text-align: center; }
.auth-card-title { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.auth-card-sub { margin-top: 6px; font-size: 13.5px; color: var(--text-muted); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-google {
  width: 100%;
  padding: 11px 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all .15s var(--ease);
  text-decoration: none;
}
.btn-google:hover {
  background: var(--surface-2);
  border-color: var(--text-muted);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ==========================================================================
   首页区块
   ========================================================================== */

.section { padding: 72px 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 46px; }
.section-title { font-size: 30px; font-weight: 700; letter-spacing: -.025em; margin-bottom: 12px; }
.section-desc { font-size: 15px; color: var(--text-soft); line-height: 1.7; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.feature {
  padding: 26px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: all .2s var(--ease);
}
.feature:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 16px;
}
.feature-icon svg { width: 21px; height: 21px; }
.feature-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.feature-desc { font-size: 13.5px; line-height: 1.7; color: var(--text-soft); }

/* 步骤 */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; }
.step { position: relative; padding-left: 0; }
.step-num {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 14px;
}
.step-title { font-size: 16px; font-weight: 600; margin-bottom: 7px; }
.step-desc { font-size: 13.5px; line-height: 1.7; color: var(--text-soft); }

/* 数据统计条 */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px;
  padding: 32px 0;
}
.stats-bar-item { text-align: center; }
.stats-bar-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.stats-bar-label { margin-top: 5px; font-size: 13px; color: var(--text-muted); }

/* FAQ */
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  font-family: inherit;
}
.faq-q:hover { background: var(--surface-2); }
.faq-q svg {
  width: 18px; height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform .2s var(--ease);
}
.faq-item.is-open .faq-q svg { transform: rotate(180deg); }
.faq-a {
  display: none;
  padding: 0 20px 18px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-soft);
}
.faq-item.is-open .faq-a { display: block; }

/* ==========================================================================
   页脚
   ========================================================================== */

.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 44px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(2, 1fr);
  gap: 40px;
  margin-bottom: 32px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 700; }
.footer-desc { font-size: 13px; color: var(--text-muted); line-height: 1.7; max-width: 320px; }
.footer-col h4 { font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: 13px; color: var(--text-soft); }
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
}
.footer-disclaimer { font-size: 12px; color: var(--text-muted); line-height: 1.6; max-width: 620px; }

/* ==========================================================================
   内容页（条款/隐私/联系）
   ========================================================================== */

.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 44px 0 36px;
}
.page-head h1 { font-size: 32px; font-weight: 700; letter-spacing: -.025em; }
.page-head p { margin-top: 10px; font-size: 14.5px; color: var(--text-soft); }

.prose { font-size: 14.5px; line-height: 1.85; color: var(--text-soft); }
.prose h2 {
  font-size: 19px;
  font-weight: 650;
  color: var(--text);
  margin: 34px 0 12px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 16px; font-weight: 600; color: var(--text); margin: 24px 0 10px; }
.prose p { margin-bottom: 14px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 7px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }

/* ==========================================================================
   空状态
   ========================================================================== */

.empty {
  text-align: center;
  padding: 72px 24px;
}
.empty-icon {
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--text-muted);
}
.empty-icon svg { width: 26px; height: 26px; }
.empty-title { font-size: 16px; font-weight: 600; margin-bottom: 7px; }
.empty-desc { font-size: 13.5px; color: var(--text-muted); max-width: 400px; margin: 0 auto 20px; line-height: 1.7; }

/* ==========================================================================
   账号卡片
   ========================================================================== */

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  transition: all .2s var(--ease);
}
.account-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.account-top { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.account-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--brand-soft);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  color: var(--text-soft);
  overflow: hidden;
}
.account-meta { min-width: 0; flex: 1; }
.account-name {
  font-size: 15px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-name svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }
.account-id {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px 0;
  border-block: 1px solid var(--border);
  margin-bottom: 14px;
}
.account-stat { text-align: center; }
.account-stat-value {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.account-stat-label { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

.account-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ==========================================================================
   进度条
   ========================================================================== */

.progress {
  height: 5px;
  background: var(--brand-soft);
  border-radius: var(--r-full);
  overflow: hidden;
  min-width: 60px;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-full);
  transition: width .4s var(--ease);
}
.progress-bar.is-success { background: var(--success); }
.progress-bar.is-danger  { background: var(--danger); }

/* ==========================================================================
   图表（纯 CSS/SVG 实现，不依赖图表库）
   ========================================================================== */

.chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 180px;
  padding: 16px 0 0;
}
.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  min-width: 0;
  position: relative;
}
.chart-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: opacity .15s var(--ease);
}
.chart-bar-ok { background: var(--accent); }
.chart-bar-fail { background: #f5b5ae; }
.chart-col:hover .chart-bar { opacity: .78; }

.chart-labels {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.chart-labels span {
  flex: 1;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 14px;
}
.chart-legend-item { display: flex; align-items: center; gap: 6px; }
.chart-legend-dot { width: 9px; height: 9px; border-radius: 2px; }

/* 迷你趋势条 */
.sparkline { display: flex; align-items: flex-end; gap: 2px; height: 32px; }
.sparkline span {
  flex: 1;
  background: var(--accent);
  border-radius: 2px;
  min-height: 2px;
  opacity: .75;
}

/* ==========================================================================
   标签页
   ========================================================================== */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

/*
 * 换行变体：标签数量多、且右侧还要放搜索框时用这个。
 * 光写 flex-wrap:wrap 不够 —— 基类的 overflow-x:auto 会让另一轴自动变成 auto，
 * 标签一换行就顶出一条纵向滚动条。所以这里必须把两轴都放开。
 */
.tabs-wrap {
  flex-wrap: wrap;
  overflow: visible;
  row-gap: 4px;
}
.tab {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 550;
  color: var(--text-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tab .count {
  padding: 1px 7px;
  border-radius: var(--r-full);
  background: var(--brand-soft);
  font-size: 11px;
  font-weight: 700;
}
.tab.is-active .count { background: var(--accent-soft); color: var(--accent); }

/* ==========================================================================
   右下角悬浮联系方式（Telegram / WhatsApp）
   由后台「系统设置 → 站点设置」开关控制，未开启时不渲染
   ========================================================================== */

.contact-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-fab-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 6px 18px rgba(16, 24, 40, .18);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
  position: relative;
}
.contact-fab-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 26px rgba(16, 24, 40, .26);
  color: #fff;
}
.contact-fab-btn svg { width: 24px; height: 24px; }

.contact-fab-telegram { background: #229ED9; }
.contact-fab-telegram:hover { background: #1d8bbe; }
.contact-fab-whatsapp { background: #25D366; }
.contact-fab-whatsapp:hover { background: #1eb958; }

/* 悬停时浮出的文字标签 */
.contact-fab-btn::after {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 11px;
  background: var(--brand);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--r-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s var(--ease);
}
.contact-fab-btn:hover::after { opacity: 1; }

@media (max-width: 560px) {
  .contact-fab { right: 14px; bottom: 14px; gap: 10px; }
  .contact-fab-btn { width: 44px; height: 44px; }
  .contact-fab-btn svg { width: 22px; height: 22px; }
  .contact-fab-btn::after { display: none; }
}

/* ==========================================================================
   悬浮窗（Modal）
   带入场动效：遮罩淡入 + 卡片轻微上浮缩放。
   尊重 prefers-reduced-motion —— 用户系统里关了动画就不播。
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: grid;
  place-items: center;
  padding: 20px;
  /*
   * 遮罩层自己不滚动。若在这里开 overflow:auto，内容超高时滚动条会贴在
   * 屏幕最右边缘，看着像页面出问题了。改成卡片内部滚动（见 .modal-body），
   * 头部与底部固定，滚动条落在卡片内，视觉上才是"弹窗在滚"。
   */
  overflow: hidden;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .45);
  backdrop-filter: blur(2px);
  animation: modal-fade .18s var(--ease);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  animation: modal-pop .22s var(--ease);
  overflow: hidden;   /* 让圆角裁住内部滚动区，滚动条不会盖住圆角 */
}

@keyframes modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal-card { animation: none; }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 650; }
.modal-sub { margin-top: 3px; font-size: 13px; color: var(--text-muted); }

.modal-close {
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  border-radius: var(--r-md);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s var(--ease);
}
.modal-close:hover { background: var(--brand-soft); color: var(--text); }

.modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;   /* flex 子项默认 min-height:auto，不加这行内容超高时不会收缩滚动 */
}

/* 弹窗内的滚动条收窄、淡化，不抢视觉 */
.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-full);
  border: 2px solid var(--surface);
}
.modal-body::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.modal-body { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  flex-shrink: 0;
}

/* 拖拽上传区 */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .15s var(--ease);
  background: var(--surface-2);
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.01);
}
.dropzone-icon {
  width: 44px; height: 44px;
  margin: 0 auto 12px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}
.dropzone-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.dropzone-hint { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }

/* 上传进度 */
.upload-progress { margin-top: 14px; }
.upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 12.5px;
}
.upload-progress-name {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-progress-pct {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}
.upload-progress .progress { height: 6px; }

/* ==========================================================================
   时间轴
   用于「运行日志」页：左侧定宽时间列 + 中间竖线圆点 + 右侧卡片。
   时间用 tabular-nums 等宽数字，保证不同时刻的秒数纵向对齐、一眼可扫。
   ========================================================================== */

.tl-row { display: flex; align-items: stretch; }

.tl-time {
  flex: 0 0 92px;
  width: 92px;
  padding-right: 14px;
  text-align: right;
}
.tl-day {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.tl-clock {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.tl-rail {
  position: relative;
  flex: 0 0 18px;
  width: 18px;
  display: flex;
  justify-content: center;
}
.tl-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
/* 竖线从圆点下沿连到下一条的圆点上沿（-6px 正好补上下一行圆点的上边距） */
.tl-line {
  position: absolute;
  left: 50%;
  width: 1px;
  margin-left: -.5px;
  top: 16px;
  bottom: -6px;
  background: var(--border);
}

.tl-main { flex: 1; min-width: 0; padding-bottom: 14px; }
.tl-row:last-child .tl-main { padding-bottom: 0; }

@media (max-width: 560px) {
  .tl-time { flex-basis: 64px; width: 64px; padding-right: 9px; }
  .tl-clock { font-size: 13.5px; }
  .tl-rail { flex-basis: 14px; width: 14px; }
}

/* ==========================================================================
   工具类
   ========================================================================== */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 0; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowrap { white-space: nowrap; }
.w-full { width: 100%; }
.hidden { display: none !important; }

.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* 表格里的小头像 */
.cell-user { display: flex; align-items: center; gap: 9px; min-width: 0; }

/*
 * 表格头像。必须显式写 max-width:none ——
 * 全局重置里有 img{max-width:100%}，当单元格比图片窄时浏览器会只压缩宽度、
 * 高度不变，圆头像就被拉成竖长的椭圆。这里锁死宽高比。
 */
.avatar-img {
  width: 40px;
  height: 40px;
  max-width: none;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-inline: auto;
  background: var(--brand-soft);
}
.avatar-md { width: 40px; height: 40px; font-size: 15px; }

/* ==========================================================================
   自定义下拉框
   原生 <select> 展开后的选项面板由浏览器绘制，CSS 几乎无法干预，
   浅色主题下会显得突兀。这里用 button + 浮层自己实现，外观完全可控。
   键盘支持：Enter/Space 展开，↑↓ 移动，Enter 选中，Esc 关闭。
   ========================================================================== */

.dropdown { position: relative; display: inline-block; }

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 132px;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.dropdown-toggle:hover { border-color: var(--text-muted); }
.dropdown.is-open .dropdown-toggle {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.dropdown-toggle svg {
  width: 15px; height: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform .18s var(--ease);
}
.dropdown.is-open .dropdown-toggle svg { transform: rotate(180deg); }

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  min-width: 100%;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  animation: dropdown-in .14s var(--ease);
}
.dropdown.is-open .dropdown-menu { display: block; }

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dropdown-menu { animation: none; }
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--text-soft);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.dropdown-item:hover { background: var(--brand-soft); color: var(--text); }
.dropdown-item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.dropdown-item .check { opacity: 0; flex-shrink: 0; }
.dropdown-item.is-active .check { opacity: 1; }

/* 单元格与表头的居中对齐（表头跟着数据一起居中） */
.table .td-center { text-align: center; }

/*
 * 简介单元格：把整列宽度用满，不做 max-width 限制。
 * TikTok 的简介上限就是 160 字符，正常两三行内一定放得下，
 * 行数上限只是防御历史脏数据（早期可能存了超长内容）。
 */
.bio-cell {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-soft);
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/*
 * 表格里「被表单包住的按钮」。
 * form 默认是块级元素，放进 flex 容器会被 align-items:stretch 拉满高度，
 * 里面的按钮看起来就比旁边直接放的 <a>/<button> 低一截。
 * 让 form 自己也成为一条 flex 线，并把外边距清零，就能对齐了。
 */
.table form {
  display: flex;
  margin: 0;
}
.table td .flex,
.table td [class*="flex"] {
  align-items: center;
}

/* 危险动作但保留按钮边框，与相邻按钮视觉一致 */
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.cell-user-text { min-width: 0; }
.cell-user-name { font-weight: 600; font-size: 13.5px; }
.cell-user-sub { font-size: 12px; color: var(--text-muted); }

/* 代码块 */
.code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 2px 6px;
  background: var(--brand-soft);
  border-radius: var(--r-sm);
  color: var(--text-soft);
  word-break: break-all;
}
.code-block {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow-x: auto;
  line-height: 1.65;
  color: var(--text-soft);
  white-space: pre-wrap;
  word-break: break-all;
}

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

@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; padding: 48px 0 56px; }
  .hero-title { font-size: 36px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 860px) {
  /* 侧边栏改为抽屉式 */
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .25s var(--ease);
    box-shadow: var(--shadow-xl);
  }
  .sidebar.is-open { transform: none; }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, .4);
    z-index: 199;
  }
  .sidebar-backdrop.is-open { display: block; }

  .main-head, .main-body { padding-inline: 18px; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 18px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    margin: 0;
  }
  .nav-links.is-open { display: flex; }
  .nav-toggle { display: grid; }

  .navbar-inner { gap: 12px; }

  .form-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 30px; }
  .section { padding: 52px 0; }
  .section-title { font-size: 24px; }

  .stats-bar-value { font-size: 26px; }
  .stat-value { font-size: 22px; }

  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 560px) {
  .container { padding-inline: 16px; }
  .hero-inner { padding: 36px 0 44px; }
  .hero-title { font-size: 26px; }
  .hero-subtitle { font-size: 15px; }
  .auth-card { padding: 22px 18px; }
  .main-head, .main-body { padding-inline: 14px; }
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .account-grid { grid-template-columns: 1fr; }
  .toast-stack { left: 14px; right: 14px; top: 14px; }
  .toast { max-width: none; min-width: 0; }
  .hero-actions .btn { flex: 1; }
}

/* 打印：隐藏导航和操作按钮 */
@media print {
  .navbar, .sidebar, .main-actions, .footer, .toast-stack { display: none !important; }
  body { background: #fff; }
  .card { border-color: #ddd; box-shadow: none; }
}
