:root {
  --ai-paper: #f4f2eb;
  --ai-ink: #171714;
  --ai-muted: #6c6a62;
  --ai-line: #d3d0c5;
  --ai-card: #fbfaf6;
  --ai-accent: #1c5a43;
  --ai-risk: #9e3f2e;
}

* { box-sizing: border-box; }
.ai-page-body { margin: 0; background: var(--ai-paper); color: var(--ai-ink); font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif; }
.ai-page-body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .18; background-image: repeating-linear-gradient(0deg, transparent 0, transparent 31px, rgba(23,23,20,.055) 32px); }
.ai-shell { position: relative; width: min(1420px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 44px; }
.ai-topbar { min-height: 76px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; border-bottom: 1px solid var(--ai-ink); }
.ai-topbar .brand { justify-self: start; }
.ai-topbar .desk-nav { justify-self: center; }
.ai-service-state { justify-self: end; display: flex; align-items: center; gap: 8px; color: var(--ai-muted); font-size: 12px; }
.ai-service-state i { width: 7px; height: 7px; border-radius: 50%; background: #aaa79d; }
.ai-service-state.ready i { background: var(--ai-accent); box-shadow: 0 0 0 4px rgba(28,90,67,.1); }
.ai-service-state.error i { background: var(--ai-risk); }

.ai-hero { display: grid; grid-template-columns: minmax(0, 1fr) 420px; align-items: end; gap: 64px; padding: 62px 0 42px; }
.ai-kicker { display: block; margin-bottom: 15px; color: var(--ai-accent); font: 700 11px/1.2 "SFMono-Regular", Consolas, monospace; letter-spacing: .16em; }
.ai-hero h1 { margin: 0; font-family: "Songti SC", "STSong", Georgia, serif; font-size: clamp(50px, 6vw, 88px); font-weight: 600; line-height: .96; letter-spacing: -.055em; }
.ai-hero p { max-width: 690px; margin: 25px 0 0; color: #4f4d47; font-size: 16px; line-height: 1.8; }
.ai-contract { margin: 0; border-top: 1px solid var(--ai-ink); }
.ai-contract div { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--ai-line); }
.ai-contract dt { color: var(--ai-muted); font-size: 12px; }
.ai-contract dd { margin: 0; font-size: 12px; font-weight: 650; }

.ai-config-notice { display: flex; align-items: center; gap: 18px; min-height: 52px; padding: 12px 16px; border: 1px solid #c5bda7; background: #ece7d8; }
.ai-config-notice b { font-size: 13px; }
.ai-config-notice span { color: var(--ai-muted); font-size: 12px; }
.ai-config-notice.ready { border-color: #aac6ba; background: #e6eee9; }
.ai-config-notice.blocked { border-color: #d7bcb3; background: #f3e7e2; }

.ai-workbench { display: grid; grid-template-columns: minmax(360px, .78fr) minmax(520px, 1.22fr); min-height: 720px; margin-top: 18px; border: 1px solid var(--ai-ink); background: var(--ai-card); }
.ai-controls { padding: 34px; border-right: 1px solid var(--ai-ink); }
.ai-section-label { display: flex; align-items: center; gap: 11px; margin-bottom: 17px; }
.ai-section-label span { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--ai-ink); border-radius: 50%; font: 700 10px "SFMono-Regular", monospace; }
.ai-section-label b { font-family: "Songti SC", "STSong", Georgia, serif; font-size: 18px; }
.question-label { margin-top: 29px; padding-top: 26px; border-top: 1px solid var(--ai-line); }
.ai-kind-tabs { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 21px; border: 1px solid var(--ai-line); }
.ai-kind-tabs button { min-height: 42px; border: 0; border-right: 1px solid var(--ai-line); background: transparent; color: var(--ai-muted); cursor: pointer; font: inherit; font-size: 12px; }
.ai-kind-tabs button:last-child { border-right: 0; }
.ai-kind-tabs button.active { background: var(--ai-ink); color: #fff; }
.ai-field { display: grid; gap: 8px; margin-top: 15px; }
.ai-field > span { color: #4f4d47; font-size: 12px; font-weight: 650; }
.ai-field small { color: #8b887f; font-weight: 400; }
.ai-field input, .ai-field select, .ai-field textarea { width: 100%; border: 1px solid var(--ai-line); border-radius: 0; outline: none; background: #fff; color: var(--ai-ink); font: 13px/1.6 "Avenir Next", "PingFang SC", sans-serif; }
.ai-field input, .ai-field select { height: 46px; padding: 0 12px; }
.ai-field textarea { padding: 11px 12px; resize: vertical; }
.ai-field input:focus, .ai-field select:focus, .ai-field textarea:focus { border-color: var(--ai-ink); box-shadow: 0 0 0 1px var(--ai-ink); }
.ai-evidence-preview { min-height: 98px; margin-top: 17px; padding: 14px; border-left: 3px solid var(--ai-line); background: #efede6; }
.ai-evidence-preview > span { display: block; margin-bottom: 7px; color: var(--ai-muted); font: 700 10px "SFMono-Regular", monospace; letter-spacing: .08em; text-transform: uppercase; }
.ai-evidence-preview p { margin: 0; color: #4f4d47; font-size: 12px; line-height: 1.65; }
.ai-evidence-preview dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 18px; margin: 0; }
.ai-evidence-preview dl div { min-width: 0; }
.ai-evidence-preview dt { color: var(--ai-muted); font-size: 10px; }
.ai-evidence-preview dd { overflow: hidden; margin: 2px 0 0; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.access-field { margin-top: 19px; }
.ai-submit { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between; margin-top: 19px; border: 1px solid var(--ai-ink); background: var(--ai-ink); padding: 0 18px; color: #fff; cursor: pointer; font: 650 14px "Avenir Next", sans-serif; }
.ai-submit:disabled { border-color: #aaa79d; background: #aaa79d; cursor: not-allowed; }
.ai-submit:not(:disabled):hover { background: var(--ai-accent); border-color: var(--ai-accent); }
.ai-submit i { font-style: normal; font-size: 21px; }
.ai-form-footnote { margin: 10px 0 0; color: var(--ai-muted); font-size: 10px; line-height: 1.5; }

.ai-result-panel { min-width: 0; padding: 34px 38px; }
.ai-result-empty { display: grid; min-height: 620px; place-content: center; text-align: center; }
.ai-result-empty > span { color: var(--ai-muted); font: 700 10px "SFMono-Regular", monospace; letter-spacing: .18em; }
.ai-result-empty h2 { margin: 18px 0 8px; font-family: "Songti SC", "STSong", Georgia, serif; font-size: 29px; font-weight: 500; }
.ai-result-empty p { max-width: 440px; margin: 0 auto; color: var(--ai-muted); font-size: 13px; line-height: 1.7; }
.empty-axis { width: 300px; height: 76px; display: grid; grid-template-columns: repeat(4, 1fr); align-items: end; gap: 4px; margin: 40px auto 0; border-bottom: 1px solid var(--ai-line); }
.empty-axis i { display: block; background: #d8d5ca; }
.empty-axis i:nth-child(1) { height: 31%; }.empty-axis i:nth-child(2) { height: 68%; }.empty-axis i:nth-child(3) { height: 46%; }.empty-axis i:nth-child(4) { height: 83%; }
.ai-loading { min-height: 620px; place-content: center; text-align: center; }
.ai-loading:not(.hidden) { display: grid; }
.ai-loading i { width: 34px; height: 34px; margin: 0 auto 18px; border: 1px solid var(--ai-line); border-top-color: var(--ai-ink); border-radius: 50%; animation: ai-spin .85s linear infinite; }
.ai-loading b { font-family: "Songti SC", "STSong", Georgia, serif; font-size: 22px; }
.ai-loading span { margin-top: 8px; color: var(--ai-muted); font-size: 12px; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--ai-ink); }
.result-head span { color: var(--ai-muted); font-size: 11px; }
.result-head h2 { margin: 7px 0 0; font-family: "Songti SC", "STSong", Georgia, serif; font-size: clamp(34px, 4vw, 54px); font-weight: 600; letter-spacing: -.04em; }
.result-head time { color: var(--ai-muted); font: 10px "SFMono-Regular", monospace; white-space: nowrap; }
.result-summary { margin: 24px 0; font-family: "Songti SC", "STSong", Georgia, serif; font-size: 18px; line-height: 1.8; }
.result-scores { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--ai-line); }
.result-score { min-width: 0; padding: 16px; border-right: 1px solid var(--ai-line); }
.result-score:last-child { border-right: 0; }
.result-score span { color: var(--ai-muted); font-size: 10px; }
.result-score b { display: block; margin: 5px 0 9px; font: 600 28px "SFMono-Regular", Consolas, monospace; }
.result-score i { display: block; height: 3px; background: #dedbd1; }
.result-score i em { display: block; height: 100%; background: var(--ai-accent); }
.result-score.risk i em { background: var(--ai-risk); }
.result-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 28px; border-top: 1px solid var(--ai-line); border-left: 1px solid var(--ai-line); }
.result-sections section { min-height: 180px; padding: 20px; border-right: 1px solid var(--ai-line); border-bottom: 1px solid var(--ai-line); }
.result-sections h3 { margin: 0 0 13px; font-size: 12px; letter-spacing: .08em; }
.result-sections ul, .result-sections ol { margin: 0; padding-left: 18px; }
.result-sections li { margin: 0 0 8px; color: #4f4d47; font-size: 12px; line-height: 1.55; }
.result-sections .risk h3 { color: var(--ai-risk); }
.result-foot { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 22px; color: var(--ai-muted); font: 10px "SFMono-Regular", monospace; }
.result-foot b { margin-left: auto; color: var(--ai-ink); }
.ai-page-footer { display: grid; grid-template-columns: 250px 1fr; gap: 40px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--ai-ink); }
.ai-page-footer span { font-family: "Songti SC", "STSong", Georgia, serif; font-size: 17px; }
.ai-page-footer p { max-width: 760px; margin: 0; color: var(--ai-muted); font-size: 12px; line-height: 1.7; }

@media (max-width: 980px) {
  .ai-shell { width: min(100% - 28px, 760px); }
  .ai-topbar { grid-template-columns: 1fr auto; padding: 12px 0; }
  .ai-topbar .desk-nav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; overflow-x: auto; }
  .ai-service-state { grid-column: 2; grid-row: 1; }
  .ai-hero { grid-template-columns: 1fr; gap: 32px; padding: 42px 0 30px; }
  .ai-workbench { grid-template-columns: 1fr; }
  .ai-controls { border-right: 0; border-bottom: 1px solid var(--ai-ink); }
}

@media (max-width: 620px) {
  .ai-shell { width: 100%; padding: 0 14px 30px; }
  .ai-topbar .brand em { display: none; }
  .ai-service-state span { max-width: 90px; text-align: right; }
  .ai-hero h1 { font-size: 52px; }
  .ai-kind-tabs { grid-template-columns: repeat(2, 1fr); }
  .ai-kind-tabs button:nth-child(2) { border-right: 0; }
  .ai-kind-tabs button:nth-child(-n+2) { border-bottom: 1px solid var(--ai-line); }
  .ai-controls, .ai-result-panel { padding: 24px 18px; }
  .result-scores { grid-template-columns: repeat(2, 1fr); }
  .result-score:nth-child(2) { border-right: 0; }
  .result-score:nth-child(-n+2) { border-bottom: 1px solid var(--ai-line); }
  .result-sections { grid-template-columns: 1fr; }
  .ai-page-footer { grid-template-columns: 1fr; gap: 8px; }
}
