:root {
    --bg: #f3efe7;
    --panel: rgba(255, 252, 247, 0.82);
    --text: #1f2430;
    --muted: #5b6475;
    --line: rgba(68, 76, 92, 0.14);
    --shadow: 0 24px 60px rgba(40, 33, 20, 0.10);
    --red: #d94f3d;
    --red-deep: #a73528;
    --blue: #2f6fed;
    --green: #0f8a6d;
    --gold: #d5a021;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(217, 79, 61, 0.18), transparent 30%),
        radial-gradient(circle at top right, rgba(47, 111, 237, 0.18), transparent 28%),
        linear-gradient(180deg, #f7f1e7 0%, #efe7da 100%);
}

a {
    color: inherit;
}

.page-shell {
    min-height: 100vh;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
    background: rgba(247, 241, 231, 0.72);
    border-bottom: 1px solid rgba(84, 78, 69, 0.08);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.brand-badge {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--red), #f07b3f);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 18px 30px rgba(217, 79, 61, 0.28);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-copy strong {
    font-size: 1.02rem;
}

.brand-copy small {
    color: var(--muted);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.site-nav a {
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 999px;
    color: #364054;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover {
    background: rgba(47, 111, 237, 0.10);
    color: var(--blue);
    transform: translateY(-1px);
}

.page-main {
    padding: 34px 0 56px;
}

.hero-panel,
.panel,
.stat-card {
    animation: rise-in 0.45s ease both;
}

.hero-panel {
    display: grid;
    grid-template-columns: 1.45fr 0.95fr;
    gap: 24px;
    margin-bottom: 24px;
}

.hero-copy,
.hero-side,
.panel,
.stat-card {
    border: 1px solid rgba(97, 88, 73, 0.12);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero-copy {
    padding: 34px;
}

.hero-copy h1,
.page-heading h1 {
    margin: 10px 0 14px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.hero-copy p,
.page-heading p,
.panel-head p,
.muted-copy,
.explanation-copy {
    color: var(--muted);
    line-height: 1.7;
}

.eyebrow {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(217, 79, 61, 0.12);
    color: var(--red-deep);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-metrics {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.metric-chip {
    min-width: 150px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(68, 76, 92, 0.08);
}

.metric-chip strong,
.detail-item strong,
.summary-item strong,
.stat-card strong {
    display: block;
    font-size: 1.05rem;
}

.metric-chip span,
.detail-item span,
.summary-item span,
.stat-card span {
    color: var(--muted);
    font-size: 0.92rem;
}

.hero-side {
    padding: 24px;
    display: flex;
}

.info-card {
    width: 100%;
    padding: 22px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(47, 111, 237, 0.06), rgba(217, 79, 61, 0.05)),
        #fffdfa;
    border: 1px solid rgba(68, 76, 92, 0.08);
}

.runtime-card {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(68, 76, 92, 0.08);
}

.runtime-card strong {
    display: block;
    margin: 6px 0 10px;
    font-size: 1.05rem;
}

.runtime-card p,
.runtime-label,
.warning-copy,
.flow-step span {
    color: var(--muted);
    line-height: 1.7;
}

.runtime-label {
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.feature-list {
    padding-left: 20px;
    margin: 14px 0 0;
    color: var(--muted);
    line-height: 1.8;
}

.panel {
    padding: 28px;
    margin-bottom: 24px;
}

.panel-head,
.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.panel-head h2,
.request-card h3,
.info-card h3 {
    margin: 0 0 6px;
    font-size: 1.24rem;
}

.detect-form,
.feedback-form {
    margin-top: 18px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
}

textarea,
pre {
    font-family: Consolas, "Courier New", monospace;
}

.detect-form textarea {
    width: 100%;
    border: 1px solid rgba(68, 76, 92, 0.14);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.86);
    padding: 18px;
    font-size: 0.96rem;
    line-height: 1.7;
    min-height: 260px;
    resize: vertical;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.detect-form textarea:focus {
    outline: none;
    border-color: rgba(47, 111, 237, 0.4);
    box-shadow: 0 0 0 5px rgba(47, 111, 237, 0.10);
}

.form-actions,
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.sample-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

.btn:disabled,
.btn[aria-busy="true"] {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--red), #f07b3f);
    box-shadow: 0 14px 26px rgba(217, 79, 61, 0.22);
}

.btn-secondary {
    color: #364054;
    background: rgba(255, 255, 255, 0.84);
    border-color: rgba(68, 76, 92, 0.12);
}

.status-pill,
.table-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
}

.status-danger,
.tag-danger {
    color: #8a281b;
    background: rgba(217, 79, 61, 0.14);
}

.status-safe,
.tag-muted {
    color: #0d6f58;
    background: rgba(15, 138, 109, 0.14);
}

.result-grid,
.request-panels,
.stats-grid,
.chart-grid,
.detail-grid {
    display: grid;
    gap: 18px;
}

.result-grid {
    grid-template-columns: 1fr 1.1fr;
    margin-top: 8px;
}

.result-summary {
    display: grid;
    gap: 14px;
    padding: 22px;
    border-radius: 24px;
    color: #fff;
}

.result-summary.attack {
    background: linear-gradient(145deg, #b73728, #e36c44);
}

.result-summary.normal {
    background: linear-gradient(145deg, #0f8a6d, #2aa785);
}

.summary-item {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.summary-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.summary-item span {
    color: rgba(255, 255, 255, 0.76);
}

.summary-confidence strong {
    margin-bottom: 10px;
}

.confidence-meter {
    height: 8px;
    margin-top: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    overflow: hidden;
}

.confidence-meter-fill {
    height: 100%;
    max-width: 100%;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.92);
    transition: width 0.5s ease;
}

.result-panel:focus {
    outline: none;
}

.result-panel:focus-visible {
    box-shadow: var(--shadow), 0 0 0 3px rgba(47, 111, 237, 0.35);
}

.detail-card,
.request-card {
    padding: 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(68, 76, 92, 0.08);
}

.request-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
}

.single-panel {
    grid-template-columns: 1fr;
}

.request-card pre {
    margin: 0;
    padding: 18px;
    border-radius: 18px;
    background: #fffefb;
    border: 1px solid var(--line);
    overflow-x: auto;
    line-height: 1.7;
    color: #2c3340;
}

.page-heading {
    margin-bottom: 22px;
}

.page-heading h1 {
    font-size: clamp(1.9rem, 3vw, 2.8rem);
}

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 24px;
}

.stat-card {
    padding: 24px;
}

.stat-card strong {
    margin: 10px 0 8px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
}

.stat-card small {
    color: var(--muted);
}

.accent-red {
    background: linear-gradient(180deg, rgba(217, 79, 61, 0.11), rgba(255, 252, 247, 0.88));
}

.accent-blue {
    background: linear-gradient(180deg, rgba(47, 111, 237, 0.10), rgba(255, 252, 247, 0.88));
}

.accent-gold {
    background: linear-gradient(180deg, rgba(213, 160, 33, 0.13), rgba(255, 252, 247, 0.88));
}

.chart-grid {
    grid-template-columns: 1.2fr 0.9fr;
}

.model-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 18px;
    margin-bottom: 24px;
}

.status-grid {
    margin-top: 8px;
}

.flow-list {
    display: grid;
    gap: 14px;
}

.flow-step {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(68, 76, 92, 0.08);
}

.flow-step strong {
    display: block;
    margin-bottom: 6px;
}

.perf-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0 20px;
}

.compact-perf-grid {
    margin-top: 16px;
}

.perf-hero {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 8px;
}

.perf-hero-card {
    padding: 18px 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(68, 76, 92, 0.08);
}

.perf-hero-card span,
.perf-hero-card small {
    color: var(--muted);
}

.perf-hero-card strong {
    display: block;
    margin: 10px 0 8px;
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1;
}

.perf-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 18px 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(68, 76, 92, 0.08);
}

.perf-card-head,
.perf-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.perf-card-head {
    margin-bottom: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.perf-title {
    min-width: 0;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.perf-card span,
.perf-card small {
    color: var(--muted);
}

.perf-value {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 8px;
    min-width: 0;
}

.perf-number {
    color: var(--text);
    font-size: clamp(1.3rem, 1.8vw, 1.85rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.01em;
    min-width: 0;
}

.perf-unit {
    flex-shrink: 0;
    margin-bottom: 1px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--muted);
}

.perf-highlight {
    background: linear-gradient(180deg, rgba(15, 138, 109, 0.14), rgba(255, 255, 255, 0.82));
    border-color: rgba(15, 138, 109, 0.22);
}

.perf-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.perf-badge.neutral {
    color: #6f5326;
    background: rgba(213, 160, 33, 0.16);
}

.perf-badge.cool {
    color: #1c56b2;
    background: rgba(47, 111, 237, 0.14);
}

.perf-badge.success {
    color: #0d6f58;
    background: rgba(15, 138, 109, 0.16);
}

.perf-meta {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(68, 76, 92, 0.08);
}

.perf-meta strong {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
    color: var(--text);
}

.perf-charts {
    margin-bottom: 0;
}

.inner-panel {
    margin-bottom: 0;
}

.small-chart {
    height: 320px;
}

.chart-box {
    width: 100%;
    height: 380px;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 8px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.table th,
.table td {
    padding: 16px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.table thead th {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background: rgba(47, 111, 237, 0.04);
}

.table-link {
    color: var(--blue);
    font-weight: 700;
    text-decoration: none;
}

.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    flex-wrap: wrap;
    color: var(--muted);
}

.pagination a {
    text-decoration: none;
    color: var(--blue);
    font-weight: 700;
}

.detail-layout {
    display: grid;
    gap: 18px;
}

.detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.detail-item {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.70);
    border: 1px solid rgba(68, 76, 92, 0.08);
}

.detail-item strong {
    margin-top: 8px;
}

.narrow-panel {
    max-width: 820px;
}

.inline-card {
    margin: 10px 0 20px;
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid transparent;
}

.alert-success {
    color: #0d6f58;
    background: rgba(15, 138, 109, 0.12);
    border-color: rgba(15, 138, 109, 0.18);
}

.alert-danger {
    color: #8a281b;
    background: rgba(217, 79, 61, 0.12);
    border-color: rgba(217, 79, 61, 0.18);
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero-panel,
    .panel,
    .stat-card {
        animation: none;
    }

    .site-nav a:hover,
    .btn:hover:not(:disabled) {
        transform: none;
    }

    .confidence-meter-fill {
        transition: none;
    }
}

@media (max-width: 980px) {
    .hero-panel,
    .result-grid,
    .stats-grid,
    .chart-grid,
    .model-grid,
    .perf-hero,
    .perf-grid,
    .detail-grid,
    .request-panels,
    .compact-grid {
        grid-template-columns: 1fr;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-nav {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(100% - 24px, 1180px);
    }

    .hero-copy,
    .hero-side,
    .panel,
    .stat-card {
        border-radius: 22px;
    }

    .hero-copy,
    .panel {
        padding: 22px;
    }

    .brand-copy small {
        display: none;
    }

    .chart-box {
        height: 300px;
    }
}
