* {
    box-sizing: border-box;
}

:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --ink: #172338;
    --muted: #718096;
    --line: #e6ebf2;
    --blue: #2463eb;
    --blue-dark: #1749bd;
    --blue-soft: #edf3ff;
    --green: #16a36a;
    --shadow: 0 8px 28px rgba(28, 48, 78, 0.055);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

button, select {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 248px;
    background: #101d32;
    color: #dce6f5;
    padding: 26px 18px 18px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 38px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #4c8cff, #2154ce);
    color: white;
    font-size: 23px;
    font-weight: 800;
}

.brand-title {
    font-size: 17px;
    font-weight: 750;
    letter-spacing: .2px;
    color: #fff;
}

.brand-subtitle {
    color: #9fb0c8;
    font-size: 11px;
    margin-top: 3px;
}

.nav-label {
    color: #8192ab;
    font-size: 11px;
    letter-spacing: 1.4px;
    padding: 0 12px 10px;
}

.nav-item {
    color: #c6d2e3;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 12px 13px;
    border-radius: 9px;
    margin: 3px 0;
    font-size: 13px;
}

.nav-item.active, .nav-item:hover {
    background: #203b64;
    color: #fff;
}

.nav-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-bottom {
    margin-top: auto;
}

.system-card {
    border: 1px solid #2b3d59;
    background: #172944;
    border-radius: 12px;
    padding: 14px;
}

.system-card-title {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #e7eef8;
}

.status-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #d1dceb;
}

.status-dot, .live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e5a33a;
}

.status-dot.online, .live-dot {
    background: #22c989;
    box-shadow: 0 0 0 3px rgba(34, 201, 137, .12);
}

.status-dot.offline {
    background: #e25c63;
}

.system-meta {
    color: #8fa2bc;
    font-size: 10px;
    margin-top: 8px;
    line-height: 1.5;
}

.sidebar-foot {
    color: #72839d;
    font-size: 10px;
    text-align: center;
    padding-top: 16px;
}

.main-content {
    min-width: 0;
    width: calc(100% - 248px);
    max-width: 1600px;
    margin: 0 auto;
    padding: 34px 42px 22px;
}

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

.eyebrow, .section-kicker {
    color: #7890b2;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

h1 {
    font-size: 27px;
    margin: 8px 0 7px;
    letter-spacing: -.6px;
}

.page-desc {
    color: var(--muted);
    font-size: 13px;
    margin: 0;
}

.topbar-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 30px;
    padding: 9px 13px;
    font-size: 11px;
    color: #52647e;
    white-space: nowrap;
}

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

.stat-card, .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 17px 19px;
}

.stat-label {
    font-size: 11px;
    color: var(--muted);
}

.stat-value {
    font-size: 21px;
    font-weight: 750;
    margin: 8px 0 5px;
    color: #20334f;
}

.model-stat {
    font-size: 18px;
}

.stat-note {
    color: #9aa7b8;
    font-size: 10px;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 17px;
    align-items: stretch;
}

.panel {
    padding: 21px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.section-heading h2 {
    font-size: 16px;
    margin: 5px 0 0;
}

.subtle-tag {
    font-size: 10px;
    color: #6f83a2;
    background: #f1f5fb;
    padding: 6px 9px;
    border-radius: 20px;
}

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

.model-select {
    width: 100%;
    height: 40px;
    border: 1px solid #dce4ef;
    border-radius: 8px;
    background: #fff;
    color: #34445c;
    padding: 0 11px;
    outline: none;
    font-size: 12px;
}

.model-select:focus {
    border-color: #7da5ff;
    box-shadow: 0 0 0 3px rgba(36, 99, 235, .08);
}

.field-hint {
    font-size: 10px;
    color: #9aa6b6;
    margin: 7px 0 15px;
}

.drop-zone {
    border: 1.5px dashed #b9c9df;
    border-radius: 12px;
    background: #f9fbfe;
    min-height: 210px;
    padding: 23px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: .18s ease;
    cursor: pointer;
    text-align: center;
}

.drop-zone.dragover {
    border-color: var(--blue);
    background: #f0f5ff;
}

.upload-symbol {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 25px;
    margin-bottom: 11px;
}

.drop-title {
    font-size: 13px;
    font-weight: 750;
}

.drop-desc {
    font-size: 10px;
    color: #8a98aa;
    margin: 6px 0 13px;
}

.secondary-button {
    border: 1px solid #cbd8ea;
    background: #fff;
    color: #35547f;
    border-radius: 7px;
    padding: 8px 15px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.secondary-button:hover {
    border-color: #8ba9dd;
    background: #f6f9ff;
}

.file-hint {
    color: #a1adbc;
    font-size: 9px;
    margin-top: 13px;
}

.preview-wrap {
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px;
    background: #fbfcfe;
}

.preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 9px;
}

#previewImage {
    display: block;
    width: 100%;
    max-height: 230px;
    object-fit: contain;
    border-radius: 7px;
    background: #eef2f7;
}

.file-name {
    color: #8290a2;
    font-size: 10px;
    margin-top: 8px;
    overflow-wrap: anywhere;
}

.primary-button {
    width: 100%;
    border: 0;
    border-radius: 9px;
    background: var(--blue);
    color: #fff;
    height: 43px;
    margin-top: 15px;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
    transition: .18s ease;
}

.primary-button:hover:not(:disabled) {
    background: var(--blue-dark);
    transform: translateY(-1px);
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.button-icon {
    margin-right: 7px;
}

.text-button {
    border: 0;
    background: transparent;
    color: #5276ae;
    font-size: 11px;
    cursor: pointer;
    padding: 3px;
}

.text-button:hover {
    text-decoration: underline;
}

.danger-text {
    color: #c15c65;
}

.empty-state {
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.empty-illustration {
    width: 65px;
    height: 65px;
    border-radius: 22px;
    background: #f0f4fb;
    color: #8ba1c0;
    display: grid;
    place-items: center;
    font-size: 38px;
    margin-bottom: 15px;
}

.empty-state h3 {
    font-size: 14px;
    margin: 0 0 8px;
}

.empty-state p {
    max-width: 245px;
    color: #98a5b5;
    font-size: 11px;
    line-height: 1.7;
    margin: 0;
}

.prediction-highlight {
    border-radius: 12px;
    padding: 17px;
    background: linear-gradient(125deg, #edf4ff, #f6f9ff);
    border: 1px solid #e0eaff;
}

.prediction-label {
    color: #6d83a5;
    font-size: 10px;
}

.prediction-class {
    color: #1c4fae;
    font-size: 27px;
    font-weight: 800;
    margin: 7px 0 13px;
}

.confidence-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #6c7f9d;
}

.confidence-line strong {
    color: #1f5bc4;
    font-size: 16px;
}

.probability-section {
    margin-top: 19px;
}

.probability-title {
    font-size: 12px;
    font-weight: 750;
    margin-bottom: 13px;
}

.probability-row {
    margin: 11px 0;
}

.probability-head {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #53647c;
    margin-bottom: 6px;
}

.probability-head strong {
    color: #30435e;
}

.progress-track {
    height: 7px;
    background: #edf1f6;
    border-radius: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, #4b83ed, #2463eb);
}

.result-meta {
    border-top: 1px solid var(--line);
    padding-top: 12px;
    margin-top: 18px;
    font-size: 10px;
    line-height: 1.8;
    color: #8a98a9;
}

.disclaimer {
    margin-top: 10px;
    border-radius: 8px;
    background: #fff9ed;
    color: #9b7a3c;
    padding: 9px 10px;
    font-size: 9px;
    line-height: 1.6;
}

.history-panel {
    margin-top: 18px;
}

.history-heading {
    margin-bottom: 12px;
}

.table-wrap {
    overflow-x: auto;
}

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

th {
    text-align: left;
    color: #8492a5;
    background: #f8fafd;
    font-size: 10px;
    font-weight: 700;
    padding: 11px 10px;
}

td {
    border-top: 1px solid #edf0f5;
    padding: 10px;
    font-size: 10px;
    color: #506078;
}

.history-thumb {
    width: 39px;
    height: 35px;
    object-fit: cover;
    border-radius: 6px;
    background: #eef2f7;
}

.table-empty {
    text-align: center;
    color: #a2adbb;
    padding: 27px;
}

.message {
    margin-top: 10px;
    padding: 9px 11px;
    border-radius: 8px;
    font-size: 10px;
    line-height: 1.5;
}

.message.error {
    color: #a53f49;
    background: #fff0f1;
    border: 1px solid #f7d9dc;
}

.message.success {
    color: #237b59;
    background: #effaf5;
    border: 1px solid #d5f0e3;
}

.page-footer {
    text-align: center;
    color: #a4afbd;
    font-size: 9px;
    padding: 22px 0 4px;
}

.hidden {
    display: none !important;
}

@media (max-width: 1050px) {
    .main-content {
        padding: 27px 24px;
    }
    .sidebar {
        width: 215px;
    }
    .main-content {
        width: calc(100% - 215px);
    }
    .workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .sidebar {
        display: none;
    }
    .main-content {
        width: 100%;
        padding: 22px 14px;
    }
    .topbar {
        flex-direction: column;
    }
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }
    .stat-card {
        padding: 13px 15px;
    }
    .stat-value {
        font-size: 18px;
    }
    .panel {
        padding: 16px;
    }
}
