:root {
  --ink: #172033;
  --muted: #667085;
  --line: #e3e8f1;
  --soft: #f6f8fc;
  --blue: #1664ff;
  --blue-dark: #0d4fd7;
  --purple: #7456ff;
  --green: #00a870;
  --red: #d92d20;
  --amber: #a15c07;
  --shadow: 0 18px 54px rgba(30, 54, 96, .09);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #f8f9fc; font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; line-height: 1.6; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 17px; font-weight: 800; text-decoration: none; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; overflow: hidden; border-radius: 10px; background: #fff; }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 50% 0, #e9efff 0, #f8f9fc 45%); }
.login-card { width: min(480px, 100%); padding: 44px; border: 1px solid rgba(220, 226, 237, .9); border-radius: 24px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.login-card .brand { margin-bottom: 42px; }
.login-card h1 { margin: 0; font-size: 34px; letter-spacing: -.04em; }
.login-card .lead { margin: 12px 0 30px; color: var(--muted); }
label { display: grid; gap: 8px; color: #344054; font-size: 13px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid #dce2ec; border-radius: 11px; outline: 0; background: #fff; color: var(--ink); transition: .2s; }
input, select { min-height: 46px; padding: 0 13px; }
textarea { padding: 11px 13px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,100,255,.1); }
.fine-print { margin: 18px 0 0; color: #98a2b3; font-size: 12px; text-align: center; }
.form-error { min-height: 22px; margin: 5px 0; color: var(--red); font-size: 13px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 19px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 750; text-decoration: none; transition: .2s; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button.primary { color: #fff; background: var(--blue); box-shadow: 0 8px 20px rgba(22,100,255,.2); }
.button.primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.button.secondary { border-color: var(--line); color: #344054; background: #fff; }
.button.wide { width: 100%; }
.text-button { border: 0; padding: 5px; color: var(--muted); background: transparent; cursor: pointer; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1180px)/2)); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.top-actions { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 13px; }
.model-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid #dfe8ff; border-radius: 99px; color: #31589e; background: #f2f6ff; font-weight: 700; }
.model-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(0,168,112,.12); }
.workspace { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 46px 0 80px; }
.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.workspace-heading h1 { margin: 0; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.045em; }
.workspace-heading p:last-child { margin: 8px 0 0; color: var(--muted); }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 278px; align-items: start; gap: 24px; }
.main-column, .result-stack { display: grid; gap: 20px; }
.panel, .guide-panel, .result-card { border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 30px rgba(30,54,96,.04); }
.panel { padding: 28px; }
.panel-heading { display: flex; gap: 14px; margin-bottom: 22px; }
.panel-heading > span { flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--blue); font-size: 13px; font-weight: 800; }
.panel-heading h2 { margin: 0; font-size: 20px; }
.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.upload-box { min-height: 116px; display: flex; justify-content: center; flex-direction: column; padding: 18px; border: 1.5px dashed #b9c6dc; border-radius: 14px; background: #fafbfe; cursor: pointer; }
.upload-box:hover { border-color: var(--blue); background: #f5f8ff; }
.upload-box input { min-height: auto; margin-top: 8px; padding: 8px; border: 0; background: transparent; }
.upload-box small { color: #98a2b3; font-weight: 500; }
.upload-box small.has-files { color: var(--blue); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-actions p { margin: 0; color: var(--muted); font-size: 12px; }
.guide-panel { position: sticky; top: 92px; padding: 24px; }
.guide-panel h3 { margin: 0 0 15px; }
.guide-panel ol { margin: 0; padding-left: 22px; color: #475467; font-size: 13px; }
.guide-panel li { margin: 8px 0; }
.guide-note { display: grid; gap: 2px; margin-top: 22px; padding: 14px; border-radius: 11px; color: #31589e; background: #f1f5ff; }
.guide-note span { color: #667da6; font-size: 12px; }
.notice { margin-bottom: 20px; padding: 13px 16px; border-radius: 11px; font-size: 13px; }
.notice.warning { color: #8a5511; background: #fff4d9; }
.notice.error { color: #b42318; background: #ffebe9; }
.mode-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px; }
.mode-grid label { display: block; cursor: pointer; }
.mode-grid input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mode-grid span { min-height: 92px; display: flex; flex-direction: column; justify-content: center; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.mode-grid small { margin-top: 3px; color: var(--muted); font-weight: 500; line-height: 1.45; }
.mode-grid input:checked + span { border-color: var(--blue); background: #f4f7ff; box-shadow: inset 0 0 0 1px var(--blue); }
.task-fields { padding-top: 4px; }
.loading-panel { min-height: 360px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.loading-panel h2 { margin: 18px 0 4px; }
.loading-panel p { margin: 0; color: var(--muted); }
.spinner { width: 42px; height: 42px; border: 4px solid #dce4f4; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.result-heading h2 { margin: 0; font-size: 30px; }
.result-heading > div:last-child { display: flex; gap: 10px; }
.result-stack { grid-template-columns: 1fr 1fr; }
.result-card { padding: 24px; }
.result-card.wide { grid-column: 1 / -1; }
.result-card.attention { border-color: #f0d6a8; background: #fffdf8; }
.result-card h3 { margin: 0 0 13px; font-size: 18px; }
.result-card p { margin: 0; color: #475467; white-space: pre-wrap; }
.clean-list { margin: 0; padding-left: 20px; color: #475467; }
.clean-list li { margin: 7px 0; }
.empty { color: #98a2b3 !important; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { min-width: 95px; padding: 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #344054; background: #f6f8fc; white-space: nowrap; }
.total-line { margin-top: 14px; text-align: right; }
.risk-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.risk-summary span { display: grid; gap: 2px; place-items: center; padding: 13px; border-radius: 11px; font-size: 12px; }
.risk-summary b { font-size: 24px; }
.risk-high { color: #b42318; background: #fff0ee; }
.risk-medium { color: #9a5b09; background: #fff6e5; }
.risk-low { color: #32715a; background: #eaf8f2; }
.disclaimer { margin-top: 14px !important; color: #98a2b3 !important; font-size: 12px; }
.steps-list { display: grid; gap: 12px; }
.steps-list > div { display: flex; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.steps-list > div > span { flex: 0 0 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--blue); background: #edf3ff; font-weight: 800; }
.steps-list b { display: block; }
.steps-list p { margin-top: 4px; font-size: 13px; }
.warning-text { color: #9a5b09 !important; }
.question-list { display: grid; gap: 12px; }
.question-list article { padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.question-list ol { margin: 8px 0; color: #475467; }
.question-list p { margin-top: 6px; font-size: 13px; }
.question-list small { color: #98a2b3; }
@media (max-width: 920px) { .editor-layout { grid-template-columns: 1fr; } .guide-panel { display: none; } .mode-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .topbar { padding: 0 16px; } .top-actions { gap: 9px; } .model-pill, #user-label { display: none; }
  .workspace { width: min(100% - 24px, 1180px); padding-top: 28px; }
  .workspace-heading, .result-heading { align-items: stretch; flex-direction: column; }
  .workspace-heading h1 { font-size: 31px; } .workspace-heading > .button { align-self: flex-start; }
  .panel, .result-card { padding: 20px; } .form-grid, .result-stack { grid-template-columns: 1fr; }
  .form-grid .full, .result-card.wide { grid-column: auto; }
  .form-actions { align-items: stretch; flex-direction: column; } .form-actions .button { width: 100%; }
  .mode-grid { grid-template-columns: 1fr 1fr; } .login-card { padding: 30px 24px; }
  .result-heading > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
}
