/** 首页任务记录、积分、错题文件夹与任务取消扩展样式。 */

/* web-v1.3.2：首页任务记录、整页控制与积分页 */
#pageHome > .upload-card {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  align-content: start;
}
.task-history-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 20px;
  border-radius: var(--radius-xl);
  background: rgba(255, 254, 250, 0.94);
  box-shadow: var(--shadow);
}
.task-history-header { align-items: flex-end; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.task-history-caption { margin: 5px 0 0; color: var(--text-muted); font-size: .82rem; }
.import-task-list {
  align-content: start;
  gap: 16px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(21, 94, 74, .38) transparent;
  padding: 2px 4px 18px 0;
}
.import-task-list::-webkit-scrollbar { width: 8px; }
.import-task-list::-webkit-scrollbar-track { background: transparent; }
.import-task-list::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: rgba(21, 94, 74, .34); background-clip: padding-box; }
.task-day-group { display: grid; gap: 9px; }
.task-day-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 2px; color: var(--surface-ink); }
.task-day-heading span { color: var(--text-muted); font-size: .76rem; }
.task-history-empty { min-height: 112px; place-items: center; color: var(--text-muted); }
.import-task-card { padding: 15px 16px; border-radius: 16px; background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(246,243,235,.76)); }
.import-task-head strong { font-size: .96rem; }
.page-import-options { grid-template-columns: minmax(0, 1.15fr) minmax(250px, .85fr); }
.auto-grouping-note,
.scan-toggle { min-height: 78px; }
.auto-grouping-note { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-muted); }
.auto-grouping-note div { display: grid; gap: 4px; }
.auto-grouping-note strong { color: var(--surface-ink); }
.auto-grouping-note small { color: var(--text-muted); line-height: 1.5; }
.auto-grouping-icon { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #fff; font-weight: 800; background: var(--brand-strong); }

.points-page-content { display: grid; gap: 14px; }
.points-balance-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 20px; align-items: end; padding: 24px; border-radius: 22px; color: #f9f7ef; background: linear-gradient(135deg, #123f35, #24725f); box-shadow: 0 20px 44px rgba(18,63,53,.2); }
.points-balance-copy > span { font-size: .78rem; letter-spacing: .08em; opacity: .78; }
.points-balance-copy > strong { display: block; margin: 8px 0 10px; font-family: var(--font-serif); font-size: clamp(3rem, 7vw, 5.2rem); line-height: .9; }
.points-balance-copy p { margin: 0; max-width: 520px; color: rgba(255,255,255,.72); font-size: .84rem; line-height: 1.6; }
.points-redeem-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 16px; background: rgba(255,255,255,.1); }
.points-redeem-form label { display: grid; gap: 5px; color: rgba(255,255,255,.78); font-size: .74rem; }
.points-redeem-form input { width: 100%; min-height: 42px; border: 1px solid rgba(255,255,255,.18); border-radius: 11px; padding: 8px 10px; color: var(--surface-ink); background: rgba(255,255,255,.94); }
.points-redeem-form .primary-button { align-self: end; border-color: rgba(255,255,255,.25); background: #f4efe1; color: var(--brand-strong); box-shadow: none; }
.points-benefit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.points-benefit-card { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.points-benefit-card > span { color: var(--text-muted); font-size: .78rem; }
.points-benefit-card > strong { display: block; margin: 8px 0 5px; color: var(--surface-ink); font-family: var(--font-serif); font-size: 1.55rem; }
.points-benefit-card p { margin: 0; color: var(--text-muted); font-size: .8rem; }
.points-benefit-card.accent { background: linear-gradient(135deg, rgba(184,106,60,.08), rgba(255,254,250,.94)); }
.points-ledger-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.points-ledger-card { min-width: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.points-ledger-heading { display: flex; justify-content: space-between; align-items: flex-end; padding: 15px 16px; border-bottom: 1px solid var(--line); background: var(--surface-muted); }
.points-ledger-heading div { display: grid; gap: 3px; }
.points-ledger-heading span,
.points-ledger-heading small { color: var(--text-muted); font-size: .74rem; }
.points-ledger-heading strong { color: var(--surface-ink); }
.points-ledger-list { max-height: 330px; overflow-y: auto; }
.points-ledger-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.points-ledger-row:last-child { border-bottom: 0; }
.points-ledger-main,
.points-ledger-side { display: grid; gap: 4px; min-width: 0; }
.points-ledger-main strong { color: var(--surface-ink); font-size: .86rem; }
.points-ledger-main span,
.points-ledger-side span { color: var(--text-muted); font-size: .72rem; overflow-wrap: anywhere; }
.points-ledger-side { justify-items: end; text-align: right; }
.points-delta { color: var(--text-main); font-size: .94rem; }
.points-delta.positive { color: var(--brand); }
.points-delta.negative { color: var(--danger); }
.points-ledger-empty { padding: 28px; text-align: center; color: var(--text-muted); }
.formula-rich-text { white-space: normal; }
.rich-list-row { display: block; padding-left: 1em; position: relative; }
.rich-list-row::before { content: "•"; position: absolute; left: 0; color: var(--brand); }
.notion-record-title.formula-rich-text { font-weight: 700; }

@media (max-width: 760px) {
  .points-balance-hero,
  .points-benefit-grid,
  .points-ledger-grid { grid-template-columns: 1fr; }
  .points-redeem-form { grid-template-columns: 1fr; }
  .points-ledger-row { align-items: start; }
}
@media (max-width: 640px) {
  .page-import-options { grid-template-columns: 1fr; }
  .task-history-panel { padding: 14px; }
  .task-history-header { align-items: flex-start; padding-right: 64px; }
  .import-task-card { padding-right: 64px; }
  .auto-grouping-note,
  .scan-toggle { min-height: auto; }
  .points-balance-hero { padding: 18px; }
}

.upload-card.page-mode .upload-dropzone,
.upload-card.page-mode .selected-files-list,
.upload-card.page-mode .upload-actions {
  grid-column: 1 / -1;
}
.upload-card.page-mode .upload-dropzone { min-height: 176px; }

.upload-over-limit { color: var(--danger) !important; }

.global-task-panel {
  position: fixed;
  right: 18px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 45;
  width: min(390px, calc(100vw - 36px));
  max-height: min(70vh, 720px);
  overflow: hidden;
  border: 1px solid rgba(36, 114, 95, .2);
  border-radius: 18px;
  background: rgba(255, 254, 250, .97);
  box-shadow: 0 18px 44px rgba(31, 67, 54, .18);
  backdrop-filter: blur(14px);
}
.global-task-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}
.global-task-panel-header > div { display: grid; gap: 2px; min-width: 0; }
.global-task-panel-header strong { color: var(--brand-strong); font-size: .92rem; }
.global-task-panel-header .panel-meta { font-size: .72rem; }
.global-task-panel-list { display: grid; gap: 9px; max-height: min(62vh, 640px); overflow: auto; padding: 10px; }
.global-task-panel.is-collapsed .global-task-panel-list { display: none; }
.global-task-item { display: grid; gap: 7px; padding: 11px 12px; border: 1px solid rgba(36, 114, 95, .16); border-radius: 13px; background: rgba(248, 250, 246, .94); }
.global-task-item.is-terminal { background: rgba(247, 245, 239, .78); }
.global-task-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.global-task-item-head > div { display: grid; gap: 2px; min-width: 0; }
.global-task-item-head strong { overflow-wrap: anywhere; font-size: .84rem; }
.global-task-item-head span { color: var(--text-muted); font-size: .72rem; overflow-wrap: anywhere; }
.global-task-item-head b { color: var(--brand-strong); font-size: .8rem; white-space: nowrap; }
.global-task-progress { height: 6px; overflow: hidden; border-radius: 999px; background: rgba(36, 114, 95, .12); }
.global-task-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #7da98d); transition: width .25s ease; }
.global-task-item-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--text-muted); font-size: .7rem; }
.global-task-item-meta span { overflow-wrap: anywhere; }
.global-task-error { margin: 0; color: #a53e2c; font-size: .72rem; line-height: 1.45; overflow-wrap: anywhere; }
.global-task-item-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.global-task-item-actions .ghost-button,
.global-task-item-actions .primary-button { min-height: 44px; padding: 7px 10px; font-size: .72rem; }
.storage-usage-card { margin-top: 10px; }

@media (max-width: 640px) {
  .page-import-options { grid-template-columns: 1fr; }
  .global-task-panel { right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
}


@media (max-width: 980px) {
  #pageHome.page-active { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow-y: auto; }
  #pageHome > .upload-card { overflow: visible; }
  .task-history-panel { min-height: auto; overflow: visible; }
  .import-task-list { max-height: min(56vh, 560px); }
}

/* web-v1.4：错题文件夹资料库 */
#pageMistakes.page-active {
  grid-template-columns: 268px minmax(0, 1fr);
  border: 1px solid rgba(24, 79, 64, .12);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 254, 250, .76);
  box-shadow: 0 22px 60px rgba(45, 61, 52, .09);
}
.folder-sidebar {
  width: auto;
  min-width: 0;
  padding: 20px 16px 16px;
  gap: 14px;
  border-right: 1px solid rgba(24, 79, 64, .12);
  background:
    radial-gradient(circle at 20% 0%, rgba(196, 220, 201, .42), transparent 38%),
    linear-gradient(180deg, rgba(246, 248, 239, .98), rgba(239, 243, 232, .94));
}
.folder-sidebar-header { align-items: flex-start; padding: 0 4px; }
.folder-sidebar-header h3 { margin-top: 2px; color: #183f34; font-family: "STSong", "SimSun", serif; font-size: 1.2rem; letter-spacing: .04em; }
.sidebar-eyebrow { color: #789083; font-size: .62rem; font-weight: 800; letter-spacing: .16em; }
.icon-button { display: inline-grid; width: 38px; height: 38px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--brand-strong); background: rgba(255,255,255,.72); }
.icon-button svg, .folder-search svg, .folder-icon svg, .folder-more svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.folder-drawer-close, .folder-drawer-open { display: none; }
.folder-search { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 11px; border: 1px solid rgba(24,79,64,.13); border-radius: 13px; color: #789083; background: rgba(255,255,255,.7); box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.folder-search:focus-within { border-color: rgba(36,114,95,.45); box-shadow: 0 0 0 3px rgba(36,114,95,.08); }
.folder-search input { min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; color: var(--text-main); background: transparent; font: inherit; font-size: .82rem; }
.folder-list { gap: 12px; padding: 1px 5px 24px 0; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: rgba(24,79,64,.27) transparent; }
.folder-list::-webkit-scrollbar { width: 7px; }
.folder-list::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: rgba(24,79,64,.28); background-clip: padding-box; }
.folder-group { display: grid; gap: 4px; }
.folder-group h4 { display: flex; align-items: center; justify-content: space-between; margin: 3px 7px 2px; color: #77887e; font-size: .66rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.folder-group h4 span { font-variant-numeric: tabular-nums; }
.folder-system-group { padding-bottom: 10px; border-bottom: 1px solid rgba(24,79,64,.1); }
.folder-system-item { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 0 11px; border: 1px solid transparent; border-radius: 12px; color: #365047; background: transparent; text-align: left; }
.folder-system-item b { min-width: 27px; padding: 3px 7px; border-radius: 999px; color: #637a70; background: rgba(255,255,255,.7); font-size: .7rem; text-align: center; }
.folder-system-item:hover, .folder-system-item.active { border-color: rgba(24,79,64,.12); color: #123f32; background: rgba(255,255,255,.82); box-shadow: 0 7px 18px rgba(37,72,57,.07); }
.folder-item { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 2px; padding: 0; border-radius: 13px; cursor: default; }
.folder-item:hover, .folder-item.active { border-color: transparent; background: rgba(255,255,255,.7); }
.folder-select { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 8px; min-width: 0; min-height: 48px; padding: 5px 4px 5px 8px; border: 0; color: inherit; background: transparent; text-align: left; }
.folder-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; color: #5f806f; background: rgba(209,225,207,.74); }
.folder-icon.exam { color: #8a6346; background: rgba(235,216,186,.7); }
.folder-copy { display: grid; min-width: 0; gap: 2px; }
.folder-copy strong { overflow: hidden; color: #29463c; font-size: .82rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.folder-copy small { overflow: hidden; color: #839188; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.folder-item-count { padding: 2px 5px; font-variant-numeric: tabular-nums; }
.folder-more { display: grid; width: 30px; height: 30px; margin: auto 4px auto 0; padding: 0; place-items: center; border: 0; border-radius: 9px; color: #7a8d82; background: transparent; opacity: .25; }
.folder-item:hover .folder-more, .folder-item.active .folder-more, .folder-more:focus { opacity: 1; }
.folder-context-menu { position: absolute; z-index: 15; top: 41px; right: 3px; display: grid; width: 146px; padding: 6px; border: 1px solid rgba(24,79,64,.13); border-radius: 13px; background: rgba(255,255,252,.98); box-shadow: 0 16px 38px rgba(28,52,43,.16); }
.folder-context-menu button { padding: 8px 9px; border: 0; border-radius: 8px; color: #3d534a; background: transparent; font-size: .76rem; text-align: left; }
.folder-context-menu button:hover { background: var(--brand-soft); }
.folder-context-menu .danger-text { color: #a5483e; }
.folder-sidebar-footer { padding-top: 10px; border-top: 1px solid rgba(24,79,64,.1); }
.folder-create-button { width: 100%; min-height: 42px; border: 1px dashed rgba(24,79,64,.26); border-radius: 13px; color: #2c6756; background: rgba(255,255,255,.5); font-weight: 700; }
.folder-create-button span { margin-right: 5px; font-size: 1rem; }
.folder-empty { padding: 28px 12px; color: var(--text-muted); font-size: .78rem; text-align: center; }
.full-list-panel { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.mistakes-panel-header { min-height: 68px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.mistakes-heading { display: grid; gap: 1px; }
.mistakes-heading > span { color: var(--text-muted); font-size: .66rem; font-weight: 800; letter-spacing: .1em; }
.mistakes-heading h2 { margin: 0; font-family: "STSong", "SimSun", serif; }
.folder-manage-card { max-width: 420px; text-align: left; }
.folder-manage-header span { color: var(--text-muted); font-size: .68rem; font-weight: 800; letter-spacing: .12em; }
.folder-manage-header h3 { margin: 3px 0 16px; color: var(--brand-strong); font-family: "STSong", "SimSun", serif; font-size: 1.25rem; }
.folder-manage-hint { margin: -5px 0 12px; color: var(--text-muted); font-size: .8rem; line-height: 1.6; }
.folder-choice-list { display: grid; gap: 8px; }
.folder-choice-list button { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--text-main); background: var(--surface-plain); text-align: left; }
.folder-choice-list button:hover { border-color: rgba(36,114,95,.35); background: var(--brand-soft); }
.folder-choice-list strong { font-size: .88rem; }
.folder-choice-list span { color: var(--text-muted); font-size: .75rem; }
.danger-choices button:last-child { border-color: rgba(165,72,62,.2); }
.danger-choices button:last-child strong { color: #a5483e; }
.folder-drawer-backdrop { display: none; }

@media (max-width: 720px) {
  #pageMistakes.page-active { grid-template-columns: 1fr; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  #pageMistakes .page-panel.full-list-panel { height: auto; min-height: 76vh; overflow: visible; }
  #pageMistakes .full-list-panel .mistake-list { height: auto; overflow: visible; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  #pageMistakes .mistakes-panel-header,
  #pageMistakes #mistakeDefaultToolbar,
  #pageMistakes .tight-toolbar { min-width: 0; max-width: 100%; }
  #pageMistakes .mistakes-panel-header { flex-wrap: wrap; }
  #pageMistakes #allMistakeCount { max-width: 100%; overflow-wrap: anywhere; }
  #pageMistakes .filter-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  #pageMistakes .filter-bar select,
  #pageMistakes .filter-bar input,
  #pageMistakes .filter-bar button { width: 100%; min-width: 0; max-width: 100%; }
  #pageMistakes .tight-toolbar > * { min-width: 0; max-width: 100%; }
  .folder-drawer-open, .folder-drawer-close { display: inline-grid; flex: 0 0 auto; }
  .folder-sidebar { display: none; }
  .folder-sidebar.mobile-expanded { position: fixed; z-index: 42; inset: 8px auto 76px 8px; display: flex !important; width: min(310px, calc(100vw - 28px)); height: auto; padding: 18px 14px 14px; border: 1px solid rgba(24,79,64,.15); border-radius: 22px; box-shadow: 0 28px 70px rgba(20,43,35,.28); }
  .folder-drawer-backdrop:not([hidden]) { position: fixed; z-index: 41; inset: 0; display: block; background: rgba(15,31,26,.32); backdrop-filter: blur(3px); }
  body.folder-drawer-open { overflow: hidden; }
  .mistakes-panel-header { align-items: center; }
}

@media (max-width: 360px) {
  #pageMistakes .filter-bar { grid-template-columns: 1fr; }
}

/* web-v1.4：任务取消；web-v1.5：单题预估说明 */
.single-points-estimate { margin-top: 10px; }
.single-points-estimate strong { color: var(--brand-strong); font-weight: 800; }
.import-task-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.import-task-actions .ghost-button { min-height: 32px; padding: 5px 10px; font-size: .74rem; }
.task-points-line { display: flex; gap: 12px; margin-top: 8px; color: var(--text-muted); font-size: .71rem; }
.task-cancel-card { max-width: 470px; text-align: left; }
.task-cancel-heading span { color: var(--text-muted); font-size: .68rem; font-weight: 800; letter-spacing: .12em; }
.task-cancel-heading h3 { margin: 3px 0 16px; color: var(--brand-strong); font-family: "STSong", "SimSun", serif; font-size: 1.3rem; }
.task-cancel-options { display: grid; gap: 10px; }
.task-cancel-option { display: grid; gap: 5px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 15px; color: var(--text-main); background: var(--surface-plain); text-align: left; }
.task-cancel-option:hover { border-color: rgba(36,114,95,.4); background: var(--brand-soft); }
.task-cancel-option strong { font-size: .9rem; }
.task-cancel-option span { color: var(--text-muted); font-size: .77rem; line-height: 1.55; }
.task-cancel-option.rollback { border-color: rgba(165,72,62,.2); }
.task-cancel-option.rollback strong { color: #a5483e; }
.task-cancel-status { min-height: 22px; margin: 14px 0 0; color: var(--text-muted); font-size: .78rem; line-height: 1.5; }


.mistake-load-more {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 1.1rem 0 calc(1.1rem + env(safe-area-inset-bottom));
  color: var(--text-muted, #66746e);
}
.mistake-load-more p { margin: 0; font-size: 0.88rem; }
.mistake-load-more .ghost-button { min-width: 9rem; min-height: 44px; }

/* web-v1.4.3：整页题目确认工作台与逐文件上传进度 */
body.selection-workspace-open { overflow: hidden; }
body.selection-workspace-open .confirm-overlay { z-index: 70; }
.import-selection-workspace {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: var(--text-main);
  background: rgba(245,243,238,.98);
}
.selection-workspace-header,
.selection-workspace-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,254,250,.96);
}
.selection-workspace-footer { justify-content: space-between; border-top: 1px solid var(--line); border-bottom: 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.selection-header-title { display: grid; gap: 2px; min-width: 0; margin-right: auto; }
.selection-header-title h2 { margin: 0; overflow-wrap: anywhere; font-family: "STSong", "SimSun", serif; font-size: 1.2rem; }
.selection-mode-tabs, .selection-canvas-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.selection-mode-tabs .ghost-button { min-height: 36px; padding: 7px 12px; }
.selection-mode-tabs .active { color: #fff; border-color: var(--brand-strong); background: var(--brand-strong); }
.selection-save-status { min-width: 64px; color: var(--text-muted); font-size: .76rem; text-align: right; }
.selection-save-status[data-state="error"] { color: var(--danger); }
.selection-save-status[data-state="saving"], .selection-save-status[data-state="pending"] { color: var(--accent); }
.selection-workspace-body { display: grid; grid-template-columns: 190px minmax(0,1fr) 330px; min-height: 0; overflow: hidden; }
.selection-page-rail, .selection-candidate-pane { min-width: 0; min-height: 0; padding: 16px; background: rgba(255,254,250,.78); }
.selection-page-rail { border-right: 1px solid var(--line); overflow-y: auto; }
.selection-candidate-pane { display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: 12px; border-left: 1px solid var(--line); overflow: hidden; }
.selection-rail-heading, .selection-pane-heading, .selection-preview-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.selection-rail-heading { align-items: center; margin-bottom: 10px; color: var(--text-muted); font-size: .74rem; }
.selection-rail-heading strong { color: var(--brand-strong); }
.selection-page-list { display: grid; gap: 9px; }
.selection-page-thumb-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 4px; min-width: 0; }
.selection-page-thumb { display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: center; gap: 8px; min-height: 52px; padding: 7px; border: 1px solid transparent; border-radius: 12px; color: var(--text-main); background: transparent; text-align: left; }
.selection-page-thumb:hover, .selection-page-thumb.active { border-color: rgba(36,114,95,.25); background: var(--brand-soft); }
.selection-page-thumb-row.needs-review .selection-thumb-index { color: #874820; background: var(--accent-soft); }
.selection-page-thumb-row.needs-review .selection-thumb-copy small { color: #874820; }
.selection-page-thumb-row[draggable="true"] { cursor: grab; }
.selection-page-thumb-row[draggable="true"]:active { cursor: grabbing; }
.selection-page-move { display: grid; gap: 3px; }
.selection-page-move .icon-button { width: 30px; min-height: 28px; padding: 2px; border-radius: 7px; font-size: .76rem; }
.selection-page-move .icon-button:disabled { opacity: .35; cursor: not-allowed; }
.selection-thumb-index { display: grid; width: 30px; height: 36px; place-items: center; border-radius: 8px; color: var(--brand-strong); background: var(--surface-muted); font-weight: 800; }
.selection-thumb-copy { display: grid; min-width: 0; gap: 3px; }
.selection-thumb-copy strong, .selection-thumb-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selection-thumb-copy strong { font-size: .78rem; }
.selection-thumb-copy small { color: var(--text-muted); font-size: .68rem; }
.selection-canvas-pane { display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: 10px; min-width: 0; min-height: 0; padding: 14px 16px; }
.selection-canvas-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.selection-canvas-stage { position: relative; min-width: 0; min-height: 0; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: #dedbd2; touch-action: pan-x pan-y; }
.selection-canvas-content { position: relative; width: 100%; min-width: 100%; margin: 0 auto; }
.selection-page-image { display: block; width: 100%; height: auto; object-fit: contain; background: #fff; }
.selection-box-layer { position: absolute; inset: 0; pointer-events: none; }
.selection-box { position: absolute; min-width: 8px; min-height: 8px; padding: 0; border: 1.5px solid rgba(50,66,58,.78); border-radius: 4px; color: var(--surface-ink); background: rgba(255,255,255,.04); pointer-events: auto; text-align: left; }
.selection-box:hover, .selection-box:focus-visible { z-index: 4; border-color: var(--accent); background: rgba(184,106,60,.1); }
.selection-box.is-selected { border: 2px solid var(--brand); background: rgba(36,114,95,.1); }
.selection-box.is-adjusting { z-index: 5; border: 2px solid var(--accent); background: rgba(184,106,60,.14); }
.selection-box-label { position: absolute; top: 2px; left: 3px; max-width: calc(100% - 6px); overflow: hidden; padding: 1px 4px; border-radius: 4px; color: #fff; background: rgba(21,83,65,.86); font-size: .68rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.selection-box:not(.is-selected) .selection-box-label { color: var(--text-main); background: rgba(255,254,250,.84); }
.selection-handles { position: absolute; inset: -12px; pointer-events: none; }
.selection-handle { position: absolute; width: 20px; height: 20px; border: 2px solid var(--accent); border-radius: 50%; background: var(--surface-plain); pointer-events: auto; }
.handle-nw { left: 0; top: 0; cursor: nwse-resize; }.handle-n { left: calc(50% - 10px); top: 0; cursor: ns-resize; }.handle-ne { right: 0; top: 0; cursor: nesw-resize; }.handle-e { right: 0; top: calc(50% - 10px); cursor: ew-resize; }.handle-se { right: 0; bottom: 0; cursor: nwse-resize; }.handle-s { left: calc(50% - 10px); bottom: 0; cursor: ns-resize; }.handle-sw { left: 0; bottom: 0; cursor: nesw-resize; }.handle-w { left: 0; top: calc(50% - 10px); cursor: ew-resize; }
.selection-canvas-hint { margin: 0; color: var(--text-muted); font-size: .74rem; line-height: 1.5; }
.selection-page-warning, .selection-preview-warning { margin: 0; padding: 8px 10px; border: 1px solid rgba(184,106,60,.3); border-radius: 9px; color: #874820; background: var(--accent-soft); font-size: .76rem; line-height: 1.5; }
.selection-batch-menu { position: relative; z-index: 8; }
.selection-batch-menu summary { list-style: none; }
.selection-batch-menu summary::-webkit-details-marker { display: none; }
.selection-batch-popover { position: absolute; z-index: 10; top: calc(100% + 6px); right: 0; display: grid; min-width: 164px; gap: 4px; padding: 7px; border: 1px solid rgba(24,79,64,.13); border-radius: 11px; background: rgba(255,255,252,.98); box-shadow: 0 16px 38px rgba(28,52,43,.16); }
.selection-batch-popover .ghost-button { min-height: 36px; padding: 7px 9px; text-align: left; }
.selection-batch-summary { padding: 3px 5px 5px; color: var(--text-muted); font-size: .68rem; line-height: 1.35; }
.selection-pane-heading { align-items: flex-start; }
.selection-pane-heading h3, .selection-preview-header h3 { margin: 3px 0 0; font-family: "STSong", "SimSun", serif; font-size: 1.1rem; }
.selection-candidate-list { min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 8px; padding-right: 3px; }
.selection-candidate { display: grid; gap: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-plain); }
.selection-candidate.selected { border-color: rgba(36,114,95,.38); background: rgba(226,239,223,.48); }
.selection-candidate.on-page { box-shadow: inset 3px 0 0 var(--accent); }
.selection-candidate-main { display: grid; grid-template-columns: 20px 46px minmax(0,1fr); align-items: center; gap: 7px; min-width: 0; cursor: pointer; }
.selection-candidate-main input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.selection-candidate-label-input { width: 46px !important; height: 30px; padding: 3px 4px; border: 1px solid var(--line); border-radius: 7px; color: var(--brand-strong); background: var(--surface-muted); font-size: .74rem; font-weight: 800; }
.selection-candidate-label { color: var(--brand-strong); font-weight: 800; }
.selection-candidate-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.selection-candidate-meta { display: flex; flex-wrap: wrap; gap: 5px 8px; color: var(--text-muted); font-size: .68rem; }
.selection-candidate-meta .badge { min-height: 20px; padding: 2px 7px; font-size: .66rem; }
.selection-candidate-actions { display: flex; gap: 5px; }
.selection-candidate-actions .icon-button { width: auto; min-height: 32px; padding: 4px 8px; border-radius: 8px; font-size: .7rem; }
.selection-add-button { width: 100%; min-height: 44px; }
.selection-empty { padding: 28px 10px; color: var(--text-muted); font-size: .78rem; line-height: 1.6; text-align: center; }
.selection-candidate.is-highlight { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(184,106,60,.28); }
.selection-box.is-highlight { z-index: 6; border: 2px solid var(--accent); background: rgba(184,106,60,.16); }
.selection-drawer-button, .selection-drawer-close { display: none; }
.selection-drawer-backdrop { display: none; }
.selection-footer-summary { display: grid; gap: 2px; min-width: 0; }
.selection-footer-summary strong { color: var(--brand-strong); font-size: .82rem; }
.selection-footer-summary span { color: var(--text-muted); font-size: .7rem; }
.selection-preview-panel { display: none; min-height: 0; overflow: hidden; padding: 18px 22px; background: var(--surface); }
.import-selection-workspace[data-step="preview"] { grid-template-rows: auto minmax(0,1fr) auto; }
.import-selection-workspace[data-step="preview"] .selection-workspace-body { display: block; overflow-y: auto; padding: 20px max(18px, 8vw); }
.import-selection-workspace[data-step="preview"] .selection-preview-panel { display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: 14px; }
.selection-preview-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-content: start; gap: 12px; overflow-y: auto; padding: 2px; }
.selection-preview-item { display: grid; gap: 8px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-plain); }
.selection-preview-heading { display: flex; gap: 8px; align-items: baseline; min-width: 0; }.selection-preview-heading strong { color: var(--brand-strong); }.selection-preview-heading span { overflow: hidden; color: var(--text-muted); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.selection-preview-image { width: 100%; max-height: 300px; object-fit: contain; background: #fff; }
.selection-preview-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

@media (max-width: 979px) {
  .selection-workspace-body { grid-template-columns: 138px minmax(0,1fr) 280px; }
  .selection-page-rail, .selection-candidate-pane { padding: 12px 9px; }
}
@media (max-width: 720px) {
  /* 头部 */
  .selection-workspace-header { gap: 8px; padding: 9px 10px; }
  .selection-header-title h2 { font-size: 1rem; }
  .selection-save-status { min-width: 48px; font-size: .68rem; }
  .selection-view-tabs .ghost-button { min-height: 40px; padding: 6px 10px; }

  /* 主体：画布铺满全屏，页条收为横向缩略条，候选列表变为底部抽屉 */
  .selection-workspace-body { display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; }
  .selection-canvas-pane { order: 1; grid-row: 1; min-height: 0; padding: 8px; }
  .selection-canvas-hint { display: none; }
  .selection-canvas-toolbar { align-items: flex-start; flex-direction: column; }
  .selection-canvas-actions { width: 100%; justify-content: space-between; }
  .selection-canvas-actions .ghost-button { flex: 1; }
  .selection-mode-tabs .icon-button, .selection-canvas-actions .icon-button { min-width: 44px; min-height: 44px; }

  .selection-page-rail { order: 2; grid-row: 2; min-height: 96px; max-height: 96px; border-top: 1px solid var(--line); border-right: 0; padding: 8px 10px; overflow: hidden; }
  .selection-rail-heading { margin: 0 0 6px; }
  .selection-page-list { display: flex; min-height: 52px; overflow-x: auto; gap: 6px; }
  .selection-page-thumb-row { min-width: 150px; }
  .selection-page-thumb { min-width: 116px; min-height: 44px; }
  .selection-page-move { display: none; }

  /* 候选列表抽屉 */
  .selection-candidate-pane {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
    min-height: 220px; max-height: min(68vh, 560px);
    border-top: 1px solid var(--line); border-left: 0;
    border-radius: 18px 18px 0 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -14px 38px rgba(28,52,43,.22);
    transform: translateY(105%);
    transition: transform .22s ease;
  }
  .import-selection-workspace.selection-drawer-open .selection-candidate-pane { transform: translateY(0); }
  .selection-drawer-close { display: inline-flex; min-height: 36px; }
  .selection-drawer-button { display: inline-flex; flex: 1; min-height: 44px; }
  .selection-drawer-backdrop { display: block; position: absolute; inset: 0; z-index: 7; background: rgba(20,32,26,.42); }

  .selection-candidate-actions .icon-button { min-height: 44px; }
  .selection-batch-menu { flex: 1; }
  .selection-batch-menu > summary { width: 100%; text-align: center; }
  .selection-batch-popover { right: 0; left: auto; }

  .selection-workspace-footer { gap: 8px; padding: 9px 10px max(9px, env(safe-area-inset-bottom)); }
  .selection-footer-summary { display: none; }
  .selection-workspace-footer .primary-button { flex: 1; }
  .selection-workspace-footer .danger-button { min-width: 44px; padding-inline: 10px; font-size: .7rem; }
  .import-selection-workspace[data-step="preview"] .selection-workspace-body { display: block; overflow-y: auto; padding: 12px; }
  .selection-preview-panel { padding: 12px; }
  .selection-preview-list { grid-template-columns: 1fr; }
}

/* web-v1.5：订阅橱窗 */
.plans-showcase { display: grid; gap: 14px; }
.plans-showcase-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.plans-showcase-heading h3 { margin: 0; }
.plans-showcase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.plan-card { display: grid; gap: 8px; align-content: start; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-muted); }
.plan-card--accent { border-color: rgba(36,114,95,.45); background: linear-gradient(160deg, rgba(226,239,223,.55), var(--surface-muted)); }
.plan-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-card-price { margin: 0; color: var(--brand-strong); font-size: 1.3rem; font-weight: 800; }
.plan-card-meta { margin: 0; color: var(--text-muted); font-size: .76rem; }
.plan-card-desc { margin: 0; font-size: .8rem; line-height: 1.6; white-space: pre-line; }
.plan-buy-button { justify-self: start; margin-top: 4px; text-decoration: none; }

/* web-v1.5：邀请返利区 */
.points-invite-card { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-muted); }
.invite-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.invite-code-box { display: flex; align-items: center; gap: 10px; }
.invite-code-box code { padding: 6px 12px; border-radius: 10px; background: var(--brand-soft, rgba(36,114,95,.12)); color: var(--brand-strong); font-weight: 800; letter-spacing: .06em; }
.invite-stats { display: flex; gap: 16px; color: var(--text-muted); font-size: .8rem; }
.invite-stats strong { color: var(--brand-strong); }
.invite-note { margin: 0; color: var(--text-muted); font-size: .74rem; line-height: 1.6; }
