:root {
    color-scheme: light;
    --line: rgba(15, 23, 42, 0.08);
    --stats-row-height: 92px;
}
* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
}
body {
    background:
        radial-gradient(circle at 82% 10%, rgba(29, 78, 216, 0.08), transparent 32rem),
        linear-gradient(180deg, #ffffff, #f8fafc 48%, #ffffff);
    color: #0f172a;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
}
body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(to bottom, black 0%, transparent 76%);
}
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    display: flex;
    width: 100%;
    align-items: center;
    padding: 22px clamp(18px, 4vw, 56px);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(20px);
}
.site-header h1 {
    flex: 1;
    margin: 0;
    color: #0c1e43;
    font-size: 1.6rem;
    font-weight: 650;
    letter-spacing: 0.03em;
    text-align: left;
    text-transform: uppercase;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 740;
    letter-spacing: 0.12em;
    text-decoration: none;
    text-transform: uppercase;
}
.brand-signet {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(235, 242, 246, 0.24);
    border-radius: 3px;
    background: linear-gradient(145deg, #fff1, #94a3b805);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    color: #1d4ed8;
    fill: currentColor;
}
.brand-wordmark {
    display: grid;
    gap: 2px;
    line-height: 1;
}
.brand-wordmark span:first-child {
    color: #111827;
    font-size: 0.78rem;
    font-weight: 780;
}
.brand-wordmark span:last-child {
    color: #334155;
    font-size: 0.68rem;
    font-weight: 560;
    letter-spacing: 0.16em;
}
.header-link {
    margin-left: auto;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
}
.header-link:hover {
    color: #1d4ed8;
}
main {
    padding: 124px clamp(18px, 4vw, 56px) 48px;
}
.workspace {
    display: grid;
    min-width: 0;
    gap: 20px;
    width: min(1500px, 100%);
    margin: 0 auto;
}
.workspace-panel,
.plot-card,
.upload-button {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(14px);
}
.workspace-panel {
    min-width: 0;
    padding: 28px;
}
.upload-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}
.upload-group-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.metadata-panel,
.stats-panel {
    max-width: 100%;
}
.stats-panel {
    min-height: var(--stats-row-height);
}
.metadata-panel {
    display: grid;
    gap: 12px;
}
.diagnosis-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
}
.no-diagnosis-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.no-diagnosis-control input {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    accent-color: #1d4ed8;
}
.diagnosis-error {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}
.upload-button {
    display: grid;
    min-height: 92px;
    place-items: center;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
}
.upload-file-name {
    width: 100%;
    min-height: 92px;
    box-sizing: border-box;
    padding: 16px;
    border: 1px solid #1d4ed8;
    border-radius: 6px;
    background: #ffffff;
    color: #1d4ed8;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
}
.upload-prerequisite-error {
    border-color: #dc2626;
}
.upload-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}
.diagnostic-readout {
    display: flex;
    align-items: baseline;
    gap: 16px;
}
.diagnostic-readout strong {
    color: #1d4ed8;
    font-size: clamp(3.5rem, 8vw, 6rem);
    line-height: 0.9;
}
.diagnostic-state {
    padding: 6px 12px;
    border: 1px solid rgba(29, 78, 216, 0.15);
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.plot-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding-bottom: 6px;
}
.plot-grid {
    grid-auto-rows: auto;
}
.plot-slot {
    min-width: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid #000000;
}
.plot-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.plot-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    color: #0f172a;
    text-align: left;
}
.plot-canvas,
.plot-preview {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    border-radius: 4px;
    background:
        linear-gradient(135deg, rgba(29, 78, 216, 0.14), transparent),
        linear-gradient(180deg, #f8fafc, #eef2ff);
}
.plot-caption {
    font-size: 0.9rem;
    font-weight: 600;
}
.two-column-text {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    hyphens: auto;
    overflow-wrap: break-word;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #0c1e43;
}
.two-column-text p {
    margin: 0 0 1rem;
}
.table-wrap {
    overflow-x: auto;
}
.table-wrap table {
    width: 100%;
    border-collapse: collapse;
}
.table-wrap th,
.table-wrap td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    text-align: left;
}
.table-wrap th {
    color: #0c1e43;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.table-wrap td {
    color: #334155;
}
.table-wrap tbody tr:nth-child(odd) td {
    background: rgba(248, 250, 252, 0.8);
}
.sample-table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
}
.sample-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}
.sample-table th,
.sample-table td {
    min-width: 180px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    text-align: left;
}
.sample-table th {
    white-space: pre-line;
}
.sample-table tbody tr {
    cursor: pointer;
}
.stats-row,
.stats-row td {
    height: var(--stats-row-height);
    vertical-align: middle;
}
.stats-row td {
    overflow: hidden;
}
.sample-table tbody tr:hover,
.sample-table tbody tr:focus {
    background: #eff6ff;
    outline: none;
}
@media (max-width: 720px) {
    .upload-group,
    .upload-group-four {
        grid-template-columns: 1fr;
    }
    .two-column-text {
        column-count: 1;
    }
    .plot-strip {
        grid-template-columns: 1fr;
    }
    .diagnostic-panel {
        align-items: start;
    }
    .diagnostic-readout {
        flex-wrap: wrap;
    }
}
