:root {
  color-scheme: light;
  --bg: #f7f9fb;
  --surface: #fff;
  --ink: #1c2a3b;
  --muted: #5b6879;
  --line: #d8e0e9;
  --input-line: #8592a3;
  --primary: #2163d6;
  --primary-hover: #194eab;
  --primary-soft: #edf4ff;
  --danger: #b42318;
  --danger-soft: #fff2f0;
  --focus: #2163d6;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, textarea { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
.assistant { width: 100%; max-width: 520px; min-width: 0; margin: 0 auto; padding: 20px 16px max(16px, env(safe-area-inset-bottom)); }
.header { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.identity { display: flex; gap: 10px; align-items: center; }
.app-mark { width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.app-mark svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
h1 { font-size: 19px; font-weight: 650; letter-spacing: -.35px; line-height: 1.35; margin: 0 0 3px; }
.subtitle { color: var(--muted); margin: 0; font-size: 12px; }
.session-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; }
.session-status { font-size: 12px; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.session-status.verified { color: #2b674c; }
.agent-label { color: var(--muted); font-size: 11px; white-space: nowrap; padding: 2px 7px; border: 1px solid var(--line); border-radius: 4px; }
.label-row, .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.label-row label, .section-heading h2 { font-size: 14px; font-weight: 600; margin: 0; }
.field-tag { color: var(--muted); font-size: 11px; }
textarea { display: block; width: 100%; min-width: 0; border: 1px solid var(--input-line); border-radius: 7px; padding: 10px 11px; background: var(--surface); color: var(--ink); font-size: 14px; line-height: 1.65; resize: vertical; min-height: 84px; transition: border-color 150ms; }
textarea::placeholder { color: #647287; opacity: 1; }
textarea:disabled { background: #f0f3f7; color: var(--muted); }
textarea[aria-invalid="true"] { border-color: var(--danger); }
textarea:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
#customer-message { min-height: 137px; }
.field-footer { display: flex; align-items: flex-start; gap: 12px; margin-top: 7px; justify-content: space-between; }
.hint { color: var(--muted); font-size: 12px; margin: 0; }
.character-count { font-size: 11px; color: var(--muted); white-space: nowrap; padding-top: 1px; }
.field-error { color: var(--danger); font-size: 12px; margin: 5px 0 0; }
.context-details { margin-top: 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 7px; }
summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-height: 44px; gap: 8px; list-style: none; font-size: 13px; font-weight: 500; padding: 10px 11px; }
summary::-webkit-details-marker { display: none; }
summary svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--muted); stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 150ms; }
details[open] > summary svg { transform: rotate(180deg); }
.optional { font-size: 12px; color: var(--muted); font-weight: 400; }
.context-body { padding: 0 11px 11px; }
.context-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.context-body .hint { margin-top: 6px; }
.actions { display: flex; gap: 8px; margin-top: 14px; }
.button { min-height: 44px; border-radius: 7px; border: 1px solid transparent; padding: 10px 14px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 550; line-height: 1.4; transition: background-color 150ms, border-color 150ms, color 150ms; }
.button-primary { flex: 1; background: var(--primary); color: #fff; }
.button-primary:hover { background: var(--primary-hover); }
.button-primary:disabled { color: #fff; background: #7488a8; }
.button svg { height: 17px; width: 17px; flex: 0 0 auto; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.button-secondary { background: var(--surface); border-color: var(--input-line); color: var(--ink); }
.button-secondary:hover { background: #edf1f6; }
.button:active { filter: brightness(.94); }
#clear-button { min-width: 68px; }
.spinner { border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; width: 16px; height: 16px; border-radius: 50%; animation: spin 850ms linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.generation-status { font-size: 12px; color: var(--muted); margin: 10px 0 0; overflow-wrap: anywhere; }
.notice { margin: 12px 0; padding: 11px 12px; border-radius: 7px; font-size: 13px; border: 1px solid var(--line); background: var(--surface); overflow-wrap: anywhere; }
.notice p { margin: 0 0 8px; }
.notice-error { background: var(--danger-soft); border-color: #e7aaa4; color: var(--danger); }
.auth-panel { margin-bottom: 18px; }
.empty-state { text-align: center; margin-top: 23px; padding: 21px 12px; border: 1px dashed #c5cfdd; border-radius: 8px; }
.empty-state svg { stroke: #738298; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; width: 26px; height: 26px; margin-bottom: 7px; }
.empty-state h2 { font-size: 13px; font-weight: 500; margin: 0 0 3px; color: var(--ink); }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }
.result-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
#reply-text { min-height: 174px; }
.result-section > .hint { margin-top: 7px; }
.button-copy { width: 100%; background: var(--primary-soft); border-color: #a9c4ed; color: #1c55b3; margin-top: 12px; }
.button-copy:hover { background: #e0ecff; }
.button-copy:disabled { opacity: .65; }
.copy-status { margin: 7px 0 0; font-size: 12px; color: var(--muted); }
.evidence-details { border-bottom: 1px solid var(--line); margin-top: 9px; }
.evidence-details summary { padding: 10px 0; font-weight: 550; }
.evidence-text { padding-bottom: 12px; color: var(--muted); font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.footer { font-size: 11px; text-align: center; color: var(--muted); margin-top: 17px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 340px) { .assistant { padding-left: 12px; padding-right: 12px; } .field-footer { flex-wrap: wrap; gap: 3px; } h1 { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .spinner { border-color: rgba(255,255,255,.4); border-top-color: #fff; } }
