/* React 接管 SSR 外壳；分组间距采用8/12/16/24/32px层级，保留原有内容与金色交互。 */
:root{--qm-space-xs:8px;--qm-space-sm:12px;--qm-space-md:16px;--qm-space-lg:24px;--qm-space-xl:32px}
.react-modal-loading{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;align-content:center;gap:var(--qm-space-md);padding:var(--qm-space-lg);text-align:center;background:#0009;color:var(--ink)}
.profile-react-avatar{width:88px;height:88px;object-fit:contain}
/* 小图标保持独立尺寸，不能被互动栏的flex布局压缩或拉伸。 */
.ui-icon{flex-shrink:0}
.react-preview-note{padding:8px 20px;background:var(--panel-soft);color:var(--muted);font-size:12px;text-align:center}
.react-empty{padding:32px;color:var(--muted);line-height:1.8}
.react-inline-error{color:var(--gold);font-size:12px;line-height:1.8}
button:disabled{cursor:default}
/* 手机账户区保留发布；未来明确开放火种时仅资源页显示余额；站名保持一行。 */
.site-header .brand b,.site-header .brand small{white-space:nowrap}
/* 账户控件之间保留外部留白；头像内容填满42px方框，并不意味着与旁边控件贴边。 */
.site-header{padding-block:12px}
.site-header .account-slot{gap:var(--qm-space-md)}
html[lang] .site-header>.primary-nav{row-gap:var(--qm-space-xs)}
/* 账户按钮在桌面也不能因三列导航挤压而把“发布”拆成上下两行。 */
.site-header .account-slot>.primary-button{flex-shrink:0;white-space:nowrap;padding-inline:12px}
/* 顶部头像与账户按钮同为42px高；去掉旧内边距，图片和文字头像均填满方形，角标仍定位在外层。 */
.site-header .account-avatar-link{box-sizing:border-box;flex:0 0 42px;width:42px;min-width:42px;height:42px;min-height:42px;padding:0;margin-inline-start:var(--qm-space-xs)}
.site-header .account-avatar-link .user-dot{box-sizing:border-box;width:100%;height:100%;flex-shrink:0;font-size:20px}
/* 角标外移4px，保留与页头边缘的留白，避免放大头像后裁切提示。 */
.site-header .account-avatar-link>.notification-badge{top:-4px;right:-4px}
/* 管理视角切换沿用当前主题文字色，浅色主题不能继承旧样式的近白回退色。 */
.admin-view-toggle{color:var(--ink)}
/* fieldset保留整组禁用语义，同时恢复其内部字段间距，避免外层form的gap失效。 */
.news-editor-form>fieldset{display:grid;gap:var(--qm-space-md)}
/* ZIP、适用版本、下载方式是三个独立分组；compose-main包裹层不能使表单外层gap失效。 */
.resource-upload-settings{display:grid;gap:var(--qm-space-md)}
.resource-upload-settings>label{display:grid;gap:var(--qm-space-xs)}
/* 投稿基础皮肤同时用于视界；data-resource-kind只标识地图/模型/工具，不能拿它作为全部表单的样式开关。 */
.resource-share-form{display:flex;flex-direction:column;gap:var(--qm-space-md);padding:22px var(--resource-share-gutter,24px) 0}
.resource-share-form :is(input[name=title],textarea,.inline-media-editor,input[type=url]){box-sizing:border-box;width:100%;min-width:0;color:var(--ink);background:var(--panel-soft);border:1px solid var(--line);border-radius:8px;font-size:14px;font-weight:400}
.resource-share-form input[name=title]{min-height:43px;padding:8px 12px}
.resource-share-form :is(textarea,.inline-media-editor){min-height:114px;padding:11px 13px;scroll-margin-block:76px 80px}
.resource-share-form textarea{resize:vertical}
.resource-share-form .compose-main>label{display:grid;gap:var(--qm-space-xs);min-width:0;margin-block:var(--qm-space-md);font-size:14px;font-weight:650}
.resource-share-form input[type=url]{min-height:42px;padding:8px 12px}
.resource-share-form :is(input[name=title],textarea,.inline-media-editor,input[type=url]):focus-visible{outline:2px solid var(--gold);outline-offset:2px;box-shadow:none}
.resource-share-form :is(.form-error,.resource-upload-notice,.resource-upload-progress){margin:0}
.resource-share-form :is(.form-error,.resource-upload-notice):empty{display:none}
.resource-share-form .compose-controls{position:sticky;bottom:0;z-index:1;order:1;flex-wrap:wrap;margin-inline:calc(-1 * var(--resource-share-gutter,24px));padding:12px var(--resource-share-gutter,24px);border-color:var(--line);background:var(--panel)}
.resource-share-form .compose-controls>button{min-height:38px;margin-block:0;border-radius:7px}
.resource-share-form .compose-controls>.primary-button{min-width:clamp(80px,17vw,112px)}
/* 编辑旧帖的附件不在图库网格内；按正文可用宽度约束原图，移除按钮跟随预览边界。 */
.compose-main>.compose-media-tile{width:fit-content;max-width:100%;margin-block:var(--qm-space-sm)}
.compose-media-tile>img,.compose-media-tile>video{display:block;max-width:100%;max-height:360px;height:auto;object-fit:contain}
/* 兴趣复选框不继承文本输入框的44px高度；整块标签仍保留36px可点击区域。 */
.profile-edit-modal .member-tag-options{gap:var(--qm-space-xs)}
.profile-edit-modal .member-tag-options label{display:inline-flex;align-items:center;gap:var(--qm-space-xs);min-height:36px;margin:0;padding:6px 8px}
.profile-edit-modal .member-tag-options input[type=checkbox]{flex:0 0 16px;width:16px;height:16px;min-height:16px;margin:0;padding:0}
/* 自动底部对齐不能吞掉密码提示与按钮的最小留白；共同作者搜索框使用正常输入尺寸。 */
.profile-password-panel .field-hint{margin-bottom:var(--qm-space-md)}
.contributor-picker-body input{min-height:42px;padding:8px 12px;border:1px solid var(--line);border-radius:4px;background:var(--panel);color:var(--ink)}
/* 板块展开区的讨论入口是独立操作，不能以内联链接紧贴上一行互动按钮。 */
.board-expanded-content>.outline-button{display:inline-flex;align-items:center;justify-content:center;max-width:100%;min-height:42px;margin-top:var(--qm-space-sm);padding:8px 16px;white-space:normal;text-align:center}
/* 解锁按钮可能因余额不足禁用；保留明确文字，不继承旧站“所有禁用按钮都转圈”的样式。 */
.resource-unlock-actions{gap:var(--qm-space-sm)}
.resource-unlock-dialog button:disabled{color:var(--ink)!important;cursor:default;opacity:.6}
.resource-unlock-dialog .primary-button:disabled{color:#17130e!important}
.resource-unlock-dialog button:disabled::after{content:none}
/* 长提示按可用宽度换行，窄屏通知与屏幕边缘保持16px留白。 */
.toast{overflow-wrap:anywhere}
@media(max-width:760px){
  .profile-edit-modal .profile-edit-heading{gap:var(--qm-space-md);padding-inline-end:0}
  .profile-edit-modal .profile-edit-heading h2{font-size:26px;line-height:1.3}
}
@media(max-width:650px){
  html[lang] .site-header{padding-block:12px 8px;row-gap:var(--qm-space-xs)}
  html[lang] .site-header>.primary-nav{column-gap:var(--qm-space-md)}
  .site-header>.brand{gap:7px}
  .site-header>.brand .brand-logo{width:32px;height:32px}
  html[lang] .site-header .brand b{font-size:16px}
  .site-header .brand small{font-size:8px;letter-spacing:.03em}
  .site-header .account-slot{gap:var(--qm-space-xs)}
  .site-header .account-slot .primary-button{padding:6px 9px;white-space:nowrap}
  /* 有余额时单独放在右侧控件下方，给完整站名和42px头像留出空间，不压缩点击目标。 */
  .site-header .account-slot:has(.ember-balance){position:relative;padding-bottom:22px}
  html[lang] .site-header:has(.ember-balance)>.brand{align-self:start;margin-top:5px}
  .site-header .ember-balance{position:absolute;right:0;bottom:0;font-size:10px;line-height:14px;padding:0;white-space:nowrap}
  .toast-region{left:var(--qm-space-md);right:var(--qm-space-md);bottom:var(--qm-space-md)}
  .toast{max-width:100%}
}
/* 极窄手机保留完整站名、发布和42px头像，仅收紧品牌与辅助开关，兼容滚动条占用的宽度。 */
@media(max-width:350px){
  .site-header:has(.account-avatar-link)>.brand{gap:5px}
  .site-header:has(.account-avatar-link)>.brand .brand-logo{width:24px;height:24px}
  html[lang] .site-header:has(.account-avatar-link) .brand b{font-size:14px;letter-spacing:.02em}
  html[lang] .site-header:has(.account-avatar-link) .brand small{font-size:7px;letter-spacing:.02em}
  .site-header .account-slot:has(.account-avatar-link){gap:6px}
  .site-header .account-slot:has(.account-avatar-link)>.theme-toggle{flex-basis:28px;width:28px;min-width:28px;height:28px;min-height:28px}
  .site-header .account-slot:has(.account-avatar-link)>.language-toggle{width:28px;min-width:28px;padding:0 2px}
}
/* 作品集嵌在主页操作栏中；关闭按钮不继承满宽主操作，手机全屏抽屉也不保留滚动条槽。 */
@media(max-width:600px){
  .creator-gallery-header>.outline-button{width:auto;flex:none;padding:8px 14px}
  html:has(.creator-gallery-drawer[open]){scrollbar-gutter:auto}
}
/* 英文游客入门入口替换未登录发布框；沿用小块内容的16px内边距，链接可换行且保留点击间隔。 */
.newcomer-guide{padding:16px;border-bottom:1px solid var(--line);display:grid;gap:12px}
.newcomer-guide h2{font-size:18px;line-height:1.4;margin:0}
.newcomer-guide p{margin:0;line-height:1.65;color:var(--muted)}
.newcomer-guide nav{display:flex;flex-wrap:wrap;gap:12px 20px;align-items:center}
.newcomer-guide nav a{color:var(--gold);line-height:1.6;text-underline-offset:4px}
.newcomer-guide .newcomer-account-note{font-size:12px}
/* 资源起步说明中的真实链接以颜色和下划线双重区分，避免与灰色正文混在一起。 */
.resource-directory-heading p a,.community-resource-section>p a,.community-showcase-grid>.muted a{color:var(--gold);text-decoration:underline;text-underline-offset:3px}
/* 规则正文中的申请表保留完整输入宽度，提交按钮只占自身内容，避免桌面整行拉长。 */
.rules-detail .invite-request-form>button{justify-self:start;width:auto}
/* 回复引用只作用于评论卡片；定位高亮与滚动留白不改变其他页面的颜色或尺寸。 */
.post .replying-to { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.post .reply-reference { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 8px; overflow-wrap: anywhere; text-underline-offset: 3px; }
.post[data-post-id] { scroll-margin-top: 112px; }
.post.reply-reference-target { outline: 1px solid rgba(197, 164, 94, .65); outline-offset: -1px; background-color: rgba(197, 164, 94, .09); transition: background-color .2s ease; }
.post .reply-reference-unavailable { opacity: .72; }
.reply-reference-status { margin: 12px 0; }
@media (max-width: 760px) { .post .reply-reference { min-height: 44px; padding: 8px; } }
@media (prefers-reduced-motion: reduce) { .post.reply-reference-target { transition: none; } }
