:root {
  --paper:#faf8f1; --surface:#fffef9; --ink:#26372e; --muted:#566459;
  --line:#d5d6c8; --dark:#243f32; --action:#8b4133; --soft:#f0ede2;
  --serif:Georgia,"Songti SC","STSong",serif;
  --sans:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC",sans-serif;
}
* {box-sizing:border-box}
body {margin:0;background:var(--paper);color:var(--ink);font:16px/1.6 var(--sans);overflow-wrap:anywhere}
h1,h2,h3,p {margin:0}
h1,h2,h3,.brand {font-family:var(--serif);font-weight:normal}
a {color:var(--action);text-underline-offset:.2em}
button,select,textarea,input {color:inherit;font:inherit}
button,select,summary {cursor:pointer}
button {background:var(--surface);border:1px solid #aeb2a5;border-radius:6px;padding:.35rem .75rem}
button:hover,select:hover {border-color:var(--action)}
button:disabled,select:disabled {opacity:.62;cursor:wait}
a:focus-visible,button:focus-visible,select:focus-visible,summary:focus-visible,textarea:focus-visible,input:focus-visible,[tabindex="-1"]:focus-visible {outline:3px solid #ab5644;outline-offset:3px}
[hidden]{display:none!important}
.shell {width:min(1176px,calc(100% - 96px));margin-inline:auto}
.masthead {border-bottom:1px solid var(--line)}
.header-inner,.masthead nav,.brand,.composer-head,.composer-head>div,.compose-actions,.section-head,.recovery-actions,.actions,.feedback-line,footer {display:flex;align-items:center}
.header-inner {justify-content:space-between;min-height:78px;gap:20px}
.brand {display:inline-flex;gap:12px;align-items:center;text-decoration:none;color:var(--ink);font-size:29px;font-weight:bold;letter-spacing:-1.6px;line-height:1}
.brand small {display:block;letter-spacing:.22em;font:10px/1.6 var(--sans);color:var(--muted);margin-top:4px}
.mark {width:41px;height:41px;display:grid;place-content:center;position:relative;border:1.5px solid var(--dark);border-radius:50%;font:italic 28px/.9 var(--serif);letter-spacing:-.16em;padding-right:8px}
.mark span {font-size:19px;position:absolute;left:21px;top:14px}
.masthead nav {gap:24px;font-size:.9rem;font-weight:580}
.masthead nav a {color:var(--ink);text-decoration:none;padding:.5rem 0}
.masthead nav a:hover {text-decoration:underline}
.masthead nav .current {color:var(--action)}
.lang {border-radius:40px;background:none;padding:.35rem .85rem;min-height:39px}
.hero {padding:clamp(38px,6vw,78px) 0 clamp(25px,3.2vw,45px);max-width:940px}
.hero h1 {font-size:clamp(44px,5.55vw,82px);line-height:1.06;letter-spacing:-.058em;text-wrap:balance}
.hero em {color:var(--action);font-weight:normal}
:lang(zh-Hans) .hero h1 {font-size:clamp(36px,4.8vw,68px);letter-spacing:-.045em;line-height:1.18}
:lang(zh-Hans) .hero em {font-style:normal}
.hero p {max-width:700px;margin-top:15px;color:var(--muted);font-size:clamp(16px,1.5vw,19px);line-height:1.55}
.layout {display:grid;grid-template-columns:minmax(0,2.18fr) minmax(245px,1fr);gap:clamp(20px,3vw,42px);align-items:start}
.workspace,.sidebar {min-width:0}
.composer,.turn,.tools,.reading {border-radius:12px}
.composer {padding:clamp(18px,2.35vw,34px);border:1px solid var(--line);background:var(--surface);box-shadow:0 3px 12px #33442f08;scroll-margin:12px}
.composer-head {justify-content:space-between;gap:12px;margin-bottom:16px}
.composer-head>div {gap:9px}
.composer-head h2,.section-head h2,.tools h2 {font-size:clamp(22px,2vw,29px);line-height:1.22;letter-spacing:-.04em}
.assistant-mark {font:25px/1 var(--serif);color:var(--action)}
.session-label,.turn-mode {color:var(--muted);font-size:.76rem;font-weight:600}
#ask-form {border:1px solid #aaa99c;border-radius:8px;background:#fffefb;overflow:hidden}
#question {display:block;border:0;resize:vertical;background:transparent;width:100%;min-height:96px;padding:15px 17px 5px;line-height:1.5}
#question:focus-visible {outline-offset:-3px}
#question::placeholder {color:#686e64}
.compose-actions {justify-content:space-between;padding:4px 10px 10px;gap:10px}
.mode-label select,#phrase-kind {border:1px solid #c2c4b6;background:var(--paper);border-radius:5px;font-size:.85rem;padding:.45em .35em;max-width:100%}
.primary {background:var(--action);color:#fffdf9;border-color:var(--action);font-weight:650;min-height:44px;padding:6px 18px}
.primary:hover {background:#713428}
.privacy {padding:9px 13px;border-top:1px solid var(--line);background:#f7f5ec;color:var(--muted);font-size:.78rem;line-height:1.55}
.examples,.actions,.feedback-line,.recovery-actions {display:flex;flex-wrap:wrap;gap:7px}
.examples {margin-top:17px}
.examples button {border-color:var(--line);font-size:.84rem;background:#f6f3ea;min-height:38px;text-align:left}
.credit-line,.source-context {font-size:.8rem;color:var(--muted);margin-top:13px}
.source-context {margin:0 14px 5px}
.credit-line:not(:empty):before {content:"";display:inline-block;width:7px;height:7px;background:#66785d;border-radius:100%;margin-right:.42em}
.notice,.confirm-row,.offer {border-radius:6px;background:#f4eadf;padding:10px 13px;line-height:1.55}
.notice,.offer,.recovery-actions:not(:empty),.confirm-row {margin-top:12px}
.notice {font-size:.88rem}
.offer h3 {font-size:1.26rem}
.offer p {margin:.3em 0 .8em;font-size:.88rem}
.reading {background:var(--dark);color:#faf7eb;padding:clamp(19px,2.2vw,31px);position:relative;overflow:hidden}
.book {color:#c4d5b4;font-size:33px;line-height:1;margin-bottom:12px}
.reading h2 {font-size:clamp(27px,2.3vw,37px);line-height:1.2;letter-spacing:-.04em}
.reading p {color:#e0e4d6;font-size:.93rem;margin:8px 0 18px}
.on-dark {color:#fff9e8;font-weight:650;font-size:.92rem}
.tools {margin-top:17px;border:1px solid var(--line);padding:18px 20px 4px}
.tools h2 {font-size:23px;margin-bottom:10px}
.tools details {border-top:1px solid var(--line);padding-bottom:0}
.tools details[open] {padding-bottom:13px}
.tools summary {display:flex;gap:9px;align-items:center;min-height:49px;font-weight:580;font-size:.9rem;list-style:none}
.tools summary:after {content:"+";margin-left:auto;font-size:19px;color:var(--muted)}
.tools details[open]>summary:after {content:"−"}
.tools summary::-webkit-details-marker{display:none}
.tool-icon {font-family:var(--serif);font-size:19px;color:var(--action);width:22px;text-align:center}
.tools p,.tools output,.tool-status {font-size:.88rem}
.tools p {margin:7px 0;color:var(--muted)}
.tools .phrase-cn {color:var(--ink);font-size:1.24rem;line-height:1.45;margin-top:13px}
#cost-fields label {display:grid;grid-template-columns:1fr 86px;gap:8px;align-items:center;margin:6px 0;font-size:.86rem}
#cost-fields input {width:100%;border-radius:5px;border:1px solid #aeb2a5;background:var(--surface);padding:4px 6px}
#cost-result {display:block;margin-top:11px;font-weight:650}
.history {margin-bottom:20px}
.section-head {justify-content:space-between;gap:12px;margin:0 0 13px}
.history-tools {display:flex;gap:12px;flex-wrap:wrap;align-items:center;justify-content:flex-end;font-size:.84rem}
.casefile h2 {font-size:clamp(23px,2vw,30px);line-height:1.25}
.casefile .source-meta {margin:6px 0}
.casefile details {margin-top:8px}
.casefile summary {font-size:.87rem}
.casefile li strong,.casefile li p {font-size:.88rem}
.text-action {border:0;background:transparent;padding:.35rem 0;color:var(--action);text-decoration:underline;text-underline-offset:.18em;font-size:.85rem}
.turn {border:1px solid var(--line);background:var(--surface);padding:clamp(16px,2.4vw,32px);margin-bottom:15px}
.turn summary {font-size:1rem;font-weight:600}
.turn h3 {font-size:clamp(21px,2vw,29px);line-height:1.35;margin:.15em 0 .55em;letter-spacing:-.025em}
.turn p,.turn li {white-space:pre-wrap}
.turn .answer {line-height:1.65}
.turn header {display:flex;align-items:center;justify-content:space-between;gap:10px}
.turn h4 {font-size:.96rem;margin:19px 0 5px}
.turn ul {padding:0;margin:6px 0;list-style:none}
.turn li {padding:8px 0;border-top:1px solid var(--line)}
.turn li p {margin:3px 0;color:var(--muted);font-size:.94rem}
.item-kind {display:inline-block;color:#5f5544;font-size:.75rem;background:#f2eddf;border-radius:3px;padding:1px 5px;margin-right:8px}
.source-meta,.feedback-line {font-size:.83rem;color:var(--muted)}
.turn .next {border-left:3px solid #a17458;background:#f7f3e9;padding:9px 12px;margin:14px 0}
.turn .actions button,.feedback-line button,.recovery-actions button {font-size:.82rem;min-height:36px}
.turn .actions {margin-top:13px}
.feedback-line {padding-top:10px}
.feedback-line button {border:0;background:transparent;color:var(--action);padding:.2rem .42rem;text-decoration:underline}
.feedback-line button[aria-pressed=true] {color:var(--ink);font-weight:700}
.manual-copy {display:block;width:100%;height:90px}
.turn .response-note {font-size:.84rem;color:var(--muted);margin:.35rem 0}
.has-turns .hero {padding:24px 0 20px}
.has-turns .hero h1 {font-size:clamp(30px,3.5vw,45px)}
.has-turns .hero p {display:none}
footer {border-top:1px solid var(--line);margin-top:clamp(48px,8vw,96px);padding:17px 0 29px;gap:14px;justify-content:space-between;color:var(--muted);font-size:.77rem}
footer span:first-child {font-family:var(--serif);font-size:1rem;color:var(--ink)}
.sr,.skip:not(:focus) {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.skip:focus {position:fixed;z-index:10;top:4px;left:4px;background:white;padding:6px}
@media(max-width:860px) {.shell{width:calc(100% - 44px)}.layout{grid-template-columns:minmax(0,1.6fr) minmax(230px,.95fr);gap:16px}.composer,.turn{padding:18px}}
@media(max-width:700px) {.shell{width:calc(100% - 34px)}.header-inner{min-height:62px}.brand{font-size:23px;gap:7px}.mark{width:32px;height:32px;font-size:23px}.mark span{left:16px;top:10px;font-size:15px}.masthead nav{gap:12px}.masthead nav .current{display:none}.layout{display:block}.sidebar{margin-top:20px}.reading{padding:19px}.book{float:right}.tools{margin-top:12px}.hero{padding:37px 0 24px}.hero h1{max-width:600px}.hero p{margin-top:10px}.session-label{font-size:.7rem}.composer,.turn{padding:15px}.composer-head{margin-bottom:12px}.examples button,.feedback-line button,.turn .actions button,.recovery-actions button{min-height:44px}.has-turns .hero{padding:21px 0}footer{align-items:flex-start;flex-direction:column;gap:5px}}
@media(max-width:370px) {.shell{width:calc(100% - 24px)}.composer-head{align-items:flex-start;flex-direction:column;gap:3px}.masthead nav{gap:9px}.lang{padding:.32rem .63rem}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
