/* 故事Wiki公共视觉规范：信息优先、低饱和、长时间阅读友好。 */
:root {
    --brand-navy: #20334d;
    --brand-blue: #2b4662;
    --brand-gold: #c99a67;
    --brand-bg: #f8f7f4;
    --brand-panel: #fffefa;
    --brand-border: #e9e4dc;
    --brand-text: #2f3440;
    --brand-muted: #858895;
    --brand-soft: #f1eee8;
    --semantic-success: #507962;
    --semantic-success-soft: #ebf3ec;
    --semantic-warning: #996a3d;
    --semantic-warning-soft: #f7f0e3;
    --semantic-draft: #6e7890;
    --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft Yahei', sans-serif;
    --font-editorial: 'Songti SC', STSong, 'Noto Serif SC', 'Source Han Serif SC', SimSun, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--brand-bg); color: var(--brand-text); font-family: var(--font-ui); font-size: 14px; line-height: 1.65; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(84,129,165,.45); outline-offset: 3px; }
.app-header { position: sticky; top: 0; height: 70px; z-index: 50; background: linear-gradient(110deg, #1c2e48, #294560); color: #fffaf4; box-shadow: 0 4px 20px rgba(16,31,49,.1); border-bottom: 1px solid rgba(231,202,164,.23); }
.header-inner { max-width: 1800px; margin: 0 auto; height: 100%; display: flex; align-items: center; padding: 0 34px; gap: 36px; }
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; overflow: hidden; border: 1px solid rgba(237,214,185,.8); background: #f7f4ed; border-radius: 11px; box-shadow: 0 3px 12px rgba(0,0,0,.12); }
.brand-logo { display: block; width: 34px; height: 34px; object-fit: contain; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; gap: 4px; }
.brand-name { font-size: 18px; font-weight: 600; font-family: var(--font-editorial); letter-spacing: 1.3px; white-space: nowrap; }
.brand-signature { font-size: 8px; color: #d5c7b9; letter-spacing: 1.8px; white-space: nowrap; }
.top-tabs { display: flex; align-self: stretch; gap: 12px; }
.top-tab { display: flex; align-items: center; padding: 0 12px; color: #c8d1db; font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.top-tab:hover { color: white; }
.top-tab.active { color: #fff; border-color: #edc79d; }
.header-actions { display: flex; gap: 16px; align-items: center; margin-left: auto; white-space: nowrap; }
.header-export { color: #d8dce4; font-size: 12px; }
.header-export:hover { color: #fff; }
.header-create { background: #e6c4a0 !important; color: #2b3546 !important; border-color: #e6c4a0 !important; }
.btn-plus { font-size: 16px; }
.mobile-nav-toggle { border: 0; background: transparent; color: white; font-size: 23px; display: none; }
.app-body { max-width: 1800px; min-height: calc(100vh - 70px); margin: 0 auto; display: flex; }
.sidebar { width: 268px; flex: 0 0 268px; border-right: 1px solid var(--brand-border); background: #fffcf8; padding: 24px 17px; min-height: calc(100vh - 70px); display: flex; flex-direction: column; position: sticky; top: 70px; align-self: flex-start; height: calc(100vh - 70px); }
.sidebar-search { height: 39px; display: flex; align-items: center; gap: 7px; border: 1px solid #e8e3db; background: #f7f5f1; border-radius: 8px; padding: 0 11px; }
.sidebar-search:focus-within { border-color: #b3c2ce; background: #fff; }
.search-glyph { color: #9097a4; font-size: 23px; line-height: 1; }
.sidebar-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 12px; }
.sidebar-search input::placeholder { color: #a0a2a9; }
.keyboard-hint { color: #bbb7b2; font-size: 14px; }
.sidebar-section-head { margin: 31px 8px 10px; display: flex; justify-content: space-between; align-items: center; color: #989ba2; font-size: 11px; letter-spacing: 1px; font-weight: 700; }
.sidebar-section-head button { border: 0; background: none; color: #a4a3a4; font-size: 20px; line-height: 1; }
.sidebar-section-head button:hover { color: var(--brand-blue); }
.sidebar-navigation { min-height: 0; overflow-y: auto; padding: 0 1px 12px; scrollbar-width: thin; }
.tree-group { margin: 0 0 21px; }
.tree-group-title { display: flex; align-items: center; gap: 9px; padding: 7px 8px; color: #596173; font-size: 12px; font-weight: 750; }
.group-dot { display: block; width: 8px; height: 8px; border-radius: 3px; background: #ba8e6d; }
.group-dot.type-character { background: #829a9d; }.group-dot.type-location { background: #91a179; }.group-dot.type-lore { background: #a79aba; }.group-dot.type-note { background: #c3a67d; }.group-dot.type-act { background: #bf948e; }
.group-count { font-size: 11px; margin-left: auto; color: #b1b1b4; font-weight: 500; }
.sidebar-tree { margin: 1px 0 0; padding: 0; list-style: none; }
.sidebar-tree .sidebar-tree { margin-left: 17px; border-left: 1px solid #e7e2da; padding-left: 4px; }
.tree-link { display: flex; align-items: center; min-height: 34px; gap: 7px; border-radius: 7px; padding: 5px 8px; font-size: 12px; color: #666d77; }
.tree-link:hover { background: #f3f0eb; color: #25374f; }
.tree-link.current { color: #334e6b; background: #eaf0f3; font-weight: 700; }
.tree-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-branch { font-size: 13px; color: #b1b3b7; width: 10px; flex: 0 0 10px; }
.tree-final { color: var(--semantic-success); margin-left: auto; }
.sidebar-empty { font-size: 12px; color: var(--brand-muted); padding: 15px; }
.sidebar-bottom { margin-top: auto; background: #f6f2ed; border: 1px solid #ede5dd; border-radius: 10px; padding: 13px 10px; display: flex; align-items: center; gap: 9px; }
.sidebar-bottom-symbol { font-family: var(--font-editorial); color: #bb9c8c; font-size: 25px; }
.sidebar-bottom strong { font-size: 11px; font-weight: 700; display: block; color: #6f6263; }
.sidebar-bottom span { font-size: 10px; display: block; margin-top: 1px; color: #a09593; }
.main-content { width: calc(100% - 268px); flex: 1; min-width: 0; padding: 0 44px; display: flex; flex-direction: column; }
.app-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: auto; padding: 28px 3px; color: #a1a2a6; font-size: 10px; }
.eyebrow { display: block; color: #b18b6d; font-size: 10px; letter-spacing: 1.8px; font-weight: 800; }
.button { min-height: 37px; border-radius: 7px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 15px; line-height: 1.2; font-size: 12px; font-weight: 700; white-space: nowrap; }
.button-primary { background: var(--brand-blue); color: white; border-color: var(--brand-blue); }
.button-primary:hover { background: #213a55; }
.button-outline { background: #fffefa; border-color: #e0ded9; color: #566274; }
.button-outline:hover { border-color: #b9c8d1; background: #f7f9fa; }
.button-subtle { background: #f1f0ed; border-color: #e6e4e0; color: #606778; }
.text-link { font-size: 12px; font-weight: 700; color: #58748b; padding: 2px 0; background: transparent; border: none; }
.text-link:hover { color: #27435d; }
.status-label { display: inline-flex; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 5px; white-space: nowrap; line-height: 1.45; }
.status-final { color: #4a7760; background: #eaf3ed; }
.status-review { color: #967044; background: #faf0e0; }
.status-draft { color: #697489; background: #ebedf0; }
.status-archived { color: #84848b; background: #eeecec; }
.modal { width: min(530px, calc(100% - 28px)); max-height: 88vh; overflow-y: auto; padding: 27px 30px 29px; border: 1px solid #e4dcd4; background: #fffefa; color: var(--brand-text); border-radius: 13px; box-shadow: 0 24px 75px rgba(24,35,53,.25); }
.modal::backdrop { background: rgba(23,34,49,.44); backdrop-filter: blur(3px); }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-heading h2 { margin: 5px 0 0; font-size: 22px; font-family: var(--font-editorial); font-weight: 650; }
.icon-button { border: 0; background: transparent; color: #8d929d; font-size: 24px; line-height: 1; padding: 0 3px; }
.icon-button:hover { color: #333; }
.modal-description { font-size: 12px; color: #8e9099; margin: 13px 0 24px; }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field > span { font-size: 12px; font-weight: 700; color: #6d7480; }
.form-field em { font-style: normal; color: #b96658; }
.form-field small { font-weight: 400; color: #a1a3a8; }
.form-field input, .form-field textarea, .form-field select { width: 100%; min-width: 0; border: 1px solid #e2dfd9; border-radius: 7px; background: #fff; outline: none; padding: 10px 11px; color: #373d49; font-size: 13px; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: #a1b7c9; box-shadow: 0 0 0 3px rgba(77,116,149,.10); }
.form-field textarea { resize: vertical; }
.form-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
#createForm { display: flex; flex-direction: column; gap: 17px; }
#createForm .modal-description { margin: -3px 0 5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 8px; }
.form-error { padding: 10px; background: #fbf0ef; border: 1px solid #f0d9d6; color: #a54f4d; border-radius: 7px; font-size: 12px; }
#toast { position: fixed; z-index: 200; bottom: 28px; right: 28px; border-radius: 9px; padding: 12px 20px; color: white; background: #233952; font-size: 12px; font-weight: 600; box-shadow: 0 10px 28px rgba(20,33,49,.25); opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s, transform .2s; }
#toast.visible { opacity: 1; transform: translateY(0); }
#toast.error { background: #8d4545; }
.simple-page { max-width: 1040px; margin: 65px auto 85px; width: 100%; }
.simple-page h1 { font-family: var(--font-editorial); font-size: 38px; font-weight: 600; margin: 8px 0 7px; }
.simple-intro { color: #898e98; margin: 0 0 28px; font-size: 13px; }
.search-main-form { display: grid; grid-template-columns: minmax(200px, 1fr) 150px auto; gap: 10px; background: white; border: 1px solid var(--brand-border); padding: 13px; border-radius: 10px; }
.search-main-form input,.search-main-form select { border: 1px solid #e5e3de; border-radius: 7px; padding: 7px 11px; background: #fff; min-width: 0; outline: none; }
.search-result-count { margin: 30px 2px 14px; color: #7a8491; font-size: 12px; }
.search-result-list { display: grid; gap: 10px; }
.search-result { padding: 22px 25px; border-radius: 10px; border: 1px solid var(--brand-border); background: white; }
.search-result:hover { border-color: #c8d3da; box-shadow: 0 5px 15px rgba(27,47,67,.04); }
.search-result-title { display: flex; gap: 13px; align-items: center; }
.search-result h3 { font-family: var(--font-editorial); font-size: 18px; margin: 0; font-weight: 650; }
.search-result p { color: #7e838b; font-size: 12px; line-height: 1.7; margin: 8px 0 13px; }
.search-result-meta { display: flex; gap: 18px; font-size: 10px; color: #aaabb1; }
.search-empty { text-align: center; padding: 70px 20px; background: white; border: 1px dashed #ddd; border-radius: 10px; color: #878b97; }
.search-empty > div { font-size: 40px; }
.search-empty h3 { margin-bottom: 3px; color: #626b78; }
.guide-article { background: #fffefa; padding: 28px 40px; border-radius: 10px; border: 1px solid var(--brand-border); }
.markdown-body { color: #48515d; font-size: 14px; line-height: 1.95; word-break: break-word; overflow-wrap: anywhere; }
.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4 { font-family: var(--font-editorial); color: #303b4b; font-weight: 650; line-height: 1.45; }
.markdown-body h1 { font-size: 27px; margin: 1.35em 0 .55em; }.markdown-body h2 { font-size: 20px; margin: 1.6em 0 .65em; }.markdown-body h3 { font-size: 17px; margin: 1.3em 0 .55em; }.markdown-body h4 { font-size: 15px; margin: 1.1em 0 .5em; }
.markdown-body p { margin: .7em 0 1.25em; }.markdown-body ul,.markdown-body ol { padding-left: 27px; margin: 1em 0; }.markdown-body li { padding-left: 3px; }
.markdown-body blockquote { margin: 20px 0; padding: 6px 18px; color: #78818c; background: #f8f6f1; border-left: 3px solid #d6bfa6; }
.markdown-body code { padding: 2px 5px; border-radius: 4px; background: #f2f1ec; color: #8a5e4e; font-size: .9em; }
.markdown-body pre { background: #283646; color: #f7f5f1; border-radius: 8px; padding: 18px 20px; overflow: auto; line-height: 1.6; }
.markdown-body pre code { padding: 0; color: inherit; background: transparent; }
.markdown-body table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 20px 0; }.markdown-body td,.markdown-body th { border: 1px solid #e9e5df; padding: 8px 11px; }.markdown-body th { background: #f7f5f1; text-align: left; }
.markdown-body hr { border: none; border-top: 1px solid #e7e5dd; margin: 26px 0; }
.markdown-body a { color: #386b88; text-decoration: underline; text-decoration-color: #aec9d4; text-underline-offset: 3px; }.markdown-body .wiki-ref { font-weight: 650; background: #eef4f5; border-radius: 4px; padding: 1px 3px; text-decoration: none; }.markdown-body .wiki-ref:hover { background: #dfebee; }.markdown-body .wiki-missing { color: #9c6a56; border-bottom: 1px dashed #c99a85; }
@media(max-width:1150px) { .header-inner { gap: 22px; padding: 0 21px; }.main-content { padding: 0 26px; }.sidebar { width: 238px; flex-basis: 238px; }.brand-name { font-size: 16px; } }
@media(max-width:880px) { .mobile-nav-toggle { display: block; }.sidebar { position: fixed; top: 70px; left: 0; z-index: 40; transform: translateX(-102%); transition: transform .2s; width: 275px; box-shadow: 8px 12px 20px rgba(27,38,54,.08); }.sidebar.open { transform: translateX(0); }.main-content { width: 100%; }.top-tabs { margin-left: auto; }.header-actions { margin-left: 0; }.header-export { display: none; } }
@media(max-width:650px) { .app-header { height: 63px; }.header-inner { padding: 0 14px; gap: 11px; }.brand-mark { width: 32px; height: 32px; font-size: 20px; }.brand-name { font-size: 15px; }.brand-signature { font-size: 6px; }.top-tabs { display: none; }.sidebar { top: 63px; height: calc(100vh - 63px); }.header-create { padding: 8px 10px; }.main-content { padding: 0 16px; }.app-footer { flex-direction: column; gap: 0; }.simple-page { margin-top: 34px; }.simple-page h1 { font-size: 29px; }.search-main-form { grid-template-columns: 1fr; }.form-two-col { grid-template-columns: 1fr; }.modal { padding: 22px 20px; }.guide-article { padding: 22px; } }

/* Wiki资料目录：文件夹多层树、分组折叠和快捷添加。 */
.tree-group-title { padding: 0 3px 0 6px; gap: 3px; }
.tree-group-toggle { display: flex; flex: 1; min-width: 0; align-items: center; gap: 9px; padding: 7px 3px; border: 0; background: none; color: #596173; font-size: 12px; font-weight: 750; text-align: left; }
.tree-group-toggle:hover { color: #273e56; }
.tree-group-toggle .group-count { margin-left: auto; }
.group-caret { font-size: 10px; color: #9fa5ae; width: 10px; text-align: center; }
.tree-group-create { display: grid; place-items: center; flex: 0 0 24px; height: 24px; border: 0; border-radius: 6px; color: #9ba1a9; background: transparent; font-size: 19px; }
.tree-group-create:hover { background: #e9eef0; color: #3b5870; }
.tree-group.collapsed .tree-group-pages { display: none; }
.tree-group.collapsed .group-caret { transform: rotate(-90deg); }
.tree-node-row { display: flex; align-items: center; min-width: 0; border-radius: 7px; }
.tree-node-row:hover { background: #f5f2ee; }
.tree-node-row .tree-link { flex: 1; min-width: 0; padding-left: 4px; }
.tree-node-toggle, .tree-node-indent { display: grid; place-items: center; flex: 0 0 15px; width: 15px; height: 29px; padding: 0; color: #a4aab1; background: transparent; border: none; font-size: 12px; }
.tree-node-toggle:hover { color: #3d5971; }
.tree-node.collapsed > .tree-node-children { display: none; }
.tree-node.collapsed > .tree-node-row .tree-node-toggle { transform: rotate(-90deg); }
.tree-node-indent { font-size: 10px; }
.tree-folder-row .tree-link { color: #394d62; font-weight: 700; }
.tree-folder-row .tree-link.current { background: #eaf0f3; }
.tree-folder-glyph { font-size: 11px; color: #ad9278; flex: 0 0 auto; }
.tree-add-child { display: none; place-items: center; width: 22px; height: 25px; flex: 0 0 22px; margin-right: 2px; border: none; background: transparent; color: #8695a2; font-size: 17px; border-radius: 5px; }
.tree-node-row:hover .tree-add-child, .tree-add-child:focus-visible { display: grid; }
.tree-add-child:hover { background: #e3eaf0; color: #25425d; }
.sidebar-group-empty { color: #aaa7a4; padding: 4px 0 5px 27px; font-size: 11px; }
@media (pointer: coarse) { .tree-add-child { display: grid; } }

/* 多工程导航与切换 */
.header-project-selector { display: flex; flex-direction: column; gap: 1px; color: #d4dce7; font-size: 9px; min-width: 126px; }
.header-project-selector select { width: 152px; max-width: 100%; background: #344e69; color: #fff; border: 1px solid #5c7083; border-radius: 7px; padding: 6px 7px; font-size: 12px; cursor: pointer; }
.sidebar-project-info { padding: 11px 13px; margin-bottom: 14px; border: 1px solid #e7e1d8; border-radius: 8px; background: #f5f2ec; display: flex; flex-direction: column; gap: 3px; }
.sidebar-project-info span { font-size: 9px; color: #96919a; letter-spacing: .7px; }
.sidebar-project-info strong { font-family: var(--font-editorial); font-size: 16px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-project-info a { color: #657b91; font-size: 11px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 17px; }
.project-card { padding: 21px; border: 1px solid var(--brand-border); border-radius: 12px; background: white; display: flex; flex-direction: column; gap: 11px; }
.project-card.active { border-color: #97acbc; background: #fbfcfc; }
.project-card h2 { font-family: var(--font-editorial); margin: 0; font-size: 22px; }
.project-card p { color: #7b8490; font-size: 12px; min-height: 32px; margin: 0; }
.project-card .project-action-row { display: flex; align-items: center; gap: 11px; margin-top: auto; }
.project-card details { margin-top: 8px; padding-top: 12px; border-top: 1px solid #ece7e0; }
.project-card details summary { cursor: pointer; color: #657b91; font-size: 12px; }
.project-card .form-field { margin-top: 10px; }
.project-card details .button { margin-top: 12px; }
.project-create-panel { margin: 24px 0; padding: 25px; background: white; border: 1px solid var(--brand-border); border-radius: 12px; }
.project-create-panel form { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(180px, 1.6fr) auto; gap: 13px; align-items: end; }
.project-create-panel h2 { margin: 0 0 14px; font-family: var(--font-editorial); }
@media (max-width: 1360px) { .header-inner { gap: 14px; padding: 0 18px; } .header-actions { gap: 9px; } .top-tabs { gap: 3px; } .top-tab { padding: 0 8px; } .header-project-selector select { width: 118px; } }
@media (max-width: 1050px) { .header-overview { display: none; } .brand-signature { display: none; } }
@media (max-width: 880px) { .header-project-selector { min-width: 110px; } .header-project-selector select { width: 115px; } }
@media (max-width: 650px) { .project-create-panel form { grid-template-columns: 1fr; } .header-project-selector span { display: none; } .header-project-selector { min-width: 105px; } .header-project-selector select { width: 109px; font-size: 11px; } .brand-copy { display: none; } }

/* V7 手机专用交互：抽屉目录、快捷导航、触屏安全区域。桌面样式保持不变。 */
.mobile-sidebar-heading, .mobile-sidebar-menu, .mobile-sidebar-backdrop, .mobile-bottom-nav { display: none; }
@media (max-width: 880px) {
    .mobile-nav-toggle { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px; font-size: 23px; }
    .top-tabs { display: none; }
    .mobile-nav-toggle:active { background: rgba(255,255,255,.12); }
    .mobile-sidebar-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(16,28,42,.56); }
    .sidebar { z-index: 61; top: 0; left: 0; width: min(390px, 92vw); height: 100dvh; min-height: 0; padding: 16px 16px max(18px, env(safe-area-inset-bottom)); transform: translateX(-104%); transition: transform .22s ease-out; box-shadow: none; overflow: hidden; }
    .sidebar.open { transform: translateX(0); box-shadow: 15px 0 36px rgba(17,29,44,.2); }
    .mobile-sidebar-open { overflow: hidden; }
    .mobile-sidebar-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 12px; color: #33465a; font-family: var(--font-editorial); font-size: 19px; }
    .mobile-sidebar-close { display: grid; place-items: center; border: 0; background: #f3f0eb; border-radius: 9px; width: 44px; height: 44px; font-size: 29px; color: #526579; line-height: 1; }
    .mobile-sidebar-menu { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; padding: 3px 0 14px; }
    .mobile-sidebar-menu a { padding: 9px 10px; min-height: 44px; background: #f4f2ee; border: 1px solid #eae6df; border-radius: 8px; color: #526476; font-size: 12px; display: flex; align-items: center; justify-content: center; }
    .sidebar-project-info { flex-shrink: 0; }
    .sidebar-navigation { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
    .tree-link, .tree-group-toggle { min-height: 44px; font-size: 14px; }
    .tree-node-toggle, .tree-node-indent { flex-basis: 32px; width: 32px; min-height: 42px; font-size: 17px; }
    .tree-add-child, .tree-group-create { display: grid; width: 40px; height: 42px; flex-basis: 40px; font-size: 20px; }
    .tree-group-title { min-height: 48px; }
    .sidebar-bottom { flex-shrink: 0; margin-top: 10px; }
    .sidebar-search { flex-shrink: 0; min-height: 44px; }
    .sidebar-search input { font-size: 16px; }
}
@media (max-width: 700px) {
    .app-header { height: 60px; }
    .header-inner { padding: 0 12px; gap: 10px; }
    .mobile-nav-toggle { flex-basis: 44px; }
    .brand-mark { width: 34px; height: 34px; font-size: 19px; }
    .brand-copy { display: flex; }
    .brand-name { font-size: 15px; letter-spacing: .3px; }
    .brand-signature { display: none; }
    .header-actions { min-width: 0; flex: 1; justify-content: flex-end; }
    .header-project-selector { min-width: 0; max-width: min(42vw, 180px); }
    .header-project-selector select { width: 100%; max-width: 100%; min-height: 44px; font-size: 16px; padding: 8px 9px; }
    .header-project-selector span, .header-create, .top-tabs, .header-export { display: none; }
    .main-content { padding: 0 15px; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
    .app-footer { padding: 20px 2px; text-align: center; }
    .mobile-bottom-nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid #e9e2d9; background: rgba(255,254,250,.97); box-shadow: 0 -4px 16px rgba(29,44,60,.05); }
    .mobile-bottom-nav a, .mobile-bottom-nav button { border: 0; background: transparent; border-radius: 9px; color: #7b8290; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 53px; gap: 0; padding: 3px; }
    .mobile-bottom-nav a[aria-current="page"] { color: #2e5775; background: #edf2f4; }
    .mobile-bottom-nav span { font-size: 24px; line-height: 1.15; }
    .mobile-bottom-nav small { font-size: 11px; font-weight: 650; }
    body.wiki-is-editing .mobile-bottom-nav { display: none; }
    .modal { position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: 100%; max-height: min(92dvh, 950px); border-radius: 20px 20px 0 0; border-bottom: none; padding: 21px 20px calc(22px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
    .modal-heading h2 { font-size: 23px; }
    .icon-button { min-width: 44px; min-height: 44px; font-size: 27px; }
    .form-field input, .form-field select, .form-field textarea, .search-main-form input, .search-main-form select { min-height: 44px; font-size: 16px; }
    .button, .modal-actions .button { min-height: 44px; font-size: 13px; }
    .modal-actions .button { flex: 1; }
    .link-results { max-height: 48dvh; }
    .link-result { min-height: 48px; font-size: 14px; gap: 7px; }
    .search-result { padding: 19px 17px; }
    .simple-page { margin-top: 28px; margin-bottom: 30px; }
    .simple-page h1 { font-size: 30px; }
    .guide-article { padding: 19px 18px; }
    .markdown-body { font-size: 15px; line-height: 1.9; }
    .markdown-body pre { max-width: 100%; padding: 13px; }
    .markdown-body table { display: block; overflow-x: auto; white-space: nowrap; }
    #toast { left: 14px; right: 14px; bottom: calc(82px + env(safe-area-inset-bottom)); text-align: center; }
    body.wiki-is-editing #toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
    .project-grid { grid-template-columns: minmax(0,1fr); }
    .project-create-panel { padding: 19px 16px; }
}
@media (max-width: 365px) {
    .brand-copy { display: none; }
    .header-project-selector { max-width: 60vw; }
    .main-content { padding-left: 12px; padding-right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar, #toast { transition: none; }
}

/* V8 站点品牌标识；沿用 V7 的布局，不更改既有手机交互。 */
@media (max-width: 700px) {
    .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
    .brand-logo { width: 30px; height: 30px; }
}

/* V9 身份验证入口：桌面顶栏退出按钮与手机目录中的账号操作。 */
.header-logout-form { margin: 0; display: flex; align-items: center; }
.header-logout { border: 1px solid rgba(255,255,255,.22); border-radius: 7px; padding: 7px 11px; background: rgba(255,255,255,.055); color: #e3e7ea; font-size: 11px; white-space: nowrap; }
.header-logout:hover { background: rgba(255,255,255,.15); color: #fff; }
.mobile-logout-form { margin: 0; display: none; }
.mobile-logout-form button { border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; text-align: left; width: 100%; padding: 10px 8px; }
@media (max-width: 1250px) { .header-logout { padding: 7px 8px; font-size: 10px; } }
@media (max-width: 880px) { .header-logout-form { display: none; }.mobile-logout-form { display: block; } }

/* V12 用户头像菜单与多用户账号页：桌面弹出面板、手机触控布局。 */
.account-menu { position: relative; flex: 0 0 auto; z-index: 52; }
.account-trigger { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 3px; cursor: pointer; list-style: none; border: 1px solid transparent; border-radius: 50%; }
.account-trigger::-webkit-details-marker { display: none; }
.account-trigger:hover, .account-menu[open] .account-trigger { border-color: rgba(235,200,150,.85); background: rgba(255,255,255,.1); }
.account-avatar { width: 40px; height: 40px; border: 2px solid #c7a372; border-radius: 50%; object-fit: cover; background: #f4ece4; }
.account-dropdown { position: absolute; right: 0; top: calc(100% + 10px); width: 320px; max-width: min(92vw, 380px); background: #fff; color: #283b53; border: 1px solid #dce2e7; border-radius: 15px; box-shadow: 0 17px 42px rgba(17,34,52,.22); white-space: normal; overflow: hidden; }
.account-dropdown-header { display: flex; align-items: center; gap: 12px; padding: 17px 19px; border-bottom: 1px solid #e8ecef; }
.account-profile-avatar { width: 48px; height: 48px; border-radius: 50%; border: 2px solid #c7a372; object-fit: cover; background: #f4ece4; }
.account-dropdown-header > div { display: flex; flex-direction: column; min-width: 0; gap: 4px; }
.account-dropdown-header strong { font-size: 16px; overflow-wrap: anywhere; }
.account-dropdown-header small { font-size: 11px; color: #7d8a99; }
.account-dropdown-link { min-height: 53px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid #e8ecef; font-size: 14px; font-weight: 650; color: #2a4057; }
.account-dropdown-link:hover { background: #f1f5f7; }
.account-dropdown-link > span:last-child { color: #91a3b0; font-size: 21px; font-weight: 400; }
.account-dropdown-status { display: flex; align-items: center; gap: 8px; min-height: 55px; padding: 14px 19px; border-bottom: 1px solid #e8ecef; font-size: 13px; font-weight: 650; color: #52697d; }
.account-online-dot { width: 10px; height: 10px; border-radius: 50%; background: #4eab84; box-shadow: 0 0 0 5px #eaf6ee; margin-right: 5px; }
.account-logout-form { margin: 0; }
.account-logout-form button { width: 100%; min-height: 54px; padding: 15px 20px; color: #bf4c49; font-size: 14px; font-weight: 700; text-align: left; border: 0; background: #fff; cursor: pointer; }
.account-logout-form button:hover { background: #fcf0ef; }
.account-settings-page, .account-users-page { max-width: 790px; }
.account-settings-card { background: #fffefa; border: 1px solid #e4dfd7; border-radius: 14px; padding: 28px; margin-bottom: 18px; box-shadow: 0 5px 17px rgba(44,58,72,.035); }
.account-settings-card > h2 { margin: 0 0 8px; font-family: var(--font-editorial); font-size: 22px; }
.account-identity, .account-user-heading { display: flex; align-items: center; gap: 13px; }
.account-identity img { border-radius: 50%; object-fit: cover; border: 2px solid #c7a372; background: #f4ece4; }
.account-identity h2 { margin: 0 0 6px; font-size: 23px; }
.account-card-divider { height: 1px; background: #e8e2db; margin: 24px 0; }
.account-settings-help, .account-admin-hint { color: #88919a; font-size: 12px; line-height: 1.8; margin: 0 0 23px; }
.account-form { display: grid; gap: 17px; }
.account-form-actions { display: flex; justify-content: flex-end; padding-top: 7px; }
.account-form-actions .button { min-width: 146px; }
.account-settings-footer { color: #778696; font-size: 12px; }
.account-settings-footer a { color: #426a91; font-weight: 700; }
.account-message, .account-success { margin-bottom: 18px; }
.account-success { background: #edf7f1; border: 1px solid #d4e7da; border-radius: 8px; padding: 11px 14px; color: #417e62; font-size: 12px; }
.account-users-card h2 small { font-size: 13px; color: #a2a9b0; font-family: sans-serif; }
.account-user-list { display: grid; gap: 12px; margin-top: 19px; }
.account-user-item { border: 1px solid #ece7e0; border-radius: 10px; padding: 17px; background: #fff; }
.account-user-heading > img { border-radius: 50%; object-fit: cover; border: 1px solid #ded2c2; }
.account-user-name { display: grid; gap: 4px; min-width: 0; flex: 1; }
.account-user-name strong { font-size: 14px; overflow-wrap: anywhere; }
.account-user-name small { color: #92a0ad; font-size: 11px; }
.account-user-details { margin-top: 14px; border-top: 1px solid #eee9e3; padding-top: 13px; }
.account-user-details > summary { font-size: 12px; cursor: pointer; font-weight: 650; color: #466680; }
.account-reset-form { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 12px; margin-top: 15px; }
.account-reset-form > button { grid-column: 1 / -1; justify-self: start; }
.account-status-form { margin: 13px 0 0; }
.account-admin-hint { margin: 12px 0 0; }
@media (max-width: 880px) { .account-dropdown { position: fixed; top: 63px; right: 12px; width: min(340px, calc(100vw - 24px)); max-height: calc(100dvh - 95px); overflow-y: auto; } .account-trigger { width: 46px; height: 46px; } }
@media (max-width: 700px) { .account-menu { z-index: 53; } .account-settings-card { padding: 20px 17px; } .account-reset-form { grid-template-columns: 1fr; } .account-settings-page, .account-users-page { margin-top: 30px; } .account-dropdown { top: 58px; } }
@media (max-width: 425px) { .header-inner { gap: 7px; } .header-project-selector { max-width: 37vw; } .brand-name { font-size: 13px; } .account-trigger { width: 42px; height: 42px; } .account-avatar { width: 36px; height: 36px; } }
