:root {
  color-scheme: light;
  --bg: #f3f4f7; --surface: #ffffff; --ink: #202b40; --muted: #566277;
  --line: #d9dfeb; --accent: #334a85; --accent-soft: #eef1fa;
  --pass: #24543b; --pass-bg: #eaf4ed; --fail: #823c30; --fail-bg: #fbefeb;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
a { color: var(--accent); }
.shell { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.topbar { background: #fbfcfe; border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; gap: 10px; align-items: center; color: var(--ink); font-weight: 800; text-decoration: none; }
.brand-icon { display: grid; place-items: center; width: 39px; height: 39px; background: var(--accent); color: #fff; border-radius: 12px; font-family: Georgia, serif; font-size: 21px; }
.brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.home-link { font-size: 13px; text-decoration: none; border-radius: 8px; padding: 8px; }
.home-link:hover { background: var(--accent-soft); }
.hero { padding: 27px 0 19px; }
.eyebrow { font-size: 10px; font-weight: 800; letter-spacing: .18em; color: #59698a; margin: 0 0 6px; }
h1 { font-size: clamp(27px, 4vw, 38px); line-height: 1.25; letter-spacing: -.025em; margin: 0; }
.lead { color: var(--muted); margin: 9px 0 12px; }
.scope-note { color: #455578; background: #ecf0f9; border: 1px solid #d6dfee; border-radius: 10px; padding: 9px 12px; font-size: 12px; margin: 0; max-width: 900px; }
.workspace { display: grid; grid-template-columns: 1.05fr 1fr; gap: 15px; align-items: stretch; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 25px #273c6210; padding: 20px; margin-bottom: 16px; min-width: 0; }
.workspace > .panel { margin-bottom: 16px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 15px; }
h2 { font-size: 17px; line-height: 1.5; margin: 0; }
h3 { font-size: 13px; margin: 0 0 7px; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.pill { background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 4px 9px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.pill.subtle { background: #f0f3f8; color: #4e5d73; }
.color-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.color-field { min-width: 0; }
.field-label { display: block; font-size: 13px; font-weight: 750; margin-bottom: 7px; }
.color-control { display: flex; align-items: stretch; border: 1px solid #bec9dd; border-radius: 10px; overflow: hidden; min-width: 0; background: #fff; }
.color-control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #334a851a; }
input[type=color] { width: 49px; min-width: 49px; height: 47px; padding: 5px; border: 0; border-right: 1px solid #d8dfec; background: #f4f6fb; border-radius: 0; cursor: pointer; }
input[type=text] { width: 100%; min-width: 0; border: 0; padding: 8px 9px; outline: none; color: var(--ink); background: white; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
input[aria-invalid=true] { background: #fff7f3; color: #7b352a; }
.field-help, .picker-hint { margin: 5px 0 0; font-size: 10px; color: var(--muted); }
.picker-hint { min-height: 16px; }
.picker-hint.invalid { color: #813c2f; }
.field-error { color: #813c2f; font-size: 11px; margin: 3px 0 0; min-height: 18px; overflow-wrap: anywhere; }
.input-actions { margin-top: 9px; }
.button { border: 1px solid #c2cce0; background: #fff; border-radius: 9px; padding: 8px 12px; font-size: 12px; line-height: 1.5; }
.button:hover:not(:disabled) { background: #f4f6fb; border-color: #879bc4; }
.button.primary { background: var(--accent); color: white; border-color: var(--accent); font-weight: 750; }
.button.primary:hover:not(:disabled) { background: #293f75; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.preset-area { border-top: 1px solid #e3e8f0; margin-top: 19px; padding-top: 14px; }
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset { min-width: 0; padding: 8px 9px; border: 1px solid #d3dceb; background: #fafbfe; border-radius: 8px; font-size: 11px; display: flex; align-items: center; gap: 6px; text-align: left; }
.preset:hover { background: #edf1fa; border-color: #8ea0c2; }
.preset-dot { height: 17px; width: 17px; min-width: 17px; border-radius: 50%; border: 1px solid #a5afc1; }
.preset-dot.body { background: linear-gradient(135deg,#1f2937 50%,white 50%); }
.preset-dot.dark { background: linear-gradient(135deg,#e5e7eb 50%,#111827 50%); }
.preset-dot.normal-edge { background: linear-gradient(135deg,#777 50%,white 50%); }
.preset-dot.large-edge { background: linear-gradient(135deg,#959595 50%,white 50%); }
#currentPair { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.ratio-display { display: flex; align-items: baseline; gap: 7px; margin: 0; line-height: 1.1; }
.ratio-display strong { font-size: clamp(43px, 5.3vw, 60px); letter-spacing: -.05em; font-weight: 800; color: #283e72; }
.ratio-display > span { font-size: 21px; color: #566988; }
.precision-note { color: var(--muted); font-size: 10px; margin: 6px 0 12px; }
.grade-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.grade-table th, .grade-table td { padding: 7px 4px; border-bottom: 1px solid #e6ebf3; text-align: left; }
.grade-table thead th { color: var(--muted); font-size: 10px; font-weight: 600; padding-top: 0; }
.grade-table tbody th { font-weight: 650; }
.grade-table td:nth-child(2) { color: #52627c; white-space: nowrap; }
.grade-table th:last-child, .grade-table td:last-child { text-align: right; }
.grade { font-size: 10px; border-radius: 99px; padding: 3px 7px; display: inline-block; white-space: nowrap; }
.grade.pass { color: var(--pass); background: var(--pass-bg); }
.grade.fail { color: var(--fail); background: var(--fail-bg); }
.copy-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.copy-description { color: var(--muted); font-size: 10px; }
.action-status { min-height: 17px; font-size: 11px; color: #304b79; margin: 7px 0 0; overflow-wrap: anywhere; }
.preview-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.preview-item { min-width: 0; }
.sample-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 750; margin-bottom: 7px; }
.sample-label > span { font-size: 10px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.sample-body { background: var(--sample-bg, #fff); color: var(--sample-fg, #1f2937); min-height: 130px; border: 1px solid #cbd4e4; border-radius: 10px; padding: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.sample-body p { margin: 0 0 12px; }
.sample-body p:last-child { margin-bottom: 0; }
.regular-sample { font-size: 16px; font-weight: 400; }
.large-sample { font-size: 24px; font-weight: 400; }
.bold-sample { font-size: 20px; font-weight: 700; }
.candidate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.candidate-card { background: #fafbfd; border: 1px solid #d5deec; border-radius: 11px; padding: 13px; min-width: 0; }
.candidate-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 7px; flex-wrap: wrap; }
.candidate-heading h3 { display: flex; align-items: center; gap: 6px; font-size: 12px; margin: 0; }
.candidate-heading code { font: 10px ui-monospace, monospace; color: #53647e; }
.color-chip { width: 15px; height: 15px; display: inline-block; border: 1px solid #8994a6; border-radius: 4px; }
.color-chip.black { background: #000; }
.color-chip.white { background: #fff; }
.recommended { font-size: 10px; color: #38523f; background: #e9f1e9; border-radius: 99px; padding: 2px 7px; white-space: nowrap; }
.candidate-ratio { margin: 8px 0 3px; color: #2e4778; }
.candidate-ratio strong { font-size: 23px; }
.candidate-ratio span { font-size: 12px; margin-left: 4px; }
.candidate-grades { font-size: 11px; color: #475973; margin: 0 0 11px; }
.rules-panel h2 { margin-bottom: 11px; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.rules-grid h3 { font-size: 12px; margin-bottom: 4px; }
.rules-grid p { font-size: 11px; color: var(--muted); margin: 0; }
.standard-links { margin: 14px 0 0; font-size: 10px; color: var(--muted); }
.standard-links a { text-underline-offset: 3px; }
.empty-state { padding: 22px 14px; border: 1px dashed #c7d2e6; border-radius: 11px; color: #53627a; background: #f8faff; font-size: 12px; text-align: center; }
.empty-state strong { display: block; color: #344a70; }
.empty-state p { margin: 5px 0 0; }
#invalidNotice { min-height: 255px; display: flex; flex-direction: column; justify-content: center; }
.copy-fallback { border-color: #b8c9e8; background: #f7faff; }
.copy-fallback textarea { width: 100%; min-height: 190px; resize: vertical; border: 1px solid #bdcce4; border-radius: 9px; background: white; color: #273b5d; padding: 11px; font: 12px/1.6 ui-monospace, monospace; }
.footer { color: var(--muted); font-size: 10px; padding: 1px 0 25px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #a87011; outline-offset: 3px; }
@media (max-width: 880px) { .workspace { grid-template-columns: 1fr; gap: 0; } .preview-grid { grid-template-columns: 1fr; } .sample-body { min-height: 100px; } .shell { width: min(720px, calc(100% - 28px)); } .color-fields { gap: 18px; } }
@media (max-width: 520px) { .shell { width: calc(100% - 20px); } .topbar-inner { min-height: 62px; } .hero { padding: 21px 0 16px; } .panel { padding: 15px; border-radius: 13px; } .color-fields { grid-template-columns: 1fr; gap: 8px; } .color-control { max-width: none; } .field-error { min-height: 16px; } .candidate-grid, .rules-grid { grid-template-columns: 1fr; gap: 11px; } .candidate-heading { flex-wrap: nowrap; } .preview-panel .section-heading { flex-wrap: wrap; } .scope-note { font-size: 11px; } .ratio-display strong { font-size: 49px; } .grade-table th,.grade-table td { padding-block: 8px; } .home-link { padding-right: 0; } }
