:root {
  color-scheme: light;
  --ink: #173c31;
  --green: #285e47;
  --green-hover: #1d4936;
  --text: #293a32;
  --muted: #5c695f;
  --line: #dce1d8;
  --soft-line: #e9ece5;
  --paper: #fffefa;
  --surface: #ffffff;
  --tint: #f0f4ed;
  --amber: #a96134;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", SimSun, serif;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --editor-height: clamp(220px, 28vh, 340px);
  font-family: var(--sans);
  color: var(--text);
  background: #f5f5ef;
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; }
button, summary, select { cursor: pointer; }
button { color: inherit; touch-action: manipulation; }
button:disabled { cursor: default; }
button:focus-visible, select:focus-visible, summary:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #468164;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.shell { max-width: 1472px; margin-inline: auto; padding-inline: clamp(18px, 5.5vw, 88px); }
.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }
.mast-inner, .brand, .help-link, .pane-head, .pane h2, .editor-footer, .actions, .tabs, .page-foot, .section-head, .dialog-head {
  display: flex;
  align-items: center;
}
.mast-inner { min-height: 66px; justify-content: space-between; gap: 10px; }
.brand { gap: 12px; }
.brand strong { font: 700 25px/1.2 var(--serif); color: var(--ink); letter-spacing: .08em; }
.bookmark { position: relative; display: block; width: 34px; height: 34px; border-radius: 9px; background: var(--ink); }
.bookmark::before, .bookmark::after { content: ""; position: absolute; top: 9px; height: 15px; width: 8px; background: #ebe9cc; }
.bookmark::before { left: 8px; transform: skewY(16deg); border-radius: 2px 0 0 1px; }
.bookmark::after { right: 8px; transform: skewY(-16deg); border-radius: 0 2px 1px 0; background: #fff9dc; }
.brand-divider { width: 1px; height: 16px; background: var(--line); }
.brand-subtitle { color: var(--muted); font-size: 13px; }
.help-link, .subtle, .text-button, .anchor-button, .close { background: transparent; border: 0; }
.help-link { gap: 6px; padding: 8px 2px 8px 8px; color: var(--muted); font-size: 13px; min-height: 40px; }
.help-icon, .foot-mark { border: 1.3px solid currentColor; border-radius: 50%; width: 16px; height: 16px; display: inline-grid; place-items: center; line-height: 1; font-size: 11px; font-weight: 650; }
.intro {
  display: flex; align-items: center; isolation: isolate; overflow: hidden; position: relative;
  min-height: clamp(140px, 17vh, 175px);
  margin: 22px 0 21px; padding: 26px clamp(24px, 3.5vw, 54px);
  border-radius: 16px; color: #fcf9e9; background-color: var(--ink);
}
.intro::before {
  content: ""; position: absolute; inset: 0 0 0 32%; z-index: -2;
  background: url("./editor-desk.webp") center 70% / cover no-repeat;
}
.intro::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #173c31 0%, #173c31 32%, rgba(23,60,49,.82) 43%, rgba(23,60,49,.15) 68%, transparent 80%);
}
.intro-copy { max-width: 65%; }
.intro h1 { font: 700 clamp(34px, 3.1vw, 48px)/1.22 var(--serif); letter-spacing: .045em; }
.title-and { color: #d6d8b0; }
.intro p { color: #e1e6d7; margin-top: 12px; font-size: 14px; line-height: 1.7; }
.workspace { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); gap: clamp(14px, 1.6vw, 24px); align-items: start; }
.pane {
  min-width: 0; border: 1px solid #d5dcd1; border-radius: 14px; background: var(--surface);
  box-shadow: 0 2px 4px #253b2810, 0 8px 24px -18px #253b283a;
}
.pane-head { padding: 16px 21px; justify-content: space-between; gap: 8px; min-height: 65px; }
.pane h2 { gap: 10px; font-size: 18px; line-height: 1.5; color: var(--ink); }
.tool-icon { position: relative; width: 32px; height: 32px; border-radius: 9px; display: inline-grid; place-items: center; flex: none; background: #edf3e9; color: var(--green); }
.manuscript::before { content: ""; width: 12px; height: 15px; border: 1.5px solid; border-radius: 2px; background: linear-gradient(currentColor,currentColor) center 4px/7px 1px no-repeat, linear-gradient(currentColor,currentColor) center 8px/7px 1px no-repeat; }
.report { background: #f5efe2; color: #946230; }
.report::before { content: ""; width: 15px; height: 15px; border-bottom: 1.5px solid; background: linear-gradient(currentColor,currentColor) left bottom 2px/3px 5px no-repeat, linear-gradient(currentColor,currentColor) center bottom 2px/3px 10px no-repeat, linear-gradient(currentColor,currentColor) right bottom 2px/3px 7px no-repeat; }
.text-button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 3px 11px; color: var(--green); border: 1px solid #d8dfd4; border-radius: 7px; background: #fcfdf9; font-size: 13px; }
.text-button:hover, .mini-button:hover { background: var(--tint); }
.help-link:hover, .subtle:hover:not(:disabled), .anchor-button:hover { color: var(--green-hover); text-decoration: underline; text-underline-offset: 3px; }
.input-body { margin-inline: 21px; border: 1px solid #cbd5c9; border-radius: 9px; overflow: hidden; background: var(--paper); }
.input-body:focus-within { border-color: #568365; outline: 2px solid #bed3bb90; outline-offset: 1px; }
#source {
  display: block; width: 100%; height: var(--editor-height); min-height: 180px; resize: vertical;
  margin: 0; padding: 15px 18px; border: 0; border-radius: 9px; background: transparent;
  color: var(--text); font-size: 16px; line-height: 1.95; outline: none;
}
#source:placeholder-shown {
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(1.95em - 1px), #e9e9e0 calc(1.95em - 1px) 1.95em);
  background-position: 18px 15px; background-size: calc(100% - 36px) calc(100% - 30px); background-repeat: no-repeat;
}
#source::placeholder { color: #737b70; }
.editor-footer { min-height: 36px; padding: 1px 13px 4px 17px; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.subtle { padding: 5px; min-height: 30px; font-size: 12px; color: var(--muted); }
.subtle:disabled { color: #778174; }
.over-limit { color: #a43c2c; font-weight: 650; }
.settings { margin: 12px 21px 0; border: 1px solid var(--soft-line); border-radius: 8px; background: #f6f8f3; }
.settings summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px; min-height: 42px; }
.settings summary::-webkit-details-marker { display: none; }
.controls-icon { position: relative; width: 15px; height: 10px; border-block: 1.5px solid var(--green); flex: none; }
.controls-icon::before,.controls-icon::after { content: ""; position: absolute; width: 4px; height: 4px; border: 1.5px solid var(--green); border-radius: 50%; background: #f6f8f3; }
.controls-icon::before { left: 2px; top: -3.5px; } .controls-icon::after { right: 2px; bottom: -3.5px; }
.setting-title { font-weight: 600; }
.setting-summary { margin-left: auto; color: var(--muted); font-size: 12px; text-align: right; overflow-wrap: anywhere; }
.chevron { width: 7px; height: 7px; margin: -3px 3px 0 4px; flex: none; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg); }
.settings[open] .chevron { transform: rotate(225deg); margin-top: 3px; }
.setting-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; border-top: 1px solid var(--line); padding: 14px; }
.setting-fields label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.setting-fields select, .setting-fields input { min-width: 0; width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid #c8d3c5; border-radius: 6px; background: white; color: var(--text); }
.setting-fields select:disabled { color: #70786e; background: #f2f4ee; }
.wide { grid-column: 1 / -1; }
.hint { font-size: 13px; line-height: 1.75; color: var(--muted); }
.actions { gap: 10px; padding: 15px 21px 20px; }
.actions button { min-height: 44px; font-size: 15px; font-weight: 650; border-radius: 8px; padding: 9px 14px; }
.primary { background: var(--green); color: white; border: 1px solid var(--green); flex: 1.25; }
.primary span { margin-left: 4px; }
.primary:hover:not(:disabled) { background: var(--green-hover); }
.secondary { background: #fff; border: 1px solid #9eaf9a; color: var(--green); flex: 1; }
.secondary:hover:not(:disabled) { background: #f1f6ed; }
.primary:disabled { background: #738d7d; border-color: #738d7d; }
.secondary:disabled { color: #6f7c71; border-color: #c9d2c6; background: #fafbf7; }
.review-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 20px; font-size: 12px; color: var(--muted); background: #f2f4ef; }
.review-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #8b958b; }
.review-status[data-state="ready"] { color: #356343; background: #edf4e9; }
.review-status[data-state="ready"]::before { background: #488050; }
.review-status[data-state="busy"]::before { background: #b88943; }
.tabs { margin-inline: 21px; padding: 3px; border: 1px solid var(--soft-line); border-radius: 9px; background: #f2f4ef; gap: 3px; }
.tabs button { flex: 1; background: transparent; border: 1px solid transparent; border-radius: 6px; min-height: 34px; padding: 4px; font-size: 13px; color: var(--muted); }
.tabs button:hover { color: var(--green); }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: #dce2d7; background: var(--surface); box-shadow: 0 1px 3px #344c3520; font-weight: 650; }
.result-content { padding: 16px 21px 20px; overflow-wrap: anywhere; }
.empty { min-height: calc(var(--editor-height) + 94px); display: grid; align-content: center; justify-items: center; text-align: center; padding: 20px 8px; }
.paper-icon { position: relative; width: 51px; height: 61px; padding: 14px 8px; border-radius: 4px 9px 4px 4px; border: 1px solid #a7b59e; background: var(--paper); box-shadow: -4px 4px 0 0 #e8eee1, -5px 5px 0 0 #afbaa8; transform: rotate(7deg); margin: 8px 0 22px; }
.paper-icon::after { content: ""; position: absolute; width: 11px; height: 14px; top: -1px; right: 6px; background: #c59b5e; clip-path: polygon(0 0,100% 0,100% 100%,50% 76%,0 100%); }
.paper-icon i { display: block; margin-bottom: 5px; height: 2px; width: 88%; background: #bac3b2; }
.paper-icon i:first-child { width: 47%; background: #67816a; }
.paper-icon i:nth-child(3) { width: 65%; } .paper-icon i:last-child { width: 77%; }
.empty h3 { font: 650 18px/1.5 var(--sans); color: #354b3c; }
.empty p { margin-top: 6px; max-width: 270px; font-size: 13px; line-height: 1.75; color: var(--muted); }
.page-foot { gap: 8px; font-size: 12px; color: var(--muted); line-height: 1.7; padding: 16px 2px 25px; }
.foot-mark { flex: none; width: 14px; height: 14px; font-family: Georgia, serif; }
.notice { font-size: 13px; line-height: 1.7; padding: 9px 12px; border-radius: 6px; overflow-wrap: anywhere; }
.warning { background: #f8f0df; color: #77502c; }
.error { background: #faebe6; color: #903f2d; margin: 0 21px 15px; }
#service-warning { margin-bottom: 12px; }
.result-content .warning { margin: 10px 0 13px; }
.score { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; background: #ecf2e8; border: 1px solid #d6e2cf; border-radius: 9px; }
.score[data-level="中"] { background: #f7f0df; border-color: #ead6ad; }
.score[data-level="高"] { background: #fbebe4; border-color: #e9c9b9; }
.score .caption, .metric dt { font-size: 12px; color: var(--muted); }
.score .level { margin-top: 3px; font-size: 20px; font-weight: 650; color: var(--ink); }
.score-number { font: 650 40px/1 "Inter", Arial, sans-serif; color: var(--ink); white-space: nowrap; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.score-number small { font: 500 12px var(--sans); color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; background: var(--soft-line); border: 1px solid var(--soft-line); border-radius: 8px; overflow: hidden; margin: 12px 0; }
.metric { background: var(--surface); padding: 9px 12px; }
.metric dd { margin-top: 3px; color: var(--ink); font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.reading-bands { margin: 10px 0; }
.band-track { display: flex; overflow: hidden; height: 6px; border-radius: 6px; background: var(--soft-line); margin: 6px 0 4px; }
.band-segment, .band-key::before { background: var(--band-color); }
.band-short { --band-color: #568169; } .band-medium { --band-color: #b8bd86; } .band-long { --band-color: #c18a62; }
.band-labels { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; line-height: 1.8; }
.band-key::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 4px; }
.section-head { margin: 18px 0 9px; justify-content: space-between; gap: 8px; }
.section-head:first-child { margin-top: 0; }
.section-head h3 { font-size: 16px; color: var(--ink); }
.paragraph { margin-top: 9px; min-width: 0; border: 1px solid var(--soft-line); border-radius: 8px; padding: 11px 13px; }
.paragraph-head { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.anchor-button, .mini-button { color: var(--green); font-size: 13px; }
.anchor-button { font-weight: 650; padding: 2px 4px 2px 0; }
.mini-button { min-height: 34px; padding: 5px 10px; border: 1px solid #b6c8b3; background: var(--paper); border-radius: 6px; white-space: nowrap; }
.evidence { font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.evidence + .evidence { margin-top: 10px; }
.evidence strong { font-weight: 650; }
.quote, .draft { white-space: pre-wrap; overflow-wrap: anywhere; }
.draft { padding: 15px 17px; color: var(--text); background: var(--paper); border: 1px solid #e1e6da; border-radius: 8px; font-size: 16px; line-height: 1.95; }
.trace, .guide, .note-list { margin: 8px 0; padding-inline-start: 1.4em; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.trace, .note-list { color: var(--muted); }
.diff-label { margin: 8px 0 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.quote { margin: 5px 0; border-left: 3px solid #c6cdbf; padding: 6px 10px; background: #f4f5f0; font-size: 14px; line-height: 1.85; }
.quote.revised { border-left-color: #759176; background: #edf4e9; }
.result-content details { margin-top: 10px; }
.result-content details summary { display: list-item; font-size: 13px; color: var(--green); padding-block: 5px; }
.dialog-head { justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
dialog { width: min(425px, calc(100% - 32px)); border: 1px solid #bdcabb; padding: 21px; background: var(--paper); color: var(--text); border-radius: 14px; box-shadow: 0 15px 55px #13291e30; }
dialog::backdrop { background: #14271d64; }
.dialog-head h2 { font: 700 23px/1.5 var(--serif); }
.close { font-size: 24px; line-height: 1; padding: 5px; min-width: 36px; min-height: 36px; border-radius: 6px; }
.close:hover { background: var(--tint); }
.guide li { padding: 10px 0 0 2px; }
.guide li::marker { color: var(--green); font-weight: 700; }
.guide p { color: var(--muted); margin-top: 3px; }
@media (min-width: 801px) and (min-height: 710px) {
  .input-pane { position: sticky; top: 12px; }
  .input-pane:has(.settings[open]) { position: static; }
}
@media (max-width: 800px) {
  .workspace { grid-template-columns: 1fr; gap: 14px; }
  .shell { max-width: 730px; padding-inline: clamp(13px, 4vw, 28px); }
  .mast-inner { min-height: 56px; }
  .intro { min-height: 132px; padding: 20px 22px; margin: 14px 0; }
  .intro-copy { max-width: 76%; }
  .intro p { margin-top: 7px; max-width: 24em; }
  .intro::before { left: 35%; }
  .intro::after { background: linear-gradient(90deg, #173c31 8%, #173c31 33%, rgba(23,60,49,.94) 49%, rgba(23,60,49,.62) 65%, rgba(23,60,49,.12) 90%); }
  .empty { min-height: 190px; }
  .results-pane { scroll-margin-top: 10px; }
  #source { height: 225px; }
  .setting-fields input, .setting-fields select { font-size: 16px; }
}
@media (max-width: 480px) {
  .brand { gap: 8px; }
  .brand strong { font-size: 22px; }
  .brand-subtitle { font-size: 12px; }
  .bookmark { transform: scale(.9); transform-origin: left center; margin-right: -2px; }
  .help-link { padding-left: 2px; font-size: 12px; }
  .intro { padding-inline: 17px; min-height: 120px; border-radius: 11px; }
  .intro-copy { max-width: 73%; }
  .intro h1 { font-size: clamp(27px, 7.6vw, 35px); }
  .intro p { font-size: 12px; }
  .pane { border-radius: 11px; }
  .pane-head { min-height: 57px; padding: 12px 14px; }
  .pane h2 { font-size: 17px; gap: 8px; }
  .tool-icon { width: 29px; height: 29px; }
  .input-body, .settings, .tabs { margin-inline: 13px; }
  #source { height: 202px; padding: 11px 13px; }
  #source:placeholder-shown { background-position: 13px 11px; background-size: calc(100% - 26px) calc(100% - 22px); }
  .actions { padding: 13px; }
  .tabs button { min-height: 38px; }
  .result-content { padding: 13px; }
  .error { margin-inline: 13px; }
  .metric { padding: 8px; }
  .text-button, .mini-button, .help-link, .subtle, .anchor-button { min-height: 36px; }
}
@media (max-width: 355px) {
  .brand-divider, .brand-subtitle { display: none; }
  .setting-fields { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
