* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f4f6f8; color: #1c2b33; font-size: 15px; line-height: 1.6;
}
.hidden { display: none !important; }
.muted { color: #7a8a93; }
.err { color: #c0392b; min-height: 1.2em; }

.login { position: fixed; inset: 0; background: #eef2f5; display: flex; align-items: center; justify-content: center; z-index: 50; }
.login-card { background: #fff; border-radius: 14px; padding: 32px 26px; width: min(92vw, 380px); box-shadow: 0 6px 30px rgba(0,0,0,.08); }
.login-card h1 { font-size: 22px; margin: 0 0 6px; }
.login-card input { width: 100%; padding: 12px; font-size: 16px; border: 1px solid #d5dde2; border-radius: 10px; margin: 14px 0; }

.topbar { background: #1f6f8b; color: #fff; padding: 14px 16px; position: sticky; top: 0; z-index: 10; }
.topbar .title { font-size: 18px; font-weight: 600; }
.topbar .subtitle { font-size: 12px; opacity: .85; }

.tabs { display: flex; overflow-x: auto; background: #fff; border-bottom: 1px solid #e2e8ec; position: sticky; top: 56px; z-index: 9; -webkit-overflow-scrolling: touch; }
.tabs button { flex: 0 0 auto; padding: 12px 14px; border: 0; background: none; font-size: 14px; color: #56707d; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.on { color: #1f6f8b; border-bottom-color: #1f6f8b; font-weight: 600; }

.view { max-width: 860px; margin: 0 auto; padding: 14px 12px 80px; }

.card { background: #fff; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

.kv { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed #edf1f3; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: #7a8a93; flex: 0 0 auto; }
.kv .v { text-align: right; word-break: break-all; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; margin-right: 4px; }
.badge.green { background: #e6f6ec; color: #1e7d43; }
.badge.red { background: #fdecea; color: #b3261e; }
.badge.amber { background: #fff6e0; color: #8a6d00; }
.badge.blue { background: #e8f1fb; color: #1c5c9e; }
.badge.gray { background: #eef1f3; color: #607680; }

.btn { border: 1px solid #cfd9de; background: #fff; color: #1c2b33; border-radius: 10px; padding: 8px 14px; font-size: 14px; cursor: pointer; }
.btn.primary { background: #1f6f8b; border-color: #1f6f8b; color: #fff; }
.btn.danger { color: #b3261e; border-color: #f0c6c2; }
.btn.ghost { border: 0; background: none; font-size: 16px; }
.btn.block { width: 100%; padding: 12px; font-size: 16px; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { border-bottom: 1px solid #edf1f3; padding: 6px 6px; text-align: left; vertical-align: top; }
table.data th { color: #7a8a93; font-weight: 500; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal-card { background: #fff; width: min(100vw, 640px); max-height: 88vh; overflow-y: auto; border-radius: 16px 16px 0 0; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid #edf1f3; font-weight: 600; position: sticky; top: 0; background: #fff; }
.modal-body { padding: 14px 16px 24px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: #56707d; margin-bottom: 4px; }
.field input, .field textarea, .field select { width: 100%; padding: 10px; font-size: 15px; border: 1px solid #d5dde2; border-radius: 8px; font-family: inherit; }
.field textarea { min-height: 72px; }

.timeline-item { border-left: 3px solid #1f6f8b; padding: 2px 0 14px 14px; position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -7px; top: 8px; width: 11px; height: 11px; border-radius: 50%; background: #1f6f8b; }
.timeline-item .d { font-size: 13px; color: #1f6f8b; font-weight: 600; }
.timeline-item .t { font-weight: 600; }

.scenario { border-left: 4px solid #e2a03f; }
.scenario .row { padding: 3px 0; }
.scenario .lbl { color: #7a8a93; display: inline-block; min-width: 64px; }

.doc-content { white-space: pre-wrap; font-size: 14px; line-height: 1.8; }
.spark { display: block; }

.alert-strip { background: #fff6e0; border-left: 4px solid #e2a03f; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.principle-strip { background: #fdecea; border-left: 4px solid #b3261e; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .view { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
}
