/* assets/css/style.css */
/* 暗色科技 UI + 风险血条 */

:root {
    --bg-main: #020617;
    --bg-card: #020617;
    --bg-box: #020617;
    --bg-chip: #0f172a;
    --border-soft: #1e293b;
    --text-main: #e5e7eb;
    --text-sub: #9ca3af;
    --accent-green: #22c55e;
    --accent-orange: #fb923c;
    --accent-red: #ef4444;
    --accent-blue: #38bdf8;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,system-ui,-system-ui,sans-serif;
    background: radial-gradient(circle at top, #0f172a 0, #020617 50%, #000 100%);
    color: var(--text-main);
}

.wrapper {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 20px;
}

.card {
    width: 100%;
    max-width: 1120px;
    background: radial-gradient(circle at top left, #0f172a 0, #020617 45%, #000 100%);
    border-radius: 20px;
    border: 1px solid #1e293b;
    padding: 22px 22px 28px;
    box-shadow: 0 25px 60px rgba(15,23,42,.85);
}

/* header */

.header-top {
    display: flex;
    gap: 24px;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,.6);
    font-size: 12px;
    color: var(--text-sub);
    background: radial-gradient(circle at left, rgba(56,189,248,.35), transparent 60%);
}

.highlight {
    color: var(--accent-green);
}

.hero-title {
    margin: 10px 0 4px;
    font-size: 24px;
    letter-spacing: 0.03em;
}

.hero-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.6;
}

/* main score */

.hero-score {
    min-width: 190px;
    text-align: right;
}

.hero-score-label {
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 6px;
}

.hero-score-value {
    font-size: 40px;
    font-weight: 700;
}

.hero-score-level {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    background: #0f172a;
    border: 1px solid #1e293b;
}

/* risk bar (血条) */

.risk-bar-wrapper {
    margin-top: 12px;
}

.risk-bar-bg {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #020617;
    border: 1px solid #1f2937;
    overflow: hidden;
    box-shadow: inset 0 0 8px rgba(15,23,42,.9);
}

.risk-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg,#22c55e,#eab308,#ef4444);
    box-shadow: 0 0 12px rgba(34,197,94,.4);
    transition: width .3s ease, background .3s ease, box-shadow .3s ease;
}

.risk-bar-fill.risk-low {
    background: linear-gradient(90deg,#22c55e,#16a34a);
    box-shadow: 0 0 10px rgba(34,197,94,.6);
}

.risk-bar-fill.risk-medium {
    background: linear-gradient(90deg,#eab308,#f97316);
    box-shadow: 0 0 10px rgba(234,179,8,.6);
}

.risk-bar-fill.risk-high {
    background: linear-gradient(90deg,#ef4444,#b91c1c);
    box-shadow: 0 0 14px rgba(248,113,113,.8);
}

.risk-bar-scale {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #6b7280;
    margin-top: 2px;
}

/* grid */

.grid-2 {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

@media (max-width: 900px) {
    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }
    .hero-score {
        text-align: left;
        margin-top: 8px;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* boxes */

.box {
    background: rgba(15,23,42,.78);
    border-radius: 16px;
    border: 1px solid rgba(30,64,175,.45);
    padding: 12px 14px 12px;
    margin-top: 10px;
}

.box h2 {
    margin: 0 0 10px;
    font-size: 15px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #e5e7eb;
}

/* rows */

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
    border-bottom: 1px dashed rgba(51,65,85,.6);
}

.info-row:last-child {
    border-bottom: none;
}

.label {
    color: var(--text-sub);
    white-space: nowrap;
}

.value {
    text-align: right;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
}

.value.small {
    font-size: 11px;
    max-width: 240px;
    word-break: break-all;
}

/* risk detail */

.risk-summary {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 6px;
}

.risk-reasons {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.risk-reasons li {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(15,23,42,.9);
    border: 1px solid rgba(148,163,184,.4);
}

/* buttons */

.actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    border: 1px solid rgba(148,163,184,.6);
    background: #020617;
    color: #e5e7eb;
    cursor: pointer;
    transition: background .18s ease, transform .1s ease, box-shadow .18s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn.primary {
    background: linear-gradient(135deg,#22c55e,#16a34a);
    border-color: transparent;
    color: #0f172a;
    font-weight: 600;
}

.btn.secondary {
    background: #020617;
}

.btn.ghost {
    background: transparent;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 25px rgba(15,23,42,.75);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* json viewer */

.json-viewer {
    max-height: 260px;
    overflow: auto;
    background: #020617;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 11px;
    border: 1px solid #1e293b;
}

/* footer */

.footer-note {
    margin-top: 18px;
    font-size: 11px;
    color: var(--text-sub);
    line-height: 1.6;
}

/* risk level color */

.risk-low {
    color: var(--accent-green);
}

.risk-medium {
    color: var(--accent-orange);
}

.risk-high {
    color: var(--accent-red);
}
