* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f4f1ea; --card: #fff; --ink: #23262f; --muted: #6b7280;
  --line: #e7e2d6; --accent: #b8862f; --accent-light: #e8c87a;
  --accent-gradient: linear-gradient(135deg,#b8862f 0%,#e8c87a 50%,#b8862f 100%);
  --accent-gradient-hover: linear-gradient(135deg,#a6761f 0%,#d4b25a 50%,#a6761f 100%);
  --pos: #2e7d32; --neg: #c62828; --risk: #f57f17;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(31,35,40,.08);
}
body {
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",SimHei,sans-serif;
  background:
    radial-gradient(1200px 600px at 85% -5%, rgba(232,200,122,.18), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(61,139,125,.10), transparent 55%),
    var(--bg);
  background-attachment: fixed; color: var(--ink);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
#app { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: rgba(255,255,255,.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--accent-gradient); }
.brand { display: flex; align-items: center; gap: 14px; }
.logo-box {
  width: 38px; height: 38px; border-radius: 10px; background: var(--accent-gradient); color: #fff;
  display: grid; place-items: center; flex: 0 0 38px; padding: 7px; box-shadow: 0 2px 8px rgba(184,134,47,.25);
}
.logo-box .logo { width: 22px; height: 22px; }
.topbar h1 { font-size: 19px; font-weight: 800; background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.subtitle { font-size: 12px; color: var(--muted); }
.badge { font-size: 12px; color: #8a5a14; background: linear-gradient(135deg,#fdf6e3,#f7e9c8); border: 1px solid #ecd9a8; padding: 4px 11px; border-radius: 999px; font-weight: 600; }
.loading { padding: 80px; text-align: center; color: var(--muted); }
.content { padding: 24px; max-width: 1100px; margin: 0 auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow-md); overflow: hidden; }
.card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--accent-gradient); }
.card h3 { position: relative; padding-left: 12px; font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.card h3::before { content: ""; position: absolute; left: 0; top: 2px; width: 4px; height: 16px; border-radius: 2px; background: var(--accent-gradient); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; margin-bottom: 4px; }
.field .val { font-size: 13px; color: var(--accent); font-weight: 600; margin-left: 8px; }
.field input[type=range] { width: 100%; accent-color: var(--accent); }
.field select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; background: #fff; }
.field select:focus, .field input[type=range]:focus { outline: none; }
.predict-btn { margin-top: 8px; width: 100%; padding: 11px; background: var(--accent-gradient); color: #fff; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 8px rgba(184,134,47,.2); transition: background .15s ease, box-shadow .15s ease; }
.predict-btn:hover { background: var(--accent-gradient-hover); box-shadow: 0 4px 14px rgba(184,134,47,.3); }
.result-card { display: flex; flex-direction: column; }
.placeholder { color: var(--muted); text-align: center; padding: 40px 0; }
.prob { font-size: 52px; font-weight: 800; background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; text-align: center; }
.prob-label { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.band { text-align: center; padding: 8px; border-radius: 9px; font-weight: 600; margin-bottom: 8px; }
.band.low { background: #e8f5e9; color: var(--pos); }
.band.mid { background: #fff8e1; color: var(--risk); }
.band.high { background: #fdecea; color: var(--neg); }
.advice { font-size: 13px; color: var(--ink); margin-bottom: 14px; line-height: 1.5; }
.plot { width: 100%; height: 320px; }
.disclaimer { font-size: 11px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg,#d9b964,#b8862f); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg,#c8a857,#a6761f); }
::-webkit-scrollbar-track { background: transparent; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
