:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #182942;
  background: #f4f7fb;
  font-synthesis: none;
  --border: #d9e1ed;
  --muted: #586a82;
  --blue: #175bcd;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, select, textarea { font: inherit; }
button, select { min-height: 44px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: inherit; }
button { padding: 10px 18px; cursor: pointer; font-size: .9375rem; font-weight: 600; }
button:hover:not(:disabled) { background: #edf3fe; border-color: #9ab6e2; }
button:disabled { color: #748196; background: #f3f5f8; cursor: not-allowed; }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #548cff; outline-offset: 3px; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover { background: #124ba9; }
button.primary span { margin-left: 16px; opacity: .75; }
button.quiet { background: transparent; border-color: transparent; color: var(--muted); }
button.small { padding: 6px 12px; font-size: .875rem; }
[hidden] { display: none !important; }
.site-header, main, .site-footer { width: min(1440px, 100% - 80px); margin-inline: auto; }
.site-header { min-height: 88px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #fff; background: var(--blue); font: 700 20px monospace; }
.privacy-badge { font-size: .875rem; color: #276448; background: #e8f3ed; padding: 8px 12px; border-radius: 24px; white-space: nowrap; }
.privacy-badge span { font-size: .75rem; margin-right: 5px; }
.intro { padding: 34px 0 26px; }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: .875rem; font-weight: 600; letter-spacing: .08em; }
h1 { margin: 0 0 12px; font-size: clamp(1.65rem, 3vw, 2.15rem); letter-spacing: -.025em; }
.intro > p:last-child { margin: 0; color: var(--muted); line-height: 1.7; }
.toolbar, .actions, .options, .result-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar { justify-content: space-between; margin-bottom: 18px; gap: 16px; }
.options { color: var(--muted); font-size: .875rem; }
select { padding: 8px 30px 8px 12px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.editor-panel { min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 16px #162e5105; }
.panel-heading { min-height: 66px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel-heading > label { font-weight: 600; }
.meta { font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
textarea { width: 100%; height: clamp(320px, 47vh, 640px); display: block; resize: vertical; border: 0; outline: none; padding: 20px; background: transparent; color: #233854; font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 1rem; line-height: 1.75; tab-size: 2; border-radius: 0; }
textarea:focus { box-shadow: inset 0 0 0 2px var(--blue); }
textarea[aria-invalid="true"] { box-shadow: inset 0 0 0 2px #ba3636; }
textarea::placeholder { color: #728096; opacity: 1; }
.result-panel { background: #fbfdff; }
.panel-footer { border-top: 1px solid var(--border); padding: 11px 20px; color: var(--muted); font-size: .8125rem; line-height: 1.6; }
.feedback { margin: 16px 0 24px; min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-left: 3px solid #aebcce; background: #eaf0f7; border-radius: 0 6px 6px 0; }
.feedback p { margin: 0; font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; }
.feedback button { flex-shrink: 0; margin-left: auto; }
.feedback[data-kind="success"] { background: #e8f4ec; border-color: #29824b; color: #24623c; }
.feedback[data-kind="error"] { background: #fff0ee; border-color: #bd3939; color: #9c2525; }
.site-footer { border-top: 1px solid var(--border); padding: 20px 0 28px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .8125rem; line-height: 1.6; }
.noscript { color: #9c2525; }
@media (max-width: 760px) {
  .site-header, main, .site-footer { width: calc(100% - 32px); }
  .site-header { min-height: 74px; }
  .intro { padding: 26px 0 22px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  textarea { height: 310px; padding: 16px; }
  .panel-heading { padding-inline: 16px; }
  .toolbar { align-items: flex-start; }
  .feedback { align-items: flex-start; flex-wrap: wrap; }
  .privacy-badge { padding: 7px 9px; font-size: .8125rem; }
}
@media (max-width: 360px) {
  button { padding-inline: 12px; }
  .brand { gap: 8px; }
  .brand-mark { width: 30px; height: 30px; }
  .result-actions { gap: 6px; }
}
