* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f6f8;
    color: #20252b;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Microsoft YaHei",
        sans-serif;
}

.page {
    max-width: 1180px;
    margin: auto;
    padding: 0 28px 50px;
}


/* =========================
   Header
========================= */

.header {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e4e7eb;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;

    background: #20252b;
    color: white;

    border-radius: 10px;

    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
}

.brand-subtitle {
    margin-top: 3px;
    color: #8b9198;
    font-size: 12px;
}

.status {
    display: flex;
    align-items: center;
    gap: 7px;

    color: #666d75;
    font-size: 13px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #42a76a;
}


/* =========================
   Hero
========================= */

.hero {
    padding: 78px 0 48px;
    max-width: 760px;
}

.hero-tag {
    display: inline-block;

    padding: 6px 10px;

    border: 1px solid #d9dde2;
    border-radius: 5px;

    font-size: 11px;
    letter-spacing: 1.5px;
    color: #737a82;
}

.hero h1 {
    margin: 20px 0 18px;

    font-size: 48px;
    line-height: 1.2;
    letter-spacing: -1px;
}

.hero p {
    margin: 0;

    color: #727982;
    font-size: 16px;
    line-height: 1.8;
}


/* =========================
   Cards
========================= */

.input-card,
.loading-card,
.result-section {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(30, 35, 40, 0.04);
}

.input-card {
    padding: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.section-label {
    color: #8b9198;
    font-size: 11px;
    letter-spacing: 1.3px;
    font-weight: 600;
}

h2 {
    margin: 8px 0 0;
    font-size: 24px;
}

.counter {
    color: #a0a5ab;
    font-size: 12px;
}


/* =========================
   Input
========================= */

textarea {
    width: 100%;
    min-height: 190px;

    margin-top: 24px;
    padding: 18px;

    resize: vertical;

    border: 1px solid #dfe3e7;
    border-radius: 10px;

    outline: none;

    font-family: inherit;
    font-size: 15px;
    line-height: 1.7;

    transition: border 0.2s;
}

textarea:focus {
    border-color: #9098a1;
}

.examples {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;

    margin-top: 14px;
}

.examples-title {
    color: #8b9198;
    font-size: 12px;
}

.examples button {
    padding: 6px 11px;

    border: 1px solid #e1e4e8;
    border-radius: 6px;

    background: #fafbfc;

    color: #666d75;

    cursor: pointer;
}

.examples button:hover {
    background: #f1f3f5;
}


.analyze-button {
    width: 100%;

    margin-top: 22px;
    padding: 15px 20px;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;

    border: 0;
    border-radius: 9px;

    background: #20252b;
    color: white;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition: transform 0.15s,
                opacity 0.15s;
}

.analyze-button:hover {
    opacity: 0.9;
}

.analyze-button:active {
    transform: scale(0.99);
}

.arrow {
    font-size: 20px;
}


/* =========================
   Loading
========================= */

.loading-card {
    margin-top: 20px;
    padding: 25px;

    display: flex;
    align-items: center;
    gap: 18px;
}

.loader {
    width: 28px;
    height: 28px;

    border: 3px solid #e2e5e8;
    border-top-color: #20252b;

    border-radius: 50%;

    animation: spin 0.8s linear infinite;
}

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

.loading-card strong {
    font-size: 15px;
}

.loading-card p {
    margin: 5px 0 0;
    color: #8a9097;
    font-size: 13px;
}


/* =========================
   Result
========================= */

.result-section {
    margin-top: 20px;
    padding: 30px;
}

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

.recommend-badge {
    padding: 9px 15px;

    border-radius: 8px;

    background: #eef7f1;
    color: #267045;

    font-size: 13px;
    font-weight: 700;
}


/* =========================
   Metrics
========================= */

.metrics {
    display: grid;

    grid-template-columns:
        repeat(5, 1fr);

    gap: 12px;

    margin-top: 25px;
}

.metric-card {
    min-height: 130px;

    padding: 18px;

    background: #fafbfc;

    border: 1px solid #e7eaed;
    border-radius: 10px;
}

.metric-name {
    color: #858c94;
    font-size: 12px;
}

.metric-value {
    margin-top: 15px;

    font-size: 25px;
    font-weight: 700;
}

.metric-value.small {
    font-size: 18px;
}

.score {
    margin-top: 12px;
}

.score strong {
    font-size: 27px;
}

.score span {
    color: #9299a0;
    font-size: 12px;
}

.progress {
    height: 4px;

    margin-top: 10px;

    background: #e7eaed;

    border-radius: 5px;

    overflow: hidden;
}

.progress-bar {
    height: 100%;

    width: 0;

    background: #30363d;

    transition: width 0.5s;
}

.risk {
    margin-top: 15px;

    font-size: 20px;
    font-weight: 700;
}


/* =========================
   Detailed analysis
========================= */

.analysis-grid {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 12px;

    margin-top: 18px;
}

.info-card {
    padding: 22px;

    border: 1px solid #e5e8eb;
    border-radius: 10px;
}

.info-title {
    color: #777f87;
    font-size: 12px;
    font-weight: 600;
}

.info-content {
    margin-top: 11px;

    font-size: 14px;
    line-height: 1.8;
}


/* =========================
   Recommendation
========================= */

.reason-card {
    display: flex;
    gap: 15px;

    margin-top: 18px;
    padding: 22px;

    background: #faf9f4;

    border: 1px solid #ebe7d9;
    border-radius: 10px;
}

.reason-icon {
    font-size: 18px;
}

.reason-text {
    margin-top: 9px;

    font-size: 14px;
    line-height: 1.7;
}


/* =========================
   Explanation
========================= */

.explanation-card {
    margin-top: 12px;
    padding: 22px;

    background: #fafbfc;

    border-radius: 10px;
}


/* =========================
   Disclaimer
========================= */

.disclaimer {
    margin-top: 20px;

    padding: 18px;

    background: #f7f8f9;

    border-radius: 8px;

    color: #858c93;

    font-size: 11px;
    line-height: 1.7;
}

.disclaimer strong {
    color: #636a72;
}


/* =========================
   Footer
========================= */

footer {
    padding: 35px 0;

    text-align: center;

    color: #a0a5aa;
    font-size: 11px;
}


/* =========================
   Utility
========================= */

.hidden {
    display: none !important;
}


/* =========================
   Mobile
========================= */

@media (max-width: 850px) {

    .hero h1 {
        font-size: 38px;
    }

    .metrics {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 560px) {

    .page {
        padding: 0 15px 35px;
    }

    .header {
        height: 68px;
    }

    .status {
        display: none;
    }

    .hero {
        padding: 50px 0 35px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .input-card,
    .result-section {
        padding: 20px;
    }

    .metrics {
        grid-template-columns: 1fr;
    }

}