:root {
    --ink: #0f172a;
    --muted: #475569;
    --paper: #f1f5f9;
    --card: #ffffff;
    --line: #cbd5e1;
    --pine: #2563eb;
    --pine-dark: #1e40af;
    --mint: #dbeafe;
    --coral: #0e7490;
    --shadow: 0 18px 50px rgba(15, 23, 42, .14);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
a { color: inherit; text-underline-offset: 3px; }
button, textarea, select, input { font: inherit; }
button, select { cursor: pointer; }
.site-header { height: 76px; padding: 0 clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(241,245,249,.94); }
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.brand-mark, .avatar { display: grid; place-items: center; background: var(--pine); color: white; font-weight: 800; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px 13px 13px 4px; }
.brand span:last-child { display: grid; gap: 2px; }
.brand small { color: var(--muted); font-size: 12px; }
nav { display: flex; gap: 26px; font-size: 14px; }
nav a { text-decoration: none; color: var(--muted); }
nav a:hover { color: var(--pine); }
.app-shell { min-height: calc(100vh - 130px); display: grid; grid-template-columns: minmax(280px, .72fr) minmax(520px, 1.28fr); gap: clamp(18px, 3vw, 44px); padding: clamp(24px, 4vw, 56px) clamp(20px, 5vw, 76px); }
.scope-panel { align-self: center; max-width: 520px; }
.eyebrow { color: var(--coral); font-weight: 800; letter-spacing: .18em; font-size: 12px; }
h1 { font-size: clamp(35px, 4vw, 58px); line-height: 1.12; margin: 14px 0 18px; letter-spacing: -.04em; }
.scope-panel > p { color: var(--muted); line-height: 1.9; font-size: 16px; }
.scope-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 24px 0; }
.scope-grid span { border: 1px solid var(--line); border-radius: 99px; padding: 9px 13px; text-align: center; background: rgba(255,255,255,.52); font-size: 13px; }
.notice-card { border-left: 4px solid var(--coral); padding: 15px 17px; background: #ecfeff; border-radius: 0 12px 12px 0; }
.notice-card p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.public-records { font-size: 12px; color: var(--muted); margin-top: 20px; }
.public-records div { display: grid; grid-template-columns: 72px 1fr; margin: 7px 0; }
.public-records dt { font-weight: 700; color: var(--ink); }
.public-records dd { margin: 0; overflow-wrap: anywhere; }
.chat-panel { min-height: 620px; max-height: 760px; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; }
.chat-toolbar { display: flex; align-items: center; gap: 10px; padding: 18px 22px 8px; }
.chat-toolbar > div { margin-right: auto; font-size: 13px; font-weight: 700; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 5px #dcfce7; }
.chat-toolbar label { color: var(--muted); font-size: 12px; }
select, input, dialog textarea { border: 1px solid var(--line); border-radius: 10px; background: white; padding: 9px 11px; color: var(--ink); }
.provider-detail { margin: 0; padding: 0 22px 13px; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--line); }
.messages { flex: 1; overflow-y: auto; padding: 24px 22px; display: flex; flex-direction: column; gap: 20px; scroll-behavior: smooth; }
.message { display: flex; gap: 11px; max-width: 86%; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.avatar { flex: 0 0 32px; height: 32px; border-radius: 10px 10px 10px 3px; font-size: 12px; }
.user .avatar { background: #e2e8f0; color: var(--ink); border-radius: 10px 10px 3px 10px; }
.message-body { min-width: 0; }
.message-body > p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 0; padding: 13px 15px; background: #eff6ff; border-radius: 5px 16px 16px 16px; line-height: 1.75; font-size: 14px; }
.user .message-body > p { background: var(--pine); color: white; border-radius: 16px 5px 16px 16px; }
.message-meta { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.user .message-meta { justify-content: flex-end; }
.ai-badge { display: inline-flex; align-items: center; border-radius: 5px; padding: 2px 6px; background: #e0f2fe; color: #075985; font-size: 10px; font-weight: 800; }
.message-actions { display: flex; gap: 11px; margin-top: 7px; }
.message-actions button, .link-button { border: 0; padding: 0; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 11px; }
.composer { margin: 0 18px 10px; border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: white; box-shadow: 0 4px 18px rgba(15,23,42,.08); }
.composer textarea { width: 100%; resize: none; border: 0; outline: 0; min-height: 64px; color: var(--ink); }
.composer-foot { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.composer-foot button, .primary-button { border: 0; border-radius: 10px; background: var(--pine); color: white; padding: 10px 19px; font-weight: 700; }
.composer-foot button:disabled { opacity: .55; cursor: wait; }
.consent { display: block; color: var(--muted); font-size: 10px; margin-top: 7px; line-height: 1.5; }
.consent input { vertical-align: middle; margin: 0 5px 0 0; padding: 0; }
.global-aigc-label { margin: 0 20px 14px; text-align: center; color: var(--muted); font-size: 11px; }
.site-footer { min-height: 54px; padding: 14px clamp(20px, 4vw, 64px); display: flex; gap: 26px; align-items: center; justify-content: center; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
dialog { width: min(520px, calc(100vw - 30px)); border: 0; border-radius: 20px; padding: 0; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(15,23,42,.55); backdrop-filter: blur(3px); }
dialog form { padding: 24px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { margin: 0 0 16px; }
.dialog-head button { border: 0; background: transparent; font-size: 28px; }
dialog label { display: grid; gap: 6px; margin: 12px 0; color: var(--muted); font-size: 12px; }
dialog textarea { min-height: 100px; resize: vertical; }
.form-status { min-height: 20px; font-size: 12px; color: var(--pine); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.legal-shell { width: min(900px, calc(100% - 40px)); margin: 42px auto 70px; }
.legal-shell article { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: clamp(24px, 5vw, 56px); box-shadow: var(--shadow); }
.legal-shell h1 { font-size: clamp(30px, 5vw, 48px); }
.legal-shell h2 { margin-top: 34px; color: var(--pine); }
.legal-shell p, .legal-shell li { color: #334155; line-height: 1.9; }
.legal-meta { color: var(--muted); font-size: 12px; }
.compliance-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.compliance-table th, .compliance-table td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compliance-table th { color: var(--pine); }
@media (max-width: 900px) {
    .site-header { height: auto; padding-top: 14px; padding-bottom: 14px; }
    nav { display: none; }
    .app-shell { grid-template-columns: 1fr; padding-top: 28px; }
    .scope-panel { max-width: none; }
    h1 { font-size: 38px; }
    .chat-panel { min-height: 650px; max-height: none; }
    .site-footer { flex-wrap: wrap; gap: 10px 20px; }
}
@media (max-width: 560px) {
    .scope-grid, .public-records { display: none; }
    .chat-toolbar { align-items: flex-start; flex-wrap: wrap; }
    .chat-toolbar > div { width: 100%; }
    .message { max-width: 96%; }
    .composer { margin-left: 10px; margin-right: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
