:root {
  --ink: #1d1d1f; --ink-2: #424245; --muted: #6e6e73; --faint: #86868b;
  --line: #e5e5ea; --fill: #f5f5f7; --paper: #ffffff;
  --brand: #c8382e; --brand-soft: #fbeceb; --ok: #2f7d4f; --ok-soft: #eaf5ee; --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.6;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
a { color: inherit; }
button, input, textarea { font: inherit; }
.hidden { display: none !important; }

.eb-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-left)) 10px max(16px, env(safe-area-inset-right));
  background: rgba(255,255,255,.94); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.eb-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.eb-mark { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: #fff; font-weight: 700; font-size: 18px; }
.eb-brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.eb-brand-text strong { font-size: 16px; }
.eb-brand-text span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eb-nav { display: flex; gap: 4px; flex: 0 0 auto; }
.eb-link { padding: 6px 10px; border-radius: 999px; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.eb-link:hover { background: var(--fill); }

.eb-main { max-width: 720px; margin: 0 auto; padding: 18px 16px 80px; }
.eb-loading, .eb-empty { color: var(--muted); text-align: center; padding: 40px 0; }
h1 { font-size: 26px; line-height: 1.25; margin: 6px 0 8px; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 26px 0 10px; }
h3 { font-size: 16px; margin: 0 0 6px; }
.eb-sub { color: var(--muted); margin: 0 0 16px; }
.eb-kicker { color: var(--brand); font-weight: 600; font-size: 13px; margin: 0; }

.eb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 18px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.eb-btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.eb-btn.accent { background: var(--brand); border-color: var(--brand); color: #fff; }
.eb-btn.ghost { border-color: transparent; color: var(--muted); }
.eb-btn:disabled { opacity: .45; cursor: default; }
.eb-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.eb-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; background: #fff; }
.eb-card.soft { background: var(--fill); border-color: transparent; }
.eb-card.brand { background: var(--brand-soft); border-color: transparent; }
.eb-card.ok { background: var(--ok-soft); border-color: transparent; }
.eb-label { font-size: 12px; color: var(--muted); margin: 0 0 2px; }
.eb-pre { white-space: pre-wrap; word-break: break-word; margin: 0; }
.eb-photo { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; margin-top: 10px; border: 1px solid var(--line); }

.eb-list { list-style: none; padding: 0; margin: 0; }
.eb-item { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; text-decoration: none; }
.eb-item:hover { border-color: #c7c7cc; }
.eb-item-title { font-weight: 600; }
.eb-item-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.eb-chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--fill); color: var(--ink-2); margin-right: 6px; }
.eb-chip.due { background: var(--brand); color: #fff; }
.eb-chip.done { background: var(--ok-soft); color: var(--ok); }

.eb-field { display: block; margin: 12px 0; }
.eb-field > span { display: block; font-weight: 600; margin-bottom: 6px; }
.eb-field small { font-weight: 400; color: var(--muted); }
textarea, input[type="text"] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-size: 16px; }
textarea { min-height: 88px; resize: vertical; }
textarea:focus, input:focus { outline: 2px solid rgba(200,56,46,.25); border-color: var(--brand); }
.eb-file { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px dashed #c7c7cc; border-radius: 12px; cursor: pointer; }
.eb-file input { display: none; }
.eb-note { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.eb-warn { font-size: 13px; color: var(--brand); margin: 6px 0 0; }

.eb-steps { display: flex; gap: 6px; margin: 8px 0 14px; }
.eb-steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); display: block; }
.eb-steps i.on { background: var(--brand); }
.eb-chat { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.eb-q, .eb-a { max-width: 88%; padding: 10px 12px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; }
.eb-q { align-self: flex-start; background: var(--fill); }
.eb-a { align-self: flex-end; background: var(--ink); color: #fff; }
.eb-ask { font-size: 18px; font-weight: 600; margin: 8px 0; }

.eb-stage { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.eb-stage-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.eb-stage-state { font-size: 13px; color: var(--muted); }
.eb-stage-state.ready { color: var(--brand); font-weight: 600; }
.eb-stage-state.pass { color: var(--ok); font-weight: 600; }
.eb-history { font-size: 14px; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }
.eb-history p { margin: 2px 0; }
details.eb-adult { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
details.eb-adult summary { cursor: pointer; color: var(--muted); }
.eb-spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: ebspin .9s linear infinite; vertical-align: -2px; }
@keyframes ebspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .eb-spin { animation: none; } }
.eb-toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; max-width: 90vw; z-index: 20; }
