/* ============================================================
   WenzFlow Server Web v2 — 共享样式
   风格基准：wenzflow_www（zinc 极简 / 蓝色点缀 / 暗色模式）
   ============================================================ */

/* ── 设计令牌 ── */
:root {
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --bg-muted: #f4f4f5;        /* zinc-100 */
  --surface: #ffffff;
  --border: #e4e4e7;          /* zinc-200 */
  --border-strong: #d4d4d8;   /* zinc-300 */
  --text: #0a0a0a;
  --text-secondary: #71717a;  /* zinc-500 */
  --text-muted: #a1a1aa;      /* zinc-400 */
  --accent: #2563eb;          /* blue-600 */
  --accent-soft: rgba(37, 99, 235, 0.08);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.1);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.1);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-full: 999px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --font-sans: "Geist", "Inter", -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", Consolas, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark {
  --bg: #000000;
  --bg-subtle: #09090b;       /* zinc-950 */
  --bg-muted: #18181b;        /* zinc-900 */
  --surface: #18181b;
  --border: #27272a;          /* zinc-800 */
  --border-strong: #3f3f46;   /* zinc-700 */
  --text: #e5e5e5;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;      /* zinc-600 */
  --accent-soft: rgba(37, 99, 235, 0.16);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* ── 基础 ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
img { display: block; }
button { font-family: inherit; cursor: pointer; }

/* ── Lucide 图标 ── */
svg.lucide { width: 1em; height: 1em; flex-shrink: 0; }

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

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d4d4; border-radius: 3px; }
html.dark ::-webkit-scrollbar-thumb { background: #333; }

/* ── 排版工具 ── */
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.h1 { font-size: clamp(40px, 7vw, 72px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.h2 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.h3 { font-size: 18px; font-weight: 600; }
.lead { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }

.container { max-width: 1024px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section { padding: 128px 0; }

/* ── 官网 Header ── */
.site-header {
  position: fixed;
  top: 0;
  z-index: 50;
  width: 100%;
  transition: all 0.5s ease;
}
.site-header.scrolled {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.brand img { width: 28px; height: 28px; border-radius: 6px; }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav > a, .site-nav-products-toggle {
  position: relative;
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}
.site-nav > a:hover, .site-nav-products-toggle:hover, .site-nav-products-toggle[aria-expanded="true"] { color: var(--text); }
/* glow-line（x.ai 风格下划线） */
.site-nav > a::after, .site-nav-products-toggle::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.site-nav > a:hover::after, .site-nav-products-toggle:hover::after, .site-nav-products-toggle[aria-expanded="true"]::after { opacity: 1; }
.site-nav-products-chevron {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 0 2px 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.site-nav-products-toggle[aria-expanded="true"] .site-nav-products-chevron { transform: rotate(225deg) translate(-2px, -2px); }
.site-nav-products-toggle:focus-visible, .site-product-link:focus-visible, .site-products-retry:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.site-products-popup {
  position: fixed;
  top: 64px;
  left: 50%;
  z-index: 51;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
  width: min(1024px, calc(100vw - 48px));
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 38px 48px 44px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
}
.site-products-popup[hidden], .site-products-status[hidden], .site-products-retry[hidden] { display: none; }
.site-products-column { min-width: 0; }
.site-products-heading { padding: 0 10px; color: var(--text-secondary); font-size: 14px; }
.site-products-popup .site-product-link {
  display: block;
  margin-top: 10px;
  padding: 12px 10px;
  border-radius: 10px;
  font-size: 17px;
  line-height: 1.4;
  color: var(--text);
  overflow-wrap: anywhere;
}
.site-products-popup .site-product-link:hover { background: var(--accent-soft); color: var(--accent); }
.site-product-link span { display: block; margin-top: 4px; color: var(--text-secondary); font-size: 12px; }
.site-products-status { padding: 14px 10px; color: var(--text-secondary); }
.site-products-retry { margin: 0 10px; padding: 6px 0; border: 0; background: transparent; color: var(--accent); }
@media (max-width: 850px) {
  .site-products-popup { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 24px; }
}
@media (max-width: 600px) {
  .site-products-popup { grid-template-columns: minmax(0, 1fr); width: calc(100vw - 24px); max-height: calc(100vh - 76px); padding: 18px; }
}

.header-actions { display: flex; align-items: center; gap: 8px; }

/* ── 按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out),
    background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); box-shadow: none; }

.btn-primary { background: var(--text); color: var(--bg); }
html.dark .btn-primary { background: #fafafa; color: #09090b; }
.btn-primary:hover { opacity: 0.9; }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #1d4ed8; }

.btn-outline { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--text-muted); }

.btn-ghost { color: var(--text-secondary); background: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--bg-muted); box-shadow: none; }

.btn-danger { color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--danger-soft); box-shadow: none; }

.btn-lg { padding: 12px 28px; font-size: 14px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; }

/* ── 徽标 ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-subtle);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-accent { color: var(--accent); border-color: transparent; background: var(--accent-soft); }
.badge-success { color: var(--success); border-color: transparent; background: var(--success-soft); }
.badge-warning { color: var(--warning); border-color: transparent; background: var(--warning-soft); }
.badge-danger { color: var(--danger); border-color: transparent; background: var(--danger-soft); }

/* ── 卡片 ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s ease, box-shadow 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.card-hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-title { font-size: 14px; font-weight: 600; }
.card-title svg { width: 16px; height: 16px; vertical-align: -3px; }
.card-desc { margin-top: 6px; font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

/* ── 官网 Hero ── */
.grid-bg {
  background-size: 60px 60px;
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}
html.dark .grid-bg {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
}

.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}
.typewriter { font-weight: 300; color: var(--text-muted); font-size: clamp(20px, 3vw, 30px); min-height: 44px; }
.typewriter .caret { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ── 模块图标圆 ── */
.icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 20px;
}
.icon-circle svg { width: 20px; height: 20px; }

.step-num { font-size: 36px; font-weight: 700; color: var(--border); }
html.dark .step-num { color: #27272a; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--border); padding: 48px 0; color: var(--text-muted); font-size: 13px; }
.site-footer .cols { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 32px; }
.site-footer a:hover { color: var(--text); }

/* ── 动效 ── */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
.reveal.visible { opacity: 1; transform: translateY(0); }

@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
/* 不加 forwards：动画结束后 body 不能残留 transform，否则内部 position:fixed 的顶栏会退化成随页面滚动。 */
.page-enter { animation: pageIn 0.6s var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   管理端
   ============================================================ */

.admin-shell { display: flex; height: 100vh; overflow: hidden; background: var(--bg-muted); }

.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.admin-sidebar .brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
}
.admin-sidebar .brand-row img { width: 26px; height: 26px; border-radius: 6px; }
.admin-nav { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.admin-nav .nav-group { margin-top: 16px; padding: 0 12px 4px; font-size: 11px; color: var(--text-muted); letter-spacing: 0.08em; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease;
}
.admin-nav a:hover { background: var(--bg-muted); color: var(--text); }
.admin-nav a.active { background: var(--accent-soft); color: var(--accent); }
.admin-nav a .icon { width: 16px; height: 16px; flex-shrink: 0; }
.admin-sidebar .sidebar-foot { border-top: 1px solid var(--border); padding: 12px; }
.admin-nav-section { display: flex; flex-direction: column; gap: 2px; }
.admin-nav-group-toggle {
  width: 100%; display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 10px;
  border: 0; border-radius: 7px; background: transparent; color: var(--text-muted); cursor: pointer;
  font: inherit; font-size: 11px; letter-spacing: .08em; text-align: left;
}
.admin-nav-group-toggle:hover { background: var(--bg-muted); color: var(--text-secondary); }
.admin-nav-group-toggle .nav-chevron { width: 14px; height: 14px; flex-shrink: 0; transition: transform .16s ease; }
.admin-nav-group-toggle[aria-expanded="false"] .nav-chevron { transform: rotate(-90deg); }
.admin-nav-group-links { display: flex; flex-direction: column; gap: 2px; }
.admin-nav-group-links[hidden] { display: none; }
.admin-nav-section.has-active .admin-nav-group-toggle { color: var(--accent); }

.admin-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.admin-topbar {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-muted);
}
.admin-content { flex: 1; overflow-y: auto; padding: 24px 32px 64px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.page-head .sub { margin-top: 4px; font-size: 13px; color: var(--text-secondary); }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card .label { font-size: 12px; color: var(--text-muted); }
.stat-card .value { margin-top: 8px; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-card .trend { margin-top: 6px; font-size: 12px; }
.stat-card .trend.up { color: var(--success); }
.stat-card .trend.down { color: var(--danger); }

/* 面板 */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel-head h2 { font-size: 14px; font-weight: 600; }
.panel-body { padding: 20px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background 0.15s ease; }
.table tbody tr:hover { background: var(--bg-subtle); }
.table tbody tr:last-child td { border-bottom: none; }
.table .cell-main { font-weight: 500; color: var(--text); }
.table .cell-sub { font-size: 12px; color: var(--text-muted); }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; }

/* OSS 文件资源管理器 */
.oss-explorer { min-height: 620px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.oss-commandbar { min-height: 58px; display: flex; align-items: end; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-subtle); }
.oss-source-picker { min-width: 280px; flex: 0 1 420px; }
.oss-source-picker label { display: block; margin-bottom: 4px; font-size: 11px; color: var(--text-muted); }
.oss-nav-actions { display: flex; gap: 6px; }
.oss-commandbar .icon-btn { min-width: 38px; padding-inline: 10px; font-size: 16px; }
.oss-commandbar .icon-btn svg { width: 16px; height: 16px; }
.oss-search { display: flex; gap: 6px; margin-left: auto; min-width: 260px; max-width: 420px; flex: 1; }
.oss-source-summary { display: flex; align-items: center; gap: 16px; min-height: 36px; padding: 7px 16px; border-bottom: 1px solid var(--border); color: var(--text-secondary); font-size: 12px; overflow-x: auto; white-space: nowrap; }
.oss-source-summary strong { color: var(--text); }
.oss-explorer-body { display: grid; grid-template-columns: 210px minmax(480px,1fr) 260px; min-height: 525px; }
.oss-tree { padding: 12px 8px; border-right: 1px solid var(--border); background: var(--bg-subtle); }
.oss-tree h2,.oss-details h2 { margin: 4px 10px 10px; font-size: 12px; color: var(--text-secondary); }
.oss-tree button { width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text-secondary); text-align: left; cursor: pointer; }
.oss-tree button:hover { background: var(--accent-soft); color: var(--accent); }
.oss-tree-note { margin: 18px 10px 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: 11px; line-height: 1.6; color: var(--text-muted); }
.oss-file-pane { min-width: 0; display: flex; flex-direction: column; }
.oss-addressbar { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.oss-breadcrumb { min-width: 0; display: flex; align-items: center; gap: 5px; overflow-x: auto; }
.oss-breadcrumb button { border: 0; background: transparent; color: var(--text-secondary); padding: 4px 6px; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.oss-breadcrumb button:hover { background: var(--bg-muted); color: var(--text); }
.oss-table-wrap { flex: 1; overflow: auto; }
.oss-file-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.oss-file-table th { position: sticky; top: 0; z-index: 1; padding: 9px 10px; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text-muted); text-align: left; font-weight: 500; }
.oss-file-table th:nth-child(1) { width: 34%; }.oss-file-table th:nth-child(2) { width: 13%; }.oss-file-table th:nth-child(3) { width: 10%; }.oss-file-table th:nth-child(4) { width: 20%; }.oss-file-table th:nth-child(5) { width: 23%; }
.oss-file-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oss-file-table tbody tr { cursor: default; user-select: none; }
.oss-file-table tbody tr:hover { background: var(--bg-subtle); }
.oss-file-table tbody tr.selected { background: var(--accent-soft); color: var(--accent); }
.oss-file-icon { display: inline-flex; width: 24px; justify-content: center; margin-right: 4px; }.oss-file-icon svg { width: 16px; height: 16px; }.oss-file-name { vertical-align: middle; }
.oss-file-footer { min-height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 7px 12px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
.oss-details { padding: 12px; border-left: 1px solid var(--border); background: var(--bg-subtle); overflow: auto; }
.oss-details-empty { padding: 36px 10px; color: var(--text-muted); text-align: center; font-size: 12px; }
.oss-details-icon { padding: 18px 0 8px; text-align: center; font-size: 44px; }.oss-details-icon svg { width: 44px; height: 44px; display: inline-block; }.oss-details-name { display: block; margin-bottom: 18px; text-align: center; overflow-wrap: anywhere; }
.oss-detail-row { display: grid; gap: 4px; padding: 9px 0; border-top: 1px solid var(--border); }.oss-detail-row span { font-size: 11px; color: var(--text-muted); }.oss-detail-row code { font-size: 11px; overflow-wrap: anywhere; white-space: normal; }
.storage-maintenance-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 12px; }
.storage-maintenance-stat { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-subtle); }.storage-maintenance-stat strong { font-size: 18px; }
.warning-text { color: var(--warning); }.success-text { color: var(--success); }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.input, .select, .textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }

.search-input { position: relative; width: 260px; }
.search-input .input { padding-left: 32px; }
.search-input::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background-color: var(--text-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 21-4.34-4.34'/%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 21-4.34-4.34'/%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Tabs */
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--bg-muted); }
.tabs button {
  border: none;
  background: transparent;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

/* 简易柱状图（mock） */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding: 8px 4px 0; }
.bar-chart .bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(to top, var(--accent), #60a5fa);
  opacity: 0.85;
  min-height: 4px;
  transition: opacity 0.15s ease;
  position: relative;
}
.bar-chart .bar:hover { opacity: 1; }
.bar-chart .bar.dim { background: var(--border-strong); }
.chart-x { display: flex; gap: 6px; padding: 8px 4px 0; border-top: 1px solid var(--border); }
.chart-x span { flex: 1; text-align: center; font-size: 10px; color: var(--text-muted); }

/* 进度条 */
.progress { height: 6px; border-radius: 3px; background: var(--bg-muted); overflow: hidden; }
.progress > div { height: 100%; border-radius: 3px; background: var(--accent); }

/* Modal */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-mask.open { opacity: 1; pointer-events: auto; }
.modal {
  width: min(520px, calc(100vw - 48px));
  max-height: 80vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96) translateY(8px);
  transition: transform 0.25s var(--ease-out);
}
.modal-mask.open .modal { transform: scale(1) translateY(0); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 24px 20px; }
.modal-close { border: none; background: transparent; color: var(--text-muted); font-size: 18px; line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--text); }

/* 抽屉（详情侧栏） */
.drawer-mask { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.3); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 101;
  width: min(480px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.3s var(--ease-out);
  display: flex;
  flex-direction: column;
}
.drawer-mask.open + .drawer, .drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }

/* 描述列表 */
.desc-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.desc-row:last-child { border-bottom: none; }
.desc-row dt { color: var(--text-muted); flex-shrink: 0; }
.desc-row dd { text-align: right; color: var(--text); word-break: break-all; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 200;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--ease-out);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 主题切换按钮 */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all 0.2s ease;
}
.theme-toggle:hover { border-color: var(--border-strong); color: var(--text); }
.theme-toggle svg { width: 15px; height: 15px; }

/* 分页 */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.pagination .pages { display: flex; gap: 4px; }
.pagination .pages button {
  min-width: 28px; height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
}
.pagination .pages button.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* 空状态 */
.empty { padding: 48px 24px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* 头像 */
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* 网格工具 */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.text-sm { font-size: 12px; }

/* 响应式：官网 */
@media (max-width: 1180px) {
  .oss-explorer-body { grid-template-columns: 180px minmax(420px,1fr); }
  .oss-details { display: none; }
}
@media (max-width: 900px) {
  .oss-commandbar { align-items: stretch; flex-wrap: wrap; }
  .oss-source-picker,.oss-search { max-width: none; min-width: 100%; }
  .oss-search { order: 3; }
  .oss-explorer-body { grid-template-columns: 1fr; }
  .oss-tree { display: flex; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .oss-tree h2,.oss-tree-note { display: none; }.oss-tree button { width: auto; white-space: nowrap; }
  .storage-maintenance-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .site-nav { display: none; }
  .section { padding: 80px 0; }
  .admin-sidebar { display: none; }
}
