:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #e5e7ef;
  --primary: #2257f5;
  --primary-dark: #183fc0;
  --danger: #d92d20;
  --shadow: 0 18px 50px rgba(24, 39, 75, .08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); word-break: break-all; }
.topbar { display: flex; justify-content: space-between; gap: 24px; padding: 28px 36px; background: linear-gradient(135deg, #10225f, #245cf5); color: #fff; align-items: flex-start; }
.eyebrow { margin: 0 0 8px; opacity: .75; letter-spacing: .12em; font-size: 13px; text-transform: uppercase; }
h1 { margin: 0; font-size: 30px; line-height: 1.2; }
.subtitle { max-width: 760px; margin: 10px 0 0; opacity: .85; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; min-width: 420px; }
input, button, .button { border: 0; border-radius: 12px; padding: 11px 14px; font: inherit; }
input { min-width: 250px; background: rgba(255,255,255,.95); color: var(--text); }
button, .button { cursor: pointer; background: #fff; color: var(--primary-dark); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; }
.button.ghost { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.button.danger { color: #fff; background: rgba(217,45,32,.9); }
.notice, .letter-card { margin: 22px 36px; background: #fff8e8; border: 1px solid #fedf89; padding: 16px 18px; border-radius: 16px; color: #5f3b00; }
.grid { display: grid; grid-template-columns: 1fr; gap: 18px; padding: 0 36px 28px; }
.param-card, .letter-card { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 20px; overflow: hidden; }
.param-card { padding: 20px; }
.card-head { display: flex; gap: 12px; align-items: center; }
.badge { background: #eef4ff; color: var(--primary); border: 1px solid #c7d7fe; border-radius: 999px; padding: 6px 10px; font-weight: 800; }
h2 { margin: 0; font-size: 21px; }
.summary { color: var(--muted); margin: 10px 0 16px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; background: #fff; min-width: 880px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f8faff; color: #344054; font-size: 14px; }
tr:last-child td { border-bottom: 0; }
td:first-child { width: 64px; color: var(--muted); font-weight: 700; }
td:nth-child(2) { width: 220px; }
.letter-card { color: var(--text); padding: 22px; background: #fff; }
.letter-card p, .letter-card li { color: #344054; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at top left, #dbe7ff, transparent 35%), linear-gradient(135deg, #0f1c4d, #245cf5); padding: 20px; }
.login-card { width: min(440px, 100%); background: #fff; border-radius: 24px; box-shadow: 0 28px 90px rgba(0,0,0,.25); padding: 32px; }
.brand-mark { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: #eef4ff; color: var(--primary); font-weight: 900; margin-bottom: 16px; }
.muted, .hint { color: var(--muted); }
.login-form { display: grid; gap: 14px; margin-top: 20px; }
.login-form label { display: grid; gap: 7px; color: #344054; font-weight: 700; }
.login-form input { border: 1px solid var(--line); min-width: auto; background: #fff; }
.login-form button { justify-content: center; background: var(--primary); color: #fff; margin-top: 6px; }
.error { color: var(--danger); margin: 0; }
.hint { font-size: 13px; line-height: 1.5; }
@media (max-width: 900px) {
  .topbar { flex-direction: column; padding: 22px; }
  .actions { min-width: 0; justify-content: flex-start; }
  input { min-width: 100%; }
  .notice, .letter-card { margin: 16px; }
  .grid { padding: 0 16px 22px; }
}
@media print {
  .actions, .notice .button, .button.danger { display: none !important; }
  body { background: #fff; }
  .topbar { color: #000; background: #fff; padding: 0 0 16px; }
  .grid, .notice, .letter-card { padding: 0; margin: 0 0 16px; }
  .param-card, .letter-card, .notice { box-shadow: none; break-inside: avoid; }
}
select { border: 0; border-radius: 12px; padding: 11px 14px; font: inherit; min-width: 150px; background: rgba(255,255,255,.95); color: var(--text); }
.panel { margin: 0 36px 22px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 20px; padding: 20px; }
.section-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.section-title p { margin: 0; color: var(--muted); }
.overview-table { min-width: 1050px; }
.small-muted { color: var(--muted); font-size: 12px; margin-top: 4px; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; margin: 2px; background: #f2f4f7; color: #344054; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.good { background: #ecfdf3; color: #027a48; }
.pill.blue { background: #eef4ff; color: #2257f5; }
.pill.gray { background: #f2f4f7; color: #667085; }
.pill.bad { background: #fef3f2; color: #b42318; }
.editor-dialog { width: min(1100px, 94vw); height: min(760px, 88vh); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 30px 100px rgba(0,0,0,.3); }
.editor-dialog::backdrop { background: rgba(15, 23, 42, .55); }
.editor-head, .editor-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.editor-head h2, .editor-head p { margin: 0; }
.editor-head p { color: var(--muted); margin-top: 4px; }
#jsonEditor { width: 100%; height: calc(100% - 150px); border: 0; padding: 18px 20px; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; outline: none; resize: none; }
.editor-actions { border-top: 1px solid var(--line); border-bottom: 0; justify-content: flex-end; }
button:disabled { opacity: .6; cursor: wait; }
@media (max-width: 900px) { .panel { margin: 0 16px 16px; } select { min-width: 100%; } }
@media print { .panel { margin: 0 0 16px; box-shadow: none; } dialog { display: none; } }
.stats { display:grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 14px; margin: 22px 36px; }
.stat { background:#fff; border:1px solid var(--line); border-radius:18px; padding:16px; box-shadow:var(--shadow); }
.stat strong { display:block; font-size:26px; color:var(--primary-dark); }
.stat span { color:var(--muted); font-size:13px; }
.pill.warn { background:#fff8e8; color:#b54708; }
.row-risk-high td { background:#fff7f7; }
.public-page .actions { min-width: 520px; }
@media (max-width: 900px) { .stats { grid-template-columns: 1fr 1fr; margin:16px; } .public-page .actions { min-width:0; } }
@media print { .stats { margin:0 0 16px; } }
.content-advice { display:grid; gap:8px; background:#f8faff; border:1px solid var(--line); border-radius:14px; padding:12px 14px; margin: 0 0 16px; color:#344054; }
.content-advice b { color: var(--text); }
