:root {
    font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    color: #0f172a;
    background: #f1f5f9;
    font-synthesis: none;
}
* { box-sizing: border-box; }
html, body, #root { width: 100%; min-height: 100%; margin: 0; padding: 0; }
body { min-width: 320px; background: #f1f5f9; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.page-shell { min-height: 100vh; }
.topbar {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 44px;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 12px;
    display: grid; place-items: center;
    background: linear-gradient(145deg,#047857,#10b981);
    color: #fff; font-weight: 900; font-size: 20px;
    box-shadow: 0 8px 22px rgba(16,185,129,.25);
}
.brand-title { font-size: 17px; font-weight: 850; letter-spacing: -.2px; }
.brand-sub { font-size: 11px; color: #94a3b8; margin-top: 3px; font-weight: 600; }
.top-actions { display:flex; align-items:center; gap:10px; }
.nav-link {
    color:#475569; text-decoration:none; font-size:13px; font-weight:700;
    border:1px solid #e2e8f0; padding:9px 13px; border-radius:10px; background:#fff;
}
.model-badge {
    font-size:11px; font-weight:800; letter-spacing:.08em; color:#047857;
    background:#ecfdf5; border:1px solid #a7f3d0; padding:8px 11px; border-radius:999px;
}

.container { width: min(1480px, calc(100% - 48px)); margin: 26px auto 48px; }
.hero {
    min-height: 330px;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
    background-image:
      linear-gradient(90deg, rgba(2,44,34,.91) 0%, rgba(3,60,44,.82) 47%, rgba(5,46,36,.45) 100%),
      url('/static/soil/hero-bg.jpg');
    background-size: cover;
    background-position: center 58%;
    box-shadow: 0 20px 50px -18px rgba(15,76,61,.33);
    border:1px solid rgba(255,255,255,.16);
    color:#fff;
    padding: 42px 46px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
}
.hero-kicker { font-size:12px; letter-spacing:.16em; color:#a7f3d0; font-weight:850; }
.hero h1 { margin:12px 0 11px; font-size:clamp(30px,4vw,50px); line-height:1.12; max-width:820px; letter-spacing:-1.2px; }
.hero p { max-width:760px; margin:0; color:#d1fae5; line-height:1.8; font-size:14px; font-weight:550; }
.hero-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-top:28px; max-width:900px; }
.hero-stat {
    background:rgba(3,40,30,.58); border-radius:20px; padding:18px 20px;
    backdrop-filter:blur(12px); border:1px solid rgba(255,255,255,.18);
    box-shadow:0 8px 24px rgba(0,0,0,.15);
}
.hero-stat span { display:block; font-size:12px; color:#d1fae5; margin-bottom:7px; font-weight:700; }
.hero-stat strong { font-size:22px; font-weight:850; text-shadow:0 2px 5px rgba(0,0,0,.4); }
.hero-stat small { color:#bbf7d0; margin-left:6px; font-weight:600; }

.grid-two { display:grid; grid-template-columns:1.08fr .92fr; gap:24px; margin-top:24px; }
.card {
    border-radius:32px; background:#fff; padding:30px;
    border:1px solid rgba(226,232,240,.75);
    box-shadow:0 18px 42px -18px rgba(15,76,61,.18);
}
.card-soft { background:linear-gradient(145deg,#f8fffc 0%,#eff8f5 52%,#edf4f7 100%); border-color:rgba(167,243,208,.55); }
.card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:22px; }
.card-title { font-size:22px; font-weight:850; letter-spacing:-.4px; }
.card-desc { font-size:12px; color:#64748b; margin-top:5px; font-weight:600; line-height:1.6; }
.step-no {
    width:39px; height:39px; border-radius:12px; display:grid; place-items:center;
    background:#ecfdf5; border:1px solid #a7f3d0; color:#047857; font-weight:900;
}
.head-left { display:flex; gap:13px; align-items:flex-start; }
.dropzone {
    min-height:190px; border:1.5px dashed #86efac; border-radius:22px;
    background:rgba(240,253,244,.7); display:flex; flex-direction:column;
    align-items:center; justify-content:center; text-align:center; gap:8px;
    transition:.2s; padding:24px;
}
.dropzone:hover, .dropzone.drag { border-color:#10b981; background:#ecfdf5; transform:translateY(-1px); }
.upload-icon {
    width:52px; height:52px; border-radius:16px; display:grid; place-items:center;
    color:#fff; background:linear-gradient(145deg,#059669,#10b981); font-size:26px;
    box-shadow:0 10px 24px rgba(16,185,129,.22); margin-bottom:5px;
}
.dropzone strong { font-size:15px; }
.dropzone span { color:#64748b; font-size:12px; }
.file-info {
    margin-top:14px; border:1px solid #d1fae5; background:#f8fffc; border-radius:16px;
    padding:13px 15px; display:flex; justify-content:space-between; align-items:center; gap:14px;
}
.file-meta b { display:block; font-size:13px; max-width:580px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.file-meta span { display:block; color:#64748b; font-size:11px; margin-top:4px; }
.ghost-btn { border:1px solid #cbd5e1; background:#fff; color:#475569; padding:8px 12px; border-radius:10px; font-size:12px; font-weight:700; }

.form-grid { display:grid; grid-template-columns:1fr; gap:13px; }
.field label { display:block; font-size:12px; color:#475569; font-weight:800; margin-bottom:7px; }
.field select {
    width:100%; padding:12px 13px; border-radius:12px; border:1px solid #cbd5e1;
    background:#fff; color:#0f172a; outline:none; font-weight:650;
}
.field select:focus { border-color:#34d399; box-shadow:0 0 0 3px rgba(16,185,129,.09); }
.field-help { font-size:10.5px; color:#94a3b8; margin-top:6px; line-height:1.5; }
.primary-btn {
    margin-top:4px; width:100%; border:none; border-radius:13px; padding:13px 18px;
    color:#fff; background:linear-gradient(90deg,#047857,#10b981); font-size:14px; font-weight:850;
    box-shadow:0 10px 26px rgba(16,185,129,.22); transition:.2s;
}
.primary-btn:hover { transform:translateY(-1px); box-shadow:0 14px 30px rgba(16,185,129,.26); }
.primary-btn:disabled { cursor:not-allowed; opacity:.45; transform:none; box-shadow:none; }
.muted-panel { opacity:.5; pointer-events:none; }
.error-box { margin-top:20px; padding:14px 16px; color:#b91c1c; background:#fff1f2; border:1px solid #fecdd3; border-radius:14px; font-size:12px; font-weight:650; }

.results { margin-top:24px; }
.metric-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:18px; }
.metric-card {
    border-radius:24px; background:#fff; border:1px solid #e2e8f0;
    padding:22px 23px; box-shadow:0 12px 30px -20px rgba(15,23,42,.24);
}
.metric-card span { display:block; color:#64748b; font-size:12px; font-weight:750; }
.metric-card strong { display:block; color:#0f172a; font-size:34px; font-weight:900; margin:8px 0 3px; letter-spacing:-1px; }
.metric-card small { color:#94a3b8; font-size:10.5px; font-weight:600; line-height:1.5; }
.metric-card.kmdi strong { color:#047857; }
.metric-card.safe { background:linear-gradient(145deg,#f0fdf4,#ecfdf5); border-color:#bbf7d0; }
.metric-card.safe strong { color:#047857; }
.metric-card.danger { background:linear-gradient(145deg,#fff7ed,#fff1f2); border-color:#fecdd3; }
.metric-card.danger strong { color:#dc2626; }

.group-tabs { display:flex; flex-wrap:wrap; gap:9px; margin:18px 0 0; }
.group-tab { border:1px solid #cbd5e1; background:#fff; color:#475569; border-radius:11px; padding:9px 12px; font-size:12px; font-weight:750; }
.group-tab b { color:#047857; margin-left:7px; }
.group-tab.active { background:#ecfdf5; color:#065f46; border-color:#6ee7b7; box-shadow:0 4px 16px rgba(16,185,129,.1); }

.chart-card { margin-top:24px; }
.chart-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:20px; }
.chart-head-right { display:flex; gap:8px; align-items:center; }
.protected-badge { background:#f8fafc; border:1px solid #cbd5e1; border-radius:10px; padding:8px 10px; color:#64748b; font-size:10.5px; font-weight:700; }
.chart-box { border-radius:22px; background:#f8fafc; border:1px solid #eef2f7; padding:14px; overflow:hidden; }
#curveSvg { width:100%; height:auto; display:block; }
.chart-grid { stroke:#e2e8f0; stroke-width:1; }
.chart-zero { stroke:#94a3b8; stroke-width:1.3; }
.chart-split { stroke:#cbd5e1; stroke-width:1.2; stroke-dasharray:7 7; }
.chart-line { fill:none; stroke:#047857; stroke-width:4; stroke-linecap:round; stroke-linejoin:round; }
.chart-area-left { fill:rgba(239,68,68,.09); }
.chart-area-right { fill:rgba(14,165,233,.09); }
.chart-label { fill:#94a3b8; font-size:11px; font-weight:650; }
.chart-y { fill:#64748b; font-size:10px; }
.chart-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-top:14px; }
.summary-item { border-radius:14px; background:#f8fafc; border:1px solid #eef2f7; padding:12px 13px; display:flex; justify-content:space-between; gap:10px; }
.summary-item span { color:#64748b; font-size:10.5px; font-weight:650; }
.summary-item b { color:#0f172a; font-size:11px; }

.interpret-card { margin-top:24px; display:flex; gap:15px; align-items:flex-start; }
.status-dot { width:12px; height:12px; border-radius:50%; margin-top:6px; flex:0 0 12px; }
.status-dot.safe { background:#10b981; box-shadow:0 0 14px rgba(16,185,129,.45); }
.status-dot.danger { background:#ef4444; box-shadow:0 0 14px rgba(239,68,68,.42); }
.interpret-card h3 { margin:0 0 7px; font-size:17px; }
.interpret-card p { margin:0; color:#475569; font-size:12.5px; line-height:1.8; font-weight:550; }
.interpret-card small { display:block; color:#94a3b8; font-size:10.5px; margin-top:8px; line-height:1.6; }

footer { color:#94a3b8; font-size:10px; display:flex; justify-content:space-between; padding:28px 4px 4px; }
.hidden { display:none !important; }
.loading-text { color:#047857 !important; }

@media (max-width: 1050px) {
    .grid-two { grid-template-columns:1fr; }
    .metric-grid { grid-template-columns:repeat(2,1fr); }
    .hero-stats { grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 650px) {
    .topbar { padding:0 16px; }
    .top-actions .nav-link, .brand-sub { display:none; }
    .container { width:calc(100% - 24px); margin-top:14px; }
    .hero { padding:30px 22px; border-radius:24px; }
    .hero-stats, .metric-grid, .chart-summary { grid-template-columns:1fr; }
    .card { padding:22px; border-radius:24px; }
    .chart-head { flex-direction:column; }
    footer { flex-direction:column; gap:7px; }
}
