/* My Works: a cover shelf and a focused management list share one set of data. */
#view-create .home-right-main {
    width: 100%;
    min-width: 0;
    max-width: 1600px;
    margin: 0 auto;
    padding: 28px clamp(24px, 3vw, 48px) 18px !important;
    gap: 0;
    box-sizing: border-box;
}
#view-create .home-works-section { width: 100%; padding-top: 0 !important; }
#view-create .works-page-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
#view-create .works-page-copy { min-width: 0; }
#view-create .works-page-copy .home-section-kicker { margin-bottom: 9px; font-size: 10px; letter-spacing: .05em; }
#view-create .works-page-copy h2 { margin: 0 0 10px; color: var(--text); font-family: 'Songti SC', SimSun, serif; font-size: clamp(26px, 2.5vw, 34px); font-weight: 600; line-height: 1.35; letter-spacing: .025em; }
#view-create .works-page-copy p { margin: 0; font-size: 13px; line-height: 1.8; color: var(--muted); }
#view-create .works-page-head > :last-child:not(.works-page-copy),
#view-create .works-page-head .home-works-right { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
#view-create .works-page-head .studio-primary { min-height: 41px; padding: 10px 18px; color: var(--on-brand); }
#view-create .home-text-action { display: inline-flex; gap: 6px; align-items: center; border: 0; font-size: 12px; cursor: pointer; }
/* 回收站：线性图标与文字一体的次级入口，非删除动作，不使用危险实心红。 */
#view-create .works-page-head .works-recycle-button { justify-content: center; gap: 7px; min-height: 38px; padding: 0 12px; margin: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text-sub); line-height: 1.4; white-space: nowrap; transition: border-color .16s, color .16s; }
#view-create .works-page-head .works-recycle-button svg { display: block; flex: 0 0 17px; }
#view-create .works-page-head .works-recycle-button:hover { color: var(--brand); border-color: var(--brand); filter: brightness(.92); }
#view-create .works-page-head .works-recycle-button:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
    #view-create .works-page-head .works-recycle-button { transition: none; }
}
/* 右上操作组：新建在上、回收站在下，两者共享宽高，避免短文字导致按钮变窄。 */
#view-create .works-page-head > .works-page-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 124px; flex: 0 0 124px; }
#view-create .works-page-head .works-page-actions > button { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 100%; height: 41px; min-height: 41px; padding: 0 12px; margin: 0; font-size: 12px; line-height: 1.4; white-space: nowrap; }
#view-create .works-toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) repeat(3, 112px) auto !important; align-items: center; gap: 10px !important; margin: 18px 0 14px !important; }
#view-create .works-toolbar .home-work-search { min-height: 42px; box-shadow: none; }
#view-create .works-toolbar .home-work-select { min-height: 42px; font-size: 12px; }
#view-create .works-view-switch { display: inline-flex; align-items: center; gap: 3px; padding: 3px; background: var(--card-2); border: 1px solid var(--border); border-radius: 7px; }
#view-create .works-view-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 70px; min-height: 34px; padding: 6px 11px; background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 5px; font-size: 12px; cursor: pointer; white-space: nowrap; }
#view-create .works-view-switch button.is-active,
#view-create .works-view-switch button[aria-pressed="true"] { background: var(--card); border-color: var(--border); color: var(--brand); box-shadow: 0 1px 2px #142b1e08; font-weight: 600; }
#view-create .works-view-switch svg { width: 15px; height: 15px; flex: 0 0 auto; }
#view-create .home-works-header { padding: 0 0 15px; margin: 0; border: 0; align-items: center; flex-wrap: wrap; gap: 14px; }
#view-create .works-status-tabs { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
#view-create .works-status-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 7px 11px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--text-sub); font-size: 12px; cursor: pointer; }
#view-create .works-status-tabs button[aria-pressed="true"],
#view-create .works-status-tabs button.is-active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
#view-create .works-status-tabs button > span { font-size: 11px; opacity: .85; font-variant-numeric: tabular-nums; }
#view-create .works-status-tabs button:hover { color: var(--brand); background: var(--card-2); }
#view-create .home-results-count { margin-left: auto; font-size: 11px; }
#view-create .works-view-note { font-size: 11px; line-height: 1.7; color: var(--muted); }
#view-create .works-select, #view-create #worksSelectPage { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); cursor: pointer; flex: 0 0 15px; }
/* 批量操作条紧挨在「封面书架 · 自动记住显示方式」右侧，与「显示 N / N 部作品」同处一行。
   未选中时退成一行灰字提示，按钮用 visibility 继续占位（不用 display:none，否则行宽/行高会变），
   所以勾选/取消只换配色与文案，卡片位置恒为 0 位移。 */
#view-create .works-footer-note.works-result-row { flex-wrap: wrap; justify-content: flex-start; gap: 8px 12px; }
#view-create .works-selection-bar { display: inline-flex; align-items: center; gap: 8px; box-sizing: border-box; min-height: 36px; margin: 0; padding: 3px 4px 3px 12px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--brand); font-size: 12px; transition: background-color .16s, border-color .16s; }
#view-create .works-selection-bar[hidden] { display: none !important; }
#view-create .works-selection-bar:not(.is-idle) { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
#view-create .works-selection-bar.is-idle button { visibility: hidden; }
/* 未选中时整条退成空白占位（不显示任何文案，也不显示「全选」勾选框）：
   但高度/宽度仍在，所以勾选时只是原地变出内容和配色，作品网格不会跳动。
   ⚠️ 别改成 display:none，那样行高会塌，勾选瞬间整页作品会往下跳。 */
#view-create .works-selection-bar.is-idle .works-select-all { visibility: hidden; }
#view-create .works-selection-bar #worksSelectionCount { min-width: 112px; font-weight: 600; white-space: nowrap; }
#view-create .works-selection-bar #worksBatchStatus { white-space: nowrap; font-size: 11px; }
/* 未选中时操作条整条是空白占位，批量结果文案也不能露在外面（业务侧已清空，这里再兜一层）。 */
#view-create .works-selection-bar.is-idle #worksBatchStatus { visibility: hidden; }
#view-create .works-selection-bar button { min-height: 28px; padding: 4px 10px; background: var(--card); color: var(--text-sub); border: 1px solid var(--border); border-radius: 999px; font-size: 11px; white-space: nowrap; cursor: pointer; }
#view-create .works-selection-bar button:disabled { opacity: .5; cursor: not-allowed; }
#view-create .works-selection-bar .works-batch-trash, #view-create #worksBatchTrash { color: #a65345; }
/* 全选框常驻在操作条最左侧：勾选=全选当前筛选结果（含其他分页），再点一次取消。 */
#view-create .works-select-all { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; margin: 0; padding-right: 2px; color: var(--text-sub); font-size: 11px; line-height: 1; white-space: nowrap; cursor: pointer; user-select: none; }
#view-create .works-select-all input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); cursor: pointer; }
#view-create .works-select-all:hover, #view-create .works-selection-bar.is-idle .works-select-all:hover { color: var(--brand); }
#view-create .works-selection-bar.is-idle .works-select-all { color: var(--muted); }
#view-create #homeWorksGrid { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 20px !important; padding: 0 !important; margin: 0 !important; min-width: 0; box-sizing: border-box; align-items: stretch; }
#view-create .works-book-card { position: relative; display: grid; grid-template-columns: 38% minmax(0, 1fr); min-width: 0; min-height: 222px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); box-shadow: 0 2px 9px #142b1e03; transition: border-color .18s, box-shadow .18s; isolation: isolate; }
#view-create .works-book-card:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); box-shadow: 0 5px 20px #142b1e09; }
#view-create .works-book-card.is-selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
#view-create .works-book-card > .works-select { position: absolute; z-index: 2; left: 10px; top: 10px; box-shadow: 0 0 0 3px var(--card); border-radius: 2px; }
/* 未选中任何作品时，卡片与列表行上的勾选框先藏起来（封面/标题更干净，也不会被误点）。
   出现时机：鼠标移到这张卡片上、键盘聚焦、这张已被选中，或批量操作已激活（此时整页勾选框都露出）。
   只在真正有指针悬停的设备上生效；触摸设备没有 hover，勾选框保持常显，否则找不到入口。 */
@media (hover: hover) and (pointer: fine) {
    #view-create .works-book-card > .works-select,
    #view-create .works-row-book > .works-select {
        opacity: 0;
        pointer-events: none;
        transition: opacity .14s ease;
    }
    #view-create .works-book-card:hover > .works-select,
    #view-create .works-book-card:focus-within > .works-select,
    #view-create .works-book-card.is-selected > .works-select,
    #view-create .works-list-row:hover .works-select,
    #view-create .works-list-row:focus-within .works-select,
    #view-create .works-list-row.is-selected .works-select,
    #view-create .home-right-main:has(.works-selection-bar:not(.is-idle)) .works-select {
        opacity: 1;
        pointer-events: auto;
    }
}
@media (prefers-reduced-motion: reduce) {
    #view-create .works-book-card > .works-select, #view-create .works-row-book > .works-select { transition: none; }
}
#view-create .works-cover { position: relative; display: block; min-width: 0; width: 100%; aspect-ratio: 2 / 3; overflow: hidden; background: #294c3f; border-radius: 7px 0 0 7px; color: #f4f1de; align-self: stretch; }
#view-create .works-cover::after { content: ''; position: absolute; inset: 0; border: 1px solid #ffffff15; border-left: 4px solid #ffffff0b; pointer-events: none; border-radius: inherit; }
#view-create .works-cover-image { position: absolute; width: 100%; height: 100%; inset: 0; display: block; object-fit: cover; object-position: center; }
#view-create .works-cover-fallback { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; height: 100%; min-height: 220px; padding: 26px 16px 18px; box-sizing: border-box; overflow: hidden; font-family: 'Songti SC', SimSun, serif; font-size: clamp(18px, 1.3vw, 23px); line-height: 1.6; letter-spacing: .05em; overflow-wrap: anywhere; }
#view-create .works-cover-fallback strong { font-weight: 500; }
#view-create .works-cover-fallback small { font-family: inherit; font-size: 9px; opacity: .65; letter-spacing: .2em; }
#view-create .works-book-info { display: flex; flex-direction: column; align-items: stretch; gap: 0; min-width: 0; padding: 19px 16px 15px; }
#view-create .works-book-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; margin: 0; min-height: 42px; font-size: 15px; line-height: 1.5; color: var(--text); font-weight: 600; text-decoration: none; }
#view-create a.works-book-title:hover, #view-create button.works-book-title:hover { color: var(--brand); }
#view-create button.works-book-title { width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
#view-create .works-book-subtitle { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; overflow-wrap: anywhere; margin: 7px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.7; }
#view-create .works-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-sub); line-height: 1.5; white-space: nowrap; }
#view-create .works-status::before { content: ''; width: 5px; height: 5px; flex: 0 0 5px; background: var(--muted); border-radius: 50%; }
#view-create .works-status[data-state="running"]::before { background: var(--state-running, #2874b4); }
#view-create .works-status[data-state="done"]::before { background: var(--state-done, #247553); }
#view-create .works-status[data-state="paused"]::before, #view-create .works-status[data-state="attention"]::before { background: var(--state-paused, #966619); }
#view-create .works-status[data-state="pending"]::before { background: var(--state-pending, #66746a); }
#view-create .works-status[data-state="error"]::before, #view-create .works-status[data-state="interrupted"]::before { background: var(--state-error, #b44642); }
#view-create .works-progress-line { position: relative; width: 100%; height: 4px; background: var(--border); border-radius: 4px; overflow: hidden; margin: 11px 0 8px; }
#view-create .works-progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--brand); min-width: 0; max-width: 100%; }
#view-create .works-book-stats { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; color: var(--muted); font-size: 10px; line-height: 1.7; font-variant-numeric: tabular-nums; }
#view-create .works-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
#view-create .works-primary-action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 5px; background: var(--card); color: var(--brand); font-weight: 500; font-size: 11px; line-height: 1.4; white-space: nowrap; cursor: pointer; text-decoration: none; }
#view-create .works-primary-action:hover { border-color: var(--brand); background: var(--brand-soft); }
#view-create .works-primary-action.is-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
#view-create .works-primary-action:disabled { opacity: .6; cursor: wait; }
#view-create .works-action-menu { position: relative; margin-left: auto; flex: 0 0 auto; }
#view-create .works-action-menu > summary { display: grid; place-items: center; width: 30px; height: 32px; border: 1px solid transparent; border-radius: 5px; list-style: none; color: var(--muted); background: transparent; font-size: 19px; line-height: 1; cursor: pointer; }
#view-create .works-action-menu > summary::-webkit-details-marker { display: none; }
#view-create .works-action-menu > summary:hover, #view-create .works-action-menu[open] > summary { color: var(--brand); background: var(--card-2); border-color: var(--border); }
#view-create .works-action-menu[open] { z-index: 20; }
#view-create .works-book-card:has(.works-action-menu[open]), #view-create .works-list-row:has(.works-action-menu[open]) { z-index: 30; }
#view-create .works-menu-panel { display: flex; flex-direction: column; position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; width: 144px; padding: 5px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 7px; box-shadow: 0 8px 26px #0c221b20; }
#view-create .works-menu-panel button { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 7px 9px; border: 0; border-radius: 4px; background: transparent; color: var(--text-sub); font-size: 12px; text-align: left; cursor: pointer; }
#view-create .works-menu-panel button:hover { background: var(--card-2); color: var(--brand); }
#view-create .works-menu-panel button[data-action="trash"], #view-create .works-menu-panel button.is-danger { color: #ae5d50; }
#view-create .works-menu-panel button:disabled { opacity: .45; cursor: wait; }
#view-create [hidden] { display: none !important; }
#view-create .works-list-head, #view-create .works-list-row { display: grid; grid-template-columns: minmax(240px, 2.1fr) minmax(145px, 1fr) minmax(86px, .65fr) minmax(92px, .65fr) 116px; align-items: center; gap: 24px; box-sizing: border-box; }
#view-create .works-list-head { min-height: 44px; padding: 10px 22px; background: var(--card-2); color: var(--muted); border: 1px solid var(--border); border-bottom: 0; border-radius: 8px 8px 0 0; font-size: 11px; }
#view-create .works-list-head > :first-child { display: flex; align-items: center; gap: 17px; }
#view-create .works-list-head > :last-child { text-align: right; }
#view-create[data-works-layout="list"] #homeWorksGrid { display: block !important; background: var(--card); border: 1px solid var(--border); border-radius: 0 0 8px 8px; }
#view-create .works-list-row { position: relative; min-width: 0; padding: 18px 22px; border-bottom: 1px solid var(--border); color: var(--text); transition: background .15s; }
#view-create .works-list-row:last-child { border-bottom: 0; border-radius: 0 0 8px 8px; }
#view-create .works-list-row:hover { background: color-mix(in srgb, var(--card-2) 48%, var(--card)); }
#view-create .works-list-row.is-selected { background: var(--brand-soft); box-shadow: inset 3px 0 var(--brand); }
#view-create .works-row-book { min-width: 0; display: flex; align-items: center; gap: 17px; }
#view-create .works-row-book > .works-cover { width: 50px; height: 72px; flex: 0 0 50px; border-radius: 2px 4px 4px 2px; }
#view-create .works-row-book > .works-cover .works-cover-fallback { min-height: 72px; padding: 9px 7px; font-size: 11px; line-height: 1.45; letter-spacing: 0; }
#view-create .works-row-book > .works-cover .works-cover-fallback small { display: none; }
#view-create .works-row-book > .works-book-info { display: block; flex: 1; padding: 0; }
#view-create .works-list-row .works-book-title { min-height: 0; font-size: 13px; line-height: 1.7; -webkit-line-clamp: 2; }
#view-create .works-list-row .works-book-subtitle { margin: 6px 0 0; font-size: 10px; }
#view-create .works-row-progress { min-width: 0; color: var(--text-sub); font-size: 11px; line-height: 1.6; font-variant-numeric: tabular-nums; }
#view-create .works-row-progress > :first-child { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
#view-create .works-row-progress .works-progress-line { margin: 8px 0 5px; }
#view-create .works-row-progress small { color: var(--muted); font-size: 10px; }
#view-create .works-row-date { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; font-variant-numeric: tabular-nums; }
#view-create .works-row-date time { display: block; white-space: nowrap; }
#view-create .works-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
#view-create .works-row-actions .works-primary-action { min-height: 32px; padding: 7px 9px; }
#view-create #homeWorksPager { position: static !important; width: 100% !important; min-height: 0; margin: 24px 0 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; gap: 6px; justify-content: flex-end !important; flex-wrap: wrap; }
#view-create .home-pager-num.active { background: var(--brand) !important; border-color: var(--brand) !important; color: var(--on-brand) !important; }
#view-create .works-footer-note { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 19px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; line-height: 1.7; }
#view-create .home-works-section > .works-footer-note { margin: 0; padding: 0 0 16px; border: 0; }
#view-create .home-site-footer { padding: 24px 0 0; }
#view-create :is(button, summary, a, input, select):focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
[data-theme="dark"] #view-create .works-book-card { box-shadow: none; }
[data-theme="dark"] #view-create .works-menu-panel { box-shadow: 0 10px 28px #0006; }
[data-theme="dark"] #view-create .works-selection-bar .works-batch-trash,
[data-theme="dark"] #view-create #worksBatchTrash,
[data-theme="dark"] #view-create .works-menu-panel button[data-action="trash"],
[data-theme="dark"] #view-create .works-menu-panel button.is-danger { color: #eca99a; }
@media (min-width: 1740px) {
    #view-create #homeWorksGrid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}
@media (min-width: 1181px) and (max-width: 1360px) {
    #view-create #homeWorksGrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    #view-create .works-list-head, #view-create .works-list-row { grid-template-columns: minmax(210px, 2fr) minmax(120px, 1fr) 75px 86px 108px; gap: 16px; padding-left: 16px; padding-right: 16px; }
    #view-create .works-row-book { gap: 12px; }
}
@media (max-width: 1100px) {
    #view-create .works-toolbar { grid-template-columns: minmax(180px, 1fr) repeat(2, 112px) auto !important; }
    #view-create .works-toolbar #homeWorksStatus { display: none; }
    #view-create #homeWorksGrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    #view-create .works-list-head, #view-create .works-list-row { grid-template-columns: minmax(210px, 2fr) minmax(120px, 1fr) 75px 86px 108px; gap: 16px; padding-left: 16px; padding-right: 16px; }
    #view-create .works-row-book { gap: 12px; }
}
@media (max-width: 900px) {
    #view-create .home-right-main { padding: 26px 22px !important; }
    #view-create .works-page-head { margin-bottom: 22px; }
    #view-create .works-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto !important; }
    #view-create .works-toolbar .home-work-search { grid-column: 1 / -1; }
    #view-create .works-list-head { display: none; }
    #view-create[data-works-layout="list"] #homeWorksGrid { border-radius: 8px; }
    #view-create .works-list-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px 20px; padding: 18px; }
    #view-create .works-row-book { grid-column: 1; grid-row: 1 / 3; gap: 13px; }
    #view-create .works-row-state { grid-column: 2; grid-row: 1; justify-self: end; }
    #view-create .works-row-actions { grid-column: 2; grid-row: 2; }
    #view-create .works-row-progress { grid-column: 1; grid-row: 3; margin-left: 28px; max-width: 320px; }
    #view-create .works-row-date { grid-column: 2; grid-row: 3; align-self: end; justify-items: end; font-size: 10px; }
    #view-create .works-row-progress .works-progress-line { margin-top: 7px; }
    #view-create .works-book-card { min-height: 228px; }
}
@media (max-width: 600px) {
    #view-create .home-right-main { padding: 22px 14px !important; }
    #view-create .works-page-head { gap: 12px; align-items: flex-start; }
    #view-create .works-page-copy h2 { margin-bottom: 7px; font-size: 26px; }
    #view-create .works-page-copy p { font-size: 11px; max-width: 200px; }
    #view-create .works-page-head > :last-child:not(.works-page-copy), #view-create .works-page-head .home-works-right { gap: 6px; }
    #view-create .works-page-head .studio-primary { min-height: 36px; padding: 8px 11px; font-size: 11px; }
    #view-create .works-page-head .home-text-action { min-height: 36px; padding: 0 6px; font-size: 11px; }
    #view-create .works-page-head .home-text-action svg { display: none; }
    #view-create .works-page-head > .works-page-actions { width: 108px; flex-basis: 108px; gap: 6px; }
    #view-create .works-page-head .works-page-actions > button { height: 36px; min-height: 36px; padding: 0 10px; font-size: 11px; }
    #view-create .works-page-head .works-page-actions .works-recycle-button svg { display: block; }
    #view-create .works-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: 9px !important; margin-top: 15px !important; margin-bottom: 12px !important; }
    #view-create .works-toolbar .home-work-search { grid-column: 1 / -1; min-height: 40px; }
    #view-create .works-toolbar .home-work-select { min-height: 38px; }
    #view-create .works-view-switch { justify-self: end; }
    #view-create .works-view-switch button { min-height: 29px; min-width: 66px; }
    #view-create .home-works-header { gap: 10px; padding-bottom: 14px; }
    #view-create .works-status-tabs { gap: 3px; }
    #view-create .works-status-tabs button { min-height: 31px; padding: 6px 8px; font-size: 11px; }
    #view-create .home-results-count { width: 100%; margin-left: 0; font-size: 10px; }
    #view-create #homeWorksGrid { grid-template-columns: minmax(0, 1fr) !important; gap: 14px !important; }
    #view-create .works-book-card { grid-template-columns: 34% minmax(0, 1fr); min-height: 226px; }
    #view-create .works-book-info { padding: 19px 18px 16px; }
    #view-create .works-book-title { font-size: 15px; }
    #view-create .works-book-subtitle { font-size: 11px; }
    #view-create .works-book-stats { font-size: 10px; }
    #view-create .works-list-row { grid-template-columns: minmax(0, 1fr) 98px; gap: 12px 10px; padding: 15px 12px; }
    #view-create .works-row-book { gap: 9px; }
    #view-create .works-row-book > .works-cover { width: 42px; height: 62px; flex-basis: 42px; }
    #view-create .works-row-book > .works-cover .works-cover-fallback { min-height: 62px; padding: 6px; font-size: 10px; }
    #view-create .works-row-book .works-select { width: 14px; height: 14px; flex-basis: 14px; }
    #view-create .works-list-row .works-book-title { font-size: 12px; line-height: 1.6; }
    #view-create .works-list-row .works-book-subtitle { margin-top: 4px; font-size: 10px; }
    #view-create .works-row-actions { gap: 0; }
    #view-create .works-row-actions .works-primary-action { min-height: 29px; padding: 6px 7px; font-size: 10px; }
    #view-create .works-row-actions .works-action-menu > summary { width: 26px; height: 29px; }
    #view-create .works-row-progress { margin-left: 23px; font-size: 10px; }
    #view-create .works-row-date { font-size: 9px; }
    #view-create .works-row-progress small { font-size: 9px; }
    #view-create #homeWorksPager { justify-content: center !important; margin-top: 20px !important; }
    #view-create .works-footer-note { align-items: flex-start; flex-direction: column; gap: 5px; font-size: 10px; margin-top: 15px; padding-top: 15px; }
    #view-create .home-works-section > .works-footer-note { flex-direction: row; flex-wrap: wrap; row-gap: 8px; padding-bottom: 12px; gap: 6px 10px; }
    /* 窄屏放不下时操作条整行落到第二行，仍是「常驻」的，所以勾选不会改变行高 */
    #view-create .works-selection-bar { flex: 1 1 100%; width: 100%; justify-content: space-between; gap: 5px; margin-left: 0; padding: 3px 4px 3px 6px; }
    #view-create .works-selection-bar #worksSelectionCount { min-width: 0; flex: 1 1 auto; font-size: 11px; }
    /* 未选中时整条是空白占位：窄屏这里把「全选」勾选框直接移出布局，省下的宽度留给选中后的按钮 */
    #view-create .works-selection-bar.is-idle .works-select-all { display: none; }
    #view-create .works-selection-bar.is-idle #worksSelectionCount { min-width: 0; }
    #view-create .works-selection-bar button { font-size: 10px; padding: 4px 6px; }
}
@media (prefers-reduced-motion: reduce) {
    #view-create .works-book-card, #view-create .works-list-row { transition: none; }
}
/* 超窄屏（≤374px）一行放不下「全选 + 已选 N 部作品 + 三个按钮」：允许条内换成两行，
   并用固定 min-height 兜住两种状态，勾选前后行高仍然一致，作品不会跳动。 */
@media (max-width: 374px) {
    #view-create .works-selection-bar { flex-wrap: wrap; align-content: center; justify-content: center; row-gap: 4px; min-height: 68px; }
    #view-create .works-selection-bar #worksSelectionCount { flex: 0 0 auto; }
}

/* ============================================================
   页面固定、列表内滚（桌面端）
   · 目标：进入「我的作品」后整页不滚动；标题/筛选/工具条/结果行/分页常驻，
     只有作品网格（书架卡或列表行）内部滚动。
   · 之前 enhancements.css 把 .home-right-main / #home-shell 改成 overflow:visible，
     让整页跟着内容滚——这里用更高特异性 + !important 收回来。
   · 只在 ≥901px 生效：窄屏工具条会换成多行，固定高度会把列表挤没，那时仍走整页滚动。
   ============================================================ */
@media (min-width: 901px) {
    #view-create {
        /* 顶部导航在窄桌面宽度会换行（实测 64px / 116px 两种），写死 60px 会多滚一截。
           works.js 的 syncWorksFixedHeight() 会实测「视图距视口顶部的高度」写进 --works-fixed-h；
           没跑到 JS 时退回按 60px 估算，最多轻微多出一点滚动。 */
        height: var(--works-fixed-h, calc(100dvh - 60px));
        min-height: 0 !important;
        overflow: hidden;
    }
    #view-create #home-shell {
        /* enhancements.css 在 ≥1181px 有 #home-shell{height:auto!important}（给侧栏滚动布局用），
           同特异性只能靠后出现 + 同为 !important 才能压住，否则这里是自动高度、
           作品网格会把整页撑高，内部滚动永远不触发。 */
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
        display: flex;
        flex-direction: column;
    }
    #view-create .home-right-main {
        flex: 1 1 auto;
        height: 100% !important;
        min-height: 0;
        overflow: hidden !important;
    }
    /* 除网格外的所有块保持自然高度，不参与收缩 */
    #view-create .works-page-head,
    #view-create .home-works-section,
    #view-create #worksListHead,
    #view-create #homeWorksPager,
    #view-create .home-site-footer { flex: 0 0 auto; }

    /* 固定高度后垂直空间变紧：收掉大段留白，让列表多露一行。
       （标题区仍保留，只压 padding/margin，不改字号与结构） */
    #view-create .home-right-main { padding-top: 28px !important; padding-bottom: 18px !important; }
    #view-create .works-page-head { margin-bottom: 14px; }
    #view-create .works-toolbar { margin: 12px 0 10px !important; }
    #view-create .home-site-footer { margin-top: 6px !important; }

    /* 唯一的滚动容器。align-content:start 防止内容不足一屏时卡片被拉高摊开。 */
    #view-create #homeWorksGrid {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        align-content: start;
        overscroll-behavior: contain;
        padding: 2px 4px 8px 2px !important;
        scrollbar-width: thin;
        scrollbar-gutter: stable;
    }
    /* 列表视图的行与书架卡共用同一个滚动容器，这里只补底部留白，
       覆盖 enhancements.css 给 .home-works-grid 的 padding-bottom:56px。 */
    #view-create[data-works-layout="list"] #homeWorksGrid { padding-bottom: 12px !important; }
}
