/* ============================================================
   马上默 · 精品视觉层
   只做增量增强：收紧宽度、强化层级、补充卡片与微交互。
   ============================================================ */
html[data-study-v3] {
  --workspace-max: 72rem;
  --page-gutter: clamp(1rem, 2vw, 2rem);
  --pm-ink: #0f172a;
  --pm-muted: #64748b;
  --pm-line: #e2e8f0;
  --pm-soft: #f8fafc;
  --pm-brand: #0f766e;
  --pm-accent: #f59e0b;
  --pm-shadow: 0 18px 48px rgba(15, 23, 42, .08);
  --pm-shadow-sm: 0 7px 22px rgba(15, 23, 42, .06);
}
html[data-study-v3][data-theme="dark"] {
  --pm-ink: #e2e8f0;
  --pm-muted: #94a3b8;
  --pm-line: #243044;
  --pm-soft: #111a2b;
  --pm-brand: #2dd4bf;
  --pm-shadow: 0 18px 48px rgba(0, 0, 0, .35);
  --pm-shadow-sm: 0 7px 22px rgba(0, 0, 0, .25);
}

/* 主工作区宽度与留白：解决底部过宽 */
html[data-study-v3] body { line-height: 1.7; }
html[data-study-v3] .study-shell,
html[data-study-v3] .checkin-inner { max-inline-size: var(--workspace-max); margin-inline: auto; }
html[data-study-v3] .studio-shell {
  max-inline-size: var(--workspace-max);
  grid-template-columns: minmax(17rem, 21rem) minmax(0, 1fr);
  gap: 1.2rem;
  padding-block: 1.25rem 3rem;
}
html[data-workspace="layout"] .studio-shell,
html[data-workspace="export"] .studio-shell { max-inline-size: 68rem; grid-template-columns: minmax(20rem, .82fr) minmax(30rem, 1.18fr); }
html[data-workspace="edit"] .studio-shell { grid-template-columns: minmax(0, 1fr); max-inline-size: 72rem; }
html[data-study-v3] .workbench { min-inline-size: 0; }
@media (max-width: 75.99rem) {
  html[data-workspace="layout"] .studio-shell,
  html[data-workspace="export"] .studio-shell { grid-template-columns: minmax(0, 1fr); max-inline-size: 72rem; }
}

/* 快捷条更像产品级操作中心 */
html[data-study-v3] .checkin-bar {
  background:
    radial-gradient(620px 180px at 8% 0%, rgba(20, 184, 166, .14), transparent 60%),
    linear-gradient(135deg, rgba(240, 253, 250, .94), rgba(239, 246, 255, .88));
  border-block: 1px solid rgba(15, 118, 110, .12);
}
html[data-study-v3][data-theme="dark"] .checkin-bar {
  background: radial-gradient(620px 180px at 8% 0%, rgba(45, 212, 191, .16), transparent 60%), linear-gradient(135deg, #101f2c, #111a2b);
}
html[data-study-v3] .checkin-inner { padding: 10px 0; gap: 14px; }
html[data-study-v3] .checkin-left { border-radius: 15px; padding: 10px 14px; }
html[data-study-v3] .checkin-title { font-size: 15px; font-weight: 900; letter-spacing: -.2px; }
html[data-study-v3] .checkin-sub { color: var(--pm-muted); font-size: 12px; }
html[data-study-v3] .checkin-right .btn { border-radius: 11px; padding: 8px 12px; font-size: 12.5px; font-weight: 800; }

/* 通用卡片质感 */
html[data-study-v3] .library-panel,
html[data-study-v3] .selection-panel,
html[data-study-v3] .ink-card,
html[data-study-v3] .work-title,
html[data-study-v3] .preview-panel {
  border: 1px solid var(--pm-line);
  box-shadow: var(--pm-shadow-sm);
  border-radius: 20px;
}
html[data-study-v3] .panel-heading { padding-bottom: 12px; border-bottom: 1px solid var(--pm-line); margin-bottom: 13px; }
html[data-study-v3] .panel-heading .eyebrow,
html[data-study-v3] .eyebrow { font-size: 11px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase; color: var(--pm-brand); }
html[data-study-v3] .panel-heading h1,
html[data-study-v3] .panel-heading h2,
html[data-study-v3] .work-title h2 { font-size: 1.35rem; font-weight: 900; letter-spacing: -.3px; }
html[data-study-v3] .section-label span,
html[data-study-v3] .workspace-title { font-size: 13px; font-weight: 900; }
html[data-study-v3] .section-label small,
html[data-study-v3] .workspace-header small,
html[data-study-v3] .preview-note { color: var(--pm-muted); line-height: 1.65; }

/* 选篇卡：增强“当前课文”的阅读节奏 */
html[data-study-v3] .selection-panel {
  position: relative;
  overflow: hidden;
  min-block-size: min(38rem, calc(100dvh - 8rem));
  padding: clamp(1.5rem, 3vw, 3rem);
  background:
    radial-gradient(520px 220px at 100% 0%, rgba(245, 158, 11, .12), transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--surface) 94%, var(--pm-brand) 6%), var(--surface));
}
html[data-study-v3] .selection-panel::before {
  content: "“";
  position: absolute; right: 22px; top: -34px;
  font-family: Georgia, serif; font-size: 150px; line-height: 1;
  color: color-mix(in srgb, var(--pm-brand) 12%, transparent);
  pointer-events: none;
}
html[data-study-v3] .selection-kicker { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; font-weight: 900; color: var(--pm-muted); letter-spacing: .4px; }
html[data-study-v3] .selection-kicker span:first-child { color: var(--pm-brand); }
html[data-study-v3] .selection-panel h2 { font-size: clamp(2rem, 3vw, 2.8rem); line-height: 1.18; letter-spacing: -1px; }
html[data-study-v3] .selection-author { font-size: 14px; color: var(--pm-muted); font-weight: 700; }
html[data-study-v3] .selection-excerpt {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 2;
  padding: 14px 16px;
  border-inline-start: 3px solid var(--pm-accent);
  background: color-mix(in srgb, var(--pm-accent) 7%, transparent);
  border-radius: 0 12px 12px 0;
  color: var(--pm-ink);
}
html[data-study-v3] .selection-hint { font-size: 12px; color: var(--pm-muted); line-height: 1.8; }

/* 预览区：紧凑但信息完整 */
html[data-study-v3] .preview-panel { padding: 1rem; align-self: start; }
html[data-study-v3] .page-badge {
  border-radius: 999px;
  padding: 5px 10px;
  background: color-mix(in srgb, var(--pm-brand) 10%, transparent);
  color: var(--pm-brand);
  font-size: 11.5px;
  font-weight: 900;
}
html[data-study-v3] .page-preview-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
html[data-study-v3] .page-preview,
html[data-study-v3] .page-preview-card {
  border-radius: 14px;
  border: 1px solid var(--pm-line);
  background: var(--pm-soft);
  box-shadow: var(--pm-shadow-sm);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
html[data-study-v3] .page-preview:hover,
html[data-study-v3] .page-preview-card:hover { transform: translateY(-2px); box-shadow: var(--pm-shadow); }
html[data-study-v3] .sn-review-mark {
  margin-top: 14px;
  border: 1px solid color-mix(in srgb, var(--pm-brand) 22%, var(--pm-line));
  border-radius: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--pm-brand) 7%, #fff), var(--pm-soft));
}
html[data-study-v3][data-theme="dark"] .sn-review-mark { background: linear-gradient(135deg, #102b2b, var(--pm-soft)); }
html[data-study-v3] .sn-review-mark__title { font-size: 13px; font-weight: 900; line-height: 1.7; }
html[data-study-v3] .sn-review-mark__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 工作区设置网格更紧凑 */
html[data-study-v3] .setting-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
html[data-study-v3] .setting-grid fieldset {
  border-radius: 13px;
  border: 1px solid var(--pm-line);
  padding: 11px 12px;
  background: color-mix(in srgb, var(--pm-soft) 70%, transparent);
}
html[data-study-v3] .setting-grid legend { font-size: 11.5px; font-weight: 900; color: var(--pm-brand); padding-inline: 4px; }
html[data-study-v3] .chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
html[data-study-v3] .chip { border-radius: 9px; padding: 6px 9px; font-size: 12px; font-weight: 800; }

/* 三期页面：增强为控制台级视觉 */
html[data-study-v3] .p3-hero h1 { font-size: clamp(26px, 3vw, 38px); line-height: 1.24; letter-spacing: -.8px; margin: 8px 0 10px; }
html[data-study-v3] .p3-hero .sn-lead { font-size: 14.5px; line-height: 1.85; max-inline-size: 74ch; color: var(--pm-muted); }
html[data-study-v3] .p3-card .p3-deck,
html[data-study-v3] .p3-tools .p3-toolcard,
html[data-study-v3] .p3-word .p3-pane,
html[data-study-v3] .p3-check .p3-pane {
  box-shadow: var(--pm-shadow);
  transition: transform .22s, box-shadow .22s;
}
html[data-study-v3] .p3-card .p3-deck:hover,
html[data-study-v3] .p3-tools .p3-toolcard:hover,
html[data-study-v3] .p3-word .p3-pane:hover,
html[data-study-v3] .p3-check .p3-pane:hover { transform: translateY(-2px); }
html[data-study-v3] .p3-panel,
html[data-study-v3] .p3-shared-note { border-radius: 16px; box-shadow: var(--pm-shadow-sm); }
html[data-study-v3] .p3-rate button { border-radius: 12px; font-weight: 900; }
html[data-study-v3] .p3-card .p3-cardface { font-size: clamp(20px, 2.4vw, 30px); line-height: 1.6; }
html[data-study-v3] .p3-tools .p3-ring { box-shadow: inset 0 0 0 1px rgba(249,115,22,.14), 0 16px 35px rgba(249,115,22,.16); }
html[data-study-v3] .p3-word .p3-token { border-radius: 9px; font-weight: 800; }
html[data-study-v3] .p3-check .p3-score b { font-variant-numeric: tabular-nums; }

/* 底部提示更克制，不再撑满全宽 */
html[data-study-v3] .cta-band,
html[data-study-v3] .study-cta,
html[data-study-v3] .tool-recommend { max-inline-size: var(--workspace-max); margin-inline: auto; }

@media (max-width: 900px) {
  html[data-study-v3] .setting-grid { grid-template-columns: 1fr; }
  html[data-study-v3] .selection-panel { min-block-size: auto; }
}
