/* 三层入口和产物阅读；配色与现有纸本/墨色主题一致。 */
.apt-workbench,
[data-product-tier] {
  --apt-paper: #191714;
  --apt-input: #141310;
  --apt-ink: #f6f0e6;
  --apt-muted: #b6aea2;
  --apt-line: #484036;
  --apt-accent: #ed9eb5;
  --apt-action: #a72f2a;
  color: var(--apt-ink);
  font-family: 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
html.light-mode :is(.apt-workbench, [data-product-tier]),
html[data-ft-mode='paper'] :is(.apt-workbench, [data-product-tier]) {
  --apt-paper: #fffcf6;
  --apt-input: #fffdf9;
  --apt-ink: #29231e;
  --apt-muted: #655c52;
  --apt-line: #d9cfc0;
  --apt-accent: #990f3d;
  --apt-action: #a32d2a;
}
.apt-workbench {
  box-sizing: border-box;
  order: 3;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto 20px;
  padding: 20px;
  background: var(--apt-paper);
  border: 1px solid var(--apt-line);
  border-radius: 8px;
}
.apt-workbench h2 { margin: 0 0 16px; font-size: 17px; font-weight: 650; line-height: 1.5; }
.apt-tier-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.apt-tier-choice {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 4px 10px;
  padding: 14px;
  min-height: 100px;
  border: 1px solid var(--apt-line);
  border-radius: 6px;
  background: var(--apt-input);
  color: var(--apt-ink);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.apt-tier-choice[aria-pressed='true'] { border-color: var(--apt-accent); outline: 1px solid var(--apt-accent); }
.apt-tier-choice strong { font-size: 15px; line-height: 24px; }
.apt-step { display: block; width: 24px; line-height: 24px; border-radius: 50%; text-align: center; background: var(--apt-line); font-size: 12px; }
.apt-tier-choice[aria-pressed='true'] .apt-step { background: var(--apt-action); color: #fffaf2; }
.apt-tier-description { grid-column: 2; color: var(--apt-muted); font-size: 12px; line-height: 1.7; }
.apt-product-panel { padding-top: 16px; min-width: 0; }
.apt-product-panel h3 { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.apt-fields { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
.apt-field { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.apt-field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--apt-line);
  border-radius: 5px;
  font: inherit;
  background: var(--apt-input);
  color: var(--apt-ink);
  text-overflow: ellipsis;
}
.apt-helper { margin: 0; color: var(--apt-muted); font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.apt-source-link { display: inline-block; color: var(--apt-accent); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; margin: 0 0 10px; }
.apt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.apt-primary,
.apt-secondary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  box-sizing: border-box;
  padding: 9px 16px;
  border: 1px solid var(--apt-line);
  border-radius: 5px;
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  cursor: pointer;
  background: var(--apt-input);
  color: var(--apt-ink);
  text-decoration: none;
}
.apt-primary { background: var(--apt-action); color: #fffaf2; border-color: var(--apt-action); }
.artifact-toolbar .apt-secondary { background: transparent; color: var(--artifact-ink); border-color: var(--artifact-border); }
.artifact-toolbar .apt-secondary:focus-visible { outline: 2px solid var(--artifact-accent); outline-offset: 3px; }
.apt-workbench button:disabled,
[data-product-tier] button:disabled { opacity: .55; cursor: default; }
.apt-workbench :is(button, select, a):focus-visible,
[data-product-tier] :is(button, a):focus-visible { outline: 2px solid var(--apt-accent); outline-offset: 3px; }
.apt-status { margin: 12px 0 0; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.apt-error { color: var(--apt-accent); }
app-ai-review[data-product-mode='report'] app-ai-review-form,
app-ai-review[data-product-mode='speaker'] app-ai-review-form { display: none !important; }
.apt-workbench[hidden],
.apt-status[hidden] { display: none !important; }
.apt-badge { display: inline-block; padding: 3px 8px; border: 1px solid currentColor; border-radius: 4px; color: var(--apt-accent, #ed9eb5); font-size: 12px; line-height: 1.7; }
html.light-mode .apt-history-badge,
html[data-ft-mode='paper'] .apt-history-badge { color: #990f3d; }
.apt-history-badge { margin: 0 0 8px; }
app-ai-review-history [data-product-mode='speech'] :is(.history-health-chip, .history-card-meta, [data-testid^='history-reanalyze-']),
app-ai-review-history [data-product-mode='speaker'] :is(.history-health-chip, .history-card-meta, .history-result-pill, [data-testid^='history-reanalyze-']) { display: none !important; }
app-ai-review-artifacts[data-product-tier] { display: block; height: auto; min-height: 0; background: var(--apt-paper); color: var(--apt-ink); }
.apt-reader { max-width: 960px; margin: 0 auto; padding: 24px 28px 40px; box-sizing: border-box; overflow-wrap: anywhere; }
.apt-reader-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--apt-line); }
.apt-reader h1 { font-size: 26px; line-height: 1.5; margin: 24px 0 10px; }
.apt-reader h2 { font-size: 20px; line-height: 1.6; margin: 20px 0 8px; }
.apt-reader > .apt-prose { padding-top: 24px; font-size: 17px; line-height: 1.95; }
.apt-prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.apt-dimensions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.apt-player-commentary { margin-top: 20px; padding: 18px; border: 1px solid var(--apt-line); border-radius: 6px; }
.apt-player-commentary h3 { margin: 0 0 12px; font-size: 17px; line-height: 1.6; }
.apt-player-commentary p { margin: 0; font-size: 15px; line-height: 1.9; }
.apt-dimension { min-width: 0; padding: 18px; border: 1px solid var(--apt-line); border-radius: 6px; }
.apt-dimension-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.apt-dimension h3 { margin: 0; font-size: 16px; line-height: 1.6; }
.apt-score { color: var(--apt-accent); font-size: 14px; font-weight: 600; }
.apt-dimension p { margin: 0; font-size: 14px; line-height: 1.9; }
.apt-quote { padding-left: 12px; margin: 14px 0 0; border-left: 3px solid var(--apt-line); color: var(--apt-muted); font-size: 13px; line-height: 1.9; white-space: pre-wrap; }
@media (max-width: 760px) {
  .apt-workbench { padding: 16px; }
  .apt-tier-choice { padding: 10px; grid-template-columns: 1fr; gap: 6px; }
  .apt-tier-description { grid-column: 1; }
  .apt-tier-choice strong { font-size: 14px; }
  .apt-tier-description { font-size: 11px; }
  .apt-reader { padding: 18px 16px 32px; }
  .apt-reader h1 { font-size: 22px; }
  .apt-dimensions { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .apt-workbench { padding: 12px; }
  .apt-tier-choices { gap: 7px; }
  .apt-tier-description { display: none; }
  .apt-tier-choice { min-height: 80px; padding: 10px 8px; }
  .apt-tier-choice strong { font-size: 13px; }
  .apt-product-panel { padding-top: 14px; }
}
