/* ==========================================================================
 * MarytOpens · main.css
 * 全局设计系统 / 深浅双主题 / 响应式（Mobile · Tablet · Desktop）
 * ========================================================================== */

/* ------------------------------- 1. 设计令牌 ------------------------------ */
:root {
  --accent: #6366f1;
  --accent-rgb: 99, 102, 241;
  --accent-hover: #4f46e5;
  --accent-soft: rgba(99, 102, 241, .12);
  --accent-ring: rgba(99, 102, 241, .35);

  --ok: #16a34a;
  --ok-soft: rgba(22, 163, 74, .12);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, .12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, .12);
  --info: #0284c7;
  --info-soft: rgba(2, 132, 199, .12);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 999px;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px;
  --fs-md: 15px; --fs-lg: 17px; --fs-xl: 20px;
  --fs-2xl: 26px; --fs-3xl: 34px; --fs-4xl: 44px;

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

  --nav-h: 60px;
  --side-w: 248px;
  --side-w-collapsed: 66px;
  --maxw: 1320px;

  --dur: .18s;
  --ease: cubic-bezier(.4, 0, .2, 1);

  --z-sticky: 100;
  --z-side: 200;
  --z-nav: 300;
  --z-drawer: 400;
  --z-modal: 500;
  --z-toast: 600;
}

/* 浅色主题（默认） */
:root, [data-theme="light"] {
  --bg: #f6f7fb;
  --bg-alt: #eef0f7;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --surface-3: #f2f4f9;
  --surface-hover: #f0f2f8;
  --overlay: rgba(15, 23, 42, .45);

  --text: #10131a;
  --text-2: #414a5c;
  --text-3: #6b7488;
  --text-4: #98a1b3;
  --text-inv: #ffffff;

  --border: #e3e7ef;
  --border-2: #d3d9e6;
  --border-strong: #b9c1d4;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 4px 14px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
  --shadow-xl: 0 24px 56px rgba(16, 24, 40, .16);

  --code-bg: #f4f6fa;
  --mark: #fff3bf;
  color-scheme: light;
}

/* 深色主题 */
[data-theme="dark"] {
  --bg: #0c0f16;
  --bg-alt: #10141d;
  --surface: #151a24;
  --surface-2: #1a2029;
  --surface-3: #202735;
  --surface-hover: #212836;
  --overlay: rgba(0, 0, 0, .62);

  --text: #eef1f7;
  --text-2: #c2c9d6;
  --text-3: #929cb0;
  --text-4: #6d7688;
  --text-inv: #0c0f16;

  --border: #262d3b;
  --border-2: #313a4c;
  --border-strong: #43506a;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
  --shadow: 0 6px 18px rgba(0, 0, 0, .5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .58);
  --shadow-xl: 0 28px 64px rgba(0, 0, 0, .66);

  --accent-soft: rgba(99, 102, 241, .2);
  --ok-soft: rgba(22, 163, 74, .18);
  --warn-soft: rgba(217, 119, 6, .18);
  --danger-soft: rgba(220, 38, 38, .18);
  --info-soft: rgba(2, 132, 199, .18);

  --code-bg: #11161f;
  --mark: #4d4113;
  color-scheme: dark;
}

/* ------------------------------- 2. 基础重置 ------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; font-weight: 650; line-height: 1.3; letter-spacing: -.01em; }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--accent-hover); }

img, svg, video, canvas { max-width: 100%; display: block; }
hr { border: none; border-top: 1px solid var(--border); margin: var(--sp-6) 0; }

code, kbd, pre, samp { font-family: var(--font-mono); font-size: .92em; }
code { background: var(--code-bg); padding: .12em .4em; border-radius: var(--radius-xs); }
pre {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-4); overflow: auto; line-height: 1.6;
}
pre code { background: none; padding: 0; }
mark { background: var(--mark); color: inherit; padding: 0 .2em; border-radius: 3px; }
blockquote {
  margin: 0 0 1em; padding: var(--sp-2) var(--sp-4);
  border-left: 3px solid var(--accent); background: var(--surface-2);
  color: var(--text-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

::selection { background: var(--accent-ring); color: var(--text); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: var(--radius-full); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); background-clip: content-box; }

/* ------------------------------- 3. 布局工具 ------------------------------ */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-5); }
.container-narrow { max-width: 860px; }
.container-mid { max-width: 1060px; }

.row { display: flex; gap: var(--sp-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.row-center { display: flex; align-items: center; gap: var(--sp-2); }
.col { display: flex; flex-direction: column; gap: var(--sp-3); }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { flex: 1 1 auto; }

.grid { display: grid; gap: var(--sp-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.text-right  { text-align: right; }
.muted  { color: var(--text-3); }
.muted2 { color: var(--text-4); }
.small  { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.bold   { font-weight: 650; }
.mono   { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mt-0{margin-top:0}.mt-2{margin-top:var(--sp-2)}.mt-3{margin-top:var(--sp-3)}
.mt-4{margin-top:var(--sp-4)}.mt-6{margin-top:var(--sp-6)}.mt-8{margin-top:var(--sp-8)}
.mb-0{margin-bottom:0}.mb-2{margin-bottom:var(--sp-2)}.mb-3{margin-bottom:var(--sp-3)}
.mb-4{margin-bottom:var(--sp-4)}.mb-6{margin-bottom:var(--sp-6)}

/* ------------------------------- 4. 按钮 --------------------------------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-bd: var(--border-2);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: 38px; padding: 0 var(--sp-4);
  font-family: inherit; font-size: var(--fs-base); font-weight: 560; line-height: 1;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid var(--btn-bd); border-radius: var(--radius-sm);
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-loading { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn-primary { --btn-bg: var(--accent); --btn-fg: #fff; --btn-bd: transparent; box-shadow: 0 1px 2px rgba(var(--accent-rgb), .3); }
.btn-primary:hover { --btn-bg: var(--accent-hover); --btn-bd: transparent; box-shadow: 0 4px 12px rgba(var(--accent-rgb), .34); }

.btn-danger  { --btn-bg: var(--danger); --btn-fg: #fff; --btn-bd: transparent; }
.btn-danger:hover  { --btn-bg: #b91c1c; --btn-bd: transparent; }
.btn-success { --btn-bg: var(--ok); --btn-fg: #fff; --btn-bd: transparent; }
.btn-success:hover { --btn-bg: #15803d; --btn-bd: transparent; }
.btn-warn    { --btn-bg: var(--warn); --btn-fg: #fff; --btn-bd: transparent; }

.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; }
.btn-ghost:hover { --btn-bg: var(--surface-hover); --btn-bd: transparent; }

.btn-soft { --btn-bg: var(--accent-soft); --btn-fg: var(--accent); --btn-bd: transparent; }
.btn-soft:hover { --btn-bg: rgba(var(--accent-rgb), .2); --btn-bd: transparent; }

.btn-outline { --btn-bg: transparent; --btn-fg: var(--accent); --btn-bd: var(--accent); }
.btn-outline:hover { --btn-bg: var(--accent-soft); }

.btn-sm { height: 30px; padding: 0 var(--sp-3); font-size: var(--fs-sm); border-radius: var(--radius-xs); }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: 46px; padding: 0 var(--sp-6); font-size: var(--fs-md); border-radius: var(--radius); }
.btn-xl { height: 52px; padding: 0 var(--sp-8); font-size: var(--fs-lg); border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-round { border-radius: var(--radius-full); }

.btn.is-loading::after {
  content: ''; width: 14px; height: 14px; margin-left: 2px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); z-index: 1; }

/* OAuth 按钮 */
.btn-oauth { height: 42px; gap: var(--sp-3); font-weight: 560; }
.btn-github  { --btn-bg: #24292f; --btn-fg: #fff; --btn-bd: transparent; }
.btn-github:hover  { --btn-bg: #32383f; --btn-bd: transparent; }
.btn-discord { --btn-bg: #5865f2; --btn-fg: #fff; --btn-bd: transparent; }
.btn-discord:hover { --btn-bg: #4752c4; --btn-bd: transparent; }
.btn-telegram { --btn-bg: #229ed9; --btn-fg: #fff; --btn-bd: transparent; }
.btn-telegram:hover { --btn-bg: #1e8fc4; --btn-bd: transparent; }

/* ------------------------------- 5. 表单 --------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-4); }
.field:last-child { margin-bottom: 0; }
.label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.label .req { color: var(--danger); margin-left: 2px; }
.hint { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.5; }
.error-text { font-size: var(--fs-xs); color: var(--danger); }

.input, .textarea, .select {
  width: 100%; font-family: inherit; font-size: var(--fs-base); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.input, .select { height: 40px; padding: 0 var(--sp-3); }
.textarea { padding: var(--sp-3); min-height: 110px; resize: vertical; line-height: 1.65; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--border-strong); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:disabled, .textarea:disabled, .select:disabled { background: var(--surface-3); color: var(--text-3); cursor: not-allowed; }
.input.is-error, .textarea.is-error { border-color: var(--danger); }
.input-sm { height: 32px; font-size: var(--fs-sm); }

.select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236b7488'%3E%3Cpath d='M4.5 6.5L8 10l3.5-3.5' stroke='%236b7488' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}

.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; height: 40px; margin-left: -1px; }

.input-icon { position: relative; }
.input-icon .input { padding-left: 38px; }
.input-icon > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-4); pointer-events: none; }

.check { display: inline-flex; align-items: flex-start; gap: var(--sp-2); cursor: pointer; font-size: var(--fs-base); line-height: 1.5; }
.check input[type=checkbox], .check input[type=radio] {
  appearance: none; width: 17px; height: 17px; flex: none; margin-top: 2px;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  border-radius: 5px; cursor: pointer; position: relative;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.check input[type=radio] { border-radius: 50%; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input[type=checkbox]:checked::after {
  content: ''; position: absolute; left: 5px; top: 1.5px; width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.check input[type=radio]:checked::after {
  content: ''; position: absolute; inset: 3.5px; background: #fff; border-radius: 50%;
}
.check input:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: var(--border-strong);
  border-radius: var(--radius-full); cursor: pointer; transition: background var(--dur) var(--ease);
}
.switch .track::before {
  content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease);
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::before { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-ring); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.switch-row:last-child { border-bottom: none; }
.switch-row .sr-title { font-weight: 560; }
.switch-row .sr-desc { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }

/* ------------------------------- 6. 卡片 / 面板 --------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-xs);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card-pad { padding: var(--sp-5); }
.card-hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border);
}
.card-head h3, .card-head h2 { margin: 0; font-size: var(--fs-md); font-weight: 650; }
.card-body { padding: var(--sp-5); }
.card-foot { padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4); }

.section-title {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-4); margin: 0 0 var(--sp-3);
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.stat-card { padding: var(--sp-4) var(--sp-5); }
.stat-card .sc-label { font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.stat-card .sc-value { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.2; margin-top: 4px; letter-spacing: -.02em; }
.stat-card .sc-delta { font-size: var(--fs-xs); margin-top: 2px; }
.stat-card .sc-delta.up { color: var(--ok); }
.stat-card .sc-delta.down { color: var(--danger); }

/* ------------------------------- 7. 徽章 / 标签 --------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 8px; font-size: var(--fs-xs); font-weight: 620; line-height: 1;
  border-radius: var(--radius-full); background: var(--surface-3); color: var(--text-2);
  border: 1px solid transparent; white-space: nowrap;
}
.badge-accent  { background: var(--accent-soft);  color: var(--accent); }
.badge-ok      { background: var(--ok-soft);      color: var(--ok); }
.badge-warn    { background: var(--warn-soft);    color: var(--warn); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-info    { background: var(--info-soft);    color: var(--info); }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-lg { height: 24px; padding: 0 10px; font-size: var(--fs-sm); }

.role-tag {
  display: inline-flex; align-items: center; gap: 4px; height: 19px; padding: 0 7px;
  font-size: 11px; font-weight: 650; border-radius: var(--radius-xs);
  border: 1px solid currentColor; opacity: .95;
}
.role-tag::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  font-size: var(--fs-xs); color: var(--text-2); background: var(--surface-3);
  border-radius: var(--radius-xs); transition: all var(--dur) var(--ease);
}
a.tag:hover { background: var(--accent-soft); color: var(--accent); }
.tag-close { margin-left: 4px; cursor: pointer; opacity: .6; }
.tag-close:hover { opacity: 1; color: var(--danger); }

/* ------------------------------- 8. 头像 --------------------------------- */
.avatar {
  --size: 36px;
  width: var(--size); height: var(--size); flex: none; border-radius: 50%;
  object-fit: cover; background: var(--surface-3);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 650; color: #fff; font-size: calc(var(--size) * .4);
  text-transform: uppercase; overflow: hidden; user-select: none;
  border: 1px solid var(--border);
}
.avatar-xs { --size: 22px; } .avatar-sm { --size: 28px; }
.avatar-lg { --size: 48px; } .avatar-xl { --size: 72px; } .avatar-2xl { --size: 108px; }
.avatar-sq { border-radius: var(--radius-sm); }
.avatar-ring { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

.presence { position: relative; display: inline-flex; }
.presence::after {
  content: ''; position: absolute; right: 0; bottom: 0; width: 10px; height: 10px;
  border-radius: 50%; border: 2px solid var(--surface); background: var(--text-4);
}
.presence.online::after  { background: #22c55e; }
.presence.idle::after    { background: #eab308; }
.presence.dnd::after     { background: #ef4444; }

/* ------------------------------- 9. 顶部导航 ------------------------------ */
.navbar {
  position: sticky; top: 0; z-index: var(--z-nav);
  height: var(--nav-h); display: flex; align-items: center;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
@supports not (backdrop-filter: blur(1px)) { .navbar { background: var(--surface); } }

.navbar .container { display: flex; align-items: center; gap: var(--sp-3); height: 100%; max-width: none; }

.brand { display: flex; align-items: center; gap: var(--sp-2); font-weight: 700; font-size: var(--fs-lg); color: var(--text); letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand img, .brand svg { width: 28px; height: 28px; border-radius: var(--radius-xs); }
.brand-sub { font-size: var(--fs-xs); color: var(--text-4); font-weight: 500; margin-left: 2px; }

.nav-links { display: flex; align-items: center; gap: 2px; margin-left: var(--sp-4); }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 var(--sp-3);
  font-size: var(--fs-base); font-weight: 540; color: var(--text-2);
  border-radius: var(--radius-sm); transition: all var(--dur) var(--ease);
}
.nav-link:hover { background: var(--surface-hover); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 620; }
.nav-link svg { width: 16px; height: 16px; }

.nav-search { position: relative; max-width: 300px; flex: 1 1 200px; margin-left: var(--sp-3); }
.nav-search .input { height: 34px; background: var(--surface-3); border-color: transparent; padding-left: 34px; }
.nav-search .input:focus { background: var(--surface); border-color: var(--accent); }
.nav-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-4); }

.nav-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }

.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: none; background: transparent; color: var(--text-2);
  border-radius: var(--radius-sm); cursor: pointer; transition: all var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute; top: 5px; right: 5px; min-width: 15px; height: 15px; padding: 0 4px;
  font-size: 10px; font-weight: 700; line-height: 15px; text-align: center;
  color: #fff; background: var(--danger); border-radius: var(--radius-full);
  border: 2px solid var(--surface); box-sizing: content-box;
}

.menu-toggle { display: none; }

/* 下拉菜单 */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 216px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; z-index: var(--z-modal);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
  max-height: 78vh; overflow-y: auto;
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu.left { right: auto; left: 0; }
.dropdown-item {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%;
  padding: 8px 10px; font-size: var(--fs-base); color: var(--text-2); text-align: left;
  background: none; border: none; border-radius: var(--radius-xs); cursor: pointer;
  font-family: inherit; transition: all var(--dur) var(--ease);
}
.dropdown-item:hover { background: var(--surface-hover); color: var(--text); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-soft); }
.dropdown-item.active { background: var(--accent-soft); color: var(--accent); }
.dropdown-item svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.dropdown-sep { height: 1px; background: var(--border); margin: 5px 2px; }
.dropdown-head { padding: 8px 10px 6px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-4); }
.dropdown-user { padding: 10px; display: flex; gap: var(--sp-3); align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 5px; }

/* ------------------------------- 10. 侧边栏 ------------------------------- */
.layout { display: flex; align-items: flex-start; gap: var(--sp-5); max-width: var(--maxw); margin: 0 auto; padding: var(--sp-5); }
.layout-full { max-width: none; }

.sidebar {
  position: sticky; top: calc(var(--nav-h) + var(--sp-5));
  width: var(--side-w); flex: none; max-height: calc(100vh - var(--nav-h) - var(--sp-8));
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: var(--sp-5);
  padding-bottom: var(--sp-4);
}
.sidebar::-webkit-scrollbar { width: 6px; }

.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-group .section-title { margin-bottom: 6px; padding: 0 10px; }
.side-item {
  display: flex; align-items: center; gap: var(--sp-3); padding: 8px 10px;
  font-size: var(--fs-base); font-weight: 540; color: var(--text-2);
  border-radius: var(--radius-sm); cursor: pointer; transition: all var(--dur) var(--ease);
  border: none; background: none; font-family: inherit; width: 100%; text-align: left;
}
.side-item:hover { background: var(--surface-hover); color: var(--text); }
.side-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 620; }
.side-item svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.side-item .count { margin-left: auto; font-size: var(--fs-xs); color: var(--text-4); font-weight: 600; }
.side-item.active .count { color: var(--accent); }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-5); }
.aside {
  position: sticky; top: calc(var(--nav-h) + var(--sp-5));
  width: 288px; flex: none; display: flex; flex-direction: column; gap: var(--sp-4);
  max-height: calc(100vh - var(--nav-h) - var(--sp-8)); overflow-y: auto;
}

/* 移动端抽屉 */
.drawer-backdrop {
  position: fixed; inset: 0; background: var(--overlay); z-index: var(--z-drawer);
  opacity: 0; visibility: hidden; transition: opacity var(--dur) var(--ease), visibility var(--dur);
  backdrop-filter: blur(2px);
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }

/* ------------------------------- 11. 帖子 / 内容流 ------------------------ */
.post-list { display: flex; flex-direction: column; gap: var(--sp-3); }

.post-card { display: flex; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); }
.post-card .pc-main { flex: 1 1 auto; min-width: 0; }
.post-card .pc-title {
  font-size: var(--fs-lg); font-weight: 650; color: var(--text); margin: 0 0 5px;
  line-height: 1.4; letter-spacing: -.01em;
}
.post-card .pc-title a { color: inherit; }
.post-card .pc-title a:hover { color: var(--accent); }
.post-card .pc-excerpt { font-size: var(--fs-base); color: var(--text-3); line-height: 1.6; margin: 0 0 var(--sp-3); }
.post-card .pc-meta { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-3); }
.post-card .pc-meta .author { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-2); }
.post-card .pc-cover { width: 132px; height: 88px; flex: none; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-3); }
.post-card .pc-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--sp-2); }

.pc-stats { display: flex; gap: var(--sp-4); font-size: var(--fs-xs); color: var(--text-3); }
.pc-stats span { display: inline-flex; align-items: center; gap: 4px; }
.pc-stats svg { width: 14px; height: 14px; opacity: .75; }

.post-article { padding: var(--sp-8); }
.post-article .pa-title { font-size: var(--fs-3xl); line-height: 1.25; margin-bottom: var(--sp-4); }
.post-article .pa-meta { display: flex; align-items: center; gap: var(--sp-4); padding-bottom: var(--sp-5); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-6); flex-wrap: wrap; }

.prose { font-size: var(--fs-md); line-height: 1.8; color: var(--text-2); word-wrap: break-word; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text); margin: 1.6em 0 .6em; }
.prose h1 { font-size: 1.7em; } .prose h2 { font-size: 1.42em; padding-bottom: .3em; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: 1.22em; } .prose h4 { font-size: 1.08em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.5em; margin: 0 0 1em; }
.prose li { margin: .3em 0; }
.prose img { border-radius: var(--radius); margin: 1.2em 0; border: 1px solid var(--border); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: var(--fs-base); }
.prose th, .prose td { padding: 9px 12px; border: 1px solid var(--border); text-align: left; }
.prose th { background: var(--surface-2); font-weight: 650; color: var(--text); }
.prose pre { margin: 1.2em 0; }
.prose a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }

.post-actions { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-4) 0; border-top: 1px solid var(--border); margin-top: var(--sp-6); flex-wrap: wrap; }
.act-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 var(--sp-3);
  font-size: var(--fs-sm); font-weight: 560; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-full); cursor: pointer;
  font-family: inherit; transition: all var(--dur) var(--ease);
}
.act-btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.act-btn svg { width: 16px; height: 16px; }
.act-btn.on { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.act-btn.on.like { color: #e11d48; background: rgba(225, 29, 72, .12); }
.act-btn.on.fav  { color: #d97706; background: var(--warn-soft); }

.visibility-chip { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 620; padding: 2px 8px; border-radius: var(--radius-full); }
.vis-public   { background: var(--ok-soft); color: var(--ok); }
.vis-private  { background: var(--danger-soft); color: var(--danger); }
.vis-role     { background: var(--info-soft); color: var(--info); }
.vis-unlisted { background: var(--warn-soft); color: var(--warn); }
.vis-draft    { background: var(--surface-3); color: var(--text-3); }

/* ------------------------------- 12. 评论 -------------------------------- */
.comment-list { display: flex; flex-direction: column; gap: var(--sp-4); }
.comment { display: flex; gap: var(--sp-3); }
.comment .cm-body { flex: 1 1 auto; min-width: 0; }
.comment .cm-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: 3px; }
.comment .cm-name { font-weight: 650; font-size: var(--fs-base); color: var(--text); }
.comment .cm-time { font-size: var(--fs-xs); color: var(--text-4); }
.comment .cm-text { font-size: var(--fs-base); line-height: 1.7; color: var(--text-2); word-wrap: break-word; }
.comment .cm-actions { display: flex; gap: var(--sp-3); margin-top: 5px; font-size: var(--fs-xs); }
.comment .cm-actions button { background: none; border: none; padding: 0; color: var(--text-3); cursor: pointer; font-family: inherit; font-size: inherit; font-weight: 560; }
.comment .cm-actions button:hover { color: var(--accent); }
.comment .cm-actions button.danger:hover { color: var(--danger); }
.comment.reply { margin-left: 42px; padding-left: var(--sp-3); border-left: 2px solid var(--border); }

.comment-editor { display: flex; gap: var(--sp-3); }
.comment-editor .textarea { min-height: 76px; }

/* ------------------------------- 13. 弹窗 / 抽屉 -------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center; padding: var(--sp-4);
  background: var(--overlay); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity var(--dur) var(--ease), visibility var(--dur);
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 520px; max-height: 88vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  transform: translateY(14px) scale(.97); transition: transform .22s var(--ease);
}
.modal-backdrop.open .modal { transform: none; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 1020px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: var(--fs-lg); }
.modal-body { padding: var(--sp-5); overflow-y: auto; flex: 1 1 auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ------------------------------- 14. Toast ------------------------------- */
.toast-wrap {
  position: fixed; top: calc(var(--nav-h) + 12px); right: 16px; z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--sp-2); pointer-events: none; max-width: 380px;
}
.toast {
  display: flex; align-items: flex-start; gap: var(--sp-3); padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); pointer-events: auto;
  font-size: var(--fs-base); animation: toastIn .26s var(--ease);
}
.toast.out { animation: toastOut .2s var(--ease) forwards; }
.toast.success { border-left-color: var(--ok); }
.toast.error   { border-left-color: var(--danger); }
.toast.warn    { border-left-color: var(--warn); }
.toast .t-icon { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.toast.success .t-icon { color: var(--ok); }
.toast.error   .t-icon { color: var(--danger); }
.toast.warn    .t-icon { color: var(--warn); }
.toast .t-body { flex: 1 1 auto; min-width: 0; }
.toast .t-title { font-weight: 650; margin-bottom: 1px; }
.toast .t-desc { font-size: var(--fs-sm); color: var(--text-3); line-height: 1.5; }
.toast .t-close { background: none; border: none; color: var(--text-4); cursor: pointer; padding: 0; line-height: 1; font-size: 18px; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(24px); } }
@keyframes toastOut { to   { opacity: 0; transform: translateX(24px); } }

/* ------------------------------- 15. 表格 -------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.table th {
  padding: 10px var(--sp-4); text-align: left; font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--text-4);
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 11px var(--sp-4); border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table .td-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-compact td, .table-compact th { padding: 7px var(--sp-3); }

/* ------------------------------- 16. Tabs -------------------------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px var(--sp-4); font-size: var(--fs-base); font-weight: 560; color: var(--text-3);
  background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer;
  font-family: inherit; white-space: nowrap; transition: all var(--dur) var(--ease); margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
.tab .cnt { margin-left: 6px; font-size: var(--fs-xs); background: var(--surface-3); padding: 1px 6px; border-radius: var(--radius-full); }
.tab-panel { display: none; padding-top: var(--sp-5); }
.tab-panel.active { display: block; animation: fadeUp .22s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }

.pill-tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: var(--radius-sm); }
.pill-tab {
  padding: 6px var(--sp-3); font-size: var(--fs-sm); font-weight: 560; color: var(--text-3);
  background: none; border: none; border-radius: var(--radius-xs); cursor: pointer; font-family: inherit;
  transition: all var(--dur) var(--ease); white-space: nowrap;
}
.pill-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); font-weight: 650; }

/* ------------------------------- 17. 状态 / 骨架 -------------------------- */
.empty { text-align: center; padding: var(--sp-12) var(--sp-5); color: var(--text-3); }
.empty svg { width: 52px; height: 52px; margin: 0 auto var(--sp-4); opacity: .28; }
.empty h4 { color: var(--text-2); margin-bottom: 6px; font-size: var(--fs-md); }
.empty p { font-size: var(--fs-sm); max-width: 380px; margin: 0 auto; }

.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-hover) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius-xs); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sk-line { height: 12px; margin-bottom: 8px; }
.sk-line.w60 { width: 60%; } .sk-line.w40 { width: 40%; } .sk-line.w80 { width: 80%; }
.sk-card { height: 96px; border-radius: var(--radius); margin-bottom: var(--sp-3); }

.spinner { width: 22px; height: 22px; border: 2.5px solid var(--border-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.spinner-lg { width: 34px; height: 34px; border-width: 3px; }
.loading-center { display: flex; align-items: center; justify-content: center; padding: var(--sp-10); }

.progress { height: 6px; background: var(--surface-3); border-radius: var(--radius-full); overflow: hidden; }
.progress .bar { height: 100%; background: var(--accent); border-radius: var(--radius-full); transition: width .3s var(--ease); }

/* ------------------------------- 18. 登录页 ------------------------------- */
.auth-page { min-height: 100vh; display: flex; position: relative; overflow: hidden; }
.auth-bg { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: 0; }
.auth-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(10, 14, 24, .72), rgba(30, 20, 60, .58)); }
.auth-bg.gradient { background: radial-gradient(1200px 700px at 15% 10%, #4f46e5 0%, transparent 55%), radial-gradient(900px 600px at 85% 85%, #0ea5e9 0%, transparent 55%), linear-gradient(135deg, #0f1220, #191b34 55%, #0b1020); }
.auth-bg.gradient::after { background: rgba(0, 0, 0, .18); }

.auth-side { flex: 1 1 55%; position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; padding: var(--sp-12); color: #fff; }
.auth-side h1 { font-size: var(--fs-4xl); line-height: 1.15; margin-bottom: var(--sp-4); text-shadow: 0 2px 20px rgba(0, 0, 0, .3); }
.auth-side p { font-size: var(--fs-lg); opacity: .88; max-width: 520px; }
.auth-side .feat { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-8); }
.auth-side .feat div { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-md); opacity: .9; }
.auth-side .feat svg { width: 19px; height: 19px; flex: none; }

.auth-panel {
  flex: 0 0 470px; position: relative; z-index: 1; display: flex; align-items: center; justify-content: center;
  padding: var(--sp-8) var(--sp-6); background: var(--surface); box-shadow: -20px 0 60px rgba(0, 0, 0, .18);
  overflow-y: auto;
}
.auth-box { width: 100%; max-width: 366px; }
.auth-box .a-logo { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-6); font-weight: 700; font-size: var(--fs-xl); }
.auth-box .a-logo img, .auth-box .a-logo svg { width: 32px; height: 32px; }
.auth-box h2 { font-size: var(--fs-2xl); margin-bottom: 6px; }
.auth-box .a-sub { color: var(--text-3); font-size: var(--fs-base); margin-bottom: var(--sp-6); }
.auth-sep { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-5) 0; color: var(--text-4); font-size: var(--fs-xs); }
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-foot { margin-top: var(--sp-6); text-align: center; font-size: var(--fs-sm); color: var(--text-3); }

.cf-turnstile { display: flex; justify-content: center; margin: var(--sp-4) 0; min-height: 4px; }

.pwd-meter { display: flex; gap: 4px; margin-top: 6px; }
.pwd-meter i { flex: 1; height: 3px; border-radius: 2px; background: var(--border-2); transition: background var(--dur) var(--ease); }
.pwd-meter.s1 i:nth-child(1) { background: var(--danger); }
.pwd-meter.s2 i:nth-child(-n+2) { background: var(--warn); }
.pwd-meter.s3 i:nth-child(-n+3) { background: #eab308; }
.pwd-meter.s4 i { background: var(--ok); }

/* ------------------------------- 19. 个人主页（Landing） ------------------ */
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.landing-nav { position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-nav); height: var(--nav-h); display: flex; align-items: center; transition: all .25s var(--ease); }
.landing-nav.solid { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.landing-nav .container { display: flex; align-items: center; gap: var(--sp-3); }

.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding: var(--nav-h) 0 var(--sp-12); overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: 0; background: radial-gradient(900px 620px at 12% 18%, rgba(var(--accent-rgb), .18), transparent 60%), radial-gradient(760px 520px at 88% 78%, rgba(14, 165, 233, .16), transparent 60%); }
.hero-grid-lines { position: absolute; inset: 0; z-index: 0; opacity: .4;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 75%); }
.hero .container { position: relative; z-index: 1; }
.hero-inner { display: grid; grid-template-columns: 1.25fr .85fr; gap: var(--sp-12); align-items: center; }
.hero h1 { font-size: clamp(34px, 5.2vw, 62px); line-height: 1.08; letter-spacing: -.03em; margin-bottom: var(--sp-4); }
.hero .accent-text { background: linear-gradient(96deg, var(--accent), #0ea5e9 65%, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .tagline { font-size: clamp(15px, 1.6vw, 20px); color: var(--text-2); max-width: 620px; margin-bottom: var(--sp-6); line-height: 1.65; }
.hero-cta { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-8); }
.hero-avatar { width: 100%; max-width: 320px; aspect-ratio: 1; border-radius: var(--radius-xl); object-fit: cover; box-shadow: var(--shadow-xl); border: 1px solid var(--border); margin-left: auto; }
.hero-avatar-fallback { display: flex; align-items: center; justify-content: center; font-size: 110px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), #0ea5e9); }

.chip-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 13px;
  font-size: var(--fs-sm); font-weight: 560; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-full);
  transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.section { padding: var(--sp-12) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 620px; margin: 0 auto var(--sp-8); }
.section-head .eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--sp-2); }
.section-head h2 { font-size: clamp(24px, 3vw, 36px); letter-spacing: -.02em; }
.section-head p { color: var(--text-3); font-size: var(--fs-md); }

.feature-card { padding: var(--sp-5); height: 100%; }
.feature-card .fc-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); margin-bottom: var(--sp-3); }
.feature-card .fc-icon svg { width: 20px; height: 20px; }
.feature-card h4 { margin-bottom: 5px; font-size: var(--fs-md); }
.feature-card p { color: var(--text-3); font-size: var(--fs-sm); margin: 0; line-height: 1.65; }

.project-card { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-5); height: 100%; }
.project-card h4 { margin: 0; display: flex; align-items: center; gap: 6px; }
.project-card p { color: var(--text-3); font-size: var(--fs-sm); margin: 0; flex: 1; }

/* ------------------------------- 20. 页脚 -------------------------------- */
.footer { margin-top: auto; background: var(--surface); border-top: 1px solid var(--border); padding: var(--sp-10) 0 var(--sp-6); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--sp-8); margin-bottom: var(--sp-8); }
.footer-brand .brand { margin-bottom: var(--sp-3); }
.footer-brand p { color: var(--text-3); font-size: var(--fs-sm); max-width: 330px; }
.footer h5 { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-4); margin-bottom: var(--sp-3); }
.footer-links { display: flex; flex-direction: column; gap: 9px; }
.footer-links a { font-size: var(--fs-sm); color: var(--text-3); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { padding-top: var(--sp-5); border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.footer-legal { font-size: var(--fs-xs); color: var(--text-4); line-height: 1.9; white-space: pre-line; }
.footer-social { display: flex; gap: var(--sp-2); }

/* ------------------------------- 21. 私信 / 聊天 -------------------------- */
.dm-layout { display: grid; grid-template-columns: 300px 1fr; gap: 0; height: calc(100vh - var(--nav-h) - var(--sp-10)); min-height: 520px; overflow: hidden; }
.dm-threads { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; }
.dm-threads-head { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); }
.dm-threads-list { flex: 1; overflow-y: auto; }
.dm-thread { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); cursor: pointer; border-bottom: 1px solid var(--border); transition: background var(--dur) var(--ease); }
.dm-thread:hover { background: var(--surface-hover); }
.dm-thread.active { background: var(--accent-soft); }
.dm-thread .dt-main { flex: 1; min-width: 0; }
.dm-thread .dt-name { font-weight: 620; font-size: var(--fs-base); display: flex; justify-content: space-between; gap: 6px; }
.dm-thread .dt-time { font-size: 11px; color: var(--text-4); font-weight: 400; flex: none; }
.dm-thread .dt-last { font-size: var(--fs-sm); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-thread .dt-unread { min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; color: #fff; background: var(--danger); border-radius: var(--radius-full); }

.dm-main { display: flex; flex-direction: column; min-width: 0; }
.dm-head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--border); flex: none; }
.dm-body { flex: 1; overflow-y: auto; padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
.dm-foot { flex: none; padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); display: flex; gap: var(--sp-2); align-items: flex-end; }
.dm-foot .textarea { min-height: 42px; max-height: 140px; }

.bubble { max-width: 72%; display: flex; flex-direction: column; gap: 3px; }
.bubble.me { align-self: flex-end; align-items: flex-end; }
.bubble .bb-text { padding: 9px 13px; border-radius: var(--radius-lg); font-size: var(--fs-base); line-height: 1.6; background: var(--surface-3); color: var(--text); word-wrap: break-word; white-space: pre-wrap; }
.bubble.me .bb-text { background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.bubble:not(.me) .bb-text { border-bottom-left-radius: 5px; }
.bubble .bb-time { font-size: 11px; color: var(--text-4); padding: 0 4px; }
.dm-date-sep { text-align: center; font-size: var(--fs-xs); color: var(--text-4); margin: var(--sp-2) 0; }

/* ------------------------------- 22. 频道 / 群组 -------------------------- */
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: var(--sp-4); }
.channel-card { display: flex; flex-direction: column; overflow: hidden; height: 100%; }
.channel-card .ch-banner { height: 76px; background: linear-gradient(120deg, var(--accent), #0ea5e9); position: relative; background-size: cover; background-position: center; }
.channel-card .ch-icon { position: absolute; left: var(--sp-4); bottom: -20px; width: 46px; height: 46px; border-radius: var(--radius); border: 3px solid var(--surface); background: var(--surface-3); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; color: var(--accent); overflow: hidden; }
.channel-card .ch-body { padding: 26px var(--sp-4) var(--sp-4); flex: 1; display: flex; flex-direction: column; gap: 6px; }
.channel-card .ch-name { font-weight: 650; font-size: var(--fs-md); margin: 0; }
.channel-card .ch-desc { font-size: var(--fs-sm); color: var(--text-3); flex: 1; margin: 0; }
.channel-card .ch-meta { display: flex; gap: var(--sp-3); font-size: var(--fs-xs); color: var(--text-4); }
.channel-card .ch-foot { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); display: flex; gap: var(--sp-2); }

.group-item { display: flex; align-items: center; gap: var(--sp-3); padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--dur) var(--ease); }
.group-item:hover { background: var(--surface-hover); }
.group-item.active { background: var(--accent-soft); color: var(--accent); }
.group-item .gi-hash { color: var(--text-4); font-weight: 700; font-size: var(--fs-md); }
.group-item .gi-name { font-weight: 560; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------- 23. 权限矩阵 ---------------------------- */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-2); }
.perm-item {
  display: flex; align-items: flex-start; gap: var(--sp-3); padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  cursor: pointer; transition: all var(--dur) var(--ease);
}
.perm-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.perm-item.checked { border-color: var(--accent); background: var(--accent-soft); }
.perm-item .pi-key { font-family: var(--font-mono); font-size: 11px; color: var(--text-4); }
.perm-item .pi-label { font-size: var(--fs-sm); font-weight: 560; }
.perm-item.locked { opacity: .5; pointer-events: none; }

.role-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.role-row .rr-color { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.role-row .rr-name { font-weight: 620; }
.role-row .rr-meta { font-size: var(--fs-xs); color: var(--text-4); }

/* ------------------------------- 24. 管理后台 ---------------------------- */
.admin-layout { display: grid; grid-template-columns: var(--side-w) 1fr; gap: 0; min-height: calc(100vh - var(--nav-h)); }
.admin-side { border-right: 1px solid var(--border); background: var(--surface); padding: var(--sp-4) var(--sp-3); position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); overflow-y: auto; }
.admin-main { padding: var(--sp-6); min-width: 0; background: var(--bg); }
.admin-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.admin-header h2 { margin: 0 0 3px; font-size: var(--fs-2xl); }
.admin-header p { margin: 0; color: var(--text-3); font-size: var(--fs-sm); }

.kv-list { display: flex; flex-direction: column; }
.kv-row { display: flex; align-items: center; gap: var(--sp-4); padding: 10px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.kv-row:last-child { border-bottom: none; }
.kv-row .kv-k { flex: 0 0 190px; color: var(--text-3); font-weight: 560; }
.kv-row .kv-v { flex: 1; min-width: 0; word-break: break-all; }

.log-line { display: flex; gap: var(--sp-3); padding: 6px 0; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: var(--fs-xs); }
.log-line .lg-time { color: var(--text-4); flex: none; }
.log-line .lg-method { font-weight: 700; flex: none; width: 52px; }
.log-line .lg-status { flex: none; width: 34px; font-weight: 700; }
.log-line .lg-status.s2 { color: var(--ok); } .log-line .lg-status.s3 { color: var(--info); }
.log-line .lg-status.s4 { color: var(--warn); } .log-line .lg-status.s5 { color: var(--danger); }
.log-line .lg-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.color-input { width: 40px; height: 40px; padding: 3px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }

.upload-zone {
  border: 2px dashed var(--border-2); border-radius: var(--radius); padding: var(--sp-6);
  text-align: center; cursor: pointer; transition: all var(--dur) var(--ease); background: var(--surface-2);
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone svg { width: 30px; height: 30px; color: var(--text-4); margin: 0 auto var(--sp-2); }
.upload-zone p { margin: 0; font-size: var(--fs-sm); color: var(--text-3); }

.crop-stage { position: relative; width: 100%; aspect-ratio: 1; max-width: 320px; margin: 0 auto; overflow: hidden; border-radius: var(--radius); background: var(--surface-3); touch-action: none; cursor: move; }
.crop-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crop-mask { position: absolute; inset: 0; pointer-events: none; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); border-radius: 50%; }

/* ------------------------------- 25. 通知 -------------------------------- */
.notif-item { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); transition: background var(--dur) var(--ease); }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--accent-soft); }
.notif-item .ni-icon { width: 32px; height: 32px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface-3); }
.notif-item .ni-icon svg { width: 16px; height: 16px; }
.notif-item .ni-body { flex: 1; min-width: 0; }
.notif-item .ni-title { font-weight: 600; font-size: var(--fs-base); }
.notif-item .ni-desc { font-size: var(--fs-sm); color: var(--text-3); }
.notif-item .ni-time { font-size: 11px; color: var(--text-4); margin-top: 2px; }

/* ------------------------------- 26. 底部功能栏（移动） -------------------- */
.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav);
  height: 56px; padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); border-top: 1px solid var(--border);
}
.tabbar-inner { display: flex; height: 56px; }
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10px; font-weight: 600; color: var(--text-3); position: relative;
}
.tabbar a.active { color: var(--accent); }
.tabbar a svg { width: 21px; height: 21px; }
.tabbar a .dot { position: absolute; top: 6px; right: 50%; margin-right: -18px; min-width: 14px; height: 14px; padding: 0 3px; font-size: 9px; line-height: 14px; text-align: center; color: #fff; background: var(--danger); border-radius: var(--radius-full); }

/* ------------------------------- 27. 杂项 -------------------------------- */
.divider-v { width: 1px; align-self: stretch; background: var(--border); margin: 0 var(--sp-2); }
.link-muted { color: var(--text-3); }
.link-muted:hover { color: var(--accent); }
.copy-box { display: flex; align-items: center; gap: var(--sp-2); padding: 9px 12px; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: var(--fs-xs); }
.copy-box code { flex: 1; background: none; padding: 0; overflow: auto; white-space: nowrap; }

.banner-tip { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm); font-size: var(--fs-sm); line-height: 1.6; }
.banner-tip svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.tip-info   { background: var(--info-soft); color: var(--info); }
.tip-warn   { background: var(--warn-soft); color: var(--warn); }
.tip-danger { background: var(--danger-soft); color: var(--danger); }
.tip-ok     { background: var(--ok-soft); color: var(--ok); }

.announcement-bar { background: linear-gradient(90deg, var(--accent), #0ea5e9); color: #fff; text-align: center; padding: 7px var(--sp-4); font-size: var(--fs-sm); font-weight: 560; }
.announcement-bar a { color: #fff; text-decoration: underline; }

.pagination { display: flex; justify-content: center; gap: var(--sp-2); padding: var(--sp-5) 0; }

.fab {
  position: fixed; right: 22px; bottom: 22px; z-index: var(--z-sticky);
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: #fff; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center; transition: all var(--dur) var(--ease);
}
.fab:hover { background: var(--accent-hover); transform: scale(1.06); }
.fab svg { width: 22px; height: 22px; }

/* 语言/主题快速切换 */
.seg { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: var(--radius-sm); gap: 2px; }
.seg button { border: none; background: none; padding: 5px 10px; font-size: var(--fs-sm); font-weight: 560; color: var(--text-3); border-radius: var(--radius-xs); cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 5px; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.seg button svg { width: 15px; height: 15px; }

/* ------------------------------- 28. 响应式 ------------------------------ */
@media (max-width: 1200px) {
  .aside { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 1024px) {
  :root { --side-w: 220px; }
  .hero-inner { grid-template-columns: 1fr; gap: var(--sp-8); }
  .hero-avatar { max-width: 220px; margin: 0; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-side { padding: var(--sp-8); }
  .auth-panel { flex: 0 0 420px; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side {
    position: fixed; top: 0; left: 0; bottom: 0; width: 268px; z-index: var(--z-drawer);
    height: 100vh; transform: translateX(-100%); transition: transform .24s var(--ease); box-shadow: var(--shadow-xl);
  }
  .admin-side.open { transform: none; }
  .admin-main { padding: var(--sp-4); }
}

@media (max-width: 860px) {
  :root { --nav-h: 54px; }
  .container { padding: 0 var(--sp-4); }
  .nav-links, .nav-search { display: none; }
  .menu-toggle { display: inline-flex; }
  .layout { padding: var(--sp-4); gap: var(--sp-4); }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 272px; max-height: none; height: 100vh;
    z-index: calc(var(--z-drawer) + 1); background: var(--surface); border-right: 1px solid var(--border);
    padding: var(--sp-4); transform: translateX(-100%); transition: transform .24s var(--ease);
    box-shadow: var(--shadow-xl); gap: var(--sp-4);
  }
  .sidebar.open { transform: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .tabbar { display: block; }
  body.has-tabbar { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .fab { bottom: calc(70px + env(safe-area-inset-bottom)); right: 16px; }
  .auth-page { flex-direction: column; }
  .auth-side { display: none; }
  .auth-panel { flex: 1 1 auto; box-shadow: none; padding: var(--sp-6) var(--sp-4); }
  .dm-layout { grid-template-columns: 1fr; height: calc(100vh - var(--nav-h) - 56px); }
  .dm-threads { display: none; border-right: none; }
  .dm-layout.show-threads .dm-threads { display: flex; }
  .dm-layout.show-threads .dm-main { display: none; }
  .post-card .pc-cover { width: 92px; height: 68px; }
  .post-article { padding: var(--sp-5) var(--sp-4); }
  .post-article .pa-title { font-size: var(--fs-2xl); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
  .kv-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .kv-row .kv-k { flex: none; }
  .toast-wrap { left: 12px; right: 12px; max-width: none; }
  .modal { max-height: 92vh; }
  .comment.reply { margin-left: 20px; }
  .hero { min-height: auto; padding: calc(var(--nav-h) + var(--sp-10)) 0 var(--sp-10); }
  .section { padding: var(--sp-10) 0; }
}

@media (max-width: 520px) {
  .container { padding: 0 var(--sp-3); }
  .post-card { flex-direction: column-reverse; gap: var(--sp-3); padding: var(--sp-4); }
  .post-card .pc-cover { width: 100%; height: 148px; }
  .footer-grid { grid-template-columns: 1fr; }
  .card-pad, .card-body { padding: var(--sp-4); }
  .modal-body, .modal-head, .modal-foot { padding: var(--sp-4); }
  .brand-sub { display: none; }
  .bubble { max-width: 86%; }
  .perm-grid { grid-template-columns: 1fr; }
  .hero-cta .btn { flex: 1 1 100%; }
}

/* 打印 */
@media print {
  .navbar, .sidebar, .aside, .tabbar, .footer, .post-actions, .fab { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: none; box-shadow: none; }
}

/* 无障碍：减少动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ================= 我的文件 / Cloudflare 绑定 ================= */
.py-6 { padding-top: var(--sp-6); padding-bottom: var(--sp-6); }
.page-head { margin-bottom: var(--sp-5); }
.page-head h1 { font-size: 28px; letter-spacing: -.02em; }
.page-head p { margin-top: 4px; }
.section-head-sm { font-weight: 700; font-size: var(--fs-md); margin-bottom: 12px; }

.drop-zone { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 34px 20px; text-align: center; cursor: pointer; transition: .2s var(--ease); background: var(--surface-2); }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dz-ico { color: var(--accent); display: flex; justify-content: center; margin-bottom: 8px; }
.dz-ico svg { width: 34px; height: 34px; }
.dz-text { font-weight: 600; }
.dz-hint { margin-top: 4px; }

.bind-card { display: flex; align-items: center; gap: 14px; }
.bind-card.ok { border-color: var(--ok-soft); }
.bc-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.bc-icon svg { width: 22px; height: 22px; }
.bc-body { flex: 1; min-width: 0; }
.bc-title { font-weight: 700; }
.bc-sub { font-size: var(--fs-sm); margin-top: 2px; }

.warn-banner { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: var(--radius-md); padding: 12px 14px; margin-top: 14px; font-size: var(--fs-sm); line-height: 1.6; }
.warn-banner svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }

.file-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 10px; background: var(--surface); }
.fr-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.fr-icon svg { width: 20px; height: 20px; }
.fr-body { flex: 1; min-width: 0; }
.fr-name { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fr-sub { font-size: var(--fs-sm); margin-top: 2px; }
.fr-link { display: flex; gap: 6px; margin-top: 8px; }
.fr-link .input { flex: 1; min-width: 0; }
.fr-actions { display: flex; gap: 4px; flex: 0 0 auto; }

/* ----------------------------- 搜索页 ----------------------------------- */
.search-box { position: relative; display: flex; align-items: center; }
.search-box .sb-ico { position: absolute; left: 14px; color: var(--text-3); display: flex; }
.search-box .sb-ico svg { width: 18px; height: 18px; }
.search-input { width: 100%; padding-left: 42px; height: 46px; font-size: var(--fs-md); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.search-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text); transition: all var(--dur) var(--ease);
}
.search-row:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.search-row .avatar { flex: 0 0 auto; }
.sr-body { flex: 1 1 auto; min-width: 0; }
.sr-title { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.sr-title svg { width: 14px; height: 14px; color: var(--text-3); }
.sr-sub { font-size: var(--fs-sm); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.search-row .tag { flex: 0 0 auto; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty-state svg { width: 40px; height: 40px; opacity: .5; margin-bottom: 10px; }
.empty-state p { margin: 0; font-size: var(--fs-sm); }
.loading-block { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 0; color: var(--text-3); font-size: var(--fs-sm); }

/* --------------------------- 贡献者 / 封禁公示 --------------------------- */
.contrib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.contrib-item { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); background: var(--surface); transition: all var(--dur) var(--ease); }
.contrib-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.contrib-item .avatar { flex: 0 0 auto; }
.ci-body { min-width: 0; }
.ci-name { font-weight: 600; }
.ci-note { margin-top: 4px; }
.ban-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ban-row:last-child { border-bottom: 0; }
.ban-avatar { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--text-3), var(--border-2)); filter: blur(3px); opacity: .7; }
.ban-ip { filter: none; display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--surface-2); color: var(--text-3); }
.ban-body { flex: 1 1 auto; min-width: 0; }
.ban-name { font-weight: 600; }
.ban-meta { flex: 0 0 auto; text-align: right; font-size: var(--fs-sm); color: var(--text-3); line-height: 1.5; }

/* ==========================================================================
   极客风 Geek（用户端开关，localStorage 记忆；自定义配色亦可经内联变量覆盖）
   ========================================================================== */
html.geek {
  --font-sans: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --accent: #39ff14;
  --accent-rgb: 57, 255, 20;
  --accent-hover: #2bd40f;
  --accent-soft: rgba(57, 255, 20, .14);
  --accent-ring: rgba(57, 255, 20, .4);
  --bg: #04060a;
  --bg-alt: #080c12;
  --text: #c8f7c5;
}
html.geek body {
  background-image:
    linear-gradient(rgba(57, 255, 20, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 255, 20, .025) 1px, transparent 1px);
  background-size: 28px 28px;
}
html.geek .card,
html.geek .surface,
html.geek .modal-box {
  border: 1px solid rgba(57, 255, 20, .18);
  box-shadow: 0 0 0 1px rgba(57, 255, 20, .05), 0 8px 30px rgba(0, 0, 0, .5);
}
html.geek a:hover { text-shadow: 0 0 8px rgba(57, 255, 20, .5); }

/* 主题面板（极客开关 + 自定义配色） */
.mo-theme-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono, monospace); font-weight: 700; font-size: 14px;
  color: #04060a; background: var(--accent, #39ff14);
  border: none; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  transition: transform .15s var(--ease, ease);
}
.mo-theme-fab:hover { transform: scale(1.08); }
.mo-theme-panel {
  position: fixed; right: 18px; bottom: 76px; z-index: 61;
  width: 280px; max-width: calc(100vw - 36px);
  background: var(--surface, #fff); color: var(--text, #1a1d24);
  border: 1px solid var(--border, #e3e6ef); border-radius: var(--radius, 14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  padding: 16px; font-size: 14px;
}
html.geek .mo-theme-panel { background: #0a0e14; color: #c8f7c5; border-color: rgba(57, 255, 20, .25); }
.mo-theme-panel[hidden] { display: none; }
.mo-theme-panel h4 { margin: 0 0 10px; font-size: 15px; }
.mo-theme-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0; }
.mo-theme-row label { color: var(--text-2, #555); }
html.geek .mo-theme-row label { color: #8fd98a; }
.mo-theme-row input[type="color"] { width: 42px; height: 28px; padding: 0; border: 1px solid var(--border, #e3e6ef); border-radius: 6px; background: none; cursor: pointer; }
.mo-theme-actions { display: flex; gap: 8px; margin-top: 12px; }
.mo-theme-actions .btn { flex: 1; }
