/* ============================================================
   CR WebDAV — 专业冷淡风设计系统
   方向：Geist / Vercel 式 —— 黑白灰、hairline 边框、无渐变、
   无彩色阴影、紧凑排版、内容驱动
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f5f5f5;
  --border: #eaeaea;
  --border-strong: #d4d4d4;
  --text: #171717;
  --text-2: #525252;
  --text-muted: #737373;
  --accent: #0066ff;            /* 链接 / 焦点 */
  --accent-soft: rgba(0, 102, 255, .08);
  --primary: #171717;           /* 主按钮：黑 */
  --primary-text: #ffffff;
  --primary-hover: #3a3a3a;
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, .07);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, .08);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, .08);
  --ring: rgba(23, 23, 23, .12);
  --radius-s: 6px;
  --radius: 8px;
  --radius-l: 10px;
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow: 0 4px 14px rgba(0, 0, 0, .08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, .12);
  --topbar-h: 52px;
  --tabbar-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Code", "SF Mono", Consolas, "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --surface: #0a0a0a;
    --surface-2: #111111;
    --surface-3: #171717;
    --border: #262626;
    --border-strong: #383838;
    --text: #ededed;
    --text-2: #b8b8b8;
    --text-muted: #8f8f8f;
    --accent: #3b8bff;
    --accent-soft: rgba(59, 139, 255, .14);
    --primary: #ededed;
    --primary-text: #0a0a0a;
    --primary-hover: #ffffff;
    --danger: #f0524f;
    --danger-soft: rgba(240, 82, 79, .12);
    --success: #3fb950;
    --success-soft: rgba(63, 185, 80, .12);
    --warn: #d29922;
    --warn-soft: rgba(210, 153, 34, .12);
    --ring: rgba(237, 237, 237, .18);
    --shadow-s: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 4px 14px rgba(0, 0, 0, .5);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, .6);
  }
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.006em;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }

img { max-width: 100%; }

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--topbar-h); }

.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; color: var(--text); min-width: 0; }
.brand:hover { color: var(--text); }
.brand-logo { width: 26px; height: 26px; border-radius: var(--radius-s); object-fit: contain; }
.brand-mark {
  width: 26px; height: 26px; border-radius: var(--radius-s); display: inline-flex; align-items: center; justify-content: center;
  background: var(--text); color: var(--bg); font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topnav { display: flex; align-items: center; gap: 2px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-weight: 500; font-size: 13px;
  padding: 6px 11px; border-radius: var(--radius-s); transition: color .12s, background .12s;
}
.nav-link i { font-size: 13px; }
.nav-link:hover { color: var(--text); background: var(--surface-3); }
.nav-link.active { color: var(--text); background: var(--surface-3); font-weight: 600; }

.user-chip {
  background: var(--surface-3); color: var(--text-2); border-radius: 999px; padding: 3px 11px;
  font-size: 12px; font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inline-form { display: inline; margin: 0; }

/* ---------- 用户头像菜单 ---------- */
.user-menu { position: relative; }
.avatar-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-3); padding: 0; cursor: pointer;
  overflow: hidden; transition: border-color .12s;
}
.avatar-btn .avatar-live { position: absolute; inset: 0; }
.avatar-btn:hover { border-color: var(--text-muted); }
.avatar-img { width: 100%; height: 100%; object-fit: cover; }
.avatar-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text); font-weight: 700; font-size: 12px;
}
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 5px; z-index: 50;
  animation: fadeUp .14s ease;
}
.dropdown-header { padding: 9px 11px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown-name { display: block; font-weight: 600; font-size: 13px; }
.dropdown-email { display: block; color: var(--text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 11px; border-radius: var(--radius-s);
  color: var(--text-2); font-size: 13px; font-weight: 500; background: none; border: none; cursor: pointer;
  transition: background .1s, color .1s;
}
.dropdown-item i { width: 15px; text-align: center; color: var(--text-muted); font-size: 13px; }
.dropdown-item:hover { background: var(--surface-3); color: var(--text); }
.dropdown-item:hover i { color: var(--text); }
.dropdown-logout, .dropdown-logout i { color: var(--danger); }
.dropdown-logout:hover { background: var(--danger-soft); color: var(--danger); }
.dropdown-logout:hover i { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ---------- 移动端底部标签栏 ---------- */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar-inner { display: flex; height: var(--tabbar-h); }
.tabbar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-muted); font-size: 10px; font-weight: 500; transition: color .12s;
}
.tabbar-item i { font-size: 17px; }
.tabbar-item.active { color: var(--text); }
.tabbar-item:active { opacity: .6; }

/* ---------- 页面骨架 ---------- */
.page { flex: 1 0 auto; padding: 32px 20px 72px; animation: fadeUp .25s ease; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 5px; font-size: 22px; font-weight: 600; letter-spacing: -0.022em; }
.page-head .muted { margin: 0; font-size: 13px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 14px; border-radius: var(--radius-s); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s; white-space: nowrap; min-height: 34px;
  font-family: inherit; letter-spacing: inherit;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-text); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: transparent; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: var(--radius-s); min-height: 28px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.icon-btn {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border: 1px solid transparent; background: transparent; border-radius: var(--radius-s); color: var(--text-muted);
  cursor: pointer; transition: background .12s, color .12s; -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l);
  padding: 20px; margin-bottom: 16px;
}
.card-title { font-size: 14px; margin: 0 0 16px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--text-muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* ---------- 表单 ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-weight: 500; font-size: 13px; color: var(--text-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input {
  padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-s); font-size: 13px;
  background: var(--surface); color: var(--text); transition: border-color .12s, box-shadow .12s; width: 100%;
  font-family: inherit; min-height: 36px;
}
.input::placeholder { color: var(--text-muted); opacity: .65; }
.input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
textarea.input { resize: vertical; line-height: 1.65; }
select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px;
}
.input-sm { min-height: 30px; padding: 3px 9px; font-size: 12px; }
.field-error { color: var(--danger); font-size: 12px; }
.hint { color: var(--text-muted); font-size: 12px; margin: 3px 0 0; line-height: 1.6; }
.checkbox-row, .checkbox-line { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.checkbox-row input, .checkbox-line input { accent-color: var(--text); width: 15px; height: 15px; flex-shrink: 0; }

/* 开关 */
.toggle-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 13px 0; border-top: 1px solid var(--border);
}
.toggle-row:first-of-type { border-top: none; padding-top: 2px; }
.toggle-label { font-weight: 500; font-size: 13px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; cursor: pointer; transition: .15s;
}
.slider::before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.switch input:checked + .slider { background: var(--text); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ---------- 提示条 ---------- */
.alert {
  padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13px;
  border: 1px solid; display: flex; align-items: flex-start; gap: 9px; animation: fadeUp .2s ease;
}
.alert::before { font-family: "Font Awesome 6 Free"; font-weight: 900; flex-shrink: 0; margin-top: 1px; font-size: 13px; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 28%, transparent); }
.alert-success::before { content: "\f058"; }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.alert-danger::before { content: "\f057"; }
.alert-warning { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 32%, transparent); }
.alert-warning::before { content: "\f071"; }

/* ---------- 认证页 ---------- */
.auth-wrap { display: flex; justify-content: center; padding: 6vh 0 8vh; }
.auth-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l);
  width: 100%; max-width: 380px; padding: 30px 28px;
}
.auth-head h1 { margin: 0 0 5px; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.auth-head p { margin: 0 0 20px; font-size: 13px; }
.auth-foot { text-align: center; margin: 20px 0 0; font-size: 12px; }

/* ---------- 文件列表 ---------- */
.quota-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.quota-label { white-space: nowrap; }
.quota-label i { margin-right: 5px; }
.quota-track { flex: 1 1 160px; max-width: 300px; height: 4px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.quota-fill { height: 100%; background: var(--text); border-radius: 999px; transition: width .35s ease; }

.file-list {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l);
  overflow: visible;
}
.file-list .file-row:first-child { border-top-left-radius: var(--radius-l); border-top-right-radius: var(--radius-l); }
.file-list .file-row:last-child { border-bottom-left-radius: var(--radius-l); border-bottom-right-radius: var(--radius-l); }
.file-row {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) 100px 150px 40px; align-items: center; gap: 12px;
  padding: 6px 14px; min-height: 44px; border-bottom: 1px solid var(--border); transition: background .1s;
  -webkit-tap-highlight-color: transparent;
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--surface-2); }
.file-row-head {
  background: var(--surface); font-size: 11px; color: var(--text-muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em; cursor: default; min-height: 36px;
}
.file-row-head:hover { background: var(--surface); }
.file-list .file-row.selected { background: var(--accent-soft); }
.file-list .file-row.selected .file-name, .file-list .file-row.selected .file-label { color: var(--text); }

.file-check { display: flex; align-items: center; justify-content: center; }
.file-check input, .row-check { accent-color: var(--text); width: 15px; height: 15px; cursor: pointer; }

.file-icon { font-size: 18px; text-align: center; }
.file-name { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: default; overflow: hidden; font-weight: 500; color: var(--text); font-size: 13px; }
.file-name i { color: var(--text-muted); flex-shrink: 0; width: 16px; text-align: center; font-size: 14px; }
.file-name i.dir { color: var(--text); }
.file-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-name a[data-click="open"] { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; }
.file-meta { color: var(--text-muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.file-actions { display: flex; gap: 6px; justify-content: flex-end; }
.file-up { color: var(--accent); font-weight: 500; }
.file-up i { color: var(--accent); }

/* 移动端行内元信息 */
.file-sub { display: none; color: var(--text-muted); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.file-label-wrap { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }

/* 剪贴板状态条 */
.clipboard-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px 13px; margin-bottom: 14px; font-size: 13px; animation: fadeUp .2s ease;
}
.clipboard-icon { color: var(--text-muted); font-size: 14px; }
.clipboard-text { flex: 1; min-width: 160px; font-weight: 500; color: var(--text); }
.clipboard-actions { display: flex; gap: 8px; }

/* 面包屑 */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; color: var(--text-muted); }
.crumbs a { color: var(--text-muted); display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: var(--radius-s); font-weight: 500; }
.crumbs a:hover { background: var(--surface-3); color: var(--text); }
.crumbs a:last-child { color: var(--text); }
.crumb-folder { color: var(--text-muted); font-size: 12px; }
.crumb-sep { color: var(--border-strong); }

/* 空状态 */
.empty-state {
  text-align: center; padding: 56px 20px; background: var(--surface);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-l);
}
.empty-icon { font-size: 34px; margin-bottom: 12px; color: var(--border-strong); display: block; }
.empty-state h2 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.empty-state .muted { margin: 4px 0; font-size: 13px; }
.empty-state .btn { margin-top: 14px; }

/* FAB（移动端） */
.fab { display: none; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; padding: 0; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 500;
  color: var(--text-muted); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13px; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: var(--surface-2); }
.strong { font-weight: 600; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }

.copy-btn {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  border-radius: var(--radius-s); padding: 2px 8px; font-size: 11px; cursor: pointer; transition: all .12s;
  font-family: inherit;
}
.copy-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* 徽章：透明底 + 细边 + 色点 */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 500; border: 1px solid;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-on { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.badge-off { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }

/* 状态行 */
.status-list { display: flex; flex-direction: column; }
.status-row {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.status-row:last-child { border-bottom: none; }
.status-row > :first-child { color: var(--text-muted); flex-shrink: 0; }
.status-row > :last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* ---------- 管理仪表盘 ---------- */
.dash-nav {
  display: flex; gap: 2px; margin-bottom: 22px; padding: 0;
  border-bottom: 1px solid var(--border);
  width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.dash-nav::-webkit-scrollbar { display: none; }
.dash-nav-item {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; margin-bottom: -1px;
  color: var(--text-muted); font-size: 13px; font-weight: 500; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color .12s, border-color .12s;
}
.dash-nav-item:hover { color: var(--text); }
.dash-nav-item.active { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.dash-nav-item i { font-size: 13px; }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l);
  padding: 16px 18px; position: relative; overflow: hidden;
}
.stat-icon {
  position: absolute; right: 14px; top: 14px; color: var(--text-muted); font-size: 14px;
}
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 600; line-height: 1.2; margin: 3px 0 1px; color: var(--text); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11px; color: var(--text-muted); }

.dash-cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.module-list { display: flex; flex-direction: column; }
.module-row {
  display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; margin: 0 -12px;
  border-radius: var(--radius-s); transition: background .1s; color: var(--text);
}
.module-row:hover { background: var(--surface-2); color: var(--text); }
.module-name { font-weight: 500; font-size: 13px; }
.module-desc { font-size: 12px; color: var(--text-muted); }

/* 身份组卡片 */
.group-list { display: flex; flex-direction: column; gap: 10px; }
.group-item { padding: 14px 16px; margin-bottom: 0; }
.group-item-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.group-item-head .badge { margin-left: 8px; }
.group-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--text-muted); }
.group-meta strong { color: var(--text); font-weight: 600; }
.group-edit { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; }
.group-edit summary { cursor: pointer; color: var(--accent); font-size: 12px; font-weight: 500; padding: 4px 0; user-select: none; }
.group-edit form { margin-top: 10px; }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center;
  z-index: 60; padding: 20px; animation: fadeUp .12s ease;
}
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l);
  padding: 22px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 40px); overflow-y: auto; animation: fadeUp .18s ease;
}
.modal h3 { margin: 0 0 16px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- 通用下拉 ---------- */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 5px); min-width: 170px; z-index: 55;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 5px; display: none; animation: fadeUp .12s ease;
}
.dropdown-menu.show { display: block; }
.dropdown-menu .dropdown-item.danger, .dropdown-menu .dropdown-item.danger i { color: var(--danger); }
.dropdown-menu .dropdown-item.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- 文档页 ---------- */
.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.docs-sidebar { position: sticky; top: calc(var(--topbar-h) + 24px); }
.docs-nav {
  display: flex; flex-direction: column; gap: 1px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l);
}
.docs-nav-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: var(--radius-s);
  color: var(--text-2); font-size: 13px; font-weight: 500; transition: background .1s, color .1s;
}
.docs-nav-item i { width: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.docs-nav-item:hover { background: var(--surface-3); color: var(--text); }
.docs-nav-item.active { background: var(--surface-3); color: var(--text); font-weight: 600; }
.docs-content { min-width: 0; }
.docs-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l);
  padding: 24px 26px; margin-bottom: 18px; scroll-margin-top: calc(var(--topbar-h) + 20px);
}
.docs-section h2 { margin: 0 0 14px; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; display: flex; align-items: center; gap: 9px; }
.docs-section h3 { margin: 20px 0 8px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.docs-h-icon { color: var(--text-muted); font-size: 14px; }
.docs-section p { margin: 8px 0; line-height: 1.75; color: var(--text-2); font-size: 13px; }
.docs-section ol, .docs-section ul { margin: 8px 0; padding-left: 20px; line-height: 1.9; color: var(--text-2); font-size: 13px; }
.docs-alert {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin: 10px 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; line-height: 1.65; color: var(--text-2);
}
.docs-alert i { color: var(--text-muted); margin-top: 2px; }
.docs-alert-muted { background: var(--surface-2); }
.docs-table-wrap { overflow-x: auto; margin: 10px 0; }
.docs-table { width: 100%; border-collapse: collapse; }
.docs-table th, .docs-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.docs-table th { background: var(--surface-2); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 500; }
.code-block {
  display: block; background: var(--surface-3); color: var(--text); border: 1px solid var(--border);
  padding: 12px 14px; border-radius: var(--radius);
  font-family: var(--mono); font-size: 12px; line-height: 1.65; overflow-x: auto; margin: 8px 0;
}
.code-block code { background: none; color: inherit; padding: 0; }
.tip {
  padding: 9px 13px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: var(--radius-s); color: var(--warn); font-size: 12px; margin: 8px 0;
}

/* ---------- 个人信息页 ---------- */
.profile-card { max-width: 520px; }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.profile-avatar {
  width: 60px; height: 60px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border-strong);
}
.profile-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--text); color: var(--bg); font-size: 22px; font-weight: 700;
}
.profile-id { min-width: 0; }
.profile-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.profile-avatar-wrap { position: relative; display: block; width: 60px; height: 60px; flex-shrink: 0; }
.profile-avatar-wrap .avatar-live { position: absolute; inset: 0; }
.quota-block { margin-bottom: 18px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.quota-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; margin-bottom: 8px; }
.quota-block .quota-track { max-width: none; flex: none; width: 100%; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg); padding: 16px 0; margin-top: auto; }
.footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text-muted); font-size: 12px; }

/* ---------- 工具类 ---------- */
.muted { color: var(--text-muted); }
.hidden { display: none !important; }
.mono, code { font-family: var(--mono); }
code { background: var(--surface-3); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
.code-block code { border: none; }
.page-pad { margin-top: 40px; }

/* ============================================================
   上传任务管理器
   ============================================================ */
.upload-panel {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 55;
}

.upload-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform .15s, background .12s;
  position: relative;
  padding: 0;
}
.upload-toggle:hover { background: var(--surface-3); }
.upload-toggle .badge-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}
.upload-toggle.has-active .badge-count {
  animation: pulse-dot 1.5s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}

/* Upload drawer */
.upload-drawer {
  position: fixed;
  right: 16px;
  bottom: 76px;
  width: 360px;
  max-height: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 55;
  overflow: hidden;
  animation: fadeUp .15s ease;
}
.upload-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}
.upload-drawer-header .actions {
  display: flex;
  gap: 4px;
}
.upload-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}
.upload-drawer-body:empty::after {
  content: "暂无上传任务";
  display: block;
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.upload-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.upload-task:last-child { border-bottom: none; }
.upload-task:hover { background: var(--surface-2); }
.upload-task-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-s);
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.upload-task-icon.status-uploading { color: var(--accent); }
.upload-task-icon.status-done { color: var(--success); background: var(--success-soft); }
.upload-task-icon.status-error { color: var(--danger); background: var(--danger-soft); }
.upload-task-body {
  flex: 1;
  min-width: 0;
}
.upload-task-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}
.upload-task-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
}
.upload-task-bar {
  height: 3px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 5px;
}
.upload-task-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .2s ease;
}
.upload-task-bar-fill.done { background: var(--success); }
.upload-task-bar-fill.error { background: var(--danger); }
.upload-task-action { flex-shrink: 0; }

/* Upload button pulse indicator */
.upload-btn-wrap {
  position: relative;
  display: inline-flex;
}
.upload-btn-wrap .upload-pulse {
  display: none;
  position: absolute;
  top: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.upload-btn-wrap.has-active .upload-pulse {
  display: block;
  animation: pulse-dot 1.5s ease infinite;
}

/* ============================================================
   响应式 — 平板（≤ 900px）
   ============================================================ */
@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; }
  .docs-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .docs-nav::-webkit-scrollbar { display: none; }
  .docs-nav-item { white-space: nowrap; }
  .grid-2, .dash-cards { grid-template-columns: 1fr; }
}

/* ============================================================
   响应式 — 手机（≤ 720px）
   ============================================================ */
@media (max-width: 720px) {
  .container { padding: 0 14px; }
  .page { padding: 20px 14px calc(var(--tabbar-h) + 40px); }

  .topnav .nav-link { display: none; }
  .tabbar { display: block; }
  .footer { display: none; }

  .page-head { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 18px; }
  .page-head h1 { font-size: 19px; }
  .page-actions { gap: 8px; }

  /* 文件列表紧凑行 */
  .file-row { grid-template-columns: 26px minmax(0, 1fr) 36px; padding: 9px 12px; gap: 10px; min-height: 52px; }
  .file-row-head { display: none; }
  .file-row > .file-meta { display: none; }
  .file-sub { display: block; }
  #btn-upload, #btn-newfolder { display: none; }
  #more-dropdown { margin-left: auto; }

  /* FAB */
  .fab {
    display: flex; position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0)); z-index: 46;
    flex-direction: column; align-items: flex-end; gap: 10px;
  }
  .fab-menu { display: none; flex-direction: column; gap: 8px; align-items: flex-end; }
  .fab.open .fab-menu { display: flex; animation: fadeUp .15s ease; }
  .fab-menu .btn { box-shadow: var(--shadow); border-radius: 999px; padding: 8px 16px; }
  .fab-main {
    width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--primary); color: var(--primary-text);
    font-size: 17px; cursor: pointer; box-shadow: var(--shadow-lg);
    display: flex; align-items: center; justify-content: center; transition: transform .18s;
  }
  .fab.open .fab-main { transform: rotate(45deg); }

  .clipboard-bar { gap: 8px; }
  .clipboard-text { min-width: 0; flex-basis: 100%; order: 3; }

  /* 表格卡片化 */
  .table { min-width: 0; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px;
    padding: 4px 0; background: var(--surface);
  }
  .table td { border-bottom: none; padding: 6px 13px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .table td::before {
    content: attr(data-label); font-size: 11px; color: var(--text-muted); font-weight: 500;
    text-transform: uppercase; letter-spacing: .05em; flex-shrink: 0;
  }
  .table td:not([data-label])::before { display: none; }
  .table td > :last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; }
  .table td .actions-cell { justify-content: flex-end; }

  /* 弹窗底部抽屉 */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: none; border-radius: 14px 14px 0 0; border-bottom: none;
    padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0)); max-height: 88vh;
  }
  .modal-actions .btn { flex: 1; }

  .field-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-value { font-size: 22px; }
  .docs-section { padding: 16px; }
  .auth-card { padding: 24px 20px; }
  .auth-wrap { padding: 3vh 0 4vh; }
  .quota-track { flex-basis: 100%; max-width: none; order: 3; }

  /* 上传抽屉 — 移动端：全宽底部抽屉（避开 FAB） */
  .upload-panel { right: 10px; bottom: calc(var(--tabbar-h) + 72px); }
  .upload-toggle { width: 40px; height: 40px; font-size: 15px; }
  .upload-drawer {
    right: 8px; left: 8px; bottom: calc(var(--tabbar-h) + 124px);
    width: auto; max-height: 50vh;
    border-radius: 14px 14px 0 0;
  }
}

/* 减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   v3 结构组件：管理后台壳层 / 抽屉导航 / Tabs / 卡片列表 /
   Logo 裁剪器 / 友链编辑器
   ============================================================ */

/* ---------- 管理后台布局 ---------- */
.admin-shell {
  display: grid; grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh; min-height: 100dvh; background: var(--bg);
}
.admin-sidebar {
  border-right: 1px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh;
}
.admin-brand {
  display: flex; align-items: center; gap: 9px; padding: 0 18px; height: var(--topbar-h);
  border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; color: var(--text);
}
.admin-brand:hover { color: var(--text); }
.admin-nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.admin-nav-label {
  font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .07em; padding: 14px 10px 6px;
}
.admin-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s);
  color: var(--text-2); font-size: 13px; font-weight: 500; transition: background .1s, color .1s;
}
.admin-nav-item i { width: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.admin-nav-item:hover { background: var(--surface-3); color: var(--text); }
.admin-nav-item.active { background: var(--surface-3); color: var(--text); font-weight: 600; }
.admin-nav-item.active i { color: var(--text); }
.admin-sidebar-foot { padding: 10px; border-top: 1px solid var(--border); }

.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  display: none; align-items: center; gap: 12px; height: var(--topbar-h); padding: 0 16px;
  border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 40;
}
.admin-topbar .brand { font-size: 14px; }
.menu-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius-s);
  color: var(--text); cursor: pointer; font-size: 14px;
}
.admin-content { flex: 1; padding: 28px 32px 80px; max-width: 960px; width: 100%; margin: 0 auto; animation: fadeUp .25s ease; }

/* 移动端：侧栏变抽屉 */
.drawer-mask {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 48;
}
.drawer-mask.show { display: block; }

/* ---------- 页面 tabs（分享中心等） ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 14px; margin-bottom: -1px; font-size: 13px; font-weight: 500; color: var(--text-muted);
  border-bottom: 2px solid transparent; white-space: nowrap; transition: color .12s, border-color .12s;
  background: none; border-top: none; border-left: none; border-right: none; cursor: pointer; font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.tab .count {
  display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-muted); font-size: 11px; font-weight: 600;
}
.tab.active .count { background: var(--text); color: var(--bg); }

/* ---------- 对象卡片列表（用户 / 身份组 / 分享） ---------- */
.obj-list { display: flex; flex-direction: column; gap: 10px; }
.obj-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l);
  transition: border-color .12s;
}
.obj-card:hover { border-color: var(--border-strong); }
.obj-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  background: var(--surface-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: var(--text-2);
}
.obj-avatar img { width: 100%; height: 100%; object-fit: cover; }
.obj-avatar.square { border-radius: var(--radius); }
.obj-body { flex: 1; min-width: 0; }
.obj-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 14px; }
.obj-title a { color: var(--text); }
.obj-title a:hover { color: var(--accent); }
.obj-sub { color: var(--text-muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obj-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; color: var(--text-muted); font-size: 12px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.obj-meta b { color: var(--text-2); font-weight: 600; }
.obj-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* ---------- 友链编辑器 ---------- */
.link-editor { display: flex; flex-direction: column; gap: 8px; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 36px; gap: 8px; align-items: center; }
.link-row .icon-btn { width: 36px; height: 36px; border: 1px solid var(--border-strong); }
.link-add { align-self: flex-start; }

/* ---------- Logo 上传与裁剪 ---------- */
.logo-current { display: flex; align-items: center; gap: 14px; }
.logo-preview {
  width: 56px; height: 56px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-3); object-fit: contain; padding: 4px;
}
.cropper { display: flex; flex-direction: column; gap: 12px; }
.cropper-stage {
  position: relative; width: 100%; max-width: 320px; aspect-ratio: 1; margin: 0 auto;
  border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden;
  background: var(--surface-3); touch-action: none; cursor: grab; user-select: none;
}
.cropper-stage:active { cursor: grabbing; }
.cropper-stage img { position: absolute; transform-origin: 0 0; pointer-events: none; max-width: none; }
.cropper-mask {
  position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6);
}
.cropper-controls { display: flex; align-items: center; gap: 10px; }
.cropper-controls input[type="range"] { flex: 1; accent-color: var(--text); }

/* ---------- 文档分章（独立页面） ---------- */
.docs-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; }

/* ---------- 文件预览页 ---------- */
.preview-stage { animation: fadeUp .25s ease; }
.preview-image-wrap {
  display: flex; justify-content: center; align-items: center; padding: 24px;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-l);
  min-height: 240px;
}
.preview-image { max-width: 100%; max-height: 76vh; object-fit: contain; border-radius: var(--radius-s); }
.preview-frame {
  width: 100%; height: 78vh; border: 1px solid var(--border); border-radius: var(--radius-l);
  background: var(--surface-3);
}
.preview-media-wrap {
  display: flex; justify-content: center; padding: 24px;
  background: #000; border-radius: var(--radius-l); border: 1px solid var(--border);
}
.preview-video { max-width: 100%; max-height: 76vh; }
.preview-audio-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 48px 24px;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-l);
}
.preview-audio-icon {
  width: 64px; height: 64px; border-radius: 50%; background: var(--text); color: var(--bg);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.preview-audio-name { font-weight: 600; font-size: 14px; word-break: break-all; text-align: center; }
.preview-audio { width: 100%; max-width: 460px; }
.preview-text {
  margin: 0; padding: 18px 20px; background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-l); font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
  overflow: auto; max-height: 76vh; white-space: pre-wrap; word-break: break-all;
}
.preview-text code { background: none; border: none; padding: 0; }
.preview-unsupported {
  text-align: center; padding: 52px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l);
  max-width: 520px; margin: 0 auto;
}
.preview-unsupported h2 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.preview-unsupported .muted { margin: 0 0 18px; font-size: 13px; }
.share-browse-row { color: var(--text); text-decoration: none; cursor: pointer; }
.share-browse-row:hover { color: var(--text); }

/* ---------- 页脚友链 ---------- */
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.footer-links a { color: var(--text-muted); font-size: 12px; }
.footer-links a:hover { color: var(--text); }

/* ---------- 关于页友链 ---------- */
.friend-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.friend-links a {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
  border: 1px solid var(--border); border-radius: 999px; color: var(--text-2); font-size: 13px; font-weight: 500;
  transition: border-color .12s, color .12s;
}
.friend-links a:hover { border-color: var(--border-strong); color: var(--text); }
.friend-links a i { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   v3 响应式
   ============================================================ */
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 49;
    transform: translateX(-100%); transition: transform .22s ease; height: 100dvh;
  }
  .admin-sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .admin-topbar { display: flex; }
  .admin-content { padding: 18px 14px 80px; }
}

@media (max-width: 720px) {
  .docs-topnav-mobile { display: flex; }
  .docs-sidebar { display: none; }
  .docs-pager .btn span { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .obj-card { flex-wrap: wrap; }
  .obj-actions { flex-basis: 100%; justify-content: flex-end; }
  .link-row { grid-template-columns: minmax(0, 1fr) 36px; }
  .link-row input.link-url { grid-column: 1 / -1; grid-row: 2; }
  .link-row .icon-btn { grid-column: 2; grid-row: 1; }
}
