/* MCAIMOD 全站样式（2026-11 改版：照 Modrinth 的观感重做——浅灰底、白色圆角卡片、柔和阴影、药丸按钮；保留 MC 方块、草地边和品牌绿）。
   颜色、圆角、阴影都在 :root 里，深色模式在 [data-theme="dark"] 里覆盖。贴图一律写相对路径 ../img/…，挂在 /bbs 下也不会 404。 */
:root {
  --bg: #f3f4f1;
  --surface: #ffffff;
  --surface-hover: #fafbf8;
  --surface-2: #eff1ec;
  --surface-3: #e3e7df;
  --border: #e6e9e2;
  --border-strong: #d2d7cb;
  --text: #1a1e17;
  --text-2: #3b4335;
  --muted: #646d5b;
  --primary: #3a7d2b;
  --primary-hover: #326d25;
  --primary-ink: #ffffff;
  --primary-soft: #e3f0dc;
  --gold: #a86f12;
  --gold-soft: #fbf0d9;
  --danger: #c0392b;
  --danger-soft: #fbe5e2;
  --warn: #9a610c;
  --warn-soft: #fdf1dc;
  --ok: #2f7d4f;
  --info: #2f6fb0;
  --info-soft: #e3eefa;
  --link: #2c6aa8;
  --input-bg: #f4f5f2;
  --shadow: 0 1px 2px rgba(24, 32, 16, .05), 0 2px 8px rgba(24, 32, 16, .05);
  --shadow-hover: 0 2px 4px rgba(24, 32, 16, .06), 0 8px 22px rgba(24, 32, 16, .09);
  --shadow-lg: 0 14px 36px rgba(20, 28, 12, .16), 0 2px 6px rgba(20, 28, 12, .06);
  --shadow-px: var(--shadow);
  --ring: 0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent);
  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --focus: var(--primary);
  /* MC 场景：首页天空、页脚泥土 */
  --sky-1: #8ec5ff;
  --sky-2: #d4ebff;
  --hero-ink: #13210d;
  --hero-ink-2: #2f3d27;
  --footer-bg: #2b2119;
  --footer-ink: #eadfce;
  --footer-muted: #bfae95;
  --topbar-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --t-mod: #3a7d2b; --t-modpack: #2f7a6d; --t-plugin: #4a5fb5; --t-map: #b5752f; --t-resourcepack: #b4458a;
  --t-shader: #b8860b; --t-datapack: #6a52b3; --t-schematic: #8a6a3e; --t-addon: #2f8bb0; --t-skin: #c55a3a;
  --t-model: #5b7fa8; --t-texture: #9a5bb8; --t-asset: #6d7765;
  /* 加载器颜色（标签文字用，浅色底上够深） */
  --ld-fabric: #9a6a3c; --ld-forge: #4a5ab8; --ld-neoforge: #b8541a; --ld-quilt: #8a4fc4; --ld-paper: #2a7591; --ld-spigot: #a0640e;
  --ld-bukkit: #a33e3e; --ld-iris: #5b46b0; --ld-optifine: #9a2f2f; --ld-bedrock: #3f6f8f; --ld-vanilla: #3a7d2b;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #131512;
  --surface: #1c1f1b;
  --surface-hover: #21251f;
  --surface-2: #272b25;
  --surface-3: #32372f;
  --border: #2b302a;
  --border-strong: #3e4539;
  --text: #e9ede4;
  --text-2: #c7cfbd;
  --muted: #9ba493;
  --primary: #5cad44;
  --primary-hover: #6cbd53;
  --primary-ink: #0c1408;
  --primary-soft: #223519;
  --gold: #e0a43e;
  --gold-soft: #3a2e17;
  --danger: #e2685a;
  --danger-soft: #3d1f1b;
  --warn: #e0a43e;
  --warn-soft: #3a2e17;
  --ok: #5cbf86;
  --info: #6aa6e6;
  --info-soft: #1b2a3b;
  --link: #79b0ea;
  --input-bg: #161915;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .22);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 8px 22px rgba(0, 0, 0, .35);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, .55);
  --sky-1: #0b1330;
  --sky-2: #22325f;
  --hero-ink: #f1f5ea;
  --hero-ink-2: #c9d4ff;
  --footer-bg: #17110c;
  --footer-ink: #e2d6c3;
  --footer-muted: #a8977e;
  --t-mod: #6cbd53; --t-modpack: #4fb8a6; --t-plugin: #8a9bf0; --t-map: #e0a05a; --t-resourcepack: #e57bbd;
  --t-shader: #f0c040; --t-datapack: #a990f0; --t-schematic: #c9a46e; --t-addon: #5cc0e6; --t-skin: #f08a68;
  --t-model: #8fb2dc; --t-texture: #c795e0; --t-asset: #a8b29c;
  --ld-fabric: #dbb69b; --ld-forge: #9aa4f2; --ld-neoforge: #f5a170; --ld-quilt: #c99bf7; --ld-paper: #7cc6e0; --ld-spigot: #f0b85a;
  --ld-bukkit: #ec8f8f; --ld-iris: #a596f0; --ld-optifine: #f08080; --ld-bedrock: #8ec0e0; --ld-vanilla: #7fcf64;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 .8em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
button, input, select, textarea { font: inherit; color: inherit; }
textarea, input[type="text"], input[type="search"], input:not([type]), input[type="number"], input[type="url"], select {
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 9px 12px; background: var(--input-bg); width: 100%;
  transition: border-color .15s, box-shadow .15s, background .15s; }
textarea { resize: vertical; min-height: 60px; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); background: var(--surface); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
/* 读屏能读到、眼睛看不到（窄屏藏按钮文字用它，不用 display:none，否则按钮没名字） */
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.i { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12px; }
.center { text-align: center; }
.grow { flex: 1; }
.danger { color: var(--danger) !important; }
.pixel, .mc-block { image-rendering: crisp-edges; image-rendering: pixelated; }
.mc-block { flex: none; display: inline-block; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--surface); padding: 8px; border-radius: var(--radius-sm); }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 24px 56px; flex: 1; }
.wrap-wide { max-width: 1280px; }

/* —— 顶栏：和页面同色、半透明，左边站名，中间一组导航（「发现作品」是药丸按钮），右边搜索、发布、通知、头像 —— */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2); border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.topbar-inner { max-width: 1280px; margin: 0 auto; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left)); }
.topbar-note { color: var(--muted); font-size: 14px; padding-left: 12px; border-left: 1px solid var(--border); }
.is-bare .topbar-actions { margin-left: auto; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 800; font-size: 19px; letter-spacing: .3px; white-space: nowrap; margin-right: 8px; }
.brand img { border-radius: 8px; }
.brand:hover { text-decoration: none; }
.mainnav { display: flex; align-items: center; gap: 4px; }
.nav-link { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border-radius: var(--radius-md); color: var(--text-2); font-weight: 600; white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.nav-link:hover { background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.nav-link.is-on { color: var(--primary); background: var(--primary-soft); box-shadow: none; }
.nav-link .i { width: 19px; height: 19px; }
.nav-caret { width: 15px !important; height: 15px !important; margin-left: -2px; opacity: .7; transition: transform .2s; }
/* 「发现作品」：药丸形，在资源页时整块绿色 */
.nav-discover { border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); color: var(--text); padding: 0 14px 0 13px; }
.nav-discover.is-on { background: var(--primary); color: var(--primary-ink); box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 35%, transparent); }
.nav-discover.is-on:hover { background: var(--primary-hover); color: var(--primary-ink); }
.nav-m-only { display: none; }
.nav-drop { position: relative; }
.nav-drop:hover .nav-caret, .nav-drop:focus-within .nav-caret { transform: rotate(180deg); }
.nav-menu { position: absolute; top: calc(100% + 6px); left: 0; display: none; grid-template-columns: repeat(2, 1fr); gap: 2px; min-width: 320px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.nav-drop:hover .nav-menu, .nav-drop:focus-within .nav-menu { display: grid; }
.nav-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); font-weight: 500; }
.nav-menu .i { width: 19px; height: 19px; color: var(--tc, var(--muted)); }
.nav-menu a:hover { background: var(--surface-2); text-decoration: none; }
.topsearch { flex: 1; max-width: 320px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 14px; margin-left: auto; color: var(--muted); box-shadow: var(--shadow); }
.topsearch input { border: 0; outline: none !important; box-shadow: none !important; background: transparent !important; padding: 8px 0; width: 100%; color: var(--text); border-radius: 0; }
/* 输入框自己去掉了焦点框，补在外面这层 */
.topsearch:focus-within, .hero-search:focus-within, .browse-search:focus-within { box-shadow: var(--ring); border-color: var(--primary); }
.topsearch-m { display: none !important; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius-md); border: 0; background: transparent; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.icon-btn .i { width: 20px; height: 20px; }
.icon-btn-round { border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.nav-toggle { display: none; }
.dot-count { position: absolute; top: 2px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; box-shadow: 0 0 0 2px var(--bg); }
.usermenu { position: relative; }
.usermenu-btn { display: flex; align-items: center; gap: 2px; border: 0; background: transparent; padding: 3px 6px 3px 3px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.usermenu-btn:hover { background: var(--surface); box-shadow: var(--shadow); }
.usermenu-list { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; }
.usermenu-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
.usermenu-head > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.usermenu-head small { color: var(--muted); }
.usermenu-list hr { margin: 4px 6px; }
.usermenu-list a, .usermenu-list button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); border: 0; background: none; text-align: left; cursor: pointer; font-weight: 500; }
.usermenu-list a:hover, .usermenu-list button:hover { background: var(--surface-2); text-decoration: none; }
.usermenu-list .i { color: var(--muted); }

/* —— 按钮：圆角 12、实心底、无描边感，按下缩一点 —— */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 16px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 600; line-height: 1.2; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, filter .15s, transform .08s; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), inset 0 -2px 0 rgba(0, 0, 0, .12); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn-soft:hover { background: color-mix(in srgb, var(--primary-soft) 80%, var(--primary)); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); background: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; gap: 5px; }
.btn-sm .i { width: 16px; height: 16px; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
.btn-lg small { font-weight: 500; opacity: .8; font-size: 12px; }
.btn-block { width: 100%; }
.link-btn { border: 0; background: none; padding: 0; color: var(--link); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.link-btn.muted { color: var(--muted); }
.link-btn.muted:hover { color: var(--text-2); }
.link-btn.is-on { color: var(--primary); font-weight: 600; }
.link-btn .i { width: 16px; height: 16px; }
/* 点赞、收藏这类开关 */
.tbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); color: var(--text-2); cursor: pointer; font-weight: 600; transition: background .15s, color .15s, transform .08s; }
.tbtn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.tbtn:active { transform: scale(.97); }
.tbtn b { font-weight: 700; color: var(--muted); }
.tbtn.is-on { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, transparent); background: var(--primary-soft); }
.tbtn.is-on b { color: var(--primary); }
.tbtn.is-on .i { fill: currentColor; fill-opacity: .25; }

/* —— 通用块 —— */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.panel h3 { display: flex; align-items: center; gap: 8px; }
.panel h3 .i { color: var(--muted); }
.block { margin-bottom: 36px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 21px; }
.section-head h2 > .i { width: 22px; height: 22px; color: var(--primary); }
.section-head h2 small { color: var(--muted); font-weight: 500; font-size: 14px; }
.section-head .more { display: inline-flex; align-items: center; gap: 2px; color: var(--text-2); font-weight: 600; font-size: 14px; padding: 4px 6px 4px 12px; border-radius: 999px; }
.section-head .more .i { width: 16px; height: 16px; }
.section-head .more:hover { background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--primary); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.page-head p { margin: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.crumbs a { color: var(--text-2); }
.empty { text-align: center; padding: 44px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty .i { width: 36px; height: 36px; opacity: .6; margin-bottom: 6px; }
.empty .mc-block { display: block; width: 48px; height: 48px; margin: 0 auto 12px; }
.empty p { margin: 0 0 10px; }
.notice { padding: 12px 16px; border-radius: var(--radius-md); background: var(--info-soft); color: var(--text); margin: 0 0 16px; }
.notice-warn { background: var(--warn-soft); }
.notice-danger { background: var(--danger-soft); }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 20px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge .i { width: 13px; height: 13px; }
.badge-am { background: var(--primary-soft); color: var(--primary); }
.badge-gold { background: var(--gold-soft); color: var(--gold); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-ok { background: var(--primary-soft); color: var(--ok); }
.mini { display: inline-flex; align-items: center; padding: 0 9px; border-radius: 999px; font-size: 12px; line-height: 22px; background: var(--surface-2); color: var(--text-2); font-weight: 500; white-space: nowrap; }
a.mini:hover { color: var(--primary); text-decoration: none; background: var(--primary-soft); }
/* 加载器标签：每种一个颜色 */
.lchip { display: inline-flex; align-items: center; gap: 5px; padding: 0 9px 0 8px; border-radius: 999px; font-size: 12px; line-height: 22px; font-weight: 600; white-space: nowrap; color: var(--lc, var(--text-2)); background: color-mix(in srgb, var(--lc, #888) 13%, transparent); }
.lchip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ld-fabric { --lc: var(--ld-fabric); } .ld-forge { --lc: var(--ld-forge); } .ld-neoforge { --lc: var(--ld-neoforge); } .ld-quilt { --lc: var(--ld-quilt); }
.ld-paper { --lc: var(--ld-paper); } .ld-spigot { --lc: var(--ld-spigot); } .ld-bukkit { --lc: var(--ld-bukkit); } .ld-iris { --lc: var(--ld-iris); }
.ld-optifine { --lc: var(--ld-optifine); } .ld-bedrock { --lc: var(--ld-bedrock); } .ld-vanilla { --lc: var(--ld-vanilla); }
.role { margin-left: 4px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 700; vertical-align: 1px; }
.role-admin { background: var(--danger-soft); color: var(--danger); }
.role-mod { background: var(--info-soft); color: var(--info); }

.avatar { display: inline-grid; place-items: center; flex: none; width: var(--s, 32px); height: var(--s, 32px); border-radius: 50%; object-fit: cover; background: var(--c, #888); color: #fff; font-weight: 700; font-size: calc(var(--s, 32px) * .45); line-height: 1; }
.avatar.sys { background: var(--surface-3); color: var(--muted); --s: 36px; }
.user-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; }
.user-link:hover { color: var(--primary); text-decoration: none; }

/* 类型颜色 */
.t-mod { --tc: var(--t-mod); } .t-modpack { --tc: var(--t-modpack); } .t-plugin { --tc: var(--t-plugin); } .t-map { --tc: var(--t-map); }
.t-resourcepack { --tc: var(--t-resourcepack); } .t-shader { --tc: var(--t-shader); } .t-datapack { --tc: var(--t-datapack); }
.t-schematic { --tc: var(--t-schematic); } .t-addon { --tc: var(--t-addon); } .t-skin { --tc: var(--t-skin); } .t-model { --tc: var(--t-model); }
.t-texture { --tc: var(--t-texture); } .t-asset { --tc: var(--t-asset); }
/* 每个分类对应的原版方块贴图（无封面时铺底用；立体方块图是 block-<分类>.png） */
.t-mod { --tex: url(../img/mc/v1/crafting_table_front.png); } .t-modpack { --tex: url(../img/mc/v1/chiseled_bookshelf_occupied.png); }
.t-plugin { --tex: url(../img/mc/v1/observer_front.png); } .t-map { --tex: url(../img/mc/v1/cartography_table_top.png); }
.t-resourcepack { --tex: url(../img/mc/v1/magenta_glazed_terracotta.png); } .t-shader { --tex: url(../img/mc/v1/glowstone.png); }
.t-datapack { --tex: url(../img/mc/v1/repeating_command_block_front.png); } .t-schematic { --tex: url(../img/mc/v1/bricks.png); }
.t-addon { --tex: url(../img/mc/v1/bedrock.png); } .t-skin { --tex: url(../img/mc/v1/carved_pumpkin.png); }
.t-model { --tex: url(../img/mc/v1/slime_block.png); } .t-texture { --tex: url(../img/mc/v1/amethyst_block.png); }
.t-asset { --tex: url(../img/mc/v1/note_block.png); }
.type-chip { display: inline-flex; align-items: center; gap: 4px; padding: 0 9px 0 7px; border-radius: 999px; font-size: 12px; line-height: 22px; font-weight: 700; color: var(--tc, var(--muted)); background: color-mix(in srgb, var(--tc, #888) 13%, transparent); white-space: nowrap; }
.type-chip .i { width: 14px; height: 14px; }
a.type-chip:hover { text-decoration: none; filter: brightness(1.1); }
/* 没封面、没图标时：同类方块贴图淡淡铺底，中间放这个分类的方块 */
.rc-cover.is-icon, .rc-icon.is-block, .res-icon.is-block, .draft-thumb[class*="t-"], .related-ic[class*="t-"] { image-rendering: crisp-edges; image-rendering: pixelated;
  background: linear-gradient(color-mix(in srgb, var(--surface-2) 84%, transparent), color-mix(in srgb, var(--surface-2) 84%, transparent)), var(--tex, none) 0 0 / 32px 32px; }

/* —— 分类标签条（列表页顶上、首页分类）：一排药丸，选中的整块绿色，窄屏横着滑 —— */
.ttabs { margin: 0 -6px 18px; }
.ttabs-track { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 6px 6px; }
.ttabs-track::-webkit-scrollbar { display: none; }
.ttab { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px 0 10px; font-size: 14.5px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-weight: 600; white-space: nowrap; box-shadow: var(--shadow); border: 1px solid var(--border); transition: background .15s, color .15s, box-shadow .15s, transform .08s; }
.ttab .i { width: 17px; height: 17px; color: var(--tc, var(--muted)); }
.ttab small { color: var(--muted); font-weight: 500; font-size: 12px; }
.ttab:hover { text-decoration: none; color: var(--text); box-shadow: var(--shadow-hover); }
.ttab:active { transform: scale(.97); }
.ttab.is-on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 30%, transparent); }
.ttab.is-on .i, .ttab.is-on small { color: inherit; }

/* —— 药丸标签组（个人主页、搜索、论坛排序、评论排序、作品页「介绍 / 版本 / 评论」）—— */
.tabs, .seg, .ptabs { display: inline-flex; max-width: 100%; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar, .seg::-webkit-scrollbar, .ptabs::-webkit-scrollbar { display: none; }
.tabs a, .seg a, .seg button, .ptabs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 15px; border-radius: 999px; color: var(--text-2); font-weight: 600; border: 0; background: none; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.tabs a:hover, .seg a:hover, .seg button:hover, .ptabs a:hover { text-decoration: none; color: var(--text); background: var(--surface-2); }
.tabs .is-on, .seg .is-on, .ptabs .is-on, .tabs .is-on:hover, .seg .is-on:hover, .ptabs .is-on:hover { background: var(--primary-soft); color: var(--primary); }
.tabs small, .ptabs small { color: var(--muted); font-weight: 500; }
.ptabs .i { width: 17px; height: 17px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

/* 分页：圆形按钮 */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 28px 0 0; flex-wrap: wrap; }
.pager a, .pager span { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 38px; height: 38px; padding: 0 12px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-weight: 600; box-shadow: var(--shadow); border: 1px solid var(--border); }
.pager a:hover { text-decoration: none; color: var(--primary); box-shadow: var(--shadow-hover); }
.pager .cur { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.pager .gap { border: 0; background: none; box-shadow: none; min-width: 20px; padding: 0; }
.pager .i { width: 16px; height: 16px; }
.pager-sm { margin: 0; gap: 4px; }
.pager-sm a, .pager-sm span { min-width: 34px; height: 34px; padding: 0 8px; font-size: 14px; }

/* —— 首页 —— */
.announce { display: flex; align-items: center; gap: 10px; padding: 11px 16px; margin-bottom: 18px; border-radius: var(--radius); background: var(--gold-soft); color: var(--text); }
.announce b { color: var(--gold); }
.announce span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.announce time { color: var(--muted); font-size: 13px; }
.announce:hover { text-decoration: none; filter: brightness(.98); }
/* 首页主视觉：一条矮横幅，不占首屏。白天是蓝天加一朵小方块云，夜间（深色主题）是星空；底边一排小号的花草和草方块。
   上面一行是标题和快捷栏统计，下面一行是搜索和三个按钮，分类和热门作品第一屏就能看到。 */
.hero { position: relative; overflow: hidden; display: grid; gap: 16px; padding: 24px 28px 46px; margin-bottom: 20px; border-radius: var(--radius); color: var(--hero-ink); --focus: #2d6a22;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='136' height='32' shape-rendering='crispEdges'%3E%3Cg fill='white' fill-opacity='.8'%3E%3Crect x='16' y='0' width='96' height='16'/%3E%3Crect x='0' y='16' width='136' height='16'/%3E%3C/g%3E%3C/svg%3E") right 18% top 14px / 68px 16px no-repeat,
    linear-gradient(var(--sky-1), var(--sky-2));
  box-shadow: var(--shadow); }
[data-theme="dark"] .hero { --focus: #ffd34d;
  background:
    radial-gradient(1.5px 1.5px at 20% 20%, #fff 99%, transparent), radial-gradient(1.5px 1.5px at 60% 12%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 45% 35%, #dfe6ff 99%, transparent), radial-gradient(1.5px 1.5px at 82% 26%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 30% 48%, #cfd8ff 99%, transparent), radial-gradient(1.5px 1.5px at 92% 8%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 70% 40%, #fff 99%, transparent), radial-gradient(1.5px 1.5px at 8% 38%, #dfe6ff 99%, transparent),
    linear-gradient(var(--sky-1), var(--sky-2)); }
.hero-scene { position: absolute; left: 0; right: 0; bottom: 0; height: 32px; pointer-events: none; image-rendering: crisp-edges; image-rendering: pixelated;
  background:
    url(../img/mc/v1/plants.png) left 0 bottom 16px / 160px 16px repeat-x,
    url(../img/mc/v1/grass_block_side.png) left 0 bottom 0 / 16px 16px repeat-x; }
[data-theme="dark"] .hero-scene { filter: brightness(.55) saturate(.85); }
.hero > :not(.hero-scene) { position: relative; z-index: 1; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.hero-title { flex: 1 1 420px; min-width: 0; }
.hero h1 { font-size: clamp(21px, 2.5vw, 28px); line-height: 1.3; margin: 2px 0 4px; }
.nobr { display: inline-block; }
.hero .lead { color: var(--hero-ink-2); max-width: 680px; margin: 0; font-size: 14.5px; }
.eyebrow { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; color: #2d6a22; letter-spacing: 1px; font-size: 13px; text-transform: uppercase; }
[data-theme="dark"] .eyebrow { color: #ffd34d; }
.hero .eyebrow { margin: 0; font-size: 12px; }
.hero-search { display: flex; align-items: center; gap: 8px; background: var(--surface); color: var(--muted); border-radius: var(--radius-md); padding: 5px 5px 5px 14px; max-width: 560px; border: 1px solid var(--border); }
.hero .hero-search { flex: 1 1 320px; margin: 0; border-color: transparent; box-shadow: 0 2px 10px rgba(0, 0, 0, .1); }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: none !important; box-shadow: none !important; background: transparent !important; color: var(--text); padding: 8px 0; }
.hero-bar { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn:not(.btn-primary) { background: rgba(255, 255, 255, .88); border-color: transparent; color: var(--hero-ink); }
.hero .btn:not(.btn-primary):hover { background: #fff; }
[data-theme="dark"] .hero .btn:not(.btn-primary) { background: rgba(255, 255, 255, .12); color: #fff; }
[data-theme="dark"] .hero .btn:not(.btn-primary):hover { background: rgba(255, 255, 255, .2); }
.hero .btn-primary { background: #ffd34d; border-color: #ffd34d; color: #2b2410; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
.hero .btn-primary:hover { background: #ffdc6b; border-color: #ffdc6b; }
/* 统计做成游戏里的快捷栏（小号，放在标题右边） */
.hotbar { list-style: none; display: inline-flex; flex-wrap: wrap; gap: 3px; margin: 0; padding: 3px; background: rgba(20, 20, 20, .62); border-radius: 4px; }
.hotbar li { display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 5px; background: rgba(255, 255, 255, .08); box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .14), inset -2px -2px 0 rgba(0, 0, 0, .35); color: #fff; }
.hotbar img { width: 24px; height: 24px; image-rendering: crisp-edges; image-rendering: pixelated; }
.hotbar b { font-size: 16px; text-shadow: 2px 2px 0 #3f3f3f; }
.hotbar span { font-size: 12px; opacity: .9; }
.idea-mini { list-style: none; margin: 0; padding: 0; }
.idea-mini li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.idea-mini li:last-child { border: 0; }
.idea-mini li > div { min-width: 0; }
.idea-mini li > div > a { color: var(--text); font-weight: 600; }
.vote-mini { display: flex; flex-direction: column; align-items: center; min-width: 48px; padding: 5px 4px; border-radius: var(--radius-md); background: var(--gold-soft); color: var(--gold); }
.vote-mini:hover { text-decoration: none; }
.cols-2 > .panel { padding: 18px 20px; }
.cols-2 .plist { box-shadow: none; border: 0; border-radius: 0; background: transparent; }
.cols-2 .prow { padding: 12px 0; }
.cols-2 .prow:hover { background: transparent; }
.channel-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.channel-chips a { display: inline-flex; align-items: center; gap: 5px; padding: 7px 13px; border-radius: 999px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.channel-chips a:hover { border-color: var(--primary); text-decoration: none; }
.channel-chips small { color: var(--ok); font-size: 12px; }

/* —— 作品卡片 ——
   .rlist 里一行一个：左边 96px 圆角大图标，中间标题、作者、简介、标签，右边热度、点赞、更新时间（照 Modrinth 的列表）
   .rgrid 里（以及列表页切到「卡片」时）是 16:9 封面卡片。整张卡片都能点（标题链接铺满），作者链接浮在上面单独能点。 */
.rc { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: background .15s, box-shadow .15s, transform .15s; }
.rc:hover { background: var(--surface-hover); box-shadow: var(--shadow-hover); }
.rc.is-featured { border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); }
.rc h3 { display: flex; align-items: center; min-width: 0; margin: 0; font-size: 18px; font-weight: 700; line-height: 1.35; }
.rc h3 a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.rc h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.rc h3 a:hover { text-decoration: none; }
.rc:focus-within { box-shadow: var(--ring), var(--shadow); }
.rc h3 a:focus-visible { outline: none; }
.rc-by, .rc .ai-mark { position: relative; z-index: 2; }
.rc-by { min-width: 0; font-size: 14px; color: var(--muted); }
.rc-by .user-link { max-width: 100%; color: var(--muted); }
.rc-by .user-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.rc-head h3 { max-width: 100%; }
.rc-summary { color: var(--text-2); font-size: 14.5px; margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.rc-summary:empty { display: none; }
.rc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rc-cover { display: grid; place-items: center; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.rc-cover:not(.is-icon) { position: relative; }
.rc-cover:not(.is-icon) > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .3s; }
.rc:hover .rc-cover:not(.is-icon) > img { transform: scale(1.03); }
.rc-cover.is-icon img { width: 72px; height: 72px; object-fit: contain; }
.rc-cover.is-icon .mc-block { width: 64px; height: 64px; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .15)); transition: transform .15s; }
.rc:hover .rc-cover.is-icon .mc-block { transform: translateY(-3px); }
/* 方形封面（模型市场的渲染图等）整张显示，不裁 */
.rc-cover.is-contain { background: linear-gradient(180deg, #f3f5f2, #e6ebe5); }
.rc-cover.is-contain img { box-sizing: border-box; object-fit: contain !important; padding: 8px; }
.rc-icon { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 18px; overflow: hidden; background: var(--surface-2); flex: none; }
.rc-icon img { width: 100%; height: 100%; object-fit: contain; }
.rc-icon.is-cover img { object-fit: cover; }
.rc-icon .mc-block { width: 48px; height: 48px; }
.rc-stats { display: flex; gap: 6px 14px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.rc-stats > span { display: inline-flex; align-items: center; gap: 5px; }
.rc-stats b { color: var(--text); font-weight: 700; font-size: 16px; }
.rc-stats small { font-size: 13px; }
.rc-stats .i { width: 17px; height: 17px; }
.rc-stats > span:first-child .i { color: #e0682b; }
.rc-time { font-size: 13px; }
.rc-time .i { width: 15px !important; height: 15px !important; }
/* 列表：一行一个 */
.rlist { display: flex; flex-direction: column; gap: 12px; }
.rlist .rc { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; grid-template-areas: "icon body stats"; gap: 4px 18px; padding: 16px; align-items: start; }
.rlist .rc-cover { display: none; }
.rlist .rc-icon { grid-area: icon; }
.rlist .rc-body { grid-area: body; min-width: 0; padding-top: 2px; }
.rlist .rc-stats { grid-area: stats; flex-direction: column; align-items: flex-end; align-self: stretch; padding-top: 2px; }
.rlist .rc-time { margin-top: auto; }
/* 卡片：16:9 封面在上 */
.rgrid, :root[data-view="grid"] .rlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 16px; }
.rgrid-sm { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.rgrid .rc, :root[data-view="grid"] .rlist .rc { display: flex; flex-direction: column; align-items: stretch; padding: 0; gap: 0; }
.rgrid .rc:hover, :root[data-view="grid"] .rlist .rc:hover { transform: translateY(-2px); }
:root[data-view="grid"] .rlist .rc-cover { display: grid; }
.rgrid .rc-icon, :root[data-view="grid"] .rlist .rc-icon { display: none; }
/* 有封面也有图标：小图标压在封面左下角 */
.rgrid .rc.has-both .rc-icon, :root[data-view="grid"] .rlist .rc.has-both .rc-icon { display: grid; align-self: flex-start; position: relative; z-index: 1; width: 52px; height: 52px; margin: -30px 0 -6px 14px; border-radius: 14px; border: 3px solid var(--surface); box-shadow: var(--shadow); }
.rgrid .rc-body, :root[data-view="grid"] .rlist .rc-body { display: flex; flex-direction: column; padding: 12px 14px 0; flex: 1; min-width: 0; }
.rgrid .rc-head, :root[data-view="grid"] .rlist .rc-head { flex-direction: column; align-items: stretch; gap: 0; }
.rgrid .rc h3, :root[data-view="grid"] .rlist .rc h3 { font-size: 16px; }
.rgrid .rc-by, :root[data-view="grid"] .rlist .rc-by { font-size: 13px; }
.rgrid .rc-summary, :root[data-view="grid"] .rlist .rc-summary { font-size: 13.5px; color: var(--muted); min-height: 2.9em; }
.rgrid .rc-tags, :root[data-view="grid"] .rlist .rc-tags { margin-top: 8px; gap: 4px; }
.rgrid .rc-stats, :root[data-view="grid"] .rlist .rc-stats { flex-direction: row; align-items: center; align-self: stretch; padding: 10px 14px 12px; margin-top: auto; font-size: 13px; }
.rgrid .rc-stats b, :root[data-view="grid"] .rlist .rc-stats b { font-size: 14px; }
.rgrid .rc-stats small, :root[data-view="grid"] .rlist .rc-stats small { display: none; }
.rgrid .rc-time, :root[data-view="grid"] .rlist .rc-time { margin: 0 0 0 auto; }

/* —— 列表页：左边一栏筛选，右边大搜索框、排序 / 每页 / 列表卡片切换 / 分页，下面是结果 —— */
.browse { display: grid; grid-template-columns: 288px minmax(0, 1fr); gap: 24px; align-items: start; }
.browse-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.browse-main { min-width: 0; }
.promo-card { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-radius: var(--radius); color: var(--text); border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border)); box-shadow: var(--shadow);
  background: linear-gradient(135deg, var(--primary-soft), var(--surface) 75%); transition: box-shadow .15s, transform .15s; }
.promo-card:hover { text-decoration: none; box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.promo-card .mc-block { width: 48px; height: 48px; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .14)); }
.promo-card > span { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.4; }
.promo-card b { font-size: 15.5px; color: var(--primary); }
.promo-card small { color: var(--text-2); font-size: 12.5px; }
.promo-card > .i { color: var(--muted); width: 16px; height: 16px; align-self: flex-start; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 4px 0; }
.side-head h2 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 16px; }
.side-head h2 .i { color: var(--muted); }
.facets-clear { font-weight: 600; }
.fpanel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.fpanel > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 16px; font-weight: 700; cursor: pointer; list-style: none; border-radius: var(--radius); user-select: none; }
.fpanel > summary::-webkit-details-marker { display: none; }
.fpanel > summary:hover { color: var(--primary); }
.fpanel > summary .i { color: var(--muted); transition: transform .2s; }
.fpanel[open] > summary .i { transform: rotate(180deg); }
.fpanel-body { padding: 0 8px 12px; }
.fpanel-search { margin: 0 0 8px; padding: 7px 12px !important; font-size: 14px; }
.fopts { display: flex; flex-direction: column; gap: 1px; }
.fopts-scroll { max-height: 340px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.fopt { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; color: var(--text-2); font-size: 14.5px; line-height: 1.4; }
.fopt:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.fopt > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbox { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--border-strong); background: var(--surface); transition: background .15s, border-color .15s; }
.fbox .i { width: 13px; height: 13px; stroke-width: 3; color: var(--primary-ink); }
.fopt:hover .fbox { border-color: var(--primary); }
.fopt.is-on { color: var(--text); font-weight: 600; }
.fopt.is-on .fbox { background: var(--primary); border-color: var(--primary); }
.fopt.is-parent:not(.is-on) .fbox { border-color: var(--primary); }
.fopt-minor { display: none; padding-left: 34px; font-size: 14px; }
.fopt-minor.is-open, .fpanel-gv:has([data-show-all]:checked) .fopt-minor, .fpanel-body.is-searching .fopt-minor { display: flex; }
.fshow { margin: 8px 8px 0; font-size: 13.5px; color: var(--muted); }
.ldot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--lc, var(--muted)); margin-left: -2px; }
.fmark { display: inline-grid; color: var(--primary); }
.fmark .i { width: 17px; height: 17px; }
.fopt .ai-mark { margin: 0; width: 20px; height: 20px; font-size: 11px; vertical-align: 0; cursor: inherit; }
.fopt .ai-mark.is-wide { width: auto; min-width: 20px; font-size: 9px; padding: 0 4px; }
.browse-search { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--muted); }
.browse-search > .i { width: 20px; height: 20px; }
.browse-search input { flex: 1; min-width: 0; border: 0; outline: none !important; box-shadow: none !important; background: transparent !important; padding: 9px 0; font-size: 16px; color: var(--text); border-radius: 0; }
.browse-search .btn { min-height: 40px; }
.browse-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.browse-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.select-pill { display: inline-flex; align-items: center; gap: 2px; height: 38px; padding: 0 4px 0 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow); color: var(--muted); font-size: 14px; cursor: pointer; }
.select-pill:focus-within { box-shadow: var(--ring); border-color: var(--primary); }
.select-pill select { width: auto; border: 0 !important; box-shadow: none !important; background: transparent !important; padding: 6px 6px; font-weight: 700; color: var(--text); cursor: pointer; border-radius: 8px; }
.browse-total { margin-left: auto; font-size: 14px; }
.view-toggle { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow); }
.view-toggle .icon-btn { width: 32px; height: 30px; border-radius: 9px; }
.view-toggle .icon-btn:hover { box-shadow: none; background: var(--surface-2); }
.view-toggle .icon-btn .i { width: 18px; height: 18px; }
.view-toggle [aria-pressed="true"], .view-toggle [aria-pressed="true"]:hover { background: var(--primary-soft); color: var(--primary); }
.facets-toggle { display: none; background: var(--surface); box-shadow: var(--shadow); }
.facets-count { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin-left: 2px; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font-size: 11px; }
.tag-filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.tag-filter a { display: inline-flex; align-items: center; gap: 2px; }
.tag-filter .i { width: 14px; height: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.filters input[type="search"], .filters input:not([type]), .filters select { width: auto; }
.filters input[type="search"] { flex: 1 1 200px; min-width: 160px; }
.filters select { flex: 1 1 140px; max-width: 220px; }

/* —— 作品详情（照 Modrinth 的项目页：头部大图标、标题、简介、数据和下载按钮；下面「介绍 / 版本 / 评论」，右边几张信息卡）—— */
.res-head { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 16px; }
/* 作品页封面整张显示（站长：「地图页面也显示不全」）：固定高度的一条，图按原比例放在中间，两边用同一张图糊开垫底 */
.res-cover-box { position: relative; height: clamp(200px, 34vw, 380px); overflow: hidden; background: var(--surface-2); }
.res-cover-bg { position: absolute; inset: -80px; width: calc(100% + 160px); height: calc(100% + 160px); object-fit: cover; filter: blur(32px) saturate(1.15); opacity: .75; }
.res-cover { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; }
.res-head-main { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 8px 22px; padding: 24px; align-items: start; }
.res-icon { width: 104px; height: 104px; border-radius: 22px; background: var(--surface-2); border: 4px solid var(--surface); display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow); }
.res-head.has-cover .res-icon { margin-top: -64px; position: relative; }
.res-icon img { width: 100%; height: 100%; object-fit: contain; }
.res-icon .mc-block { width: 64px; height: 64px; }
.res-title { min-width: 0; }
.res-title h1 { margin: 0 0 6px; font-size: 30px; word-break: break-word; }
.res-title .lead { color: var(--text-2); font-size: 16px; margin-bottom: 12px; }
.res-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: var(--muted); font-size: 15px; }
.res-stats > span { display: inline-flex; align-items: center; gap: 6px; }
.res-stats b { color: var(--text); font-size: 17px; }
.res-stats > span:first-child .i { color: #e0682b; }
.res-tags { flex-wrap: wrap; gap: 6px !important; }
.res-byline { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; color: var(--muted); font-size: 14px; margin-top: 12px; }
.res-actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 230px; }
.res-dl { flex-wrap: wrap; row-gap: 0; }
.res-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.res-acts .tbtn { flex: 1 1 auto; justify-content: center; padding: 0 10px; }
.owner-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 24px; border-top: 1px solid var(--border); background: var(--surface-2); }
.owner-bar .btn:not(.btn-primary):not(.btn-danger) { background: var(--surface); }
.owner-bar select { width: auto; padding: 5px 10px; }
.ptabs { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 10; margin-bottom: 16px; }
.res-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.res-main { min-width: 0; }
.res-main > .block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); scroll-margin-top: calc(var(--topbar-h) + 70px); margin-bottom: 20px; }
.res-main > .block > .section-head h2 > .i { color: var(--primary); }
.res-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.res-side .panel + .panel { margin-top: 0; }
.side-card { padding: 18px 20px; }
.side-card h3 { font-size: 16px; margin-bottom: 10px; }
.side-card h4 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 12px 0 7px; }
.side-card h3 + h4 { margin-top: 0; }
.info { margin: 0 0 12px; }
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.info-row:last-child { border-bottom: 0; }
.info-row dt { color: var(--muted); white-space: nowrap; }
.info-row dd { margin: 0; text-align: right; word-break: break-word; font-weight: 500; }
.file-details { margin-bottom: 10px; }
.file-details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.author-card { display: flex; align-items: center; gap: 12px; }
.author-card > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.author-card a { color: var(--text); }
.author-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.author-acts .tbtn { min-height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.related { list-style: none; margin: 0 -8px; padding: 0; }
.related a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--radius-md); color: var(--text); }
.related a:hover { background: var(--surface-2); text-decoration: none; }
.related-ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.related-ic img { width: 100%; height: 100%; object-fit: cover; }
.related-ic img.pixel { object-fit: contain; }
.related-ic .mc-block { width: 32px; height: 32px; }
.related a > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.related b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related small { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; }
.related small .i { width: 13px; height: 13px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 18px; }
.gallery a { display: block; aspect-ratio: 16 / 10; border-radius: var(--radius-md); overflow: hidden; background: var(--surface-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.gallery a:hover img { transform: scale(1.04); }
.video-embed { position: relative; aspect-ratio: 16 / 9; margin-bottom: 18px; border-radius: var(--radius-md); overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.versions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.version { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; transition: background .15s; }
.version:hover { background: var(--surface-hover); }
.version.is-latest { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.version-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.version-head > b { font-size: 16px; }
.version-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.version .md { margin-top: 8px; color: var(--text-2); }
.files { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.files li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; background: var(--surface-2); border-radius: 10px; }
.files li > .i { color: var(--muted); }
.files .btn { background: var(--surface); }
.file-name { font-weight: 600; word-break: break-all; flex: 1; min-width: 140px; }
.detect-line { flex-basis: 100%; }

/* 物品与配方 */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-bottom: 20px; }
.item-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); text-align: center; }
.item-cell img { width: 48px; height: 48px; }
.item-cell b { font-size: 13px; }
.item-cell small { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.item-cell .lore { display: none; position: absolute; z-index: 5; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); width: 220px; padding: 8px 10px; border-radius: 6px; background: #1d1028; color: #e8d7ff; border: 2px solid #3b1f5c; font-size: 12px; text-align: left; flex-direction: column; }
.item-cell:hover .lore, .item-cell:focus .lore { display: flex; }
.slot-empty .i { width: 40px; height: 40px; color: var(--muted); }
.recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.recipe { display: grid; grid-template-columns: auto auto auto; align-items: center; justify-content: start; gap: 10px; padding: 12px; border-radius: 10px; background: #c6c6c6; color: #333; }
[data-theme="dark"] .recipe { background: #3b3b3b; color: #ddd; }
.recipe-name { grid-column: 1 / -1; color: inherit !important; opacity: .8; }
.craft-grid { display: grid; grid-template-columns: repeat(3, 34px); gap: 2px; }
.craft-inputs { display: flex; gap: 2px; flex-wrap: wrap; max-width: 110px; }
.slot { position: relative; display: grid; place-items: center; width: 34px; height: 34px; background: #8b8b8b; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; }
[data-theme="dark"] .slot { background: #262626; box-shadow: inset 2px 2px 0 #111, inset -2px -2px 0 #4a4a4a; }
.slot img { width: 28px; height: 28px; }
.slot i { font-size: 10px; font-style: normal; }
.craft-result { position: relative; }
.craft-result .slot { width: 46px; height: 46px; }
.craft-result .slot img { width: 36px; height: 36px; }
.craft-result .count { position: absolute; right: 2px; bottom: 0; color: #fff; text-shadow: 1px 1px 0 #3f3f3f; font-size: 13px; }
.arrow { font-size: 22px; font-weight: 700; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.arrow small { font-size: 10px; }

/* —— Markdown —— */
.md { overflow-wrap: anywhere; line-height: 1.75; }
.md h1, .md h2 { margin: 1.3em 0 .55em; }
.md h3, .md h4, .md h5, .md h6 { margin: 1.2em 0 .5em; }
.md > :first-child { margin-top: 0; }
.md img { border-radius: var(--radius-md); cursor: zoom-in; max-height: 640px; }
.md pre { background: var(--surface-2); border: 1px solid var(--border); padding: 12px 14px; border-radius: var(--radius-md); overflow-x: auto; font-size: 13px; line-height: 1.55; }
.md code { font-family: var(--mono); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 0 0 1em; padding: 8px 16px; border-left: 4px solid var(--primary); background: var(--surface-2); border-radius: 0 var(--radius-md) var(--radius-md) 0; color: var(--text-2); }
.md ul, .md ol { padding-left: 1.5em; }
.md-table { overflow-x: auto; margin-bottom: 1em; }
.md table { border-collapse: collapse; }
.md th, .md td { border: 1px solid var(--border); padding: 6px 10px; }
.md th { background: var(--surface-2); }
.md a.mention { font-weight: 600; }

/* —— 评论 —— */
.comments { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-top: 0; scroll-margin-top: calc(var(--topbar-h) + 70px); box-shadow: var(--shadow); }
.comments .section-head { flex-wrap: wrap; }
.comment-form { display: flex; gap: 12px; margin-bottom: 20px; }
.form-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.form-row.end { justify-content: flex-end; }
.comment { display: flex; gap: 12px; padding: 16px 0; border-top: 1px solid var(--border); }
.comment.is-reply { padding: 12px 0 0; border: 0; }
.comment.is-target { background: var(--gold-soft); border-radius: var(--radius-md); padding-left: 10px; }
.comment-main { flex: 1; min-width: 0; }
.comment-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.comment-body { margin: 4px 0; }
.comment-body p:last-child { margin-bottom: 0; }
.comment-actions { display: flex; gap: 14px; font-size: 13px; }
.comment-actions .link-btn { color: var(--muted); }
.comment-actions .link-btn:hover { color: var(--text-2); }
.comment-actions .link-btn.is-on { color: var(--primary); }
.replies { margin-top: 4px; padding-left: 4px; }
.reply-form { margin: 8px 0; }

/* —— 论坛、灵感 —— */
.forum-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
.boards { display: flex; flex-direction: column; gap: 10px; }
.board-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.board-card:hover { box-shadow: var(--shadow-hover); text-decoration: none; transform: translateY(-1px); }
.board-card div { flex: 1; min-width: 0; }
.board-card p { margin: 0; }
.board-card.is-ideas { background: linear-gradient(135deg, var(--gold-soft), var(--surface) 80%); }
.board-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary); }
.board-card.is-ideas .board-icon { background: var(--gold); color: #fff; }
.plist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.prow { display: flex; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--border); align-items: flex-start; transition: background .15s; }
.prow:hover { background: var(--surface-hover); }
.prow:last-child { border: 0; }
.prow.is-pinned { background: color-mix(in srgb, var(--gold-soft) 45%, var(--surface)); }
.prow-main { flex: 1; min-width: 0; }
.prow-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 16px; font-weight: 700; }
.prow-title a { color: var(--text); }
.prow-excerpt { margin: 3px 0 7px; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.prow-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--muted); }
.prow-stats { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--text-2); min-width: 64px; }
.prow-stats span { display: inline-flex; gap: 5px; align-items: center; }
.prow-stats .i { width: 15px; height: 15px; color: var(--muted); }
.prow-thumb { flex: none; width: 104px; height: 68px; border-radius: 10px; overflow: hidden; }
.prow-thumb img { width: 100%; height: 100%; object-fit: cover; }
.flag-pin { color: var(--gold); }
.board-chip { padding: 0 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12px; line-height: 20px; font-weight: 600; }
.idea-status { padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.idea-status.is-open { background: var(--gold-soft); color: var(--gold); }
.idea-status.is-claimed { background: var(--info-soft); color: var(--info); }
.idea-status.is-done { background: var(--primary-soft); color: var(--ok); }
.post { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 20px; box-shadow: var(--shadow); }
.post-title-row { display: flex; gap: 6px; flex-wrap: wrap; }
.post-head h1 { margin: 8px 0 12px; word-break: break-word; }
.post-byline { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; color: var(--muted); font-size: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.post-byline > span { display: inline-flex; align-items: center; gap: 4px; }
.post-body { font-size: 16px; }
.post-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.post .owner-bar { margin: 18px -28px -28px; border-radius: 0 0 var(--radius) var(--radius); }
.attached-resource { max-width: 340px; margin-top: 18px; }
.attached-resource > .rc { display: flex; flex-direction: column; }
.attached-resource > .rc .rc-icon { display: none; }
.attached-resource > .rc .rc-body { padding: 12px 14px 0; }
.attached-resource > .rc .rc-stats { padding: 10px 14px 12px; }
.attached-resource > .rc .rc-stats small { display: none; }
.idea-box { margin-top: 20px; background: linear-gradient(135deg, var(--gold-soft), var(--surface) 80%); }
.idea-box-head { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.ideas-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 28px; border-radius: var(--radius); margin-bottom: 18px; background: linear-gradient(135deg, var(--gold-soft), var(--surface) 75%); border: 1px solid var(--border); flex-wrap: wrap; box-shadow: var(--shadow); }
.ideas-hero h1 { display: flex; align-items: center; gap: 8px; }
.ideas-hero h1 .i { width: 30px; height: 30px; color: var(--gold); }
.ideas-hero p { max-width: 720px; margin: 0; color: var(--text-2); }
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.idea-card { display: flex; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow .15s; }
.idea-card:hover { box-shadow: var(--shadow-hover); }
.idea-vote { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 60px; padding: 8px 4px; border-radius: var(--radius-md); background: var(--gold-soft); color: var(--gold); height: fit-content; }
.idea-vote:hover { text-decoration: none; filter: brightness(.97); }
.idea-vote b { font-size: 18px; }
.idea-vote small { font-size: 11px; }
.idea-main { flex: 1; min-width: 0; }
.idea-main h3 { margin: 4px 0; }
.idea-main h3 a { color: var(--text); }
.idea-main p { font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
.idea-top { display: flex; gap: 6px; }
.idea-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius-md); }

/* —— 表单 —— */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 16px; }
.form-grid > h3 { margin: 0; }
.field { display: flex; flex-direction: column; gap: 7px; font-weight: 600; font-size: 14px; min-width: 0; }
.field > span small, .field small { font-weight: 400; }
.field.check { flex-direction: row; align-items: center; font-weight: 500; }
.field.check input { width: auto; }
.ai-preview-line { display: flex; align-items: center; min-width: 0; margin: 0; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 17px; }
.ai-preview-line b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; font-weight: 400; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 5px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-weight: 500; transition: background .15s, border-color .15s; }
.chip span:hover { border-color: var(--border-strong); }
.chip input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--primary); }
.chip input:disabled + span { opacity: .6; cursor: not-allowed; }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-actions p { margin: 0; }
.image-pick { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.image-pick-preview { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--border-strong); overflow: hidden; color: var(--muted); flex: none; }
.image-pick-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-pick-preview img.pixel { object-fit: contain; }
.image-pick.wide .image-pick-preview { width: 128px; height: 72px; }
.image-pick-preview.round { border-radius: 50%; border-style: solid; }
.gallery-pick { display: flex; flex-wrap: wrap; gap: 8px; font-weight: 400; }
.thumb { position: relative; width: 120px; height: 76px; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; }
.thumb button .i { width: 12px; height: 12px; }
.thumb.add { border-style: dashed; cursor: pointer; color: var(--muted); }
.thumb.add:hover { border-color: var(--primary); color: var(--primary); }
.publish-form, .detect { scroll-margin-top: calc(var(--topbar-h) + 12px); }
.publish-form.is-waiting > section:not([data-detect]), .publish-form.is-waiting .form-actions { opacity: .55; }
.source-pick { margin-bottom: 18px; }
.source-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.source-tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; font-weight: 600; color: var(--text-2); }
.source-tabs button:hover { color: var(--text); }
.source-tabs button.is-on { border-color: var(--primary); background: var(--primary); color: var(--primary-ink); }
.source-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px dashed var(--border-strong); color: var(--text-2); font-weight: 600; }
.source-link:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 190px; padding: 24px; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .i { width: 42px; height: 42px; color: var(--primary); }
.upload-progress { margin-top: 12px; }
.upload-progress .bar { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin-bottom: 6px; }
.upload-progress .bar i { display: block; height: 100%; background: var(--primary); width: 0; transition: width .2s; }
.am-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); max-height: 420px; overflow-y: auto; }
.am-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.am-list li div { display: flex; flex-direction: column; min-width: 0; }
.detect { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); margin-bottom: 16px; }
.staged { padding: 6px 10px; background: var(--surface-2); border-radius: 10px; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.editor { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--input-bg); font-weight: 400; }
.editor:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.editor textarea { border: 0; border-radius: 0; min-height: 220px; font-family: var(--font); box-shadow: none !important; }
.editor-bar { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.editor-bar button { min-width: 32px; padding: 4px 8px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-weight: 700; color: var(--text-2); }
.editor-bar button:hover { background: var(--surface-3); }
.editor-bar .preview-toggle { font-weight: 600; color: var(--primary); }
.editor-preview { padding: 12px 14px; min-height: 220px; background: var(--surface); }
.radio-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0 14px; }
.radio-list label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.radio-list input { width: auto; }
.copy-field { width: 100%; }

/* —— 弹窗、提示、大图 —— */
.dialog { border: 0; border-radius: 20px; padding: 24px; width: min(460px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(10, 15, 5, .5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.dialog h2 { margin-bottom: 8px; }
.dialog .field { margin: 8px 0; }
.toast-host { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 11px 18px; border-radius: var(--radius-md); background: #26301e; color: #fff; box-shadow: var(--shadow-lg); animation: toast-in .2s ease-out; max-width: min(560px, calc(100vw - 32px)); font-weight: 500; }
.toast-ok { background: var(--ok); }
.toast-error { background: var(--danger); }
[data-theme="dark"] .toast-ok, [data-theme="dark"] .toast-error { color: #0c1408; }
.toast.out { opacity: 0; transition: opacity .4s; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, .85); display: grid; place-items: center; cursor: zoom-out; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--radius-md); }
.spinner { width: 40px; height: 40px; border: 4px solid var(--surface-3); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* —— 登录、错误、文档 —— */
.auth-card { max-width: 440px; margin: 40px auto; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 36px 32px; box-shadow: var(--shadow-hover); }
.auth-card > img { border-radius: 14px; margin-bottom: 8px; }
.auth-card .btn-lg { margin: 16px 0 10px; }
.am-one .btn-lg { margin-bottom: 6px; }
.am-one p { margin: 0 0 10px; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px !important; color: var(--muted); font-size: 13px; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.dev-login { margin-top: 18px; text-align: left; border-top: 1px dashed var(--border); padding-top: 14px; }
.dev-login summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.dev-login form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.dev-login label:not(.check) { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.error-page { text-align: center; padding: 64px 16px; }
.error-code { font-size: 80px; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 8px; letter-spacing: -.02em; }
.error-page .row-gap { justify-content: center; }
.doc { max-width: 780px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow); line-height: 1.75; }
.doc li { margin-bottom: 6px; }

/* —— 个人主页（左边资料卡，右边标签 + 作品）、设置、通知 —— */
.profile { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.profile-head { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.profile-head > .avatar { box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--border); }
.profile-info { min-width: 0; width: 100%; }
.profile-info h1 { font-size: 24px; margin-bottom: 2px; word-break: break-word; }
.profile-info p { margin: 0; }
.profile-bio { margin-top: 10px !important; color: var(--text-2); overflow-wrap: anywhere; }
.profile-stats { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--border); width: 100%; display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 14px; }
.profile-stats li { display: flex; align-items: center; gap: 8px; }
.profile-stats b { color: var(--text); }
.profile-stats .i { width: 17px; height: 17px; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; width: 100%; }
.profile-main { min-width: 0; }
.profile-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.profile-main > .block > h3 { margin: 18px 0 10px; }
.profile-main > .block > h3:first-child { margin-top: 0; }
.user-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.user-list li { display: flex; flex-direction: column; gap: 4px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow); min-width: 0; }
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 2px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.settings-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.settings-nav .i { color: var(--muted); }
.settings-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.settings-main > * { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.settings-main > .panel + .panel { margin-top: 0; }
.settings-main > .form-grid { margin-bottom: 0; }
.notify-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.notify-list li { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.notify-list li:last-child { border: 0; }
.notify-list li.is-unread { background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); box-shadow: inset 3px 0 0 var(--primary); }
.notify-list .grow { min-width: 0; overflow-wrap: anywhere; }

/* —— 聊天 —— */
body.is-chat .footer { display: none; }
body.is-chat main { padding-bottom: 16px; }
.chat { display: grid; grid-template-columns: 260px minmax(0, 1fr); height: calc(100vh - var(--topbar-h) - 48px); height: calc(100dvh - var(--topbar-h) - 48px); min-height: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.chat-side { border-right: 1px solid var(--border); background: var(--surface-2); padding: 14px 10px; overflow-y: auto; }
.chat-side h2 { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); letter-spacing: 1px; margin: 4px 8px 8px; }
.chat-side h2:not(:first-child) { margin-top: 18px; }
.chat-side ul { list-style: none; margin: 0; padding: 0; }
.chat-side a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); position: relative; }
.chat-side a span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-side a small { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-side a:hover { background: var(--surface-3); text-decoration: none; }
.chat-side a.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.chat-side .dot-count { position: static; box-shadow: none; }
.chat-side [data-online]:not(:empty) { color: var(--ok); font-size: 12px; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.chat-head > div { display: flex; flex-direction: column; min-width: 0; }
.chat-head small.is-offline::after { content: " · 连接中断，正在重连"; color: var(--danger); }
.chat-back { display: none; }
.chat-log { flex: 1; overflow-y: auto; padding: 12px 0; }
.msg { position: relative; display: flex; gap: 12px; padding: 6px 18px; }
.msg.is-compact { padding-top: 1px; padding-bottom: 1px; }
.msg:hover { background: var(--surface-hover); }
.msg-gutter { width: 36px; flex: none; }
.msg-main { min-width: 0; flex: 1; }
.msg-meta { display: flex; gap: 8px; align-items: baseline; }
.msg-meta .user-link { font-weight: 600; color: var(--text); }
.msg-body { white-space: normal; overflow-wrap: anywhere; }
.msg-quote { font-size: 13px; color: var(--muted); border-left: 3px solid var(--border-strong); padding-left: 8px; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-actions { position: absolute; right: 14px; top: -10px; display: none; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 2px; box-shadow: var(--shadow); }
.msg:hover .msg-actions { display: flex; }
.msg-actions button { border: 0; background: none; cursor: pointer; padding: 3px 7px; border-radius: 8px; color: var(--text-2); }
.msg-actions button:hover { background: var(--surface-2); }
.chat-input { position: relative; display: flex; gap: 8px; align-items: flex-end; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.chat-input textarea { flex: 1; min-height: 42px; max-height: 160px; resize: none; }
.chat-input .btn { height: 42px; }
.chat-reply { flex-basis: 100%; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.chat-login { justify-content: center; }

/* —— 管理后台 —— */
.admin { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.admin-nav { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
.admin-nav a { position: relative; display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 10px; color: var(--text-2); font-weight: 500; }
.admin-nav a:hover { background: var(--surface-2); text-decoration: none; }
.admin-nav a.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.admin-nav .dot-count { position: static; margin-left: auto; box-shadow: none; }
.admin-main { min-width: 0; }
.admin-main h2 { margin-top: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow); }
a.stat:hover { box-shadow: var(--shadow-hover); text-decoration: none; }
.stat b { font-size: 28px; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 13px; }
/* 表格外面套 .table-wrap 负责横向滚动；表格本身保持 display:table，才能撑满宽度 */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 14px; }
.table:not(.table-wrap > .table) { border: 1px solid var(--border); }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.table td.actions { white-space: nowrap; }
.table td.actions .btn { margin: 2px; }
.table input:not([type="checkbox"]) { min-width: 100px; padding: 5px 8px; }
.table input.num { width: 80px; min-width: 0; }
.table input[type="checkbox"] { width: auto; }
.review-item { margin-bottom: 12px; }
.review-item header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.changelog { white-space: pre-wrap; background: var(--surface-2); padding: 10px; border-radius: 10px; max-height: 240px; overflow: auto; font-size: 13px; }
.admin-list { list-style: none; padding: 0; margin: 0; }
.admin-list li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 6px; }

.credit-score { font-size: 22px; color: var(--ok); margin-left: 6px; }
.credit-score.is-low { color: var(--warn); }
.credit-score.is-zero { color: var(--danger); }
/* 信誉分分档（设置页） */
.credit-tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 10px 0 8px; }
.credit-tiers span { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.credit-tiers span.is-on { border-color: var(--primary); color: var(--text); background: var(--primary-soft); }
.credit-tiers small { font-size: 11px; }
/* 2 分钟审核：作者看到的倒计时、管理员的队列 */
.review-live { display: flex; gap: 8px; align-items: center; }
.review-live b { font-variant-numeric: tabular-nums; }
.countdown { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--warn); min-width: 4.5em; }
.countdown.is-late { color: var(--danger); }
.scan-hits { margin: 6px 0; padding-left: 18px; }
.scan-hits code { font-size: 12px; overflow-wrap: anywhere; }
/* 自动审核觉得有问题、扣下来等管理员决定的 */
.flag-images { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.flag-images figure { margin: 0; max-width: 180px; }
.flag-images img { display: block; min-width: 64px; min-height: 64px; max-width: 180px; max-height: 140px; object-fit: contain; image-rendering: pixelated; border-radius: 6px; border: 1px solid var(--border); background: #fff; }
.flag-images figcaption { font-size: 12px; overflow-wrap: anywhere; }
/* AI 生成图标和封面 */
.art-gen { gap: 6px; }
.art-gen-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.art-gen-row .small { flex: 1 1 260px; }
.art-notice { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.art-notice > span { flex: 1 1 260px; }
/* 3D 预览（皮肤、地图、建筑） */
.viewer3d { margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: radial-gradient(ellipse at 50% 35%, var(--primary-soft) 0%, var(--surface) 75%); }
.viewer3d > .muted { padding: 40px 16px; text-align: center; }
.viewer3d-stage { height: 380px; cursor: grab; touch-action: none; }
.viewer3d-stage:active { cursor: grabbing; }
.viewer3d-stage canvas { display: block; width: 100%; height: 100%; }
.skin-flat { display: block; width: min(384px, 90%); margin: 24px auto; image-rendering: pixelated; background: repeating-conic-gradient(#0000 0 25%, #8882 0 50%) 0 0 / 16px 16px; }
.viewer3d-bar { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 10px; border-top: 1px solid var(--border); background: var(--surface); }
.viewer3d-group { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.viewer3d-group > span { font-size: 12px; color: var(--muted); margin-right: 2px; }
.viewer3d-bar .btn.is-on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
@media (max-width: 560px) { .viewer3d-stage { height: 300px; } }
.credit-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* —— AI 署名（标题左边）—— */
.ai-mark { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; margin-right: 6px; border-radius: 6px; background: var(--ai, #6d7765); color: #fff; font-size: 12px; font-weight: 800; line-height: 1; vertical-align: 2px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18); cursor: help; }
.ai-mark.is-wide { width: auto; padding: 0 5px; font-size: 10px; }
.ai-mark-lg { width: 30px; height: 30px; border-radius: 8px; font-size: 16px; vertical-align: 4px; margin-right: 10px; }
.ai-mark-lg.is-wide { font-size: 13px; padding: 0 7px; }
.info-row dd .ai-mark { width: 16px; height: 16px; font-size: 10px; margin-right: 4px; }
/* 深色主题下 Kimi、Grok 这种近黑色的标记要描一圈边，才看得出来 */
[data-theme="dark"] .ai-mark { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18), 0 0 0 1px rgba(255, 255, 255, .28); }

/* —— AI 代发 —— */
.agent-page { max-width: 820px; margin: 0 auto; }
.agent-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.agent-head h1 { margin: 0 0 4px; }
.agent-head p { margin: 0; }
.agent-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 18px; padding: 0; counter-reset: none; }
.agent-steps li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-weight: 600; font-size: 14px; }
.agent-steps b { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 13px; }
.agent-steps li.is-on { border-color: var(--primary); color: var(--text); background: var(--primary-soft); }
.agent-steps li.is-on b { background: var(--primary); color: var(--primary-ink); }
.agent-steps li.is-done b { background: var(--ok); color: #fff; }
.agent-steps li.is-todo { border-color: color-mix(in srgb, var(--gold) 60%, var(--border)); color: var(--text); }
.agent-steps li.is-todo b { background: var(--gold); color: #fff; }
.agent-page > .panel { margin-bottom: 18px; }
.agent-page > .panel + .panel { margin-top: 0; }
.agent-drafts { border-color: color-mix(in srgb, var(--gold) 50%, var(--border)); }
.agent-drafts h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.profile-drafts { margin: 0 0 18px; }
.profile-drafts > p { margin: -4px 0 6px; }
.draft-list { list-style: none; margin: 0; padding: 0; }
.draft-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.draft-thumb { flex: none; display: grid; place-items: center; width: 64px; height: 40px; border-radius: 6px; overflow: hidden; background: var(--surface-2); color: var(--muted); }
.draft-thumb img:not(.mc-block) { width: 100%; height: 100%; object-fit: cover; }
.draft-thumb img.pixel { object-fit: contain; }
.draft-thumb .mc-block { width: 32px; height: 32px; }
.draft-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.draft-main a { display: flex; align-items: center; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-create > .notice { margin: 0; }
.agent-create-main { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.agent-create-main p { margin: 0; }
.agent-more { margin-top: 14px; }
.agent-more summary { cursor: pointer; color: var(--text-2); font-size: 14px; font-weight: 600; }
.agent-more .form-grid { margin: 14px 0 0; }
.agent-result h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; color: var(--ok); }
.agent-say { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.agent-say pre { margin: 0; width: 100%; white-space: pre-wrap; word-break: break-all; font: 14px/1.6 var(--font); }
.agent-warn { display: flex; gap: 6px; align-items: flex-start; margin: 10px 0 18px; color: var(--warn); }
.agent-warn .i { width: 16px; height: 16px; margin-top: 2px; }
/* AI 的进度：生成链接后实时显示 */
.agent-live { margin: 0 0 18px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.agent-live h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; }
.agent-live h3 small { font-weight: 400; font-size: 12px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); animation: live-pulse 1.6s ease-out infinite; }
.agent-live.is-stopped .live-dot { background: var(--muted); animation: none; }
@keyframes live-pulse { to { box-shadow: 0 0 0 8px transparent; } }
.live-feed { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.live-feed li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 7px 0 7px 12px; border-left: 3px solid var(--border-strong); margin-left: 3px; }
.live-feed li + li { border-top: 1px dashed var(--border); }
.live-feed li > span { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.live-feed time { flex: none; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.live-feed .is-wait { color: var(--muted); border-left-color: var(--border); }
.live-feed .is-ok { border-left-color: var(--ok); }
.live-feed .is-todo { border-left-color: var(--gold); font-weight: 600; }
.live-feed .is-danger { border-left-color: var(--danger); color: var(--danger); }
.agent-kinds { border-top: 1px dashed var(--border); padding-top: 14px; }
.agent-kinds > p { margin-bottom: 8px; }
.agent-kind { padding: 14px 0 0; }
.agent-kind .field { margin-bottom: 12px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: var(--mono); font-size: 13px; }
.agent-howto p { margin-bottom: 8px; font-size: 14px; }
.agent-howto pre { margin: 0 0 8px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; }
.agent-result-foot { margin: 18px 0 0; padding-top: 12px; border-top: 1px dashed var(--border); }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.link-card { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.link-card.is-frozen { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.link-main { flex: 1; min-width: 0; }
.link-title { display: flex; align-items: center; gap: 8px; }
.link-events { flex-basis: 100%; }
.link-events summary { cursor: pointer; color: var(--muted); }
.link-events ul { margin: 6px 0 0; padding-left: 1.2em; }
.link-old { margin-top: 10px; }
.link-old summary { cursor: pointer; margin-bottom: 8px; }
.link-old .link-card { opacity: .75; }
.link-revoke-all { margin: 10px 0 0; text-align: right; }
.agent-rules summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.agent-rules ul { margin: 10px 0 0; padding-left: 1.2em; }
.agent-rules li { margin-bottom: 6px; }
/* 草稿详情页顶部横幅 */
.draft-banner { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; border-left: 4px solid #7b4fc9; }
.draft-banner-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 360px; }
.draft-banner-main > b { display: flex; align-items: center; gap: 8px; }
.draft-banner-main .mc-block { width: 32px; height: 32px; }
.draft-checks { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; font-size: 13px; }
.draft-checks li { display: inline-flex; align-items: center; gap: 4px; }
.draft-checks .i { width: 14px; height: 14px; }
.draft-checks .is-ok { color: var(--ok); }
.draft-checks .is-warn { color: var(--danger); }
.draft-checks .is-optional { color: var(--muted); }
.draft-checks li > b { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 10px; line-height: 1; }
.draft-checks .is-optional > b { background: var(--muted); }
.draft-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.publish-card { margin-bottom: 16px; }
.publish-card summary { cursor: pointer; font-weight: 600; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.publish-card textarea { margin-top: 12px; font-family: var(--mono); font-size: 13px; }
.publish-form .is-filled { border-color: var(--ok); background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface)); }
.source-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px dashed var(--border-strong); color: var(--text-2); font-weight: 600; }
.source-link:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
/* /a/ 下的说明页、一次性上传页 */
.agent-guide { max-width: 860px; margin: 0 auto; }
.agent-guide pre { white-space: pre-wrap; }
.guide-human { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 22px; border-radius: var(--radius-sm); background: var(--info-soft); }
.guide-human > div { flex: 1 1 300px; }
.guide-human p { margin: 4px 0 0; }
.agent-upload .mc-block { display: block; margin: 0 auto 10px; }
.agent-upload-form { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.upload-drop { display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 18px 14px; border: 2px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2); cursor: pointer; font-weight: 600; }
.upload-drop:hover, .upload-drop:focus-within { border-color: var(--primary); background: var(--primary-soft); }
.upload-drop > span { display: inline-flex; gap: 6px; align-items: center; color: var(--text-2); }
.upload-drop input[type="file"] { max-width: 100%; font-size: 14px; }
input[type="file"]::file-selector-button { margin-right: 10px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }

/* 模型：3D 展示（和 AutoMods 模型市场同一个渲染器）+ 三视图 */
.model3d { margin: 0 0 16px; }
.model3d-stage { position: relative; height: 420px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: radial-gradient(ellipse at 50% 40%, #fff 0%, #eef2ec 70%); cursor: grab; touch-action: none; }
.model3d-stage:active { cursor: grabbing; }
.model3d-stage canvas { display: block; width: 100% !important; height: 100% !important; }
.model3d-stage > [data-model3d-empty] { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }
.model3d-hint { margin: 6px 0 12px; text-align: center; }
.model3d-views { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.model3d-views figure { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #f6f8f5; overflow: hidden; }
.model3d-views figure > div { aspect-ratio: 1; display: grid; place-items: center; }
.model3d-views img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.model3d-views figcaption { padding: 6px; text-align: center; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); }
:root[data-theme="dark"] .model3d-stage, :root[data-theme="dark"] .rc-cover.is-contain { background: radial-gradient(ellipse at 50% 40%, #3a4239 0%, #232823 75%); }
:root[data-theme="dark"] .model3d-views figure { background: #262b26; }
@media (max-width: 640px) { .model3d-stage { height: 300px; } }

/* 嵌在 AutoMods 后台里（iframe）：社区自己的顶栏、页脚、公告条都不要，板块切换用 AutoMods 后台那一排 */
html.in-frame .topbar, html.in-frame .footer, html.in-frame .announce, html.in-frame .credit-banner, html.in-frame .admin-nav { display: none !important; }
html.in-frame body { padding-top: 0; }
html.in-frame main { margin-top: 0; padding-top: 12px; }
.admin-sso { max-width: 520px; margin: 40px auto; text-align: center; }

/* 提示词（AI 做的作品：做的时候给 AI 的话），作品页介绍上面单独一块 */
.prompt-box { margin: 0 0 16px; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius-sm); background: var(--surface-2); }
.prompt-box header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px 0; }
.prompt-box h2 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 15px; }
.prompt-box h2 svg { width: 16px; height: 16px; color: var(--primary); }
.prompt-box header .btn { margin-left: auto; }
.prompt-text { padding: 8px 12px 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.7; color: var(--text-2); max-height: 260px; overflow: auto; }
/* 地图、建筑蓝图的 3D 预览：和模型的一样，底下一行写规模 */
.build3d-note:not(:empty)::before { content: " · "; }
.build3d .model3d-views img { image-rendering: auto; }

/* —— 审核队列（待审核 / 已处理）：左边一列图标，中间自动审核觉得有问题的地方（点开看每个问题点），右边处理按钮 —— */
.rq-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rq-head h2 { margin: 0; }
.rq-help { margin: 8px 0 14px; }
.rq-help summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.rq-help p { margin: 6px 0 0; }
.rq-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.rq-filter { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.rq-filter b { min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.rq-filter:hover { border-color: var(--primary); }
.rq-filter.is-on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.rq-filter.is-on b { background: rgba(255, 255, 255, .25); color: inherit; }
.rq-filter.is-empty:not(.is-on) { opacity: .5; }
.rq-list { display: flex; flex-direction: column; gap: 12px; }
.rq-card { display: grid; grid-template-columns: 132px minmax(0, 1fr) 210px; gap: 18px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); transition: opacity .25s, transform .25s; }
.rq-card.is-open { border-left-color: var(--warn); }
.rq-card.is-flagged { border-left-color: var(--danger); }
.rq-card.is-done.is-pass { border-left-color: var(--ok); }
.rq-card.is-done.is-block { border-left-color: var(--warn); }
.rq-card.is-done.is-deduct { border-left-color: var(--danger); }
.rq-card:focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 40%, transparent), var(--shadow); }
.rq-card.is-leaving { opacity: 0; transform: translateX(32px); pointer-events: none; }
.rq-card.is-flash { animation: rq-flash 1.4s ease; }
@keyframes rq-flash { from { box-shadow: 0 0 0 3px var(--primary), var(--shadow); } to { box-shadow: var(--shadow); } }
/* 左 */
.rq-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rq-kind { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; max-width: 100%; padding: 2px 8px 2px 6px; border-radius: 6px; font-size: 12px; color: var(--tc, var(--text-2)); background: color-mix(in srgb, var(--tc, #888) 13%, transparent); white-space: nowrap; }
.rq-kind .i { width: 15px; height: 15px; flex: none; }
.rq-kind small { font-weight: 400; opacity: .85; }
.rq-thumb { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.rq-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rq-thumb img.is-icon { width: 64px; height: 64px; object-fit: contain; }
.rq-thumb.is-avatar img { object-fit: contain; image-rendering: pixelated; }
.rq-thumb .mc-block { width: 48px; height: 48px; }
.rq-thumb-ic .i { width: 34px; height: 34px; color: var(--muted); }
.rq-flagimgs { display: flex; gap: 4px; align-items: center; }
.rq-flagimgs img { width: 32px; height: 32px; object-fit: cover; border-radius: 5px; border: 2px solid var(--danger); background: #fff; image-rendering: pixelated; }
.rq-flagimgs span { font-size: 12px; font-weight: 700; color: var(--danger); }
.rq-author { display: flex; gap: 6px; align-items: center; min-width: 0; }
.rq-author .avatar { flex: none; }
.rq-author-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.rq-author-main a { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rq-credit { font-size: 11px; color: var(--ok); white-space: nowrap; }
.rq-credit.is-watch { color: var(--warn); }
.rq-credit.is-limited, .rq-credit.is-readonly, .rq-credit.is-locked { color: var(--danger); font-weight: 700; }
/* 中 */
.rq-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rq-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rq-pill, .rq-outcome { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.rq-pill .i, .rq-outcome .i { width: 13px; height: 13px; }
.rq-pill .countdown { min-width: 0; }
.rq-pill.is-warn { background: var(--warn-soft); color: var(--warn); }
.rq-outcome.is-pass { background: var(--primary-soft); color: var(--ok); }
.rq-outcome.is-block { background: var(--warn-soft); color: var(--warn); }
.rq-outcome.is-deduct { background: var(--danger-soft); color: var(--danger); }
.rq-who { margin-left: auto; color: var(--muted); font-size: 12px; }
.rq-title { margin: 0; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.rq-title a { color: var(--text); }
.rq-chips { display: flex; flex-wrap: wrap; gap: 5px 8px; align-items: center; }
.rq-lean { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.rq-lean .i { width: 13px; height: 13px; }
.rq-lean.is-block { background: var(--danger-soft); color: var(--danger); }
.rq-lean.is-review { background: var(--warn-soft); color: var(--warn); }
.rq-lean.is-pass { background: var(--primary-soft); color: var(--ok); }
.rq-cat { padding: 0 7px; border-radius: 6px; font-size: 12px; border: 1px solid var(--border-strong); color: var(--text-2); }
.rq-cat.is-red { border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.rq-conf { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rq-conf i { position: relative; width: 40px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.rq-conf i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 3px; background: var(--text-2); }
.rq-stat { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.rq-stat .i { width: 13px; height: 13px; }
.rq-stat.is-bad { color: var(--danger); }
.rq-reason { margin: 0; font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.rq-toggle { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; padding: 2px 0; border: 0; background: none; color: var(--link); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.rq-toggle .i { width: 15px; height: 15px; }
.rq-toggle::after { content: "▾"; transition: transform .2s; }
.rq-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
.rq-more { margin-top: 2px; padding-top: 10px; border-top: 1px dashed var(--border-strong); font-size: 14px; }
.rq-points { display: flex; flex-direction: column; gap: 10px; margin: 0; padding-left: 20px; }
.rq-points > li::marker { color: var(--muted); font-weight: 700; }
.rq-points p { margin: 2px 0 0; color: var(--text-2); overflow-wrap: anywhere; }
.rq-points .flag-images { margin-top: 4px; }
.rq-quote { margin: 4px 0 0; padding: 8px 10px; border-left: 3px solid var(--warn); border-radius: 0 6px 6px 0; background: var(--surface-2); color: var(--text-2); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.rq-quote mark { padding: 0 2px; border-radius: 3px; background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.rq-full { margin-top: 10px; }
.rq-full summary, .rq-legacy > summary { cursor: pointer; }
.rq-full summary { color: var(--link); font-size: 13px; }
.rq-full pre { margin: 6px 0 0; }
.rq-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: 13px; }
.rq-links a { display: inline-flex; align-items: center; gap: 4px; }
.rq-links .i { width: 14px; height: 14px; }
.rq-history { margin-top: 10px; font-size: 13px; }
.rq-history ol { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); }
.rq-history time { color: var(--muted); font-variant-numeric: tabular-nums; }
/* 右 */
.rq-actions { display: flex; flex-direction: column; gap: 8px; align-self: start; }
.rq-actions .btn { width: 100%; flex-wrap: wrap; column-gap: 6px; row-gap: 0; white-space: normal; text-align: center; }
.rq-actions .btn .i { width: 16px; height: 16px; }
.rq-actions .btn small { flex-basis: 100%; font-size: 12px; font-weight: 400; opacity: .85; }
.rq-actions .btn b { font-variant-numeric: tabular-nums; }
.rq-deduct { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.rq-deduct select { padding: 6px 8px; font-size: 13px; }
.rq-empty-all { display: flex; gap: 14px; align-items: center; padding: 26px 20px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.rq-empty-all > .i { flex: none; width: 34px; height: 34px; color: var(--ok); }
.rq-empty-all p { margin: 0; }
.rq-none { padding: 18px; text-align: center; }
.rq-legacy { margin-top: 28px; }
.rq-legacy > summary { font-weight: 600; color: var(--text-2); }
@media (max-width: 1100px) { .rq-card { grid-template-columns: 112px minmax(0, 1fr) 180px; gap: 14px; } }
/* 手机：上面一排图标（缩略图、类型、问题图、作者），中间详情，按钮铺满 */
@media (max-width: 720px) {
  .rq-card { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; }
  .rq-side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  .rq-thumb { order: -1; width: 56px; aspect-ratio: 1; }
  .rq-thumb img.is-icon { width: 40px; height: 40px; }
  .rq-thumb .mc-block { width: 32px; height: 32px; }
  .rq-flagimgs img { width: 28px; height: 28px; }
  .rq-author { flex-basis: 100%; }
  .rq-who { flex-basis: 100%; margin-left: 0; }
  .rq-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .rq-actions .btn { padding: 9px 8px; font-size: 14px; }
  .rq-actions .btn > .i { display: none; }
  .rq-actions > :only-child, .rq-actions > .btn:only-of-type { grid-column: 1 / -1; }
  .rq-deduct { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
  .rq-deduct .btn { width: auto; }
}

/* —— 页脚：顶上一排草方块，下面是泥土色 —— */
.footer { position: relative; background: var(--footer-bg); color: var(--footer-ink); margin-top: 64px; }
.footer::before { content: ""; position: absolute; left: 0; right: 0; top: -32px; height: 32px; pointer-events: none; image-rendering: crisp-edges; image-rendering: pixelated;
  background: url(../img/mc/v1/grass_block_side.png) 0 0 / 32px 32px repeat-x; }
[data-theme="dark"] .footer::before { filter: brightness(.55) saturate(.85); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; padding-top: 28px; padding-bottom: 28px; font-size: 14px; }
.footer-inner > div:first-child { flex: 1 1 420px; max-width: 720px; }
.footer .muted { color: var(--footer-muted); }
.footer nav { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: flex-start; }
.footer nav a, .beian a { color: var(--footer-muted); }
.footer nav a:hover, .beian a:hover { color: var(--footer-ink); }
.footer :focus-visible { outline-color: #ffd34d; }
.beian { display: flex; flex-wrap: wrap; gap: 14px; flex-basis: 100%; font-size: 12px; }

/* —— 动效和对比度偏好 —— */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (prefers-contrast: more), (forced-colors: active) {
  .hero-scene, .footer::before { display: none; }
  .hero { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
  .hero .lead { color: var(--text-2); }
  .rc, .panel, .fpanel, .ttab, .res-head { border-color: var(--border-strong); }
}

/* —— 窄屏 —— */
@media (max-width: 1180px) {
  .topsearch { display: none; }
  .topsearch-m { display: inline-grid !important; }
  .topbar-actions { margin-left: auto; }
}
@media (max-width: 1100px) {
  .browse { grid-template-columns: 252px minmax(0, 1fr); gap: 20px; }
  .browse-total { display: none; }
  .view-toggle { margin-left: auto; }
}
@media (max-width: 1020px) {
  .res-layout { grid-template-columns: 1fr; }
  .res-head-main { grid-template-columns: 88px minmax(0, 1fr); }
  .res-icon { width: 88px; height: 88px; border-radius: 20px; }
  .res-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; min-width: 0; }
  .res-actions .res-dl { flex: 0 1 auto; }
  .res-acts .tbtn { flex: 0 0 auto; }
  .forum-layout { grid-template-columns: 1fr; }
  .profile { grid-template-columns: 1fr; }
  .profile-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 18px; }
  .profile-head > .avatar { --s: 72px !important; width: 72px; height: 72px; }
  .profile-stats { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 6px 16px; }
  .profile-actions { grid-column: 1 / -1; }
  .profile-actions .btn-block { width: auto; }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; }
  .brand { margin-right: 0; }
  .mainnav { display: none; position: absolute; top: var(--topbar-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 16px 16px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
  body.nav-open .mainnav { display: flex; }
  .mainnav .nav-link { height: 44px; }
  .nav-discover, .nav-discover.is-on { border-radius: var(--radius-md); box-shadow: none; }
  .nav-m-only { display: inline-flex; order: -1; }
  .nav-caret { display: none; }
  .nav-menu { position: static; display: grid; box-shadow: none; border: 0; padding: 0 0 6px 18px; min-width: 0; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .nav-menu::before { display: none; }
  .topbar-actions { gap: 2px; }
  .topbar-actions .btn { padding: 0 11px; }
  .topbar-actions .btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .usermenu-btn .nav-caret { display: none; }
  /* 窄屏：横幅更紧，快捷栏铺满一行 */
  .hero { gap: 12px; padding: 16px 16px 40px; }
  .hero-title { flex-basis: 100%; }
  .hotbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); width: 100%; }
  .hotbar li { justify-content: center; gap: 4px; padding: 4px 2px; }
  .hotbar img { width: 20px; height: 20px; }
  .hotbar b { font-size: 15px; }
  .hotbar span { font-size: 11px; }
  .hero-bar > * { flex-basis: 100%; }
  .hero .hero-search { max-width: none; }
  .cols-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .admin { grid-template-columns: 1fr; }
  .admin-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav a { white-space: nowrap; }
  .settings { grid-template-columns: 1fr; gap: 14px; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; border-radius: 999px; padding: 4px; }
  .settings-nav a { border-radius: 999px; padding: 6px 14px; }
  .settings-nav .i { display: none; }
  .chat { grid-template-columns: 1fr; height: calc(100vh - var(--topbar-h) - 24px); border-radius: var(--radius-md); }
  .chat-side { display: block; }
  .chat-main { display: none; }
  .chat.has-open .chat-side { display: none; }
  .chat.has-open .chat-main { display: flex; }
  .chat-back { display: inline-grid; }
  .prow-thumb, .prow-stats .muted { display: none; }
  .idea-grid { grid-template-columns: 1fr; }
  /* 分类标签条：一行横着滑，右边淡出 */
  .ttabs { margin: 0 -24px 18px; }
  .ttabs-track { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 24px 8px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
  /* 列表页：筛选栏收起来，「筛选」按钮展开；搜索 → 排序那一行 → （展开的筛选）→ 结果 */
  .browse { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .browse-main { display: contents; }
  .browse-main > * { order: 4; }
  .browse-search { order: 1; }
  .browse-bar { order: 2; }
  .browse-side { order: 3; display: none; margin-bottom: 14px; }
  .browse.is-open .browse-side { display: flex; }
  .promo-card, .side-head { display: none; }
  .facets-toggle { display: inline-flex; }
  .pager-sm { display: none; }
  .res-head-main { padding: 18px; }
  .owner-bar { padding: 12px 18px; }
}
@media (max-width: 640px) {
  /* 列表一行：小图标在左，标题、简介、标签在右，数据挪到最底下一行 */
  .rlist .rc { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "icon body" "stats stats"; gap: 10px 14px; padding: 14px; }
  .rlist .rc-icon { width: 64px; height: 64px; border-radius: 14px; }
  .rlist .rc-icon .mc-block { width: 32px; height: 32px; }
  .rlist .rc-stats { flex-direction: row; align-items: center; flex-wrap: wrap; padding: 0; gap: 4px 14px; }
  .rlist .rc-stats b { font-size: 14px; }
  .rlist .rc-stats small { display: none; }
  .rlist .rc-time { margin: 0 0 0 auto; }
  .rc h3 { font-size: 16px; }
  .rc-head { flex-direction: column; align-items: stretch; gap: 0; }
  .rc-by { font-size: 13px; }
  .rc-summary { font-size: 13.5px; }
  .rc-tags { margin-top: 8px; gap: 4px; }
  .res-title h1 { font-size: 24px; }
}
@media (max-width: 560px) {
  .wrap { padding: 16px 16px 40px; }
  .topbar-inner { gap: 6px; padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .is-bare .brand span { position: static; width: auto; height: auto; clip: auto; clip-path: none; }
  .icon-btn { width: 36px; height: 36px; }
  .ttabs { margin: 0 -16px 16px; }
  .ttabs-track { padding: 2px 16px 8px; gap: 6px; }
  .ttab { height: 36px; padding: 0 13px 0 10px; }
  /* 字号小于 16px 时 iOS 和微信聚焦会自动放大页面 */
  input, select, textarea { font-size: 16px; }
  h1 { font-size: 24px; }
  .hero .lead { display: none; }
  /* 手机上横幅再压一压：不要小标题，快捷栏和按钮都矮一点 */
  .hero { gap: 10px; padding: 14px 14px 38px; background: linear-gradient(var(--sky-1), var(--sky-2)); }
  .hero .eyebrow { display: none; }
  .hero h1 { font-size: 19px; margin: 0; }
  .hotbar li { flex-direction: column; gap: 0; padding: 3px 2px; line-height: 1.25; }
  .hotbar img { width: 16px; height: 16px; }
  .hero-actions { gap: 8px; }
  .hero-actions .btn { padding: 0 12px; flex: 1; }
  .hero-actions .btn.hero-am { flex-basis: 100%; }
  .doc, .auth-card { padding: 22px 18px; }
  .agent-head { align-items: flex-start; }
  .agent-head .mc-block { width: 48px; height: 48px; }
  .agent-steps { gap: 6px; }
  .agent-steps li { flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px; font-size: 12px; line-height: 1.35; }
  .agent-create-main .btn-lg { width: 100%; }
  .copy-row { flex-direction: column; }
  /* 草稿确认：确认发布占一整行，修改、删除并排；贴在屏幕底部，往下看的时候也能点 */
  .draft-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; position: sticky; bottom: 8px; }
  .draft-actions > :first-child { grid-column: 1 / -1; }
  .draft-banner { position: relative; }
  .res-head-main { grid-template-columns: 64px minmax(0, 1fr); gap: 8px 14px; padding: 16px; }
  .res-icon { width: 64px; height: 64px; border-radius: 16px; border-width: 3px; }
  .res-head.has-cover .res-icon { margin-top: -40px; }
  .res-icon .mc-block { width: 48px; height: 48px; }
  .res-title h1 { font-size: 21px; }
  .res-title .lead { font-size: 15px; }
  .res-stats { font-size: 14px; gap: 6px 14px; }
  .res-stats b { font-size: 15px; }
  .res-actions .res-dl { width: 100%; }
  .res-acts { width: 100%; }
  .res-acts .tbtn { flex: 1 1 0; }
  .tbtn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .idea-box .tbtn-label { position: static; width: auto; height: auto; clip: auto; clip-path: none; }
  .ptabs { display: flex; }
  .ptabs a { padding: 6px 12px; }
  .res-main > .block, .comments, .post { padding: 16px; }
  .post .owner-bar { margin: 16px -16px -16px; }
  .owner-bar { padding: 12px 16px; }
  .browse-bar { gap: 8px; }
  .browse-sort .select-pill + .select-pill { display: none; }
  .select-pill { padding-left: 11px; }
  .rgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  :root[data-view="grid"] .rlist { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rgrid .rc-body, :root[data-view="grid"] .rlist .rc-body { padding: 10px 10px 0; }
  .rgrid .rc h3, :root[data-view="grid"] .rlist .rc h3 { font-size: 14.5px; }
  .rgrid .rc-summary, .rgrid .rc-tags, :root[data-view="grid"] .rlist .rc-summary, :root[data-view="grid"] .rlist .rc-tags { display: none; }
  .rgrid .rc-stats, :root[data-view="grid"] .rlist .rc-stats { padding: 8px 10px 10px; gap: 8px; }
  .rgrid .rc-stats > span:nth-child(2), :root[data-view="grid"] .rlist .rc-stats > span:nth-child(2) { display: none; }
  .rgrid .rc.has-both .rc-icon, :root[data-view="grid"] .rlist .rc.has-both .rc-icon { width: 40px; height: 40px; margin: -22px 0 -4px 10px; border-radius: 11px; border-width: 2px; }
  .radio-list { grid-template-columns: 1fr; }
  .section-head h2 { font-size: 18px; }
  .page-head .btn { flex: 1 1 auto; }
  .profile-bar { align-items: stretch; }
  .profile-bar .tabs { flex: 1 1 100%; }
  .profile-bar .view-toggle { margin-left: auto; }
  .prow { padding: 14px; gap: 10px; }
  .prow > .avatar { --s: 30px !important; width: 30px; height: 30px; }
  .prow-stats { min-width: 0; }
  .notify-list li { padding: 12px 14px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat b { font-size: 22px; }
}
