:root {
  color-scheme: light;
  --bg: #f2f5f7;
  --surface: #ffffff;
  --surface-soft: #f7f9fa;
  --ink: #182026;
  --muted: #66737c;
  --line: #dce3e7;
  --line-strong: #c4d0d6;
  --green: #147d64;
  --green-dark: #0c5f4b;
  --green-soft: #e8f5f0;
  --blue: #2869a7;
  --blue-soft: #eaf3fb;
  --amber: #a96717;
  --amber-soft: #fff4df;
  --red: #b44545;
  --red-soft: #fceded;
  --purple: #7053a4;
  --purple-soft: #f1edf8;
  --shadow: 0 8px 28px rgba(38, 54, 63, 0.08);
  --radius: 8px;
  --content: 1500px;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0;
}

button, input, select { font: inherit; }
button { letter-spacing: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px max(24px, calc((100vw - var(--content)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
}

.brand-block { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.brand-block > div { display: flex; flex-direction: column; }
.brand-block strong { font-size: 15px; }
.brand-block span { color: var(--muted); font-size: 12px; }
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--green-dark);
  color: white !important;
  font-weight: 800;
  font-size: 13px !important;
  border-radius: 6px;
}

.topbar-actions { display: flex; align-items: end; gap: 8px; }
.user-identity { align-self: center; max-width: 180px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.readonly-badge { align-self: center; padding: 3px 7px; border-radius: 4px; background: var(--amber-soft); color: var(--amber); font-size: 11px; font-weight: 700; }
.link-button { display: inline-flex; align-items: center; text-decoration: none; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 32px; background: #edf2f4; }
.auth-shell { width: min(920px, 100%); display: grid; grid-template-columns: 1.15fr .85fr; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: var(--shadow); }
.auth-brand { padding: 54px; background: #173b35; color: white; }
.auth-brand .brand-mark { margin-bottom: 28px; background: white; color: var(--green-dark) !important; }
.auth-brand .eyebrow { color: #9ed3c7; }
.auth-brand h1 { margin: 8px 0 16px; font-size: 30px; }
.auth-brand > p:last-child { color: #cee2dd; }
.auth-panel { padding: 54px 42px; display: flex; flex-direction: column; justify-content: center; gap: 26px; }
.auth-panel h2 { margin: 4px 0 0; font-size: 22px; }
.auth-form { display: grid; gap: 16px; }
.auth-form .button { margin-top: 4px; }
.auth-error { padding: 9px 10px; border-radius: 5px; background: var(--red-soft); color: var(--red); }
.demo-account { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid #ead7b3; border-radius: 6px; background: var(--amber-soft); color: #604418; }
.demo-account strong { font-size: 13px; }
.demo-account span { font-size: 12px; }
.demo-account code { font: 600 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.demo-account small { margin-top: 3px; color: #806334; }
.auth-link { color: var(--green-dark); font-size: 12px; }
.admin-workspace { padding-bottom: 50px; }
.admin-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.admin-create-form { padding: 18px 20px 24px; display: grid; gap: 12px; }
.admin-audit-panel { margin-top: 16px; }
.admin-table { min-width: 760px; }
.row-actions { display: flex; gap: 10px; }
.audit-detail { max-width: 480px; font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.share-menu-container { position: relative; }
.share-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 45;
  width: 260px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: white;
  box-shadow: 0 14px 36px rgba(31, 47, 56, .16);
}
.share-menu[hidden] { display: none; }
.share-menu button { width: 100%; padding: 10px 11px; border: 0; border-radius: 5px; background: white; text-align: left; cursor: pointer; }
.share-menu button:hover { background: var(--surface-soft); }
.share-menu strong, .share-menu span { display: block; }
.share-menu strong { color: var(--ink); font-size: 13px; }
.share-menu span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.field { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.field > span { display: flex; justify-content: space-between; gap: 16px; }
.compact-field { min-width: 150px; }
.rule-field { min-width: 240px; }
input, select {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(20, 125, 100, .12); }
select:disabled { color: #9aa4aa; background: #eef1f3; }

.button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 650;
  white-space: nowrap;
}
.button.primary { background: var(--green); color: white; }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { border-color: var(--line-strong); background: white; color: #344148; }
.button.secondary:hover { border-color: var(--green); color: var(--green-dark); }
.button:disabled { cursor: wait; opacity: .65; }

.workspace { width: min(var(--content), calc(100% - 36px)); margin: 20px auto 48px; }
.summary-strip {
  min-height: 70px;
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr)) minmax(180px, 1.25fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.summary-item { padding: 13px 16px; display: flex; flex-direction: column; justify-content: center; }
.summary-item + .summary-item { border-left: 1px solid var(--line); }
.summary-item span { color: var(--muted); font-size: 11px; }
.summary-item strong { margin-top: 2px; font-size: 14px; overflow-wrap: anywhere; }
.summary-item.run-id strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.tabs { display: flex; gap: 2px; margin-top: 18px; border-bottom: 1px solid var(--line-strong); }
.tab { padding: 12px 18px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--green-dark); border-bottom-color: var(--green); }
.tab-panel { display: none; padding-top: 18px; }
.tab-panel.active { display: block; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-heading { min-height: 98px; padding: 22px 24px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.panel-heading.tight { min-height: auto; padding: 20px; }
.panel-heading h1, .panel-heading h2 { margin: 0; line-height: 1.25; }
.panel-heading h1 { font-size: 21px; }
.panel-heading h2 { font-size: 17px; }
.panel-heading p:not(.eyebrow) { margin: 6px 0 0; color: var(--muted); max-width: 780px; }
.eyebrow { margin: 0 0 4px; color: var(--green); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.responsive-heading { align-items: center; }

.scope-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.scope-result-panel { position: sticky; top: 88px; }
.mode-legend, .role-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 12px; }
.mode-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mode-legend i { width: 9px; height: 9px; border-radius: 50%; }
.linear-dot { background: var(--green); }
.isolated-dot { background: var(--purple); }
.catalog-help { margin: 18px 24px 8px; padding: 11px 13px; background: var(--green-soft); border-left: 3px solid var(--green); }
.catalog-help span { margin-left: 10px; color: var(--muted); }
.catalog-tree { padding: 10px 16px 22px; }
.catalog-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  padding: 5px 8px 5px calc(10px + var(--depth) * 22px);
  border: 1px solid transparent;
  border-radius: 6px;
}
.catalog-row.chapter { margin-top: 12px; background: #edf2f4; border-color: var(--line); font-weight: 800; }
.catalog-row.selectable:hover { background: var(--surface-soft); border-color: var(--line); }
.catalog-row.in-linear { background: var(--green-soft); border-color: #b9dfd2; }
.catalog-row.isolated { background: var(--purple-soft); border-color: #d7cce9; }
.catalog-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.catalog-title span { overflow-wrap: anywhere; }
.catalog-title small { flex: 0 0 auto; color: var(--muted); font-weight: 500; }
.catalog-actions { display: flex; align-items: center; gap: 6px; }
.text-button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--muted); cursor: pointer; font-size: 12px; }
.text-button:hover, .text-button.active { border-color: var(--green); color: var(--green-dark); background: var(--green-soft); }
.text-button.isolated-active { border-color: var(--purple); color: var(--purple); background: var(--purple-soft); }
.catalog-row.note { color: #879198; font-size: 12px; }
.catalog-row.note::after { content: "说明节点"; color: #a0a9ae; }

.scope-current, .scope-section, .scope-note { margin: 16px 20px; }
.rolling-test-control { margin: 16px 20px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.rolling-test-toggle { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.rolling-test-toggle input { min-height: auto; accent-color: var(--green); }
.rolling-test-toggle span { display: grid; gap: 2px; }
.rolling-test-toggle small { color: var(--muted); font-size: 10px; }
.rolling-ratio-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; margin-top: 10px; }
.rolling-ratio-options[hidden], .rolling-test-preview[hidden] { display: none; }
.rolling-ratio-options label { cursor: pointer; }
.rolling-ratio-options input { position: absolute; opacity: 0; pointer-events: none; }
.rolling-ratio-options span { display: block; padding: 7px; border: 1px solid var(--line); border-radius: 5px; background: white; text-align: center; font-weight: 750; }
.rolling-ratio-options input:checked + span { border-color: var(--green); color: var(--green-dark); background: var(--green-soft); }
.rolling-test-preview { display: grid; gap: 3px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 11px; }
.rolling-test-preview span { color: var(--muted); line-height: 1.5; }
.scope-current { padding: 13px; border: 1px solid var(--line); background: var(--surface-soft); border-radius: 6px; }
.scope-current span { display: block; color: var(--muted); font-size: 11px; }
.scope-current strong { display: block; margin-top: 4px; }
.scope-section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 750; }
.scope-section-title b { min-width: 24px; padding: 2px 7px; border-radius: 10px; background: #e9eef0; text-align: center; font-size: 11px; }
.scope-list { display: grid; gap: 6px; }
.scope-chip { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 7px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; background: white; font-size: 12px; }
.scope-chip b { color: var(--green); }
.scope-chip.isolated b { color: var(--purple); }
.empty-state { color: var(--muted); font-size: 12px; }
.scope-note { padding: 11px 12px; background: var(--amber-soft); color: #77501f; font-size: 12px; border-radius: 6px; }

.table-tools { display: flex; gap: 8px; }
.table-tools input { width: 230px; }
.table-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 20px 16px; color: var(--muted); font-size: 12px; }
.table-pagination > div { display: flex; align-items: center; gap: 10px; }
.table-pagination button:disabled { cursor: not-allowed; opacity: .42; }
.notice { margin: 16px 20px 0; padding: 10px 12px; border-radius: 6px; }
.notice.info { background: var(--blue-soft); color: #315d83; }
.notice.warning { background: var(--amber-soft); color: #80581f; }
.table-wrap { overflow: auto; padding: 16px 20px 22px; }
.data-table { width: 100%; min-width: 920px; border-collapse: separate; border-spacing: 0; }
.data-table th { position: sticky; top: 0; z-index: 2; padding: 10px; background: #eef2f4; color: #526068; text-align: left; font-size: 11px; border-bottom: 1px solid var(--line-strong); }
.data-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: #fafcfc; }
.point-cell strong { display: block; }
.point-cell span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.number-cell { font-variant-numeric: tabular-nums; font-weight: 750; }
.difficulty-bar { width: 250px; height: 18px; display: flex; overflow: hidden; border-radius: 4px; background: #edf1f2; }
.difficulty-segment { min-width: 0; height: 100%; }
.difficulty-segment.easy { background: #5aa971; }
.difficulty-segment.relatively-easy { background: #a8cf72; }
.difficulty-segment.medium { background: #e9c558; }
.difficulty-segment.relatively-hard { background: #df8f4f; }
.difficulty-segment.hard { background: #c65b58; }
.difficulty-caption { margin-top: 4px; color: var(--muted); font-size: 10px; }
.status-pill { display: inline-block; padding: 3px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.status-pill.complete { color: var(--green-dark); background: var(--green-soft); }
.status-pill.missing { color: var(--red); background: var(--red-soft); }

.recommendation-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.blueprint-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.algorithm-library-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.algorithm-library-list-panel { position: sticky; top: 88px; }
.algorithm-family-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin: 14px 16px 8px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.algorithm-family-tab { min-height: 34px; padding: 5px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.algorithm-family-tab.active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(28, 42, 49, .10); }
.algorithm-library-list { padding: 8px 16px 18px; display: grid; gap: 7px; }
.algorithm-list-item { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: white; text-align: left; cursor: pointer; }
.algorithm-list-item.active { border-color: var(--green); background: var(--green-soft); }
.algorithm-list-item strong, .algorithm-list-item span { display: block; }
.algorithm-list-item strong { font-size: 13px; }
.algorithm-list-item span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.algorithm-editor-body { min-height: 420px; padding: 18px 20px 24px; }
.algorithm-explanation-section { margin: 16px 20px 0; border: 1px solid var(--line); background: #fbfcfd; }
.algorithm-explanation-section .section-heading { padding: 14px 16px 10px; }
.algorithm-explanation-list { display: grid; border-top: 1px solid var(--line); }
.algorithm-explanation { border-bottom: 1px solid var(--line); }
.algorithm-explanation:last-child { border-bottom: 0; }
.algorithm-explanation summary { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; padding: 12px 16px; cursor: pointer; }
.algorithm-explanation summary span { color: var(--muted); font-size: 13px; }
.algorithm-explanation-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 16px 16px; }
.algorithm-explanation-body section { border-left: 2px solid var(--line-strong); padding-left: 10px; }
.algorithm-explanation-body h4 { margin: 0 0 6px; font-size: 13px; }
.algorithm-explanation-body p, .algorithm-explanation-body ul { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.algorithm-explanation-body ul { padding-left: 18px; }
.algorithm-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.algorithm-config-section { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 6px; }
.algorithm-config-section.full { grid-column: 1 / -1; }
.algorithm-config-section h3 { margin: 0 0 12px; font-size: 14px; }
.algorithm-config-fields { display: grid; gap: 10px; }
.algorithm-number-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.algorithm-checkbox-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.weight-total { padding: 9px 10px; border-radius: 5px; background: var(--green-soft); color: var(--green-dark); font-weight: 750; }
.weight-total.invalid { background: var(--red-soft); color: var(--red); }
.hard-constraint-list { display: grid; gap: 6px; }
.hard-constraint-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 9px; border-radius: 5px; background: var(--surface-soft); color: var(--muted); }
.hard-constraint-row b { color: var(--ink); }
.retrieval-level-editor { display: grid; grid-template-columns: 36px 24px minmax(130px, .7fr) minmax(220px, 1.3fr) 64px; gap: 8px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 5px; }
.retrieval-level-editor.is-disabled { opacity: .55; background: var(--surface-soft); }
.retrieval-level-editor code { color: var(--green-dark); font-weight: 800; }
.order-buttons { display: flex; gap: 4px; }
.order-buttons button { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: white; cursor: pointer; }
.algorithm-editor-footer { position: sticky; bottom: 0; z-index: 4; display: grid; grid-template-columns: minmax(180px, .8fr) minmax(240px, 1fr) auto; gap: 10px; align-items: end; padding: 14px 20px; border-top: 1px solid var(--line); background: rgba(255,255,255,.97); }
.algorithm-editor-actions { display: flex; gap: 8px; }
.blueprint-config-panel { position: sticky; top: 88px; }
.blueprint-config-body { padding: 16px 20px 22px; display: grid; gap: 18px; }
.heading-actions { display: flex; gap: 8px; align-items: center; }
.blueprint-view-tabs { display: flex; gap: 2px; margin: 16px 20px 0; padding: 3px; width: fit-content; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.blueprint-view-tab { min-height: 32px; padding: 5px 12px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.blueprint-view-tab.active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(28, 42, 49, .10); }
.blueprint-view-tab:disabled { cursor: not-allowed; opacity: .45; }
.fixed-constraint { display: flex; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid #b9dfd2; border-radius: 6px; background: var(--green-soft); }
.fixed-constraint span { color: var(--green-dark); }
.config-inline-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.config-inline-title span { color: var(--muted); font-size: 11px; }
.difficulty-input-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.difficulty-input-grid label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; text-align: center; }
.difficulty-input-grid input { width: 100%; min-height: 36px; padding-inline: 5px; text-align: center; }
.difficulty-total { margin-top: 7px; color: var(--green-dark); text-align: right; font-size: 11px; font-weight: 700; }
.difficulty-total.invalid { color: var(--red); }
.difficulty-template-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 7px 0; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.difficulty-template-tab { min-height: 34px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 750; }
.difficulty-template-tab.active { background: white; color: var(--green-dark); box-shadow: 0 1px 4px rgba(20,45,38,.12); }
.difficulty-template-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.difficulty-template-actions .button { min-height: 34px; padding: 6px 8px; font-size: 11px; }
.subject-constraint { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.subject-constraint div { display: grid; gap: 2px; }
.subject-constraint span { color: var(--muted); font-size: 10px; }
.experiment-point-modal { width: min(920px, calc(100vw - 80px)); }
.experiment-point-body { display: grid; gap: 14px; }
.experiment-point-search { display: grid; grid-template-columns: minmax(130px, .6fr) minmax(210px, 1fr) minmax(130px, .6fr) minmax(190px, .9fr) auto; gap: 8px; align-items: end; }
.experiment-point-results, .experiment-point-list { display: grid; gap: 7px; max-height: 240px; overflow: auto; }
.experiment-point-row { display: grid; grid-template-columns: minmax(210px, 1.1fr) minmax(180px, .8fr) minmax(105px, .45fr) 70px auto; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 5px; }
.experiment-point-row strong { display: block; }
.experiment-point-row small { color: var(--muted); }
.experiment-point-row input[type="text"] { width: 100%; min-height: 34px; }
.experiment-point-row.is-inactive { opacity: .58; }
.compact-metrics { padding: 0; border-top: 1px solid var(--line); }
.module-summary { max-height: 290px; overflow: auto; display: grid; gap: 5px; }
.module-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 5px; }
.module-row span { overflow-wrap: anywhere; }
.module-row small { grid-column: 1 / -1; color: var(--muted); }
.module-row.is-uncovered { border-color: #e4c789; background: var(--amber-soft); }
.blueprint-warnings { margin: 0; }
.blueprint-table { min-width: 620px; }
.blueprint-table .question-id { font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: #34434b; }
.blueprint-table tr.degraded-row { background: #fff9eb; }
.blueprint-table tr.degraded-row:hover { background: #fff5d8; }
.retrieval-level { display: inline-block; margin-top: 4px; padding: 2px 7px; border-radius: 9px; background: var(--amber-soft); color: #80581f; font-size: 10px; font-weight: 750; }
.retrieval-level.exact { background: var(--green-soft); color: var(--green-dark); }
.degradation-panel { margin: 0 20px 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.section-heading h2 { margin: 0; font-size: 16px; }
.section-heading > span { color: var(--amber); font-weight: 800; }
.degradation-list { display: grid; gap: 8px; }
.degradation-item { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; padding: 11px 12px; border: 1px solid #efd59e; border-radius: 6px; background: #fff9eb; }
.degradation-item > b { color: #8a5c18; }
.degradation-item strong, .degradation-item span { display: block; }
.degradation-item span { margin-top: 3px; color: #755a2d; font-size: 11px; }
.file-generation-block { display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.download-button { display: block; min-height: 38px; padding: 8px 14px; border: 1px solid var(--green); border-radius: 6px; color: var(--green-dark); text-align: center; text-decoration: none; font-weight: 700; }
.slot-number { width: 64px; font-weight: 800; font-variant-numeric: tabular-nums; }
.type-pill, .difficulty-pill { display: inline-block; padding: 4px 9px; border-radius: 10px; font-size: 11px; font-weight: 750; }
.type-pill.choice { color: var(--blue); background: var(--blue-soft); }
.type-pill.solution { color: var(--purple); background: var(--purple-soft); }
.difficulty-easy_count { color: #27623a; background: #e5f3e8; }
.difficulty-relatively_easy_count { color: #55721f; background: #eef5dc; }
.difficulty-medium_count { color: #7a641a; background: #fff6d7; }
.difficulty-relatively_hard_count { color: #8a4d1b; background: #fff0e2; }
.difficulty-hard_count { color: var(--red); background: var(--red-soft); }
.algorithm-summary { position: sticky; top: 88px; }
.recommendation-list { padding: 16px 20px 22px; display: grid; gap: 8px; }
.recommendation-card { display: grid; grid-template-columns: 42px minmax(220px, 1.5fr) minmax(270px, 1fr) minmax(170px, .75fr); gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.recommendation-card:hover { border-color: var(--line-strong); background: #fbfcfc; }
.rank { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #eaf0f2; font-weight: 800; }
.recommendation-title strong { display: block; font-size: 14px; }
.recommendation-title span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.role { display: inline-flex; width: fit-content; padding: 3px 8px; border-radius: 10px; font-size: 11px; font-weight: 750; }
.role.basic { color: var(--green-dark); background: var(--green-soft); }
.role.trunk { color: var(--blue); background: var(--blue-soft); }
.role.hard { color: var(--red); background: var(--red-soft); }
.role.normal { color: #59666e; background: #edf1f2; }
.score-bars { display: grid; gap: 5px; }
.score-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 38px; gap: 7px; align-items: center; color: var(--muted); font-size: 10px; }
.score-track { height: 6px; border-radius: 3px; background: #e8edef; overflow: hidden; }
.score-track i { display: block; height: 100%; background: var(--green); }
.score-reason { color: #47545b; font-size: 12px; }
.score-reason b { display: block; color: var(--ink); margin-bottom: 3px; }
.metric-list { margin: 0; padding: 12px 20px; }
.metric-list div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.metric-list dt { color: var(--muted); }
.metric-list dd { margin: 0; font-weight: 800; }
.formula-block { margin: 8px 20px 18px; padding: 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; }
.formula-block strong { display: block; margin-bottom: 6px; }
.formula-block code { color: #415057; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; white-space: normal; }
.warning-list { margin: 0 20px 20px; display: grid; gap: 7px; }
.warning-item { padding: 9px 10px; background: var(--amber-soft); color: #79501f; border-radius: 5px; font-size: 11px; }

.process-steps { padding: 16px 20px 24px; display: grid; gap: 10px; }
.process-step { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.process-step summary { min-height: 58px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; }
.process-step summary::-webkit-details-marker { display: none; }
.step-number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); font-weight: 800; }
.step-title strong { display: block; }
.step-title span { color: var(--muted); font-size: 11px; }
.step-counts { display: flex; gap: 6px; }
.step-counts span { padding: 3px 7px; background: #edf1f2; border-radius: 9px; color: var(--muted); font-size: 10px; }
.step-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.step-block { min-width: 0; padding: 11px; background: white; border: 1px solid var(--line); border-radius: 5px; }
.step-block h4 { margin: 0 0 8px; font-size: 12px; }
.json-view { max-height: 320px; overflow: auto; margin: 0; color: #3d4a51; font: 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-large { min-height: 260px; display: grid; place-items: center; color: var(--muted); }

.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(25, 36, 42, .38); }
.drawer-backdrop[hidden], .modal-backdrop[hidden] { display: none; }
.drawer { position: fixed; top: 0; right: 0; z-index: 60; width: min(440px, 100vw); height: 100vh; display: flex; flex-direction: column; background: white; box-shadow: -16px 0 42px rgba(28, 42, 49, .16); transform: translateX(100%); visibility: hidden; pointer-events: none; transition: transform .2s ease, visibility 0s linear .2s; }
.drawer.open { transform: translateX(0); visibility: visible; pointer-events: auto; transition-delay: 0s; }
.drawer-header, .modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px; border-bottom: 1px solid var(--line); }
.drawer-header h2, .modal-header h2 { margin: 0; font-size: 18px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--muted); cursor: pointer; font-size: 22px; line-height: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 20px 22px; }
.config-section { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.config-section h3 { margin: 0; font-size: 14px; }
.range-field input { min-height: auto; padding: 0; border: 0; accent-color: var(--green); box-shadow: none; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.checkbox-option { min-height: 36px; display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; color: #3d4a51; cursor: pointer; }
.checkbox-option input { min-height: auto; margin: 0; accent-color: var(--green); }
.drawer-footer { padding: 14px 20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: white; }

.modal-backdrop { display: grid; place-items: center; padding: 24px; }
.modal { width: min(900px, 100%); max-height: calc(100vh - 48px); overflow: hidden; background: white; border-radius: 8px; box-shadow: var(--shadow); }
.modal-body { max-height: calc(100vh - 130px); overflow: auto; padding: 20px; }
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table th, .detail-table td { padding: 9px; border-bottom: 1px solid var(--line); text-align: right; }
.detail-table th:first-child, .detail-table td:first-child { text-align: left; }
.detail-table th { background: #eef2f4; color: var(--muted); font-size: 11px; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 80; max-width: 360px; padding: 11px 14px; border-radius: 6px; background: #243239; color: white; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1050px) {
  .topbar { align-items: flex-start; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .summary-strip { grid-template-columns: repeat(3, 1fr); }
  .summary-item:nth-child(4) { border-left: 0; border-top: 1px solid var(--line); }
  .summary-item:nth-child(n+4) { border-top: 1px solid var(--line); }
  .scope-layout, .recommendation-layout, .blueprint-layout, .algorithm-library-layout { grid-template-columns: 1fr; }
  .scope-result-panel, .algorithm-summary, .blueprint-config-panel { position: static; }
  .algorithm-library-list-panel { position: static; }
  .recommendation-card { grid-template-columns: 40px minmax(200px, 1fr) minmax(250px, 1fr); }
  .score-reason { grid-column: 2 / -1; }
}

@media (max-width: 760px) {
  .topbar { position: static; padding: 12px 14px; display: block; }
  .brand-block { min-width: 0; }
  .topbar-actions { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; }
  .compact-field, .rule-field { min-width: 0; }
  .rule-field { grid-column: 1 / -1; }
  .share-menu-container, .share-menu-container > .button { width: 100%; }
  .share-menu { left: 0; right: auto; width: min(290px, calc(100vw - 28px)); }
  .workspace { width: min(100% - 20px, var(--content)); margin-top: 10px; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .summary-item:nth-child(3), .summary-item:nth-child(5) { border-left: 0; }
  .summary-item:nth-child(n+3) { border-top: 1px solid var(--line); }
  .tabs { overflow-x: auto; }
  .tab { flex: 0 0 auto; padding: 10px 14px; }
  .panel-heading, .responsive-heading { display: block; padding: 18px; }
  .mode-legend, .role-legend, .table-tools { margin-top: 14px; }
  .table-tools { display: grid; }
  .table-tools input { width: 100%; }
  .catalog-tree { padding-inline: 8px; }
  .catalog-row { grid-template-columns: 1fr; padding-left: calc(7px + var(--depth) * 12px); }
  .catalog-actions { padding-left: 20px; }
  .catalog-help { margin-inline: 14px; }
  .recommendation-card { grid-template-columns: 34px minmax(0, 1fr); }
  .score-bars, .score-reason { grid-column: 2; }
  .step-body { grid-template-columns: 1fr; }
  .difficulty-input-grid { grid-template-columns: repeat(5, minmax(48px, 1fr)); overflow-x: auto; }
  .drawer-footer { flex-wrap: wrap; }
  .drawer-footer .button { flex: 1 1 140px; }
}
