.studio-page.memory-view .hero-copy,.studio-page.memory-view .hero-book-layer{display:none!important}
.studio-page.memory-view .hero{min-height:0!important;height:auto;background-image:none!important;background:var(--paper)}
.studio-page.memory-view .studio-workspace{display:block}
.memory-space{color:var(--ink,#26344a);min-width:0}
.memory-header{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:8px 0 12px;height:auto}
.memory-header>div:first-child{display:flex;align-items:baseline;gap:16px;flex-wrap:wrap}.memory-header h1{font-family:inherit;font-size:26px;line-height:1.4;letter-spacing:0;margin:0;text-shadow:none}
.memory-header p{font-size:13px;color:var(--muted,#7b8ba6);margin:0}.memory-header>div:last-child{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:flex-end}
.memory-connection{font-size:12px;color:#43866c}.memory-header button,.memory-empty button,.memory-load-more{border:1px solid var(--line,#dce6f2);border-radius:3px;background:var(--paper);color:#3978ce;padding:7px 10px;font-size:12px}
.memory-kind-tabs{display:flex;align-items:center;gap:6px;border-bottom:1px solid color-mix(in srgb,var(--line,#dce6f2) var(--sprout-divider-strength,45%),transparent);margin-bottom:15px}
.memory-kind-tabs button{font-size:14px;padding:10px 14px;white-space:nowrap;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;box-shadow:none;}.memory-kind-tabs button[aria-pressed=true]{color:#357edb;border-bottom-color:#357edb}.memory-kind-tabs small{font-size:11px;color:var(--muted,#7b8ba6);margin-left:5px}.memory-kind-tabs>span{font-size:11px;color:var(--muted,#7b8ba6);margin-left:auto}
.memory-layout{display:grid;grid-template-columns:var(--mg-sidebar,172px) minmax(0,1fr);gap:14px;align-items:start}
.memory-sidebar{min-width:0}.memory-sidebar details{padding-bottom:10px;max-height:calc(100dvh - 290px);overflow:auto}.memory-sidebar summary{cursor:pointer;font-size:13px;font-weight:600;margin:2px 0 12px}.memory-sidebar button{display:flex;gap:6px;align-items:center;justify-content:space-between;width:100%;text-align:left;font-size:12px;padding:8px;border-radius:3px;margin-bottom:3px;overflow-wrap:anywhere}.memory-sidebar button span{min-width:0}.memory-sidebar button small{font-size:10px;color:var(--muted,#7b8ba6)}.memory-sidebar button.active{background:#e8f1ff;color:#3379d5}.memory-sidebar>p{font-size:11px;color:var(--muted,#7b8ba6);line-height:1.8;border-top:1px solid color-mix(in srgb,var(--line,#dce6f2) var(--sprout-divider-strength,45%),transparent);padding-top:12px}
.memory-results{margin:0!important;width:auto!important;min-width:0}
.memory-search-form{display:flex;align-items:center;gap:8px;padding:5px 6px 5px 11px;background:var(--paper);border:1px solid var(--line,#dce6f2);border-radius:4px}.memory-search-form input{min-width:0;flex:1;border:0;background:transparent;color:var(--ink);outline:none;font-size:13px;height:29px}.memory-search-form button{font-size:12px;color:#3978ce;padding:6px 9px}.memory-search-form:focus-within{border-color:#438bf0}
.memory-filters{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:10px 0}.memory-filters label{display:flex;align-items:center;gap:4px;font-size:11px;color:var(--muted,#7b8ba6)}.memory-filters select{background:var(--paper);color:var(--ink);border:1px solid var(--line,#dce6f2);border-radius:3px;padding:5px 3px;font-size:11px;max-width:110px}.memory-filters>button{font-size:11px;color:#3978ce;margin-left:auto;padding:4px}
.memory-results-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:12px 0;font-size:12px;color:var(--muted,#7b8ba6)}.memory-mode{display:flex;gap:0;flex-shrink:0;border:0;border-radius:0;border-bottom:1px solid color-mix(in srgb,var(--line,#dce6f2) var(--sprout-divider-strength,45%),transparent);}.memory-mode button{padding:5px 10px;font-size:12px;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;box-shadow:none;}.memory-mode button[aria-pressed=true]{color:#347cd9;background:transparent;border-bottom-color:currentColor;}
.memory-list{display:grid;gap:9px}.memory-card{display:flex;align-items:center;gap:12px;text-align:left;width:100%;min-width:0;padding:13px;background:var(--paper);border:1px solid var(--line,#dce6f2);border-radius:4px;color:var(--ink);cursor:pointer}.memory-card.selected{border-color:#619aec;box-shadow:inset 3px 0 #619aec}.memory-card:hover{border-color:#88afe6}.memory-card-meta{display:flex;justify-content:space-between;gap:8px;font-size:10px;color:var(--muted,#7b8ba6)}.memory-card h3{font-size:14px;line-height:1.7;margin:5px 0;font-weight:600;overflow-wrap:anywhere}.memory-card-body>p{font-size:12px;line-height:1.8;margin:0 0 8px;color:var(--muted,#7b8ba6);display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
.memory-tags{display:flex;gap:5px;flex-wrap:wrap}.memory-tags>span,.memory-tags>button{font-size:10px;line-height:1.6;background:var(--bg,#f3f7fd);border:1px solid var(--line,#e1e9f4);border-radius:2px;padding:1px 5px;overflow-wrap:anywhere;color:var(--muted,#7b8ba6)}
.memory-detail{position:sticky;top:calc(var(--studio-nav-height,64px) + 12px);min-width:0;background:var(--paper);border:1px solid var(--line,#dce6f2);padding:15px;border-radius:4px;max-height:calc(100dvh - var(--studio-nav-height,64px) - 28px);overflow:auto}.memory-detail h2{font-size:17px;line-height:1.7;margin:10px 0;overflow-wrap:anywhere}.memory-detail h3{font-size:13px;margin:17px 0 8px}.memory-detail-top{display:flex;justify-content:space-between;gap:6px;font-size:10px;color:var(--muted,#7b8ba6)}.memory-detail-top small{white-space:nowrap}.memory-facts{display:grid;grid-template-columns:65px 1fr;gap:6px;font-size:11px;margin:10px 0 13px}.memory-facts dt{color:var(--muted,#7b8ba6)}.memory-facts dd{margin:0}.memory-original{font-size:13px;line-height:1.9;white-space:pre-wrap;overflow-wrap:anywhere}.memory-source{font-size:11px;line-height:1.8;color:var(--muted,#7b8ba6);white-space:pre-wrap;overflow-wrap:anywhere}.memory-detail-actions{display:flex;gap:7px;margin-top:18px;flex-wrap:wrap}.memory-detail-actions button{border:1px solid var(--line,#dce6f2);color:#3978ce;font-size:11px;padding:7px;border-radius:3px}.memory-detail-note,.memory-scope-note{font-size:10px;color:var(--muted,#7b8ba6);line-height:1.8;margin:10px 0}
.memory-empty{text-align:center;padding:35px 15px;background:var(--paper);border:1px dashed var(--line,#dce6f2);border-radius:4px;font-size:13px;color:var(--muted,#7b8ba6)}.memory-empty h3{font-size:15px;color:var(--ink);margin:0 0 8px}.memory-empty p{line-height:1.8;margin:0 0 15px}.memory-detail-empty{padding:28px 0;border:0;background:transparent}.memory-load-more{display:block;width:100%;margin-top:10px}
.memory-space button:focus-visible,.memory-correction button:focus-visible{outline:2px solid #438bf0;outline-offset:2px}
.memory-correction{width:min(660px,calc(100vw - 28px));max-height:90dvh;padding:0;border:1px solid var(--line,#dce6f2);border-radius:4px;background:var(--paper);color:var(--ink);overflow:auto}.memory-correction::backdrop{background:#10203870}.memory-correction-head{display:flex;align-items:center;justify-content:space-between;padding:13px 17px;border-bottom:1px solid color-mix(in srgb,var(--line,#dce6f2) var(--sprout-divider-strength,45%),transparent)}.memory-correction-head h2{font-size:18px;margin:0}.memory-correction-head button{font-size:24px;padding:3px 7px}.memory-correction-form{padding:15px 17px;font-size:13px}.memory-correction-form p{line-height:1.8;margin:0 0 12px}.memory-correction-form label{display:block;margin-bottom:6px;font-size:12px}.memory-correction-form textarea{box-sizing:border-box;width:100%;font:inherit;line-height:1.8;padding:10px;background:var(--bg);color:var(--ink);border:1px solid var(--line,#dce6f2);border-radius:3px;resize:vertical}.memory-correction-form>button{border:1px solid #83ade8;color:#3978ce;padding:8px 12px;margin:12px 0;border-radius:3px}
.studio-page.dark .memory-sidebar button.active{background:#233e60;color:#c0dcff}.studio-page.dark .memory-mode button[aria-pressed=true]{color:#c0dcff;border-bottom-color:currentColor}.studio-page.dark .memory-connection{color:#91c9b1}.studio-page.dark .memory-header button,.studio-page.dark .memory-detail-actions button{color:#9ac3ff}
@media(max-width:1200px){.memory-layout{grid-template-columns:var(--mg-sidebar,172px) minmax(0,1fr);gap:10px}}
@media(max-width:1050px){.memory-layout{grid-template-columns:var(--mg-sidebar,172px) minmax(0,1fr)}.memory-detail{position:static;max-height:none;grid-column:1/-1}.memory-kind-tabs>span{display:none}}
@media(max-width:650px){.memory-header{align-items:flex-start;padding:7px 0 13px;gap:8px}.memory-header h1{font-size:22px}.memory-header p{font-size:12px}.memory-header>div:last-child{gap:5px}.memory-connection{font-size:10px}.memory-layout{grid-template-columns:1fr}.memory-sidebar details{border:1px solid var(--line,#dce6f2);padding:10px;max-height:180px;overflow:auto;background:var(--paper);border-radius:3px}.memory-sidebar summary{margin:0}.memory-sidebar details[open] summary{margin-bottom:8px}.memory-sidebar>p{display:none}.memory-kind-tabs button{font-size:12px;padding:9px 7px;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;box-shadow:none;}.memory-kind-tabs small{font-size:9px;margin-left:2px}.memory-detail{grid-column:1}.memory-filters{gap:6px}.memory-filters select{max-width:95px}.memory-header button{font-size:11px;padding:6px}.memory-detail h2{font-size:16px}}
.memory-reader{width:min(900px,92vw);max-height:88dvh;padding:28px;border:1px solid var(--line,#dce6f2);border-radius:4px;background:var(--paper,#fff);color:var(--ink,#26344a)}
.memory-reader::backdrop{background:#16263f66}.memory-reader header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;border-bottom:1px solid color-mix(in srgb,var(--line,#dce6f2) var(--sprout-divider-strength,45%),transparent);padding-bottom:16px}
.memory-reader h2{font-size:23px;margin:6px 0 0;line-height:1.5}.memory-reader small,.memory-reader-meta{font-size:12px;color:var(--muted,#7b8ba6);overflow-wrap:anywhere}
.memory-reader header button{padding:4px 9px;font-size:24px}.memory-reader-meta{margin:16px 0}.memory-reader-content{white-space:pre-wrap;overflow-wrap:anywhere;font-size:16px;line-height:1.95;user-select:text}
.memory-reader footer{margin-top:24px;border-top:1px solid color-mix(in srgb,var(--line,#dce6f2) var(--sprout-divider-strength,45%),transparent);font-size:12px;overflow-wrap:anywhere}.memory-reader footer h3{font-size:13px}

/* Whole-map view: compact captions, stable positions, selection context. */
.memory-layout.memory-layout-graph{grid-template-columns:var(--mg-sidebar,172px) minmax(0,1fr)}
.memory-layout-graph>.memory-detail{grid-column:2;position:static;max-height:none}
@media(max-width:650px){.memory-layout.memory-layout-graph{grid-template-columns:1fr}.memory-layout-graph>.memory-detail{grid-column:1}}
.memory-layout-graph>.memory-detail{display:none}

/* 2026-10-27 记忆列表固定高度+内部滚动；分页钉在可视区底部，不随列表长度下移 */

.memory-results .memory-page-form{position:static;margin:10px 0 4px;padding:10px 12px;border:1px solid var(--line,#dce6f2);border-radius:6px;background:var(--paper,#fff);box-shadow:0 -8px 16px -12px #14284859}
/* 2026-10-27 右侧详情栏暂隐（DOM 保留，后续功能复用）；记忆详情改由阅读弹窗承载 */
.memory-space .memory-detail{display:none}
.memory-reader-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px;padding-top:14px;border-top:1px solid color-mix(in srgb,var(--line,#dce6f2) var(--sprout-divider-strength,45%),transparent)}
.memory-reader-actions button{font:inherit;font-size:13px;padding:6px 12px;border:1px solid var(--line,#dce6f2);border-radius:4px;background:var(--paper,#fff);color:inherit;cursor:pointer}
.memory-reader-actions button:hover{background:rgba(38,55,77,.06)}

/* 2026-10-27 阅读弹窗排版收紧：头部防堆叠、字号降档、正文淡黄纸底 */
.memory-reader header>div{flex:1;min-width:0}
.memory-reader header small{display:block;margin-bottom:5px}
.memory-reader h2{font-size:19px;margin:0;line-height:1.45;overflow-wrap:anywhere}
.memory-reader header button{font-size:18px;line-height:1;padding:4px 10px;flex:none;margin-left:8px}
.memory-reader-meta{margin:14px 0 12px}
.memory-reader-content{font-size:15px;line-height:1.9;background:#fdf8e9;border:1px solid #efe3c2;border-radius:6px;padding:14px 16px;color:#3a3222}
.memory-reader footer{margin-top:18px}
.memory-reader footer p{margin:4px 0 0}

/* 记忆行右侧操作列（参考私人书房行布局） */
.memory-card-main{flex:1;min-width:0}
.memory-card-actions{flex:none;display:flex;align-items:center;gap:8px}
.memory-card-actions button{border:1px solid var(--line,#dce6f2);background:transparent;border-radius:4px;padding:6px 12px;font-size:12px;line-height:1.6;color:var(--ink);cursor:pointer;white-space:nowrap}
.memory-card-actions button:hover{border-color:#619aec;color:#2f75db;background:#f4f8ff}

/* 2026-11-02 详情页删除：与「展开阅读」同排的红调按钮（删除=云端 retire 作废，可在治理面找回） */
.memory-selected-preview header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.memory-selected-preview header>div:first-child{min-width:0}
.memory-preview-actions{display:flex;align-items:center;gap:8px;flex:none;flex-wrap:wrap;justify-content:flex-end}
.memory-preview-actions button{border:1px solid var(--line,#dce6f2);border-radius:3px;background:var(--paper,#fff);color:#3978ce;padding:7px 10px;font-size:12px}
.memory-preview-actions .memory-delete-btn{border-color:#ecb4bd;background:#fdf1f3;color:#b42334}
.memory-preview-actions .memory-delete-btn:hover{background:#fbe3e7}
.studio-page.dark .memory-preview-actions .memory-delete-btn{border-color:#7a3542;background:#3a2429;color:#ff9aa9}
