/* ==========================================================================
   SurfCore 社区 · 暗色玻璃主题（surfcore-theme.css）
   加载顺序：community.css 之后加载本文件，本文件覆盖原样式。
   原有 class / id / data-* / aria-* 全部保留，本文件只改外观。
   ========================================================================== */

/* 1. 颜色与尺寸变量 ------------------------------------------------------ */
:root {
  color-scheme: dark;
  --night: #070c1a;          /* 页面底 */
  --night-2: #0a1124;        /* 输入框底 */
  --panel: #0f1830;          /* 实色面板 */
  --panel-2: #131f3a;        /* 次级面板 */
  --glass: rgba(15, 25, 48, .72);
  --glass-2: rgba(19, 31, 58, .6);
  --edge-soft: #1a2b48;      /* 分隔线 */
  --edge: #24385a;           /* 边框 */
  --edge-hot: #3d6a8c;       /* 悬停边框 */
  --ink: #e4eefb;            /* 正文 */
  --muted: #a9bad2;          /* 次要文字 */
  --faint: #7489a8;          /* 更弱的文字 */
  --ice: #7fd3ec;            /* 强调 */
  --ice-dim: rgba(127, 211, 236, .14);
  --ice-faint: rgba(127, 211, 236, .06);
  --ok: #8fcfb0;
  --warn: #d9b87a;
  --danger: #e8a3aa;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --shadow: 0 14px 40px rgba(2, 6, 18, .45);
  --focus: 0 0 0 3px rgba(127, 211, 236, .14);
  --rim: inset 0 1px 0 rgba(200, 235, 255, .05);   /* 玻璃上沿的一线微光 */
  font: 16px/1.7 Inter, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  color: var(--ink);
  background: var(--night);
}

/* 2. 页面底与通用元素 ---------------------------------------------------- */
body {
  background:
    radial-gradient(ellipse 60% 45% at 85% 0%, rgba(40, 62, 120, .32) 0, transparent 70%),
    radial-gradient(ellipse 50% 40% at 5% 100%, rgba(22, 48, 92, .3) 0, transparent 70%),
    var(--night);
  background-attachment: fixed;
}
a { color: var(--ice); text-underline-offset: .22em; transition: color .15s; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid rgba(127, 211, 236, .7); outline-offset: 3px; }
::selection { background: rgba(127, 211, 236, .25); }
.shell { width: min(1160px, calc(100% - 64px)); }
main { padding-block: clamp(1.2rem, 3vw, 2.4rem) 3.5rem; }
h1, h2, h3 { line-height: 1.32; overflow-wrap: anywhere; letter-spacing: .01em; }
small { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--edge-soft); }
details summary { cursor: pointer; }
.skip { z-index: 31; border-radius: var(--radius-sm); border: 1px solid var(--edge); }

/* 3. 顶栏 ---------------------------------------------------------------- */
header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(8, 14, 30, .8);
  backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--edge-soft);
}
.head { min-height: 66px; gap: clamp(1.2rem, 3.5vw, 3rem); }
.brand { gap: .55rem; font-size: 1.32rem; font-weight: 750; letter-spacing: -.02em; color: var(--ink); }
.brand img { width: 32px; height: 32px; filter: drop-shadow(0 0 6px rgba(127, 211, 236, .18)); }
.brand:hover { color: var(--ink); }
.head nav { gap: 1.5rem; }
.head nav a {
  position: relative; color: var(--muted); border: 0; font-size: .97rem;
  transition: color .15s;
}
.head nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  border-radius: 2px; background: rgba(127, 211, 236, .6);
  transform: scaleX(0); transition: transform .2s ease;
}
.head nav a:hover { color: var(--ink); }
.head nav a[aria-current] { color: var(--ice); }
.head nav a[aria-current]::after { transform: scaleX(1); }
.account { gap: .25rem; font-size: .9rem; }
.account > a:not(.btn), .message-menu summary, .account .plain {
  display: inline-flex; align-items: center; min-height: 34px; padding: .2rem .7rem;
  border: 1px solid transparent; border-radius: 999px;
  color: var(--muted); text-decoration: none; background: transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.account > a:not(.btn):hover, .message-menu summary:hover, .message-menu[open] summary, .account .plain:hover {
  color: var(--ink); background: var(--ice-faint);
}
.account .saved-tab { border-color: transparent; background: transparent; padding: .2rem .7rem; }
.account .saved-tab[aria-current] { color: var(--ice); background: var(--ice-dim); border-color: rgba(127, 211, 236, .28); }
.account > .btn { margin-left: .35rem; min-height: 34px; }
.account form { display: flex; }
/* 消息下拉 */
.message-menu summary { list-style: none; gap: .3rem; }
.message-menu summary::-webkit-details-marker { display: none; }
.message-menu summary::after { content: ''; width: .4em; height: .4em; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-.15em) rotate(45deg); opacity: .7; }
.message-menu > div {
  top: calc(100% + .55rem); right: 0; z-index: 40; min-width: 10.5rem; padding: .4rem;
  background: rgba(15, 24, 48, .96); border: 1px solid var(--edge); border-radius: var(--radius-md);
  box-shadow: var(--shadow), var(--rim); backdrop-filter: blur(12px);
}
.message-menu > div a { padding: .45rem .75rem; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; }
.message-menu > div a:hover { background: var(--ice-faint); color: var(--ink); }

/* 页脚 */
footer { border-top: 1px solid var(--edge-soft); color: var(--faint); font-weight: 600; font-size: .92rem; padding-block: 1.4rem; }
footer img { opacity: .75; }
footer span { border-left-color: var(--edge); font-weight: 400; }

/* 4. 按钮 ---------------------------------------------------------------- */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 40px; padding: .42rem 1.1rem;
  border: 1px solid var(--edge-hot); border-radius: var(--radius-sm);
  background: var(--ice-dim); color: var(--ink);
  font-weight: 600; text-decoration: none; cursor: pointer;
  box-shadow: var(--rim);
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover, button:hover { background: rgba(127, 211, 236, .22); border-color: var(--ice); color: var(--ink); }
.btn:active, button:active { transform: translateY(1px); background: rgba(127, 211, 236, .1); }
.btn:focus-visible, button:focus-visible { outline: none; border-color: var(--ice); box-shadow: var(--focus); }
button[disabled], .btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.plain, .plain:hover { min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--muted); font-weight: inherit; }
.plain:hover { color: var(--ink); }
/* 次要按钮：工具条、表单内的辅助操作 */
.tools button, .mod-dialog form[method=dialog] button, [data-remove-relation], [data-copy-link], [data-copy-invite], #add-link, #add-relation {
  background: transparent; border-color: var(--edge); color: var(--muted);
}
.tools button:hover, .mod-dialog form[method=dialog] button:hover, [data-remove-relation]:hover, [data-copy-link]:hover, [data-copy-invite]:hover, #add-link:hover, #add-relation:hover {
  background: var(--ice-faint); border-color: var(--edge-hot); color: var(--ink);
}
/* 危险操作：删除、撤销 */
button[value=hide], button[value=deleted], [action*="/revoke/"] button {
  background: rgba(232, 163, 170, .08); border-color: rgba(232, 163, 170, .4); color: var(--danger);
}
button[value=hide]:hover, button[value=deleted]:hover, [action*="/revoke/"] button:hover {
  background: rgba(232, 163, 170, .16); border-color: var(--danger); color: #f3c4c9;
}

/* 5. 输入框 -------------------------------------------------------------- */
input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), textarea, select {
  width: 100%; max-width: 100%; padding: .6rem .8rem;
  border: 1px solid var(--edge); border-radius: var(--radius-sm);
  background: var(--night-2); color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: #6d819f; }
input:not([type=checkbox]):not([type=radio]):hover, textarea:hover, select:hover { border-color: var(--edge-hot); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ice); box-shadow: var(--focus); background: #0b1430; }
input[aria-invalid=true], textarea[aria-invalid=true], select[aria-invalid=true] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(232, 163, 170, .1); }
textarea { min-height: 7rem; resize: vertical; line-height: 1.7; }
select { appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%);
  background-position: right 1.05rem center, right .75rem center; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--panel); color: var(--ink); }
input[type="file"] { padding: .5rem .65rem; color: var(--faint); font-size: .86rem; cursor: pointer; }
input[type="file"]::file-selector-button { margin-right: .8rem; padding: .42rem .95rem; border: 1px solid var(--edge-hot); border-radius: var(--radius-sm); background: var(--ice-dim); color: var(--ink); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; transition: all .15s; }
input[type="file"]::file-selector-button:hover { border-color: var(--ice); background: rgba(127, 211, 236, .16); }
input[type="range"] { accent-color: var(--ice); }
input[type=checkbox], input[type=radio] { width: 1.05rem; height: 1.05rem; accent-color: #5fb6d0; vertical-align: -.15em; }
input[type=range] { accent-color: #5fb6d0; width: 100%; }
input[type=file] { max-width: 100%; color: var(--muted); font-size: .9rem; }
input[type=file]::file-selector-button {
  margin-right: .8rem; padding: .4rem .9rem; border: 1px solid var(--edge); border-radius: var(--radius-sm);
  background: var(--panel-2); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .15s;
}
input[type=file]::file-selector-button:hover { border-color: var(--edge-hot); }
.card label, form label { font-weight: 600; font-size: .94rem; }
.card form p { margin: 0 0 1rem; }
.card form p > label { display: block; margin-bottom: .35rem; }
.helptext, .card form ul, form .helptext { color: var(--faint); font-size: .86rem; }
.card form .errorlist, .errorlist {
  list-style: none; margin: .4rem 0; padding: .5rem .8rem; color: var(--danger); font-size: .88rem;
  border: 1px solid rgba(232, 163, 170, .35); border-radius: var(--radius-sm); background: rgba(232, 163, 170, .06);
}
fieldset { min-width: 0; margin: 1rem 0; padding: 1rem 1.1rem; border: 1px solid var(--edge); border-radius: var(--radius-md); background: var(--glass-2); }
legend { padding: 0 .5rem; color: var(--muted); font-weight: 600; font-size: .9rem; }
img[alt*="验证码"] { border-radius: var(--radius-sm); border: 1px solid var(--edge); vertical-align: middle; background: var(--night-2); }

/* 6. 提示条、代码块 ------------------------------------------------------ */
.message {
  display: flex; align-items: center; gap: .6rem; margin: 0 0 1rem;
  padding: .7rem 1rem; border: 1px solid var(--edge-hot); border-radius: var(--radius-md);
  background: var(--ice-faint); color: var(--ink);
}
.message::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ice); opacity: .8; }
[role=alert] { color: var(--danger); }
code {
  display: inline-block; max-width: 100%; overflow-wrap: anywhere; padding: .25rem .6rem;
  border: 1px solid var(--edge); border-radius: var(--radius-sm); background: var(--night-2);
  color: #bfe6f4; font: .9em/1.6 Consolas, 'Cascadia Mono', monospace;
}

/* 7. 卡片与列表 ---------------------------------------------------------- */
.card, .listing {
  background: var(--glass); border: 1px solid var(--edge); border-radius: var(--radius-lg);
  box-shadow: var(--shadow), var(--rim); backdrop-filter: blur(8px);
}
.card { max-width: 56rem; margin: 0 auto 1.25rem; padding: clamp(1.3rem, 3.6vw, 2.4rem); }
.card.narrow { max-width: 40rem; }
.card h1 { font-size: clamp(1.6rem, 3.2vw, 2.15rem); margin: .2rem 0 1rem; }
.card h2 { font-size: 1.22rem; margin: 1.8rem 0 .8rem; }
.card > h1:first-child, .card > h2:first-child { margin-top: 0; }
/* 卡片内的小标题前加一道冰青短竖线 */
.card > h2, .card > section > h2, #registration-codes h2 { display: flex; align-items: center; gap: .6rem; }
.card > h2::before, .card > section > h2::before, #registration-codes h2::before {
  content: ''; flex: none; width: 3px; height: .95em; border-radius: 2px; background: var(--ice); opacity: .7;
}
.listing { margin-top: 1.25rem; overflow: hidden; }
.bar { padding: 1rem clamp(1rem, 2.4vw, 1.7rem); }
.bar h2 { font-size: 1.1rem; }
.bar h2::before { border-radius: 2px; opacity: .7; }
.bar a { color: var(--muted); text-decoration: none; padding: .25rem .75rem; border: 1px solid var(--edge); border-radius: 999px; transition: all .15s; }
.bar a:hover { color: var(--ink); border-color: var(--edge-hot); background: var(--ice-faint); }
.row { padding: 1.05rem clamp(1rem, 2.4vw, 1.7rem); border-top: 1px solid var(--edge-soft); transition: background .15s; }
.row:hover { background: var(--ice-faint); }
.row h2 { font-size: 1.08rem; margin: .2rem 0 .25rem; }
.row h2 a { color: var(--ink); text-decoration: none; }
.row h2 a:hover { color: var(--ice); text-decoration: none; }
.row small { color: var(--muted); }
.row > div > small:first-child { color: var(--ice); opacity: .85; font-size: .82rem; letter-spacing: .02em; }
.empty { padding: 2.4rem clamp(1rem, 2.4vw, 1.7rem); text-align: center; color: var(--faint); border-top: 1px solid var(--edge-soft); }
.card > .empty:first-child, .workshop-grid > .empty { border-top: 0; }
.prose { margin: 1.3rem 0; line-height: 1.9; color: #d6e2f3; }
.comment { border-top: 1px solid var(--edge-soft); padding: 1rem 0 .4rem; line-height: 1.8; }
.comment > a:first-child { font-weight: 600; text-decoration: none; }
.comment > a:first-child:hover { text-decoration: underline; }
.comment p { margin: .35rem 0; color: #cfdcee; }

/* 8. 标签页与分页 -------------------------------------------------------- */
.tabs, .pager { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.tabs a, .pager a, .profile-tabs a, .folder-tabs a, .folder-trigger {
  display: inline-flex; align-items: center; padding: .38rem .95rem;
  border: 1px solid var(--edge); border-radius: 999px; background: var(--glass);
  color: var(--muted); text-decoration: none; font-size: .92rem;
  transition: background .15s, border-color .15s, color .15s;
}
.tabs a:hover, .pager a:hover, .profile-tabs a:hover, .folder-tabs a:hover, .folder-trigger:hover {
  background: var(--ice-faint); border-color: var(--edge-hot); color: var(--ink);
}
.tabs a[aria-current], .profile-tabs a[aria-current], .folder-tabs a[aria-current] {
  background: var(--ice-dim); border-color: rgba(127, 211, 236, .45); color: var(--ink);
}
.pager { justify-content: center; margin-top: 1.4rem; }
.pager:empty { display: none; }

/* 9. 首页横幅（公告 / 社区 / 创意工坊） --------------------------------- */
.hero {
  min-height: clamp(240px, 24vw, 320px); padding: clamp(1.5rem, 4.5vw, 3.4rem);
  border: 1px solid var(--edge); border-radius: var(--radius-lg); background: #0a1328;
  box-shadow: var(--shadow), var(--rim);
}
.hero::before { opacity: .78; }
.hero::after { background: linear-gradient(90deg, #091224 10%, #0b1530 32%, rgba(11, 21, 48, .88) 42%, rgba(11, 21, 48, .25) 66%, transparent 85%); }
.eyebrow { letter-spacing: .14em; color: var(--ice); opacity: .9; }
.eyebrow b { color: var(--faint); }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); letter-spacing: .03em; margin: .55rem 0 .45rem; }
.hero p { color: #b9cbe3; }
.hero .btn { margin-top: 1.3rem; }

/* 筛选条 */
.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem 1rem;
  margin: 1.1rem 0 0; padding: .9rem 1.1rem;
  border: 1px solid var(--edge-soft); border-radius: var(--radius-md); background: var(--glass-2);
}
.filters label:not(.choice) { display: grid; gap: .3rem; min-width: 9.5rem; font-size: .85rem; color: var(--muted); font-weight: 600; }
.filters select { min-width: 9.5rem; }
.choice {
  display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .8rem; cursor: pointer;
  border: 1px solid var(--edge); border-radius: 999px; color: var(--muted); font-size: .9rem; font-weight: 500;
  transition: all .15s;
}
.choice:hover { border-color: var(--edge-hot); color: var(--ink); }
.choice:has(input:checked) { border-color: rgba(127, 211, 236, .45); background: var(--ice-dim); color: var(--ink); }
.choice input { appearance: none; position: relative; width: .9rem; height: .9rem; margin: 0; border: 1px solid var(--edge-hot); border-radius: 4px; background: var(--night-2); cursor: pointer; transition: all .15s; }
.choice input:checked { border-color: var(--ice); background: var(--ice-dim); }
.choice input:checked::after { content: ''; position: absolute; inset: 2px; border-radius: 2px; background: var(--ice); }
.choice input:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }
.filters button { margin-left: auto; }

/* 10. 作者、头像、身份徽章 ---------------------------------------------- */
.author a { color: var(--ink); text-decoration: none; }
.author a:hover strong { color: var(--ice); }
.author small { color: var(--faint); font-size: .78rem; font-family: Consolas, monospace; }
.avatar { box-shadow: 0 0 0 1px var(--edge-hot), 0 0 0 4px rgba(127, 211, 236, .05); }
.fallback { background: linear-gradient(135deg, #1c3354, #0f2036); color: #a9e2f2; font-weight: 600; }
.badges { gap: .35rem; }
.badge { border-radius: 999px; padding: .05rem .55rem; font-size: .74rem; font-weight: 600; background: rgba(255, 255, 255, .025); border-color: color-mix(in srgb, currentColor 55%, transparent); }
.badge.owner { color: #d9b87a; }
.badge.mod { color: #b9a6e6; }
.badge.dev { color: #7fd3ec; }
.badge.member { color: #a9b7c8; }
.badge.mystery { color: #e2a6c8; }

/* 11. 创意工坊卡片与获取弹窗 -------------------------------------------- */
.workshop-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 1.1rem; padding: 1.1rem; border-top: 1px solid var(--edge-soft); }
.mod-card {
  gap: .55rem; padding: 0 1rem 1rem; border: 1px solid var(--edge); border-radius: 14px;
  background: linear-gradient(180deg, rgba(19, 31, 58, .7), rgba(11, 19, 40, .85));
  box-shadow: var(--rim); transition: border-color .18s, transform .18s, box-shadow .18s;
}
.mod-card:hover { border-color: var(--edge-hot); transform: translateY(-2px); box-shadow: 0 16px 36px rgba(2, 6, 18, .5), var(--rim); }
.mod-cover { margin: 0 -1rem .6rem; background: linear-gradient(135deg, #172742, #0d1628); color: var(--faint); font: .9rem Consolas, monospace; letter-spacing: .12em; border-bottom: 1px solid var(--edge-soft); overflow: hidden; }
.mod-cover img { transition: transform .35s ease; }
.mod-card:hover .mod-cover img { transform: scale(1.03); }
.mod-link small { color: var(--ice); opacity: .85; font-size: .8rem; }
.mod-link h2 { font-size: 1.1rem; margin: .15rem 0 .1rem; }
.mod-link:hover h2 { color: var(--ice); }
.mod-card > small { font-size: .8rem; color: var(--faint); }
.mod-card .author { margin-top: auto; padding-top: .55rem; border-top: 1px solid var(--edge-soft); }
.mod-card .author a { flex-direction: row; align-items: center; gap: .5rem; }
.mod-get { align-self: stretch; min-height: 36px; }
dialog { color: var(--ink); }
.mod-dialog, .folder-dialog {
  background: rgba(15, 24, 48, .97); border: 1px solid var(--edge); border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), var(--rim);
}
.mod-dialog { padding: 1.4rem 1.5rem; }
.mod-dialog::backdrop, .folder-dialog::backdrop { background: rgba(3, 7, 18, .72); backdrop-filter: blur(3px); }
.mod-dialog h2 { font-size: 1.15rem; margin: .2rem 0 .8rem; }
.mod-dialog form[method=dialog] button { min-height: 32px; padding: .2rem .8rem; font-size: .85rem; }
.download-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 1rem; padding: .85rem 0; border-top: 1px solid var(--edge-soft); }
.download-row strong { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); }
.download-url { padding: .4rem .6rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-sm); background: var(--night-2); color: #bfe6f4; font: .85rem/1.5 Consolas, monospace; }
.download-row > div { display: flex; gap: .45rem; }
.download-row .btn, .download-row button { min-height: 34px; padding: .25rem .8rem; font-size: .88rem; }
.copy-status { margin: .6rem 0 0; color: var(--ok); font-size: .88rem; }

/* 模组分类说明 */
.pack-guide { margin: 1rem 0; padding: .8rem 1.1rem; border: 1px solid var(--edge-soft); border-left: 3px solid rgba(127, 211, 236, .5); border-radius: var(--radius-sm); background: var(--glass-2); color: var(--muted); font-size: .9rem; line-height: 1.6; }
.pack-guide strong { color: var(--ink); }

/* 12. 帖子详情、楼层、点赞收藏工具条 ------------------------------------ */
.authored, .row.authored { grid-template-columns: clamp(4.8rem, 12vw, 8rem) minmax(0, 1fr); gap: clamp(.7rem, 2vw, 1.5rem); }
article.card.authored > div > a:first-child { display: inline-flex; font-size: .88rem; color: var(--muted); text-decoration: none; }
article.card.authored > div > a:first-child:hover { color: var(--ice); }
article.card.authored h1 { margin: .4rem 0 .3rem; }
article.card.authored > .author { padding-top: .2rem; }
.mod-gallery a { border: 1px solid var(--edge-soft); border-radius: var(--radius-sm); overflow: hidden; transition: border-color .15s; }
.mod-gallery a:hover { border-color: var(--edge-hot); }
.mod-relations { margin: 1rem 0; padding: .9rem 1.1rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-md); background: var(--glass-2); }
.mod-relations h2 { font-size: 1rem; margin: 0 0 .4rem; }
.mod-relations ul { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.card.authored .btn[target=_blank] { margin: .3rem .4rem .3rem 0; }
.tools { gap: .4rem; margin: .8rem 0; }
.tools form { margin: 0; }
.tools button, .folder-trigger { min-height: 32px; padding: .2rem .85rem; font-size: .86rem; border-radius: 999px; }
.tools button[aria-pressed=true] { color: var(--ice); border-color: rgba(127, 211, 236, .45); background: var(--ice-dim); }
.tools details { position: relative; }
.tools details > summary {
  display: inline-flex; align-items: center; min-height: 32px; padding: .2rem .8rem; list-style: none;
  border: 1px solid transparent; border-radius: 999px; color: var(--faint); font-size: .86rem; transition: all .15s;
}
.tools details > summary::-webkit-details-marker { display: none; }
.tools details > summary:hover, .tools details[open] > summary { color: var(--danger); border-color: rgba(232, 163, 170, .3); }
.tools details[open] { flex: 1 1 100%; min-width: 0; }
.tools details[open] > form {
  width: min(20rem, 100%); margin-top: .4rem;
  display: grid; gap: .6rem; padding: .9rem; border: 1px solid var(--edge); border-radius: var(--radius-md);
  background: rgba(15, 24, 48, .97); box-shadow: var(--shadow);
}
.tools details[open] > form label { font-size: .86rem; color: var(--muted); }
/* 管理工具条 */
form.tools[aria-label="内容管理"] { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px dashed var(--edge); }
.category-editor { padding: .8rem 1rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-md); background: var(--glass-2); }
.category-editor label { display: grid; gap: .3rem; font-size: .86rem; color: var(--muted); }
/* 楼层 */
#replies > h2 { margin-bottom: .4rem; }
#replies > nav { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; color: transparent; font-size: 0; }
#replies > nav a { font-size: .85rem; padding: .25rem .8rem; border: 1px solid var(--edge); border-radius: 999px; color: var(--muted); text-decoration: none; transition: all .15s; }
#replies > nav a:hover { color: var(--ink); border-color: var(--edge-hot); background: var(--ice-faint); }
.floor { border-top: 1px solid var(--edge-soft); padding: .3rem 0; }
.floor > .comment { border-top: 0; }
.comment.authored { padding: 1rem 0 .5rem; }
.comment.authored > div > small:first-child { color: var(--faint); font-size: .8rem; }
.comment.authored > div > p { color: #d3deee; }
.comment.authored > div > a[href*="parent="] { font-size: .84rem; color: var(--muted); text-decoration: none; }
.comment.authored > div > a[href*="parent="]:hover { color: var(--ice); }
.comment:target { background: var(--ice-faint); border-radius: var(--radius-md); box-shadow: 0 0 0 1px rgba(127, 211, 236, .25); }
.floor-children { margin-inline-start: clamp(.7rem, 5vw, 4rem); padding-inline-start: 1rem; border-inline-start: 2px solid var(--edge); }
.floor-children .comment { border-top: 1px dashed var(--edge-soft); }
.floor-children .avatar { width: 2.3rem; height: 2.3rem; }
#write { margin-top: 1.4rem; padding: 1.1rem 1.2rem; border: 1px solid var(--edge); border-radius: var(--radius-md); background: var(--glass-2); }
#write > p:first-of-type:not(:has(textarea)) { color: var(--muted); font-size: .9rem; }
#replies > a[href^="/login/"] { display: inline-flex; margin-top: 1rem; padding: .5rem 1rem; border: 1px dashed var(--edge-hot); border-radius: var(--radius-md); text-decoration: none; }
.mention-options:not([hidden]) { margin: .4rem 0; padding: .3rem; background: rgba(15, 24, 48, .97); border: 1px solid var(--edge); border-radius: var(--radius-md); box-shadow: var(--shadow); }
.mention-options button { justify-content: flex-start; min-height: 32px; border: 0; background: transparent; color: var(--muted); box-shadow: none; }
.mention-options button:hover, .mention-options button.current { background: var(--ice-faint); color: var(--ink); outline: 1px solid rgba(127, 211, 236, .35); outline-offset: -1px; }

/* 13. 页面标题（社区贡献者等不在卡片里的 h1） --------------------------- */
main > h1 { display: flex; align-items: center; gap: .7rem; margin: .2rem 0 1.3rem; font-size: clamp(1.6rem, 3.2vw, 2.1rem); }
main > h1::before { content: ''; width: 4px; height: .9em; border-radius: 2px; background: var(--ice); opacity: .75; }

/* 14. 社区贡献者 --------------------------------------------------------- */
.contributor-channels { gap: 1.2rem; }
.contributor-column { gap: 1.2rem; }
.contributor-channels .card { padding: 1.3rem 1.4rem; }
.contributor-channels h2 { margin: 0 0 .4rem; font-size: 1.08rem; }
.contributor-channels h2 small { margin-left: auto; padding: .05rem .6rem; border: 1px solid var(--edge); border-radius: 999px; font-size: .78rem; color: var(--muted); }
.contributor-channels li { padding: .7rem .4rem; border-top: 1px solid var(--edge-soft); border-radius: var(--radius-sm); transition: background .15s; }
.contributor-channels li:hover { background: var(--ice-faint); }
.contributor-channels .author { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: .75rem; }
.contributor-channels .author a { grid-row: span 2; }
.contributor-channels .author small { grid-column: 2; }
.contributor-channels .author .badges { grid-column: 2; margin: .1rem 0 0; }
.contributor-channels .avatar { width: 2.6rem; height: 2.6rem; }
.contributor-channels .empty { padding: 1.2rem 0 .4rem; text-align: left; border: 0; }

/* 15. 个人主页 ----------------------------------------------------------- */
section.card > .author {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 1.1rem;
  margin: .4rem 0 1rem; padding: 1.1rem 1.2rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-md);
  background: linear-gradient(120deg, rgba(127, 211, 236, .06), transparent 60%), var(--glass-2);
}
section.card > .author > a { grid-row: span 3; flex-direction: row; align-items: center; gap: 1rem; }
section.card > .author .avatar { width: 4.2rem; height: 4.2rem; font-size: 1.7rem; }
section.card > .author strong { font-size: 1.3rem; }
section.card > .author > small, section.card > .author > .badges { grid-column: 2; }
section.card > .author > .badges { margin: .2rem 0 0; }
section.card > .author + p { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; color: var(--muted); font-size: .9rem; margin: 0 0 1rem; }
section.card > .author + p a, section.card > .author + p::after { font-size: .9rem; }
section.card > .author + p a { padding: .25rem .85rem; border: 1px solid var(--edge); border-radius: 999px; color: var(--muted); text-decoration: none; }
section.card > .author + p a:hover, section.card > .author + p a[aria-current] { color: var(--ink); border-color: var(--edge-hot); background: var(--ice-faint); }
section.card > .author ~ p[style] { color: #cfdcee; }
section.card > .author ~ img { margin: .6rem 0 1rem; border-radius: var(--radius-md); border: 1px solid var(--edge-soft); }
.bio-editor { margin: 1.4rem 0 .4rem; padding: 1.2rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-md); background: var(--glass-2); }
.bio-editor h2 { margin: 0 0 1rem; font-size: 1.05rem; }
.bio-fields label { font-size: .9rem; }
.bio-media small { color: var(--faint); font-size: .84rem; }
.bio-controls { gap: 1rem; }
.bio-controls a { color: var(--muted); font-size: .9rem; }
.bio-controls a:hover { color: var(--ice); }
section.card > .tools { margin-top: .4rem; }
section.card > .tools a { display: inline-flex; align-items: center; min-height: 32px; padding: .2rem .9rem; border: 1px solid var(--edge); border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .86rem; }
section.card > .tools a:hover { color: var(--ink); border-color: var(--edge-hot); background: var(--ice-faint); }
section.card > details { margin-top: 1rem; padding: .7rem 1rem; border: 1px dashed rgba(232, 163, 170, .3); border-radius: var(--radius-md); }
section.card > details > summary { color: var(--muted); font-size: .9rem; }
section.card > details form { display: grid; gap: .6rem; margin-top: .7rem; }
.profile-tabs { margin: 0 0 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--edge-soft); }
.profile-tabs ~ p { margin: 0; padding: .7rem .3rem; border-bottom: 1px solid var(--edge-soft); }
.profile-tabs ~ p a { color: var(--ink); text-decoration: none; }
.profile-tabs ~ p a:hover { color: var(--ice); }
.profile-tabs ~ .author { padding: .7rem .3rem; border-bottom: 1px solid var(--edge-soft); }
.profile-tabs ~ .author a { flex-direction: row; align-items: center; gap: .7rem; }
.profile-tabs ~ .author .avatar { width: 2.4rem; height: 2.4rem; }

/* 16. 左侧竖排分类（消息、收藏夹） --------------------------------------- */
.side-layout { display: grid; grid-template-columns: 12.5rem minmax(0, 1fr); gap: 1.25rem; align-items: start; max-width: 64rem; margin: 0 auto; }
.side-layout > .card { max-width: none; margin: 0; min-height: 22rem; }
.side-tabs {
  position: sticky; top: 86px; display: grid; gap: .2rem; padding: .55rem;
  border: 1px solid var(--edge); border-radius: var(--radius-lg); background: var(--glass);
  box-shadow: var(--shadow), var(--rim); backdrop-filter: blur(8px);
}
.side-tabs > strong { padding: .35rem .75rem .5rem; color: var(--faint); font-size: .78rem; letter-spacing: .12em; }
.side-tabs a {
  position: relative; display: flex; align-items: center; gap: .6rem; padding: .55rem .85rem;
  border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-size: .94rem;
  transition: background .15s, color .15s;
}
.side-tabs a:hover { background: var(--ice-faint); color: var(--ink); }
.side-tabs a[aria-current] { background: var(--ice-dim); color: var(--ink); }
.side-tabs a[aria-current]::before { content: ''; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px; border-radius: 2px; background: var(--ice); }
.side-tabs a > b { margin-left: auto; padding: 0 .5rem; border-radius: 999px; background: rgba(232, 163, 170, .14); color: var(--danger); font-size: .75rem; font-weight: 600; }
.side-tabs hr { width: 100%; margin: .3rem 0; }
/* 收藏夹：folder_items 输出的收藏夹列表放左边 */
.folder-layout { display: grid; grid-template-columns: 12.5rem minmax(0, 1fr); column-gap: 1.25rem; align-items: start; }
.folder-layout > .folder-tabs { grid-column: 1; grid-row: 1 / span 30; display: grid; gap: .2rem; margin: 0; padding: .55rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-md); background: var(--glass-2); position: sticky; top: 86px; }
.folder-layout > .folder-tabs a { justify-content: flex-start; padding: .5rem .8rem; border: 0; border-radius: var(--radius-sm); background: transparent; }
.folder-layout > .folder-tabs a[aria-current] { background: var(--ice-dim); }
.folder-layout > :not(.folder-tabs) { grid-column: 2; }
.folder-layout > .folder-create { margin: 0 0 .8rem; }
.folder-create > summary { display: inline-flex; padding: .3rem .9rem; border: 1px dashed var(--edge-hot); border-radius: 999px; color: var(--muted); font-size: .88rem; list-style: none; transition: all .15s; }
.folder-create > summary::-webkit-details-marker { display: none; }
.folder-create > summary:hover, .folder-create[open] > summary { color: var(--ink); background: var(--ice-faint); }
.folder-create form, .folder-create > label { display: grid; gap: .6rem; margin-top: .7rem; padding: .9rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-md); background: var(--glass-2); }
/* 消息条目 */
.side-layout .comment, .folder-layout .comment {
  margin: 0 0 .6rem; padding: .85rem 1rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-md);
  background: var(--glass-2); transition: border-color .15s, background .15s;
}
.side-layout .comment:hover, .folder-layout .comment:hover { border-color: var(--edge); background: rgba(19, 31, 58, .8); }
.side-layout .comment:has(> .author) { display: grid; grid-template-columns: clamp(5rem, 15vw, 9rem) minmax(0, 1fr); column-gap: .9rem; align-items: start; }
.side-layout .comment > * { grid-column: 2; }
.side-layout .comment > .author { grid-column: 1; grid-row: 1 / span 4; }
.side-layout .comment > .author a { gap: 0; }
.side-layout .comment > .author .avatar { width: 2.5rem; height: 2.5rem; }
.side-layout .comment > small { font-size: .8rem; color: var(--faint); }
.side-layout .comment > a { font-weight: 600; text-decoration: none; }
.side-layout .comment > a:hover { text-decoration: underline; }
.side-layout .comment > p { margin: .2rem 0; color: #cfdcee; }
.side-layout .card > h1 { font-size: 1.45rem; padding-bottom: .9rem; border-bottom: 1px solid var(--edge-soft); }
.side-layout .card > p:has(a[href^="/reports/"]) a { display: inline-flex; padding: .3rem .9rem; border: 1px solid rgba(232, 163, 170, .35); border-radius: 999px; color: var(--danger); text-decoration: none; font-size: .88rem; }
.side-layout .card > form { display: grid; gap: .7rem; margin-bottom: 1.2rem; padding: 1rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-md); background: var(--glass-2); }
.side-layout .card > form button { justify-self: end; }
.side-layout .card > p:last-child:not(:has(a)), .side-layout .card > p:only-of-type { color: var(--faint); }

/* 17. 举报审核与单条举报 ------------------------------------------------- */
.review-states { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--edge-soft); }
.review-states a { padding: .3rem .9rem; border: 1px solid var(--edge); border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .88rem; transition: all .15s; }
.review-states a:hover { color: var(--ink); border-color: var(--edge-hot); background: var(--ice-faint); }
.review-states a[aria-current] { color: var(--ink); border-color: rgba(127, 211, 236, .45); background: var(--ice-dim); }
.review-list .comment { display: grid; gap: .2rem; margin: 0 0 .6rem; padding: .85rem 1rem; border: 1px solid var(--edge-soft); border-left: 3px solid var(--edge-hot); border-radius: var(--radius-md); background: var(--glass-2); }
.review-list .comment:hover { border-color: var(--edge); border-left-color: var(--ice); }
.review-list .comment p { margin: 0; color: var(--muted); font-size: .92rem; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.review-head > a { font-weight: 600; }
.review-head .state-tag { align-self: center; }
.state-tag { display: inline-flex; padding: .02rem .55rem; border: 1px solid currentColor; border-radius: 999px; font-size: .74rem; font-weight: 600; vertical-align: .1em; }
.state-new { color: var(--warn); }
.state-owner { color: #b9a6e6; }
.state-held { color: var(--muted); }
.state-live { color: var(--ok); }
.state-deleted { color: var(--danger); }
.review-case > a:first-child { font-size: .88rem; color: var(--muted); text-decoration: none; }
.review-case > a:first-child:hover { color: var(--ice); }
.review-case > details { margin: 1rem 0; padding: .9rem 1.1rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-md); background: var(--glass-2); }
.review-case > details > summary { color: var(--muted); font-weight: 600; font-size: .9rem; }
.review-case > details[open] > summary { margin-bottom: .5rem; }
.review-case > .comment { padding: .7rem 1rem; margin-bottom: .5rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-md); }
.review-case > form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-start; margin-top: 1.4rem; padding: 1.1rem; border: 1px solid var(--edge); border-radius: var(--radius-md); background: var(--glass-2); }
.review-case > form > label { flex: 1 1 100%; display: grid; gap: .4rem; }
.review-case > form details { flex: 1 1 100%; margin-top: .4rem; padding: .8rem 1rem; border: 1px dashed rgba(232, 163, 170, .4); border-radius: var(--radius-md); }
.review-case > form details > summary { color: var(--danger); font-size: .9rem; }
.review-case > form details p { color: var(--muted); font-size: .88rem; }
.review-case > form details label { display: grid; gap: .4rem; margin-bottom: .7rem; }

/* 18. 我的身份、身份码、注册码 ------------------------------------------ */
.identity-card .grant { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 .5rem; padding: .7rem 1rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-md); background: var(--glass-2); }
.identity-card .grant strong { color: var(--ice); }
.identity-card .grant span { color: var(--muted); font-size: .88rem; }
.identity-card .grant.expired span { color: var(--danger); }
.identity-card .apply { display: grid; gap: .7rem; }
.identity-card .apply p { margin: 0; padding: .75rem 1rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-md); color: var(--muted); font-size: .92rem; }
.identity-card .apply p strong { color: var(--ink); }
.identity-card form { padding: 1rem 1.1rem; border: 1px solid var(--edge); border-radius: var(--radius-md); background: var(--glass-2); }
.identity-card article { margin: 0 0 .6rem; padding: .75rem 1rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-md); }
.identity-card article p { margin: 0 0 .3rem; font-size: .9rem; color: var(--muted); }
.identity-card article strong { color: var(--ink); }
.identity-card > a[href*="codes="] { display: inline-flex; margin: .3rem .4rem 0 0; padding: .25rem .8rem; border: 1px solid var(--edge); border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .88rem; }
#registration-codes { max-width: 56rem; }
#registration-codes > form { margin: .4rem 0 1rem; }
#registration-codes h3 { margin: 1.2rem 0 .6rem; font-size: 1rem; color: var(--muted); }
#registration-codes > div[style] { border: 1px solid var(--edge-soft); border-radius: var(--radius-md); }
.invite-table { font-size: .9rem; }
.invite-table th { position: sticky; top: 0; padding: .6rem .7rem; background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: .82rem; letter-spacing: .04em; border-bottom: 1px solid var(--edge); }
.invite-table td { padding: .55rem .7rem; border-bottom: 1px solid var(--edge-soft); }
.invite-table tbody tr:hover { background: var(--ice-faint); }
.invite-table tbody tr:last-child td { border-bottom: 0; }
.invite-table code { padding: .1rem .45rem; font-size: .85rem; }
.invite-table button { min-height: 30px; padding: .15rem .7rem; font-size: .82rem; }
#invite-copy-status { color: var(--ok); font-size: .88rem; }

/* 19. 登录、注册（退出后看到的页面） ------------------------------------ */
.auth-page { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); max-width: 60rem; margin: clamp(.5rem, 3vw, 2.5rem) auto 0; overflow: hidden; border: 1px solid var(--edge); border-radius: var(--radius-lg); box-shadow: var(--shadow), var(--rim); background: var(--glass); }
.auth-scene { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; min-height: 30rem; padding: 2rem; background: #0a1328 url('surfcore/home.webp') right 35% / cover no-repeat; }
.auth-scene::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(8, 14, 30, .96) 4%, rgba(8, 14, 30, .55) 45%, rgba(8, 14, 30, .2) 75%), linear-gradient(90deg, transparent 70%, rgba(8, 14, 30, .55)); }
.auth-scene .eyebrow { margin-bottom: .5rem; }
.auth-scene h2 { margin: 0 0 .4rem; font-size: 1.7rem; letter-spacing: .03em; }
.auth-scene p { margin: 0; color: #b9cbe3; font-size: .95rem; }
.auth-page > .card { max-width: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; backdrop-filter: none; padding: clamp(1.6rem, 4vw, 2.6rem); align-self: center; }
.auth-page > .card h1 { font-size: 1.7rem; margin-bottom: .3rem; }
.auth-lead { margin: 0 0 1.4rem; color: var(--muted); font-size: .92rem; }
.auth-page form p { margin: 0 0 1rem; }
.auth-page form button[type=submit], .auth-page form > button:last-child { width: 100%; min-height: 44px; margin-top: .4rem; }
.auth-switch { margin: 1.3rem 0 0; padding-top: 1rem; border-top: 1px solid var(--edge-soft); color: var(--muted); font-size: .9rem; }
.challenge { display: grid; gap: .6rem; margin: 0 0 1rem; padding: .9rem; border: 1px solid rgba(217, 184, 122, .35); border-radius: var(--radius-md); background: rgba(217, 184, 122, .05); }
.challenge > p:first-child { margin: 0; color: var(--warn); font-size: .88rem; }
.challenge > div { display: flex; align-items: center; gap: .8rem; }
.challenge > div a { font-size: .86rem; color: var(--muted); }
.register-methods { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; margin: 0 0 1.1rem; padding: .3rem; border: 1px solid var(--edge); border-radius: 999px; background: var(--night-2); color: transparent; font-size: 0; }
.register-methods a { padding: .4rem .8rem; border-radius: 999px; color: var(--muted); text-align: center; text-decoration: none; font-size: .9rem; transition: all .15s; }
.register-methods a:hover { color: var(--ink); }
.register-methods a[aria-current] { background: var(--ice-dim); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(127, 211, 236, .35); }
.auth-page img[alt*="验证码"], .challenge img { border: 1px solid var(--edge); border-radius: var(--radius-sm); filter: brightness(.9) contrast(.95); }
.auth-page details { margin: 1rem 0; padding: .9rem 1rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-md); background: var(--glass-2); }
.auth-page details > summary { color: var(--muted); font-weight: 600; font-size: .92rem; }
.auth-page details[open] > summary { margin-bottom: .8rem; }
.auth-page details form > a, .auth-page form > a[href*="method="] { font-size: .86rem; color: var(--muted); margin-left: .6rem; }
.auth-note { color: var(--faint); font-size: .84rem; }

/* 20. 发帖、发布模组、编辑资料 ------------------------------------------ */
.workshop-field { margin: 0 0 1rem; }
.workshop-field label { display: block; margin-bottom: .35rem; }
.link-hint { margin: 1.2rem 0 .6rem; padding: .6rem .9rem; border-left: 3px solid rgba(127, 211, 236, .5); background: var(--ice-faint); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .9rem; color: var(--ice); }
#links { display: grid; gap: .7rem; margin: .5rem 0; }
#links label { display: grid; gap: .3rem; font-size: .9rem; }
#add-link, #add-relation { min-height: 34px; padding: .2rem .9rem; border-style: dashed; font-size: .88rem; }
.mod-upload { padding: 1rem 1.1rem; }
.mod-upload > label { display: block; margin: .9rem 0 .35rem; }
.mod-upload > label:first-of-type { margin-top: 0; }
.mod-existing { gap: .7rem; margin-bottom: 1rem; }
.mod-existing label { display: grid; gap: .3rem; padding: .4rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-sm); font-size: .82rem; font-weight: 500; color: var(--muted); }
.mod-existing img { border-radius: 5px; background: var(--night-2); }
.mod-previews figure { padding: .35rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-sm); background: var(--night-2); }
.mod-previews figcaption { margin-top: .3rem; color: var(--faint); }
.mod-relation-editor { padding: 1rem 1.1rem; }
.mod-relation-layout aside { padding: .8rem 1rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-md); color: var(--muted); font-size: .88rem; }
#relation-reminder { margin: .7rem 0 0; color: var(--warn); }
.mod-relation-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; padding: .7rem; border: 1px solid var(--edge-soft); border-radius: var(--radius-sm); }
.mod-relation-row label { display: grid; gap: .3rem; margin: 0; font-size: .86rem; }
.mod-relation-row button { min-height: 40px; }
.card.narrow > form > button:last-child, .card.narrow > form > button[name=action] { min-width: 8rem; }
/* 编辑资料 */
.settings-card form { display: grid; gap: .3rem; }
.settings-card form > label { margin-top: .7rem; }
.settings-card form > small { color: var(--faint); }
.settings-card form > button { justify-self: start; margin-top: 1rem; }
.settings-card > p:first-of-type a { display: inline-flex; padding: .3rem .9rem; border: 1px solid var(--edge); border-radius: 999px; text-decoration: none; font-size: .88rem; color: var(--muted); }
.settings-card > p:first-of-type a:hover { color: var(--ink); border-color: var(--edge-hot); }
#portrait { box-shadow: 0 0 0 1px var(--edge-hot), 0 0 0 6px rgba(127, 211, 236, .06); }
#crop-status { color: var(--muted); font-size: .88rem; }
/* 收藏弹窗内部 */
.folder-dialog .card { background: transparent; box-shadow: none; backdrop-filter: none; padding: 1.4rem 1.5rem; }
.folder-dialog fieldset, [data-picker-content] fieldset { display: grid; gap: .2rem; }
.folder-choice { padding: .45rem .55rem; border-radius: var(--radius-sm); font-weight: 500; transition: background .15s; }
.folder-choice:hover { background: var(--ice-faint); }
.folder-choice:has(input:checked) { color: var(--ice); }
.picker-controls a { color: var(--muted); font-size: .9rem; }

/* 21. 窄屏 --------------------------------------------------------------- */
@media (max-width: 860px) {
  .side-layout, .folder-layout { grid-template-columns: 1fr; }
  .side-tabs, .folder-layout > .folder-tabs { position: static; display: flex; flex-wrap: nowrap; overflow-x: auto; grid-row: auto; }
  .side-tabs > strong, .side-tabs hr { display: none; }
  .side-tabs a, .folder-layout > .folder-tabs a { flex: none; }
  .side-tabs a[aria-current]::before { top: auto; bottom: 0; left: 22%; right: 22%; width: auto; height: 2px; }
  .folder-layout > :not(.folder-tabs) { grid-column: 1; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-scene { min-height: 12rem; }
  .auth-scene p { display: none; }
}
@media (max-width: 720px) {
  .shell { width: calc(100% - 28px); }
  .head { flex-wrap: wrap; gap: 0 .6rem; padding-top: .5rem; }
  .head nav { width: 100%; order: 1; gap: 1.2rem; overflow-x: auto; }
  .head nav a { min-height: 44px; }
  .account { gap: .1rem; }
  .message-menu > div { left: 50%; right: auto; transform: translateX(-50%); }
  .account > a:not(.btn), .message-menu summary, .account .plain { padding: .2rem .5rem; }
  .hero-content { max-width: 100%; }
  .filters button { margin-left: 0; }
  .mod-relation-row { grid-template-columns: 1fr; }
  section.card > .author { grid-template-columns: 1fr; }
  section.card > .author > a { grid-row: auto; }
  section.card > .author > small, section.card > .author > .badges { grid-column: 1; }
  .download-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
