* { box-sizing: border-box; }
:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: #253f60;
  background: #f8f6f0;
  font-synthesis: none;
  --ink: #253f60;
  --muted: #627386;
  --line: #d6dde2;
  --paper: #fffefa;
  --accent: #315f88;
  --accent-soft: #dceaf4;
  --glow: rgba(110, 164, 200, .22);
  --header-clearance: 88px;
}
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background:
  radial-gradient(circle at 82% 8%, rgba(202, 224, 236, .55), transparent 27rem),
  radial-gradient(circle at 5% 42%, rgba(232, 222, 202, .35), transparent 25rem),
  #f8f6f0; }
body::before { content: ""; position: fixed; z-index: -1; inset: 0; pointer-events: none; opacity: .32; background-image: radial-gradient(#607a91 0.55px, transparent 0.55px); background-size: 18px 18px; mask-image: linear-gradient(to bottom, black, transparent 72%); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button, input, textarea, select, a, summary { outline-offset: 4px; }
:focus-visible { outline: 2px solid #52799e; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.shell { max-width: 1240px; margin: auto; padding: 0 34px; }
header { min-height: 72px; position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid rgba(180, 195, 205, .68); background: rgba(248, 246, 240, .78); backdrop-filter: blur(16px) saturate(1.2); direction: ltr; }
.brand { display: flex; gap: 10px; align-items: center; flex-shrink: 0; text-decoration: none; color: var(--ink); }
.brand-mark { width: 33px; height: 33px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; transition: transform .3s ease; }
.brand:hover .brand-mark { transform: rotate(-5deg) translateY(-1px); }
.wordmark { font: 35px Georgia, serif; letter-spacing: -1.6px; }
.header-actions, .ui-language { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ui-language { gap: 9px; }
.ui-language label { margin: 0; font-size: 12px; white-space: nowrap; }
.ui-language select { max-width: 170px; }
.membership-link { padding: 8px 12px; border: 1px solid #b6c9d8; border-radius: 9px; color: var(--ink); background: #ffffff80; font-size: 12px; line-height: 1.4; text-decoration: none; overflow-wrap: anywhere; }
.membership-link:hover { background: #e5edf2; }
.intro { padding: 19px 0 16px; position: relative; }
h1 { font-size: clamp(27px, 3vw, 36px); line-height: 1.23; margin: 0 0 7px; letter-spacing: -.7px; font-weight: 680; }
.intro > p { color: var(--muted); font-size: 15px; line-height: 1.65; margin: 0 0 10px; }
.task-tabs { display: flex; margin: 0 0 16px; gap: 5px; padding: 5px; border: 1px solid rgba(190, 203, 211, .76); border-radius: 15px; background: rgba(255, 254, 250, .72); box-shadow: 0 8px 30px rgba(38, 62, 86, .05); }
.tab { display: flex; flex: 1; align-items: center; justify-content: center; gap: 9px; min-width: 0; min-height: 48px; padding: 10px 7px; color: var(--muted); background: transparent; border: 0; border-radius: 10px; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; transition: color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease; }
.tab:hover { color: var(--ink); background: rgba(224, 235, 242, .52); transform: translateY(-1px); }
.tab.active { color: #173a5d; background: linear-gradient(135deg, #edf5fa, #dceaf3); box-shadow: 0 4px 13px rgba(49, 95, 136, .14), inset 0 0 0 1px rgba(82, 121, 158, .18); font-weight: 650; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: 16px; align-items: start; }
#form, .output { min-width: 0; padding: 21px; border: 1px solid rgba(194, 205, 213, .85); border-radius: 18px; background: rgba(255, 254, 250, .9); box-shadow: 0 16px 45px rgba(36, 62, 86, .075), 0 2px 6px rgba(36, 62, 86, .04); transition: box-shadow .3s ease, transform .3s ease; }
#form:hover, .output:hover { box-shadow: 0 20px 52px rgba(36, 62, 86, .105), 0 3px 8px rgba(36, 62, 86, .05); }
.output { position: relative; overflow: hidden; background: linear-gradient(145deg, rgba(239, 246, 249, .94), rgba(227, 238, 244, .92)); border-color: rgba(177, 199, 213, .85); }
.output::before { content: ""; position: absolute; width: 240px; height: 240px; top: -155px; right: -100px; border-radius: 50%; background: radial-gradient(circle, rgba(104, 165, 202, .3), transparent 70%); pointer-events: none; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-title > * { min-width: 0; }
h2 { font-size: 17px; line-height: 1.45; font-weight: 650; margin: 0; }
h3 { font-size: 14px; font-weight: 600; line-height: 1.5; margin: 0 0 10px; }
.text-button { border: 0; background: transparent; color: #3d6285; font-size: 12px; min-height: 36px; padding: 6px 0; line-height: 1.45; }
.text-button:hover { text-decoration: underline; }
.visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mode-switch { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0 0 16px; min-inline-size: 0; }
.mode-choice { position: relative; min-inline-size: 0; max-width: 100%; }
.mode-choice input { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; margin: 0; opacity: 0; cursor: pointer; }
.mode-choice label { display: block; padding: 8px 16px; border: 1px solid #c3ced9; border-radius: 22px; margin: 0; font-size: 12px; text-align: center; overflow-wrap: anywhere; background: rgba(255,255,255,.48); transition: all .2s ease; }
.mode-choice input:checked + label { color: white; border-color: #345575; background: linear-gradient(135deg, #294d70, #3f7197); box-shadow: 0 5px 13px rgba(46,82,124,.2); transform: translateY(-1px); }
.mode-choice input:focus-visible + label { outline: 2px solid #52799e; outline-offset: 3px; }
.mode-hint { margin: 0 0 14px; font-size: 12px; line-height: 1.65; color: var(--muted); }
.office-scenarios { border: 0; min-inline-size: 0; padding: 0; margin: 0 0 15px; }
.office-scenarios legend { padding: 0; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.scenario-options { display: flex; flex-wrap: wrap; gap: 7px; }
.scenario-options button { min-height: 36px; padding: 7px 11px; border: 1px solid #cbd6de; border-radius: 9px; background: #f8faf9; color: #315674; font-size: 12px; line-height: 1.4; text-align: start; max-inline-size: 100%; overflow-wrap: anywhere; transition: background .2s ease, box-shadow .2s ease; }
.scenario-options button:hover { background: #ecf3f7; }
.scenario-options button[aria-pressed="true"] { color: #183c60; border-color: #799cb8; background: #dceaf4; box-shadow: 0 3px 10px #315f881a; }
.scenario-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 500; }
#prompt-label { font-size: 12px; color: var(--muted); }
textarea { display: block; width: 100%; min-height: 178px; padding: 15px; border-radius: 12px; border: 1px solid #bacad6; background: rgba(255,254,250,.92); color: var(--ink); font-size: 15px; line-height: 1.7; resize: vertical; text-align: start; scroll-margin-block-start: var(--header-clearance); transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
textarea::placeholder { color: #7d8a96; }
textarea:focus { border-color: #52799e; background: white; box-shadow: 0 0 0 4px rgba(82,121,158,.11), 0 9px 25px rgba(37,63,96,.06); }
#incoming { min-height: 112px; }
#incoming-wrap { margin-bottom: 14px; }
.counter { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; line-height: 1.5; margin: 7px 0 15px; }
.counter > span:last-child { white-space: nowrap; }
select { min-height: 40px; max-width: 100%; min-width: 0; padding: 7px 11px; border-radius: 9px; border: 1px solid #c4d0d9; color: var(--ink); background: rgba(255,254,250,.86); font-size: 13px; }
#everyday-settings { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin: 0 0 10px; }
#everyday-settings > div { flex: 1; min-width: 130px; }
#everyday-settings select { width: 100%; }
#everyday-settings label, #required-settings label { color: var(--muted); font-size: 11px; }
#required-settings { margin-bottom: 15px; }
#required-settings select { width: 100%; }
#advanced-settings { margin-bottom: 12px; }
summary { cursor: pointer; }
#advanced-settings summary { width: fit-content; min-height: 36px; padding: 8px 0; font-size: 12px; color: #3d6285; }
.check { display: inline-flex; align-items: center; gap: 9px; margin: 0; font-size: 12px; line-height: 1.5; }
.check input { accent-color: #2e527c; width: 17px; height: 17px; flex-shrink: 0; }
#changes-control { min-height: 32px; }
.actions, .result-actions { display: flex; gap: 10px; align-items: stretch; }
.primary, .secondary { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; border-radius: 10px; padding: 11px 15px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.primary { border: 1px solid #294d70; background: linear-gradient(135deg, #274968, #315f88); color: white; font-weight: 580; box-shadow: 0 7px 18px rgba(37,63,96,.16); }
.primary:hover { background: linear-gradient(135deg, #315a7d, #3c719d); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(37,63,96,.22); }
.primary:active, .secondary:active { transform: translateY(1px); }
.secondary { color: #355878; background: rgba(255,255,255,.35); border: 1px solid #b6c9d8; }
.secondary:hover { background: #e5edf2; transform: translateY(-1px); }
#generate { flex: 1; }
#status, #subject-status, #feedback-status { font-size: 12px; line-height: 1.6; margin: 0 0 12px; color: var(--muted); }
#status:empty, #subject-status:empty, #feedback-status:empty { margin: 0; }
.error { color: #9a4034 !important; }
.result-paper { position: relative; background: rgba(255,254,250,.96); border: 1px solid #d6e0e6; border-radius: 13px; padding: 19px; box-shadow: inset 0 1px white, 0 9px 26px rgba(37,63,96,.055); }
#result { font-size: 15px; line-height: 1.78; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 150px; text-align: start; }
#result:not(.placeholder) { animation: result-arrive .42s ease both; }
#result.placeholder { color: #738699; }
.result-actions { flex-wrap: wrap; margin-top: 14px; }
.result-actions > button { flex: 1; }
#source-details { margin-top: 6px; font-size: 12px; }
#source-details summary { padding: 10px 0; min-height: 38px; width: fit-content; }
#source-text { margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.8; max-height: 210px; overflow: auto; background: var(--paper); padding: 14px; border: 1px solid var(--line); border-radius: 7px; text-align: start; }
#review-box { padding: 13px; margin-bottom: 14px; border: 1px solid #dacba9; border-radius: 7px; color: #705b31; background: #fbf6e9; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
#review-notices { padding-inline-start: 20px; }
#review-notices p { margin: 6px 0; }
.output-foot, .subtle { font-size: 11px; line-height: 1.65; color: var(--muted); }
.output-foot { margin-top: 10px; }
#example-preview { padding: 15px; background: var(--paper); border: 1px solid #d6e0e6; border-radius: 8px; }
#example-title { color: var(--muted); font-size: 12px; }
.example-comparison { margin: 0; }
.example-comparison > div { padding: 10px 12px; background: #f4f3ee; border-radius: 6px; margin-bottom: 9px; }
.example-comparison .example-improved { background: #e9f0f5; }
.example-comparison dt { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.example-comparison dd { margin: 0; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.diff-added { background: #d6e8f5; color: #193d5f; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.diff-removed { background: #f4e4df; color: #814638; text-decoration: line-through; }
#diff-legend { display: flex; gap: 14px; font-size: 11px; margin: 12px 0 0; }
#diff-legend > span { padding: 3px 6px; border-radius: 3px; }
#quick-feedback { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 12px; color: #526c83; }
.icon-button { border: 1px solid transparent; border-radius: 6px; background: transparent; color: #526c83; min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.icon-button:hover, .icon-button[aria-pressed="true"] { background: #d9e6ee; border-color: #b4c7d5; }
#feedback-form, #subject-panel { margin-top: 14px; background: var(--paper); border: 1px solid #cbd9e2; border-radius: 8px; padding: 16px; }
#feedback-form { scroll-margin-block-start: var(--header-clearance); }
#feedback-feature { margin: 0 0 12px; font-size: 12px; color: var(--muted); }
#feedback-rating { width: 100%; margin-bottom: 14px; }
#feedback-comment { min-height: 95px; }
#feedback-status { margin-top: 12px; }
#subject-list { list-style: none; padding: 0; margin: 0; }
#subject-list li { display: flex; align-items: start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
#subject-list .subject-text { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.6; font-size: 14px; }
#subject-list button { flex-shrink: 0; }
.scenario-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; padding: 14px 17px; margin-top: 16px; background: rgba(255,254,250,.72); border: 1px solid rgba(202,211,217,.82); border-radius: 14px; box-shadow: 0 7px 24px rgba(37,63,96,.035); }
.scenario-bar h2 { font-size: 13px; }
#example-options { display: flex; flex-wrap: wrap; gap: 9px; }
#example-options button { min-height: 36px; padding: 7px 13px; border: 1px solid transparent; border-radius: 18px; background: #e7edf1; color: #45627c; font-size: 12px; line-height: 1.4; transition: transform .18s ease, background .18s ease; }
#example-options button:hover { transform: translateY(-1px); background: #dfe9ef; }
#example-options button[aria-pressed="true"] { border-color: #93adbf; background: #d6e6ef; box-shadow: 0 4px 12px rgba(49,95,136,.1); }
.faq { margin: 24px 0 0; }
.faq h2 { font-size: 15px; margin-bottom: 8px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { padding: 13px 0; font-size: 13px; line-height: 1.5; }
.faq p { margin: 0 0 14px; font-size: 12px; line-height: 1.8; color: var(--muted); max-width: 800px; }
.membership { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); gap: 16px 26px; align-items: start; margin-top: 24px; padding: 20px 22px; border: 1px solid #cbd9e2; border-radius: 14px; background: #eaf1f5; scroll-margin-block-start: var(--header-clearance); }
.membership p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.membership-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.membership-fields input { flex: 1 1 168px; min-inline-size: 0; max-inline-size: 100%; min-height: 44px; padding: 9px 12px; color: var(--ink); background: var(--paper); border: 1px solid #b6c9d8; border-radius: 9px; }
.membership-fields button { max-inline-size: 100%; }
.membership-consent { margin-top: 9px; }
#membership-status:empty { display: none; }
footer { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 20px 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
footer > p { margin: 0; }
footer details { max-width: 480px; }
footer summary { text-align: end; }
.output, #output-title { scroll-margin-block-start: var(--header-clearance); }
html[dir="rtl"] h1 { letter-spacing: 0; }
@media (max-width: 850px) {
  .shell { padding: 0 20px; }
  .workspace { gap: 12px; }
  #form, .output { padding: 18px; }
  .tab { font-size: 13px; gap: 7px; }
}
@media (max-width: 700px) {
  :root { --header-clearance: 12px; }
  .shell { padding: 0 14px; }
  header { min-height: 64px; gap: 8px; padding: 8px 0; position: relative; }
  .wordmark { font-size: 29px; }
  .brand { gap: 6px; }
  .brand-mark { width: 28px; height: 28px; }
  .header-actions { justify-content: flex-end; flex-wrap: wrap; gap: 2px 8px; }
  .header-actions .text-button, .membership-link { font-size: 11px; text-align: end; }
  .ui-language { gap: 4px; flex-basis: 100%; order: -1; justify-content: flex-end; flex-wrap: wrap; }
  .ui-language label { font-size: 10px; }
  .ui-language select { width: auto; max-width: min(145px, 100%); padding: 5px 8px; font-size: 16px; min-height: 34px; }
  .intro { padding: 18px 0 12px; }
  h1 { font-size: 25px; }
  .intro > p { font-size: 12px; margin-bottom: 6px; }
  .task-tabs { gap: 0; margin-bottom: 14px; }
  .tab { flex-direction: column; gap: 6px; padding: 10px 3px; font-size: 11px; min-height: 64px; }
  .tab .icon { width: 18px; height: 18px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  #form, .output { padding: 16px; }
  h2 { font-size: 16px; }
  .section-title { gap: 8px; margin-bottom: 12px; }
  .mode-choice label { padding: 10px 13px; min-height: 40px; }
  .scenario-options button { min-height: 40px; }
  textarea { min-height: 130px; font-size: 16px; }
  select, #feedback-comment { font-size: 16px; }
  #everyday-settings > div { min-width: 110px; }
  #result { min-height: 0; }
  .result-paper { padding: 15px; }
  .primary, .secondary, .text-button, .icon-button, #source-details summary, #example-options button { min-height: 44px; }
  .scenario-bar { gap: 10px; padding: 14px; margin-top: 14px; }
  .counter { font-size: 9px; }
  .faq { margin-top: 22px; }
  .membership { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .membership-fields input { font-size: 16px; }
  footer { flex-direction: column; gap: 10px; }
  footer summary { text-align: start; }
}
@keyframes result-arrive { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
