/* 家书书桌：照片与文字先行，操作按重要性呈现。屏幕专用，保留原印刷规则。 */
@media screen {
  body.theme-c {
    --desk-radius: 24px;
    --desk-control: 12px;
    --desk-line: rgba(243,236,217,.12);
    --desk-panel: #17271f;
    --desk-hover: #23382b;
    --vg-r-sm: 12px;
    --vg-r-md: 20px;
  }
  /* 操作：实心主按钮、无边框的普通操作、保留边界的输入字段。 */
  body.theme-c :is(#main-app,.modal-overlay,dialog,.mm-modal,#profile-edit-modal,#profile-password-modal,#avatar-picker-modal,.site-c-confirm-overlay) button {
    border-radius: var(--desk-control);
    border-color: transparent !important;
    transition: background-color .2s, color .2s, opacity .2s;
  }
  body.theme-c :is(.mm-app,.mm-modal) :is(.mm-btn,.mm-iconbtn),
  body.theme-c #main-app.theme-memoir[data-group="memoir"] :is(#shell-title,#shell-actions) :is(.mm-btn,.mm-iconbtn) {
    background: transparent; border-color: transparent; border-radius: 9999px;
    color: var(--vg-ink2); min-height: 48px; padding: 12px 16px; box-shadow: none;
  }
  body.theme-c :is(.mm-app,.mm-modal) :is(.mm-btn,.mm-iconbtn):hover:not(:disabled),
  body.theme-c #main-app.theme-memoir[data-group="memoir"] :is(#shell-title,#shell-actions) :is(.mm-btn,.mm-iconbtn):hover:not(:disabled) {
    background: var(--desk-hover); color: var(--vg-ink);
  }
  body.theme-c #main-app .mm-app .mm-btn-primary,
  body.theme-c .mm-modal .mm-btn-primary,
  body.theme-c :is(.mm-app,.mm-modal) .mm-btn-primary,
  body.theme-c .mm-app.mm-light .mm-btn-primary,
  body.theme-c #main-app.theme-memoir[data-group="memoir"] #shell-actions .mm-btn-primary,
  body.theme-c #view-memoir .vg-btn:not(.vg-btn--line):not(.vg-btn--night) {
    --desk-control: 9999px; background: var(--vg-seal); color: var(--vg-on-seal); border-radius: 9999px; padding-inline: 24px;
  }
  body.theme-c :is(.mm-app,.mm-modal) .mm-btn-primary:hover:not(:disabled),
  body.theme-c #main-app.theme-memoir[data-group="memoir"] #shell-actions .mm-btn-primary:hover:not(:disabled) {
    background: var(--vg-seal-dk); color: var(--vg-on-seal);
  }
  body.theme-c :is(.mm-app,.mm-modal) .mm-btn-danger { color: var(--vg-danger); }
  body.theme-c :is(.mm-app,.mm-modal) .mm-btn-danger:hover:not(:disabled) { color: var(--vg-danger); background: rgba(245,163,148,.1); }
  body.theme-c :is(.mm-app,.mm-modal) :is(.mm-btn,.mm-iconbtn):disabled {
    background: transparent !important; border-color: transparent !important; color: var(--vg-ink3) !important; opacity: .45;
  }
  body.theme-c :is(#main-app,.modal-overlay,dialog,.mm-modal,#profile-edit-modal,#profile-password-modal) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea) {
    border-radius: var(--desk-control); border-color: var(--desk-line) !important;
  }
  body.theme-c :is(input,textarea,select):focus-visible { outline: 2px solid var(--vg-seal); outline-offset: 3px; }
  body.theme-c :is(.bg-brand-primary,[class*="from-brand-primary"],.ai-admin-primary) { --desk-control: 9999px; border-radius: 9999px; }
  /* 顶栏：导航与内容不再被两排按钮框隔开。 */
  body.theme-c #main-app #vg-top { border-color: var(--desk-line); }
  body.theme-c #main-app #vg-pagebar { border: 0; min-height: 88px; padding-inline: 24px; gap: 16px; }
  body.theme-c #main-app.theme-memoir[data-group="memoir"] #vg-pagebar { max-width: 1320px; width: 100%; margin-inline: auto; }
  body.theme-c #main-app #shell-title { gap: 8px; }
  body.theme-c #main-app #shell-actions { gap: 2px; }
  body.theme-c #main-app.theme-memoir[data-group="memoir"] #shell-actions [data-act="read"] { color: var(--vg-seal); background: var(--vg-seal-soft); }
  body.theme-c #main-app #shell-actions [data-act="font-size"] { color: var(--vg-ink3); }
  body.theme-c #main-app #vg-top .nav-primary.is-active::before { border-radius: 50%; width: 5px; height: 5px; rotate: 0deg; }
  body.theme-c #main-app #sidebar { border-color: var(--desk-line); }
  body.theme-c #main-app #sidebar .nav-item { border-radius: 12px; border: 0; min-height: 48px; }
  body.theme-c #main-app #sidebar .nav-item.bg-glass { background: var(--vg-seal-soft); }
  /* 书房：给影像留出边缘，书架保留物件感，内容用留白分组。 */
  body.theme-c #view-memoir .st-greet { padding-block: 48px 32px; }
  body.theme-c #view-memoir .st-greet h1 { max-width: 21em; font-size: 30px; line-height: 1.5; }
  body.theme-c #view-memoir .st-feature { max-width: 1184px; margin-inline: auto; padding-inline: 32px; }
  body.theme-c #view-memoir .vg-sec-h { border: 0; margin-bottom: 24px; }
  body.theme-c #view-memoir .st-mail .q { border: 0; border-radius: 0; background: transparent; padding: 4px 0; }
  body.theme-c #view-memoir .st-mail li,body.theme-c #view-memoir .st-chs li { border-color: var(--desk-line); }
  body.theme-c #view-memoir .st-shelf { border-bottom-width: 3px; padding-bottom: 12px; }
  body.theme-c #view-memoir .st-bk { border-radius: 4px 12px 12px 4px; }
  body.theme-c #view-memoir .st-bk.add { border: 0; background: var(--vg-seal-soft); border-radius: 12px; }
  /* 书稿工作台：目录与讲述各有一处焦点，取消嵌套的空状态方框。 */
  body.theme-c .mm-app .mm-wrap.wide { max-width: 1240px; padding-top: 16px; }
  body.theme-c .mm-app .mm-book-cols { gap: 32px; }
  body.theme-c .mm-app .mm-col-main { counter-reset: desk-chapter; }
  body.theme-c .mm-app .mm-cover-img { display: block; border: 0; padding: 0; margin: 0 0 40px !important; border-radius: 16px; background: transparent; max-height: 420px; object-fit: cover; }
  body.theme-c .mm-app .mm-col-side { border: 0; border-radius: 24px; padding: 32px; background: var(--desk-panel); }
  body.theme-c .mm-app .mm-col-side > .mm-h2:first-child { margin-top: 0; }
  body.theme-c .mm-app .mm-h2 { border: 0; margin-bottom: 16px; padding-bottom: 0; gap: 16px; }
  body.theme-c .mm-app .mm-col-main > .mm-h2 { font-size: 24px; }
  body.theme-c .mm-app .mm-col-main > .mm-unassigned-heading { justify-content: flex-start !important; padding-top: 32px; }
  body.theme-c .mm-app :is(.mm-card,.mm-notice,.mm-rv-banner),body.theme-c .mm-modal .mm-card { border: 0; border-radius: 16px; box-shadow: none; }
  body.theme-c .mm-app .mm-col-side > .mm-card.mm-muted { background: transparent; padding: 0; margin: 0 0 24px; }
  body.theme-c .mm-app .mm-col-side > .mm-row { gap: 12px; align-items: flex-start; }
  body.theme-c .mm-app .mm-col-side > .mm-row > .mm-btn:not(.mm-btn-primary) { padding-inline: 8px; }
  body.theme-c .mm-app .mm-col-side .mm-secondary-tools { border-color: var(--desk-line); margin-top: 32px; padding-top: 16px; }
  body.theme-c .mm-app .mm-col-side .mm-secondary-tools > summary { color: var(--vg-ink3); font-weight: 400; }
  body.theme-c .mm-app .mm-col-main > .mm-card { background: transparent; padding: 24px 0; border: 0; border-bottom: 1px solid var(--desk-line); border-radius: 0; margin: 0; }
  body.theme-c .mm-app .mm-col-main > .mm-card.clickable:hover { background: var(--vg-seal-soft); border-color: var(--desk-line); }
  body.theme-c .mm-app .mm-col-main > .mm-card.mm-muted { color: var(--vg-ink3); padding: 12px 0 32px 48px; }
  body.theme-c .mm-app .mm-col-main .mm-story-open { font: 500 24px/1.6 var(--vg-serif) !important; padding: 0; min-height: 44px; text-align: left; border-radius: 0; }
  body.theme-c .mm-app .mm-chapter-heading { counter-increment: desk-chapter; position: relative; flex-wrap: nowrap; align-items: center; gap: 16px; padding-top: 24px; margin: 32px 0 4px !important; }
  body.theme-c .mm-app .mm-chapter-heading::before { content: counter(desk-chapter,decimal-leading-zero); color: var(--vg-seal); opacity: .7; font: 400 20px/1.5 var(--vg-serif); flex: 0 0 32px; }
  body.theme-c .mm-app .mm-chapter-heading > div:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  body.theme-c .mm-app .mm-chapter-tools { position: relative; flex: none; max-width: 100%; }
  body.theme-c .mm-app .mm-chapter-tools > summary { list-style: none; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 12px; color: var(--vg-ink3); font: 400 var(--pub-size-control)/1.7 var(--vg-sans); border-radius: 9999px; cursor: pointer; }
  body.theme-c .mm-app .mm-chapter-tools > summary::-webkit-details-marker { display: none; }
  body.theme-c .mm-app .mm-chapter-tools > summary > i { font-size: 24px; }
  body.theme-c .mm-app .mm-chapter-tools[open] > summary,body.theme-c .mm-app .mm-chapter-tools > summary:hover { background: var(--desk-hover); color: var(--vg-ink); }
  body.theme-c .mm-app .mm-chapter-tools > .mm-row { position: absolute; z-index: 25; top: 100%; right: 0; width: 224px; max-width: calc(100vw - 40px); display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 2px !important; padding: 8px; border: 1px solid var(--desk-line); border-radius: 16px; background: #21352a; box-shadow: 0 16px 40px #0005; }
  body.theme-c .mm-app .mm-chapter-tools:not([open]) > .mm-row { display: none; }
  body.theme-c .mm-app .mm-chapter-tools .mm-row > button { width: 100%; justify-content: flex-start; border-radius: 12px; height: auto !important; min-height: 48px !important; }
  body.theme-c .mm-app .mm-chapter-tools [data-act="delete-chapter"] { color: var(--vg-danger); }
  /* 通用内容：只让真正的分组拥有底色，照片不加双重边框。 */
  body.theme-c #main-app .view-section:not(#view-memoir) .bg-dark-card:not(img) { border-radius: var(--desk-radius); border: 0; box-shadow: none; }
  body.theme-c #main-app #view-profile > div > .bg-dark-card:not(.profile-summary) { background: transparent !important; border-top: 1px solid var(--desk-line); border-radius: 0; padding: 32px 0 0; }
  body.theme-c #main-app :is(.profile-upload-preview, .profile-dl-btn) { padding: 0; }
  #profile-uploads-grid .profile-dl-btn { inline-size: 48px; block-size: 48px; background: var(--vg-night); color: var(--vg-on-night); }
  #profile-uploads-grid :is(.profile-upload-preview, .profile-dl-btn):focus-visible { outline: 3px solid var(--vg-info); outline-offset: -3px; }
  #avatar-gallery-grid button[data-photo-id]:focus-visible { outline: 3px solid var(--vg-info); outline-offset: -3px; }
  body.theme-c #main-app .profile-summary { padding: 32px; gap: 24px; border: 0; background: var(--desk-panel); }
  body.theme-c #main-app #profile-avatar { border-radius: 50%; }
  body.theme-c #main-app .profile-actions button { background: transparent !important; color: var(--vg-seal); padding-inline: 4px; min-height: 44px; }
  body.theme-c #main-app .profile-actions { gap: 24px; }
  body.theme-c #main-app :is(#profile-bio,.profile-summary .flex-1) { min-width: 0; overflow-wrap: anywhere; }
  body.theme-c #main-app :is(.gallery-item,#gallery-filter-tabs,#search-filter-panel,#notif-panel,#user-dropdown) { border-radius: 16px; border-color: var(--desk-line); }
  body.theme-c #main-app #gallery-filter-tabs { background: transparent !important; border: 0; gap: 4px; }
  body.theme-c #main-app #gallery-filter-tabs button { border-radius: 9999px; }
  body.theme-c #main-app #album-people-strip { border: 0; border-radius: 0; background: transparent !important; padding-inline: 0; }
  body.theme-c #main-app #achievements-list > div { border: 0 !important; background: transparent !important; border-radius: 12px; }
  body.theme-c #main-app :is(#view-points,#view-signin,#view-ai-tasks) > div > h2 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); }
  body.theme-c #main-app #circles-list .circle-settings-btn .site-c-control-label { min-width: 0; max-width: 1px; inset: 0 auto auto 0; }
  body.theme-c #main-app .ai-task-filter { border-radius: 9999px; min-height: 44px; }
  body.theme-c #main-app .ai-admin-button { min-height: 44px; border-radius: 9999px; }
  /* 弹窗：柔和的整张纸面，内容滚动；输入和确认层级清楚。 */
  body.theme-c :is(.mm-modal,.modal-overlay > div,#profile-edit-modal > .relative,#profile-password-modal > .relative,#avatar-picker-modal > .relative,.site-c-dialog-card,dialog) {
    border-radius: 24px; border-color: var(--desk-line); box-shadow: 0 28px 100px #0006;
  }
  body.theme-c .modal-overlay:not(#auth-modal),body.theme-c .mm-modal-back { background: rgba(4,12,8,.72); backdrop-filter: blur(10px); }
  body.theme-c .mm-modal { padding: 32px; background: var(--desk-panel); }
  body.theme-c .mm-modal > .mm-row:last-child { background: var(--desk-panel); }
  body.theme-c :is(.mm-modal,.modal-overlay) :is(.mm-input,.mm-textarea,.mm-select) { background: var(--vg-bg); }
  body.theme-c :is(.mm-scope,.mm-merge) { border-radius: 24px; }
  body.theme-c .mm-app .mm-wrap:has(> .mm-body) { border: 0; border-radius: 24px; background: var(--desk-panel); }
  body.theme-c #main-app .mm-app .mm-iconbtn { border-radius: 9999px; }
  body.theme-c #main-app .mm-app .mm-chapter-tools .mm-iconbtn { border-radius: 12px; }
  body.theme-c #main-app .mm-app .mm-story-open { border-radius: 0; }
  body.theme-c .mm-modal .mm-btn-primary { border-radius: 9999px; }
  body.theme-c .modal-overlay .bg-brand-primary { border-radius: 9999px; }
  body.theme-c :is(#profile-edit-modal,#profile-password-modal,#avatar-picker-modal) > .relative { border-radius: 24px; }
  body.theme-c #main-app :is(#view-points,#view-signin) .bg-dark-card { background: var(--desk-panel); }
  body.theme-c #batch-edit-modal [class~="bg-white/5"] { border: 0; border-radius: 16px; }
  body.theme-c #create-space-modal [class*="bg-blue-"] { background: var(--vg-seal-soft) !important; border: 0; border-radius: 12px; }
  body.theme-c #auth-modal #auth-dialog { border-radius: 24px; }
  body.theme-c #auth-modal input:not([type=hidden]) { border-radius: 12px; }
  body.theme-c #auth-modal form button[type=submit] { --desk-control: 9999px; border-radius: 9999px; }
  body.theme-c #auth-modal #auth-tabs button { border-radius: 0; }
  body.theme-c #editor-modal { border-radius: 0; }
  /* 同一账本的购买页，保留渠道标志和真实价格。 */
  body.checkout-film :is(.plan-card,.pack-card,.user-panel,.channel-panel,.error-card,.market-select) { border-radius: 24px; border-color: var(--desk-line); }
  body.checkout-film :is(button,.pay-btn,.recheck-order) { border-radius: 9999px; }
  body.checkout-film .plan-card::after { border-radius: 24px; }
  body.checkout-film :is(.plan-card.selected,.pack-card.selected) { border-color: var(--vg-seal); }
  @media(min-width:768px) {
    body.theme-c .mm-app .mm-chapter-tools.opens-up > .mm-row { top: auto; bottom: 100%; }
  }
  @media(min-width:1024px) {
    body.theme-c .mm-app .mm-book-cols { grid-template-columns: minmax(0,1fr) minmax(300px,370px); }
  }
  @media(max-width:767px) {
    body.theme-c #main-app #vg-pagebar,body.theme-c #main-app.theme-memoir[data-group="memoir"] #vg-pagebar { padding: 12px 16px 16px; gap: 8px; }
    body.theme-c #main-app > .vg-body { padding-bottom: calc(96px + env(safe-area-inset-bottom,0px)); }
    body.theme-c #main-app .view-section { scroll-padding-block: 16px; }
    body.theme-c #main-app #sidebar { top: 65px; bottom: calc(88px + env(safe-area-inset-bottom,0px)); height: auto; max-height: calc(100dvh - 153px - env(safe-area-inset-bottom,0px)); }
    body.theme-c #main-app.theme-memoir[data-group="memoir"] #vg-pagebar > div:last-child { max-width: 100%; width: 100%; overflow: visible; }
    body.theme-c #main-app.theme-memoir[data-group="memoir"] #shell-actions { gap: 2px; }
    body.theme-c #main-app.theme-memoir[data-group="memoir"] #shell-actions .mm-iconbtn { padding-inline: 8px; font-size: 16px; min-width: 44px; }
    body.theme-c #main-app #shell-title .mm-iconbtn { padding-inline: 8px; }
    body.theme-c #main-app #tabbar { border: 0; padding: 8px 12px max(8px,env(safe-area-inset-bottom,0px)); box-shadow: 0 -12px 32px #0002; }
    body.theme-c #main-app #tabbar button { border-radius: 16px; min-height: 60px; }
    body.theme-c #main-app #tabbar button.is-active { background: var(--vg-seal-soft); }
    body.theme-c #view-memoir .st-greet { padding-block: 32px 24px; }
    body.theme-c #view-memoir .st-feature { padding-inline: 24px; }
    body.theme-c .mm-app .mm-wrap.wide { padding: 8px 24px 32px; }
    body.theme-c .mm-app .mm-col-side { padding: 24px; margin-bottom: 32px; border-radius: 24px; }
    body.theme-c .mm-app .mm-cover-img { margin-bottom: 32px !important; border-radius: 16px; }
    body.theme-c .mm-app .mm-chapter-heading { gap: 12px; }
    body.theme-c .mm-app .mm-chapter-tools > summary > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    body.theme-c .mm-app .mm-chapter-tools > summary { width: 48px; padding: 0; }
    body.theme-c .mm-app .mm-chapter-tools > .mm-row { position: fixed; top: auto; bottom: calc(88px + env(safe-area-inset-bottom,0px)); left: 12px; right: 12px; width: auto; max-width: none; max-height: calc(100dvh - 112px); overflow-y: auto; }
    body.theme-c #main-app .profile-summary { padding: 24px; flex-wrap: wrap; gap: 24px; }
    body.theme-c .mm-modal-back { padding: 12px; align-items: center; }
    body.theme-c .mm-modal { border-radius: 24px; padding: 24px; max-height: calc((100dvh - 24px) / var(--mm-zoom,1)); }
    body.theme-c .mm-modal > .mm-row:last-child { bottom: -24px; }
    body.theme-c :is(.modal-overlay, #profile-edit-modal,#profile-password-modal,#avatar-picker-modal) { padding: 12px; }
    body.theme-c .modal-overlay > div, body.theme-c :is(#profile-edit-modal,#profile-password-modal,#avatar-picker-modal) > .relative { max-height: calc(100dvh - 24px); }
  }
  @media(prefers-reduced-motion:reduce) {
    body.theme-c :is(button,details,summary) { transition: none; }
  }
}

/* 流式字号改成两档字阶：小屏取下限，≥64rem 取上限 */
@media (min-width: 64rem) {
  body.theme-c #view-memoir .st-greet h1 { font-size: 36px; }
}

/* 流式留白改成两档间距：小屏取下限，≥64rem 取上限 */
@media (min-width: 64rem) {
  body.theme-c #main-app #vg-pagebar { padding-inline: 64px; }
  body.theme-c .mm-app .mm-book-cols { gap: 80px; }
}
