* {
    box-sizing: border-box;
}

:root {
    --bg: #081223;
    --bg2: #0c1730;
    --panel: rgba(13, 24, 46, 0.88);
    --line: rgba(120, 150, 210, 0.14);
    --text: #eaf2ff;
    --muted: #95a9ca;
    --blue: #4da8ff;
    --blue2: #73c8ff;
    --safe: #31c46d;
    --warn: #ffb020;
    --danger: #ff5b6f;
    --neutral: #9cb3d6;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    --radius: 20px;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(53, 120, 255, 0.12), transparent 32%),
        radial-gradient(circle at top right, rgba(0, 174, 255, 0.08), transparent 26%),
        linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
    line-height: 1.68;
}

a {
    color: var(--blue2);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.wrap {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(7, 12, 24, 0.72);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
}

.top-nav {
    display: flex;
    gap: 16px;
}

.top-nav a {
    color: var(--muted);
    font-weight: 600;
}

.page {
    padding: 36px 0 72px;
}

/* index */
.search-hero,
.result-hero,
.panel,
.result-card,
.evidence-item,
.metric-card {
    background: linear-gradient(180deg, rgba(12, 22, 42, 0.95), rgba(9, 18, 35, 0.96));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.search-hero,
.result-hero {
    display: grid;
    grid-template-columns: 1.35fr 420px;
    gap: 24px;
    padding: 28px;
    border-radius: 28px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--blue2);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

h1 {
    margin: 0 0 14px;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.hero-desc {
    margin: 0 0 18px;
    color: var(--muted);
    max-width: 760px;
}

.search-card,
.result-score-panel {
    padding: 22px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(14, 28, 55, 0.96), rgba(10, 20, 39, 0.98));
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #dce8ff;
}

.field input {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(16, 29, 53, 0.92);
    color: #fff;
    outline: none;
    font-size: 15px;
}

.field input:focus {
    border-color: rgba(115, 200, 255, 0.42);
    box-shadow: 0 0 0 4px rgba(77, 168, 255, 0.10);
}

.primary-btn,
.more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 54px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #2176ff, #2cb4ff);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(28, 110, 255, 0.24);
}

.primary-btn:hover,
.more-btn:hover {
    filter: brightness(1.05);
}

.seo-section .panel {
    margin-top: 22px;
    padding: 26px;
    border-radius: var(--radius);
}

.panel {
    margin-top: 22px;
    padding: 26px;
    border-radius: var(--radius);
}

.panel h2 {
    margin-top: 0;
    font-size: 24px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 22px;
}

.metric-card {
    padding: 18px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-card strong {
    color: var(--muted);
    font-size: 13px;
}

.metric-card span {
    font-size: 28px;
    font-weight: 800;
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 22px;
}

.result-card {
    padding: 22px;
    border-radius: 22px;
    transform: translateY(18px);
    opacity: 0;
    animation: fadeUp 0.55s ease forwards;
}

.result-card:nth-child(1) { animation-delay: 0.05s; }
.result-card:nth-child(2) { animation-delay: 0.12s; }
.result-card:nth-child(3) { animation-delay: 0.19s; }
.result-card:nth-child(4) { animation-delay: 0.26s; }

.result-card h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 20px;
}

.result-card p {
    margin: 0;
    color: #e2ecff;
}

.positive-card { border-left: 4px solid #35c76f; }
.negative-card { border-left: 4px solid #ff6e81; }
.risk-card { border-left: 4px solid #ffb020; }
.summary-card { border-left: 4px solid #58b2ff; }

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.meta-chip {
    min-width: 220px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(18, 30, 58, 0.76);
}

.meta-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--muted);
}

.gauge-wrap {
    width: 100%;
}

.gauge-track {
    width: 100%;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(29, 41, 65, 0.95);
    border: 1px solid var(--line);
}

.gauge-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.7s ease;
}

.gauge-fill.safe {
    background: linear-gradient(90deg, #1fa154, #3ad57b);
}

.gauge-fill.warning {
    background: linear-gradient(90deg, #ff9d00, #ffcd57);
}

.gauge-fill.danger {
    background: linear-gradient(90deg, #ff4e62, #ff7d6f);
}

.gauge-fill.neutral {
    background: linear-gradient(90deg, #7c8da8, #a3b6d5);
}

.gauge-meta {
    margin-top: 14px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.gauge-meta strong {
    font-size: 34px;
    line-height: 1;
}

.gauge-meta span {
    color: var(--muted);
    font-size: 13px;
}

.score-hint {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
}

.risk-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-top: 16px;
}

.risk-badge.safe {
    background: rgba(49, 196, 109, 0.14);
    border: 1px solid rgba(49, 196, 109, 0.25);
    color: #9af0bb;
}

.risk-badge.warning {
    background: rgba(255, 176, 32, 0.14);
    border: 1px solid rgba(255, 176, 32, 0.22);
    color: #ffd58a;
}

.risk-badge.danger {
    background: rgba(255, 91, 111, 0.14);
    border: 1px solid rgba(255, 91, 111, 0.22);
    color: #ffb5bf;
}

.risk-badge.neutral {
    background: rgba(156, 179, 214, 0.14);
    border: 1px solid rgba(156, 179, 214, 0.22);
    color: #d5e0f3;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 18px;
}

.muted {
    margin: 6px 0 0;
    color: var(--muted);
}

.evidence-list {
    display: grid;
    gap: 16px;
}

.evidence-item {
    padding: 18px;
    border-radius: 18px;
}

.evidence-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.source-type {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(77, 168, 255, 0.12);
    color: var(--blue2);
    font-size: 12px;
    font-weight: 700;
    text-transform: lowercase;
}

.evidence-score {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(156, 179, 214, 0.12);
    color: #d3def0;
    font-size: 12px;
    font-weight: 700;
}

.evidence-title {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.35;
}

.evidence-host {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 13px;
}

.evidence-snippet {
    margin: 0;
    color: #dce8ff;
}

.is-hidden-evidence {
    display: none;
}

/* loading */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 8, 18, 0.78);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-overlay.show {
    display: flex;
}

.loading-box {
    width: min(360px, calc(100% - 32px));
    padding: 28px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(13, 24, 46, 0.96), rgba(9, 18, 35, 0.98));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    text-align: center;
}

.loading-box strong {
    display: block;
    margin-top: 16px;
    font-size: 20px;
}

.loading-box p {
    margin: 10px 0 0;
    color: var(--muted);
}

.spinner {
    width: 54px;
    height: 54px;
    margin: 0 auto;
    border-radius: 999px;
    border: 5px solid rgba(120, 150, 210, 0.18);
    border-top-color: #59b7ff;
    animation: spin 0.9s linear infinite;
}

.site-footer {
    padding: 24px 0 40px;
    border-top: 1px solid rgba(120, 150, 210, 0.12);
}

.footer-inner {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 980px) {
    .search-hero,
    .result-hero,
    .cards-grid,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .panel-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 680px) {
    .wrap {
        width: min(100% - 20px, 1120px);
    }

    .search-hero,
    .result-hero,
    .panel,
    .result-card,
    .search-card,
    .result-score-panel {
        padding: 18px;
        border-radius: 18px;
    }

    h1 {
        font-size: 30px;
    }

    .gauge-meta strong {
        font-size: 30px;
    }
}