:root {
  color-scheme: light;
  --paper: #f5f7f4;
  --surface: #ffffff;
  --ink: #1b2725;
  --muted: #66736f;
  --line: #dce4df;
  --teal: #1e4e4a;
  --teal-soft: #e6f1ed;
  --coral: #c65c46;
  --amber: #a96823;
  --green: #2f795c;
  --shadow: 0 10px 35px rgba(28, 48, 42, 0.08);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.55; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 72px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: 0; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; color: #fff; background: var(--teal); font-size: 15px; }
.topbar-note { color: var(--muted); font-size: 13px; }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 64px 0 42px; }
.hero-copy { max-width: 680px; }
.eyebrow, .section-kicker { margin: 0 0 10px; color: var(--coral); font-size: 11px; font-weight: 800; letter-spacing: 0.14em; }
.hero h1 { margin: 0; max-width: 680px; font-size: 58px; line-height: 1.08; letter-spacing: 0; }
.hero-lede { margin: 18px 0 0; max-width: 520px; color: var(--muted); font-size: 16px; }
.hero-stamp { display: inline-flex; align-items: center; gap: 9px; padding: 10px 0; color: var(--teal); font-size: 13px; white-space: nowrap; }
.stamp-dot, .preview-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--green); }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 0.86fr); align-items: start; gap: 24px; padding-bottom: 48px; }
.editor-panel, .result-panel { min-width: 0; padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.empty-result { min-height: 380px; display: grid; place-content: center; justify-items: center; padding: 40px 28px; border: 1px dashed #c9d5cf; border-radius: 8px; text-align: center; background: rgba(255, 255, 255, 0.46); }
.empty-result[hidden], .result-panel[hidden] { display: none; }
.empty-mark { color: var(--teal); font-size: 42px; font-weight: 800; line-height: 1; }
.empty-result h2 { margin: 18px 0 4px; font-size: 20px; }
.empty-result p { margin: 0; color: var(--muted); font-size: 14px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.panel-heading h2 { margin: 0; font-size: 24px; line-height: 1.2; }
.text-button { padding: 3px 0; border: 0; color: var(--teal); background: none; font-size: 13px; font-weight: 700; }
.text-button:hover { color: var(--coral); }
.mode-fieldset { min-inline-size: 0; margin: 0 0 24px; padding: 0; border: 0; }
.mode-fieldset legend { margin: 0 0 9px; padding: 0; color: var(--ink); font-size: 14px; font-weight: 700; }
.mode-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mode-option { position: relative; display: flex; min-height: 62px; align-items: center; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfb; cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.mode-option:hover { border-color: #aebdb6; background: #fff; }
.mode-option.is-selected { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.mode-option input { position: absolute; width: 1px; min-height: 0; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; background: transparent; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.mode-option input:focus-visible + .mode-option-copy { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 3px; }
.mode-option-copy { display: grid; gap: 2px; min-width: 0; }
.mode-option-copy strong { color: var(--ink); font-size: 13px; line-height: 1.25; }
.mode-option-copy small { overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.mode-description { min-height: 20px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.field-label { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.field-label span { color: var(--muted); font-size: 11px; font-weight: 500; }
.input-wrap, .textarea-wrap { position: relative; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fbfcfb; outline: none; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
input { min-height: 48px; padding: 12px 72px 12px 14px; }
textarea { resize: vertical; min-height: 140px; padding: 13px 14px 32px; }
input:focus, textarea:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px rgba(30, 78, 74, .12); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--coral); }
.char-count { position: absolute; right: 12px; bottom: 11px; color: #87928e; font-size: 11px; pointer-events: none; }
.input-wrap .char-count { top: 16px; bottom: auto; }
.textarea-wrap { margin-bottom: 18px; }
.image-upload { margin: 0 0 18px; padding: 15px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfb; }
.image-upload-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.image-upload-heading h3 { margin: 0; color: var(--ink); font-size: 14px; }
.image-upload-heading h3 span { color: var(--muted); font-size: 11px; font-weight: 500; }
.image-upload-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.image-count { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.image-dropzone { display: grid; justify-items: center; gap: 3px; min-height: 94px; padding: 16px 12px; border: 1px dashed #b8c9c0; border-radius: 6px; color: var(--teal); background: #fff; cursor: pointer; text-align: center; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.image-dropzone:hover, .image-dropzone.is-dragging { border-color: var(--teal); background: var(--teal-soft); }
.image-dropzone.is-disabled { cursor: wait; opacity: .65; }
.image-dropzone:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
.image-dropzone input { position: absolute; width: 1px; min-height: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; background: transparent; clip: rect(0 0 0 0); clip-path: inset(50%); }
.image-upload-icon { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--teal); border-radius: 50%; font-size: 19px; font-weight: 400; line-height: 1; }
.image-dropzone strong { font-size: 12px; }
.image-dropzone small { color: var(--muted); font-size: 10px; }
.image-upload-status { min-height: 17px; margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.image-upload-status.error { color: var(--coral); }
.image-previews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.image-preview { position: relative; min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.image-preview img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #f1f5f2; }
.image-preview figcaption { overflow: hidden; padding: 5px 24px 5px 6px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.image-remove { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 23px; height: 23px; padding: 0; border: 1px solid rgba(255,255,255,.9); border-radius: 50%; color: #fff; background: rgba(27, 39, 37, .72); font-size: 18px; line-height: 1; }
.image-remove:hover { background: var(--coral); }
.image-privacy-note { margin: 9px 0 0; color: #87928e; font-size: 10px; line-height: 1.45; }
.local-preview { display: flex; align-items: center; gap: 9px; min-height: 38px; margin-top: 2px; padding: 9px 12px; border-radius: 6px; color: var(--muted); background: #f1f5f2; font-size: 12px; }
.local-preview.has-issues { color: #825128; background: #fbf3e8; }
.local-preview.has-issues .preview-dot { background: var(--amber); }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.primary-button, .secondary-button { min-height: 44px; border-radius: 6px; font-weight: 700; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 140px; padding: 0 18px; border: 1px solid var(--teal); color: #fff; background: var(--teal); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(30, 78, 74, .2); }
.primary-button:disabled { cursor: wait; opacity: .64; transform: none; box-shadow: none; }
.button-icon { font-size: 19px; line-height: 1; }
.secondary-button { padding: 0 16px; border: 1px solid var(--line); color: var(--muted); background: #fff; }
.secondary-button:hover { border-color: #aebdb6; color: var(--ink); }
.secondary-button:disabled { cursor: wait; opacity: .6; }
.form-status { color: var(--muted); font-size: 12px; }
.form-status.error { color: var(--coral); }

.result-heading { margin-bottom: 22px; }
.result-meta { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.provider-badge { padding: 4px 8px; border-radius: 4px; color: var(--teal); background: var(--teal-soft); font-size: 11px; font-weight: 700; white-space: nowrap; }
.mode-badge { padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.score-row { display: flex; align-items: center; gap: 20px; padding: 2px 0 26px; border-bottom: 1px solid var(--line); }
.score-ring { --score: 0%; width: 112px; height: 112px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--teal) var(--score), #e6ece8 0); }
.score-inner { width: 88px; height: 88px; display: grid; place-content: center; justify-items: center; border-radius: 50%; background: var(--surface); }
.score-inner strong { font-size: 29px; line-height: 1; }
.score-inner span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.score-copy { min-width: 0; }
.level-label { display: inline-block; margin-bottom: 7px; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 800; }
.level-label[data-level="low"] { color: var(--green); background: #e9f4ed; }
.level-label[data-level="medium"] { color: var(--amber); background: #fbf2e2; }
.level-label[data-level="high"] { color: #a83d32; background: #fae9e5; }
.score-copy p { margin: 0; color: var(--muted); font-size: 13px; }
.result-image-status { margin-top: 6px !important; overflow-wrap: anywhere; }
.result-warning { margin-top: 8px !important; color: var(--amber) !important; }
.report-block { padding: 22px 0 0; }
.block-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.block-heading h3 { margin: 0; font-size: 15px; }
.count-badge { min-width: 23px; padding: 2px 6px; border-radius: 4px; color: var(--muted); background: #eef2ef; font-size: 11px; text-align: center; }
.issues-list { display: grid; gap: 8px; }
.issue-item { padding: 11px 12px; border-left: 3px solid var(--amber); background: #fafbf9; }
.issue-item[data-severity="high"] { border-left-color: var(--coral); }
.issue-item[data-severity="low"] { border-left-color: var(--green); }
.issue-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.severity { color: var(--muted); font-size: 10px; font-weight: 600; }
.issue-detail { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.evidence { margin: 6px 0 0; color: #8c5a2d; font-size: 11px; }
.suggestion { margin: 0; color: var(--muted); font-size: 13px; }
.revised-block { padding-bottom: 4px; }
.revised-text { min-height: 126px; color: #33413d; background: #f8faf8; font-size: 13px; line-height: 1.65; }
.report-footnote { margin: 20px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: #87928e; font-size: 11px; }
.footer { padding: 20px; border-top: 1px solid var(--line); color: #87928e; font-size: 12px; text-align: center; }

@media (max-width: 820px) {
  .topbar { height: 60px; padding: 0 20px; }
  .topbar-note { display: none; }
  main { width: min(100% - 28px, 620px); }
  .hero { align-items: flex-start; flex-direction: column; gap: 18px; padding: 42px 0 28px; }
  .hero h1 { font-size: 44px; }
  .workspace { grid-template-columns: 1fr; gap: 16px; }
  .editor-panel, .result-panel { padding: 22px 18px; }
  .empty-result { min-height: 180px; }
}

@media (max-width: 430px) {
  .hero { padding-top: 32px; }
  .hero h1 { font-size: 38px; }
  .hero-lede { font-size: 14px; }
  .form-actions { align-items: stretch; }
  .primary-button { flex: 1 1 100%; }
  .secondary-button { flex: 0 0 auto; }
  .score-row { align-items: flex-start; }
  .score-ring { width: 96px; height: 96px; }
  .score-inner { width: 76px; height: 76px; }
  .score-inner strong { font-size: 24px; }
  .image-upload { padding: 13px 12px; }
  .image-upload-heading { gap: 8px; }
  .image-upload-heading p { max-width: 230px; }
}
