/* ╔════════════════════════════════════════════════╗
   ║  CellViz — 细胞培养数据实时监控 Dashboard      ║
   ║  Dark Sci-fi Theme with Bioluminescent Accents ║
   ╚════════════════════════════════════════════════╝ */

:root {
    /* Core palette */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --bg-glass: rgba(15, 23, 42, 0.6);

    /* Accent — bioluminescent cyan/teal */
    --accent: #00e5ff;
    --accent-dim: rgba(0, 229, 255, 0.15);
    --accent-glow: rgba(0, 229, 255, 0.4);

    /* Semantic */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Text */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #475569;

    /* Borders */
    --border: rgba(148, 163, 184, 0.12);
    --border-accent: rgba(0, 229, 255, 0.25);

    /* Chart colors for batch lines */
    --batch-1: #00e5ff;
    --batch-2: #ff6b6b;
    --batch-3: #ffd93d;
    --batch-4: #6bcb77;
    --batch-5: #a78bfa;
    --batch-6: #fb923c;
    --batch-7: #f472b6;
    --batch-8: #34d399;

    /* Typography */
    --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Sizing */
    --header-h: 70px;
    --sidebar-w: 340px;
    --radius: 10px;
    --radius-sm: 6px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { font-size: 14px; }

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse at 50% -20%, rgba(0, 229, 255, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-primary) 0%, #06090e 100%);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ── Loading ───────────────────────────────── */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}
.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.spinner-ring {
    width: 48px; height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.loading-text {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

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

/* ── Header ────────────────────────────────── */
.header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 229, 255, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-left, .header-right { display: flex; align-items: center; gap: 16px; }

.logo { display: flex; align-items: center; gap: 14px; }
.author-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}
.logo-text { display: flex; flex-direction: column; gap: 4px; }
.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00e5ff 0%, #818cf8 50%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
}
.logo-sub {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.8;
    background: var(--accent);
    color: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}
.author-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    opacity: 0.8;
}

/* Phase Tabs */
.phase-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,0.3);
    padding: 4px;
    border-radius: 8px;
}
.phase-tab {
    padding: 6px 16px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.phase-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.phase-tab.active {
    color: var(--bg-primary);
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* Status */
.status-bar { display: flex; align-items: center; gap: 6px; }
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    animation: pulse-dot 2s ease-in-out infinite;
}
.status-dot.error { background: var(--danger); box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
.status-dot.loading { background: var(--warning); box-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }
.status-text { font-size: 0.75rem; color: var(--text-secondary); font-family: var(--font-mono); }
.last-update { font-size: 0.7rem; color: var(--text-muted); font-family: var(--font-mono); }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* Header buttons */
.btn-refresh, .btn-upload {
    width: 34px; height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-refresh svg, .btn-upload svg { width: 16px; height: 16px; }
.btn-refresh:hover, .btn-upload:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}
.btn-refresh.spinning svg { animation: spin 0.6s linear infinite; }

/* ── Main Layout ───────────────────────────── */
.main {
    display: flex;
    height: calc(100vh - var(--header-h));
}

/* ── Sidebar ───────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    border-right: 1px solid var(--border);
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
}
.sidebar-section-intro {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, rgba(0, 229, 255, 0.08), rgba(15, 23, 42, 0.7)),
        rgba(0, 0, 0, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.batch-selector-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.batch-selector-heading .sidebar-title { margin-bottom: 0; }
.batch-result-count {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
}
.batch-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 8px;
    margin-bottom: 8px;
}
.batch-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(2, 8, 23, 0.7);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.batch-search:focus-within {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.08);
}
.batch-search svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    color: var(--text-muted);
}
.batch-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.76rem;
}
.batch-search input::placeholder { color: var(--text-muted); }
.batch-sort {
    min-width: 0;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: 0;
    background: #0b1220;
    color: var(--text-secondary);
    font-size: 0.72rem;
    cursor: pointer;
}
.batch-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}
.batch-quick-actions button {
    padding: 7px 5px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.72);
    color: var(--text-secondary);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.batch-quick-actions button:hover {
    border-color: var(--border-accent);
    background: rgba(0, 229, 255, 0.08);
    color: var(--accent);
}
.sidebar-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.sidebar-headline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.sidebar-desc {
    color: var(--text-secondary);
    font-size: 0.76rem;
    line-height: 1.55;
    max-width: 180px;
}
.compare-cap {
    min-width: 62px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-accent);
    background: rgba(0, 229, 255, 0.12);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-align: center;
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.12);
}
.sidebar-action {
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(2, 8, 23, 0.58);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.sidebar-action:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 229, 255, 0.08);
}
.sidebar-action:disabled {
    cursor: not-allowed;
    opacity: 0.4;
    border-color: var(--border);
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.38);
}

/* Batch list */
.batch-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 46vh;
    overflow-y: auto;
    padding-right: 3px;
}
.batch-list-empty {
    padding: 18px 12px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.76rem;
    line-height: 1.6;
}
.batch-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 11px;
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
    background: rgba(2, 8, 23, 0.3);
    position: relative;
}
.batch-item:hover {
    background: rgba(255,255,255,0.045);
    border-color: rgba(148, 163, 184, 0.25);
}
.batch-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.batch-item.active {
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.13), rgba(15, 23, 42, 0.72));
    border-color: rgba(0, 229, 255, 0.38);
    box-shadow: inset 3px 0 0 var(--accent), 0 8px 22px rgba(2, 8, 23, 0.2);
}
.batch-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.batch-item-metrics {
    display: flex;
    justify-content: space-between;
    padding-left: 24px;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.batch-item-metrics span {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 4px;
    border-radius: 3px;
    display: flex;
    gap: 3px;
}
.batch-item-metrics b { color: var(--text-primary); font-weight: 500; }
.batch-item.active .batch-item-metrics b { color: var(--accent); }

.batch-color {
    width: 10px; height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}
.batch-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}
.batch-order,
.batch-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 25px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
}
.batch-order {
    border: 1px solid color-mix(in srgb, var(--batch-color), transparent 45%);
    background: color-mix(in srgb, var(--batch-color), transparent 84%);
    color: var(--batch-color);
    font-weight: 700;
}
.batch-add {
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.batch-checkbox {
    appearance: none;
    width: 16px; height: 16px;
    border: 1.5px solid var(--text-muted);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}
.batch-checkbox:checked {
    background: var(--accent);
    border-color: var(--accent);
}
.batch-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: -1px; left: 2px;
    font-size: 11px;
    color: var(--bg-primary);
    font-weight: 700;
}

/* KPI Cards */
.kpi-cards { display: flex; flex-direction: column; gap: 6px; }
.kpi-card {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    transition: all 0.25s;
}
.kpi-card:hover { border-color: var(--border-accent); }
.kpi-card.alert { border-color: rgba(239, 68, 68, 0.4); animation: alert-pulse 2s ease-in-out infinite; }
.kpi-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.kpi-value {
    font-size: 1.3rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--accent);
    line-height: 1;
}
.kpi-unit {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-left: 2px;
    font-weight: 400;
}
.kpi-trend {
    font-size: 0.7rem;
    margin-top: 4px;
    font-family: var(--font-mono);
}
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-trend.flat { color: var(--text-muted); }

@keyframes alert-pulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 12px rgba(239, 68, 68, 0.2); }
}

/* ── Charts Area ───────────────────────────── */
.charts-area {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}
.overview-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}
.overview-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    border-radius: 20px;
    border: 1px solid rgba(129, 140, 248, 0.18);
    background:
        radial-gradient(circle at top left, rgba(0, 229, 255, 0.16), transparent 34%),
        radial-gradient(circle at bottom right, rgba(167, 139, 250, 0.16), transparent 28%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(2, 8, 23, 0.96));
    box-shadow: 0 18px 32px rgba(2, 8, 23, 0.32);
}
.overview-copy {
    max-width: 760px;
}
.overview-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #7dd3fc;
    font-size: 0.78rem;
    font-family: var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.overview-title {
    font-size: 1.8rem;
    line-height: 1.15;
    margin-bottom: 10px;
    color: #f8fafc;
}
.overview-subtitle {
    max-width: 780px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
}
.overview-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 8px;
    max-width: 360px;
}
.overview-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.55);
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-family: var(--font-mono);
}
.overview-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.overview-stat {
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.66));
    min-height: 118px;
}
.overview-stat-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}
.overview-stat-value {
    color: var(--text-primary);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 8px;
}
.overview-stat-helper {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
}
.selection-panel {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.78);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}
.selection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.selection-header h3 {
    font-size: 0.92rem;
    margin-bottom: 4px;
}
.selection-header p {
    color: var(--text-secondary);
    font-size: 0.8rem;
}
.selection-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}
.selection-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.selection-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(2, 8, 23, 0.6);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.selection-chip:hover {
    border-color: var(--border-accent);
    transform: translateY(-1px);
}
.selection-chip-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}
.selection-chip-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}
.selection-chip-name {
    font-size: 0.82rem;
    font-weight: 600;
}
.selection-chip-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}
.selection-chip-remove {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1;
}
.selection-empty {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.2);
    background: rgba(2, 8, 23, 0.35);
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.6;
}
.selection-empty-action {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.selection-empty-action strong {
    color: var(--text-primary);
    font-size: 0.86rem;
}
.selection-empty-action span { color: var(--text-secondary); }
.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
}
.chart-card:hover {
    border-color: var(--border-accent);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 1px var(--accent-glow);
    transform: translateY(-1px);
}
.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.chart-header h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}
.chart-badge {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.3);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
}
.chart-container {
    width: 100%;
    height: 420px;
    padding: 12px;
}

/* ── Analysis Panel ────────────────────────── */
.analysis-panel {
    position: fixed;
    right: -420px;
    top: var(--header-h);
    width: 420px;
    height: calc(100vh - var(--header-h));
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    z-index: 90;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0,0,0,0.4);
}
.analysis-panel.open { right: 0; }
.analysis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.analysis-header h2 { font-size: 1rem; font-weight: 600; }
.btn-close-analysis {
    background: none; border: none; color: var(--text-secondary);
    font-size: 1.2rem; cursor: pointer;
    transition: color 0.2s;
}
.btn-close-analysis:hover { color: var(--text-primary); }
.analysis-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary);
}
.analysis-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.analysis-section:last-child { border-bottom: none; }
.analysis-section h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.analysis-alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.8rem;
}
.analysis-alert.warn {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}
.analysis-alert.danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}
.analysis-alert.ok {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}
.analysis-metric {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
}
.analysis-metric .label { color: var(--text-muted); }
.analysis-metric .value { color: var(--text-primary); font-weight: 500; }

/* Toggle buttons */
.btn-analysis-toggle, .btn-table-toggle {
    position: fixed;
    right: 20px;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 80;
    transition: all 0.25s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.btn-analysis-toggle { bottom: 80px; }
.btn-table-toggle { bottom: 24px; }
.btn-analysis-toggle svg, .btn-table-toggle svg { width: 20px; height: 20px; }
.btn-analysis-toggle:hover, .btn-table-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.08);
}

/* ── Modal ─────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 1100px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 64px rgba(0,0,0,0.5);
}
.modal-content.modal-sm { max-width: 460px; }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1rem; font-weight: 600; }
.btn-close-modal {
    background: none; border: none; color: var(--text-secondary);
    font-size: 1.2rem; cursor: pointer;
}
.btn-close-modal:hover { color: var(--text-primary); }

/* Config Form */
.config-form { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.form-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.form-input {
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--accent); }
.form-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.btn-primary {
    padding: 8px 24px;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary:hover {
    box-shadow: 0 0 16px var(--accent-glow);
    transform: translateY(-1px);
}

/* Data Table */
.table-wrapper {
    padding: 16px;
    overflow: auto;
    flex: 1;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    font-family: var(--font-mono);
}
.data-table th {
    padding: 8px 10px;
    background: rgba(0,0,0,0.4);
    border-bottom: 2px solid var(--border-accent);
    text-align: left;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    position: sticky;
    top: 0;
}
.data-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    color: var(--text-secondary);
}
.data-table tr:hover td { background: rgba(0,229,255,0.03); color: var(--text-primary); }

/* ── Toast ─────────────────────────────────── */
.toast-container {
    position: fixed;
    top: calc(var(--header-h) + 12px);
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 3s forwards;
    max-width: 340px;
}
.toast.success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: var(--success); }
.toast.error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: var(--danger); }
.toast.info { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); color: var(--info); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }

/* ── Responsive ────────────────────────────── */
@media (max-width: 1024px) {
    .sidebar { width: 300px; min-width: 300px; }
    .charts-grid { grid-template-columns: 1fr; }
    .overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .overview-hero { flex-direction: column; }
    .overview-meta { justify-content: flex-start; max-width: none; }
}
@media (max-width: 768px) {
    .main { display: block; height: auto; min-height: calc(100vh - var(--header-h)); }
    .sidebar {
        display: flex;
        width: 100%;
        min-width: 0;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        padding: 14px;
    }
    .batch-list { max-height: 320px; }
    .header-center { display: none; }
    .charts-grid { grid-template-columns: 1fr; }
    .chart-container { height: 260px; }
    .analysis-panel { width: 100%; right: -100%; }
    .overview-panel { gap: 12px; }
    .overview-hero { padding: 18px; }
    .overview-title { font-size: 1.35rem; }
    .overview-stats { grid-template-columns: 1fr; }
    .selection-header { flex-direction: column; align-items: flex-start; }
}

/* ── Empty State ───────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    color: var(--text-muted);
}
.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 0.85rem; max-width: 360px; line-height: 1.6; }
.empty-state .btn-primary { margin-top: 20px; }

/* ── BioProcess Command Center v2 ─────────── */
:root {
    --bg-primary: #07100f;
    --bg-secondary: #0b1513;
    --bg-card: rgba(14, 24, 21, 0.94);
    --bg-card-hover: rgba(19, 32, 28, 0.96);
    --bg-glass: rgba(8, 17, 15, 0.96);
    --accent: #35d6c2;
    --accent-dim: rgba(53, 214, 194, 0.12);
    --accent-glow: rgba(53, 214, 194, 0.24);
    --success: #62d792;
    --warning: #e7b65d;
    --danger: #ef7470;
    --info: #70a9e8;
    --text-primary: #eef5f2;
    --text-secondary: #9eada8;
    --text-muted: #5f706a;
    --border: rgba(166, 190, 181, 0.13);
    --border-accent: rgba(53, 214, 194, 0.34);
    --header-h: 68px;
    --sidebar-w: 360px;
    --radius: 8px;
    --radius-sm: 6px;
}

body {
    background-color: var(--bg-primary);
    background-image:
        linear-gradient(rgba(91, 124, 113, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91, 124, 113, 0.035) 1px, transparent 1px);
    background-size: 28px 28px;
}

.header {
    height: var(--header-h);
    padding: 0 20px;
    background: rgba(7, 16, 15, 0.96);
    border-bottom: 1px solid rgba(53, 214, 194, 0.2);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.logo-text h1 {
    color: #f3f8f6;
    letter-spacing: 0;
}

.logo-sub {
    border-color: rgba(98, 215, 146, 0.4);
    background: rgba(98, 215, 146, 0.1);
    color: var(--success);
}

.phase-tabs {
    background: rgba(2, 9, 8, 0.62);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.phase-tab { border-radius: 5px; }
.phase-tab.active {
    color: #04110f;
    background: var(--accent);
    box-shadow: none;
}

.main { height: calc(100vh - var(--header-h)); }

.sidebar {
    padding: 14px;
    gap: 14px;
    background: rgba(7, 16, 15, 0.97);
    border-right-color: rgba(166, 190, 181, 0.16);
    backdrop-filter: none;
}

.sidebar-section-intro {
    padding: 14px;
    border-radius: 8px;
    border-color: rgba(53, 214, 194, 0.25);
    border-top: 2px solid var(--accent);
    background: #0c1815;
    box-shadow: none;
}

.sidebar-title {
    letter-spacing: 0;
    color: #7f928b;
}

.sidebar-desc {
    max-width: 220px;
    color: #a9b8b2;
}

.role-counters {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.role-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    height: 25px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
}

.role-counter.primary {
    color: var(--accent);
    border-color: rgba(53, 214, 194, 0.34);
    background: rgba(53, 214, 194, 0.08);
}

.role-counter.background {
    color: #a5b0ac;
    background: rgba(123, 135, 148, 0.08);
}

.sidebar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 12px;
}

.sidebar-action {
    margin-top: 0;
    padding: 8px 9px;
    border-radius: 6px;
    background: rgba(2, 9, 8, 0.5);
    font-size: 0.74rem;
}

.batch-tools { grid-template-columns: minmax(0, 1fr) 122px; }
.batch-search,
.batch-sort {
    border-radius: 6px;
    background: #091310;
}

.batch-quick-actions button {
    min-height: 34px;
    border-radius: 6px;
    background: #0b1714;
    color: #9eada8;
}

.batch-list { max-height: 48vh; }

.batch-item {
    gap: 7px;
    padding: 10px;
    border-radius: 7px;
    background: #0a1412;
    border-color: rgba(166, 190, 181, 0.11);
    cursor: default;
}

.batch-item:hover {
    transform: none;
    background: #0d1a17;
    border-color: rgba(166, 190, 181, 0.22);
}

.batch-item.role-primary {
    background: rgba(53, 214, 194, 0.075);
    border-color: rgba(53, 214, 194, 0.38);
    box-shadow: inset 3px 0 0 var(--accent);
}

.batch-item.role-background {
    background: rgba(123, 135, 148, 0.07);
    border-color: rgba(165, 176, 172, 0.24);
    box-shadow: inset 3px 0 0 #7b8794;
}

.batch-item-metrics {
    padding-left: 18px;
    gap: 4px;
}

.batch-item-metrics span {
    background: rgba(0, 0, 0, 0.16);
    border-radius: 3px;
}

.batch-item.role-primary .batch-item-metrics b { color: var(--accent); }
.batch-item.role-background .batch-item-metrics b { color: #b4bfbb; }

.batch-order.background {
    border: 1px solid rgba(165, 176, 172, 0.28);
    background: rgba(123, 135, 148, 0.1);
    color: #b4bfbb;
}

.batch-role-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding-left: 18px;
}

.batch-role-button {
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: rgba(2, 9, 8, 0.42);
    color: #71827c;
    font-size: 0.68rem;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.batch-role-button:hover {
    color: var(--text-primary);
    border-color: rgba(166, 190, 181, 0.34);
}

.batch-role-button.primary.active {
    color: var(--accent);
    border-color: rgba(53, 214, 194, 0.48);
    background: rgba(53, 214, 194, 0.12);
}

.batch-role-button.background.active {
    color: #d1dad7;
    border-color: rgba(165, 176, 172, 0.4);
    background: rgba(123, 135, 148, 0.14);
}

.charts-area { padding: 14px 16px 24px; }
.overview-panel { gap: 10px; margin-bottom: 12px; }

.overview-hero {
    min-height: 0;
    padding: 15px 18px;
    border-radius: 8px;
    border-color: rgba(53, 214, 194, 0.2);
    border-left: 3px solid var(--accent);
    background: rgba(11, 23, 20, 0.94);
    box-shadow: none;
}

.overview-eyebrow {
    margin-bottom: 5px;
    color: var(--success);
    letter-spacing: 0;
}

.overview-title {
    font-size: 1.38rem;
    letter-spacing: 0;
    margin-bottom: 5px;
}

.overview-subtitle {
    font-size: 0.84rem;
    line-height: 1.55;
}

.overview-pill {
    padding: 6px 9px;
    border-radius: 5px;
    background: #091310;
}

.overview-stats { gap: 8px; }
.overview-stat {
    min-height: 92px;
    padding: 12px 14px;
    border-radius: 7px;
    background: rgba(12, 23, 20, 0.94);
}

.overview-stat-label { margin-bottom: 6px; letter-spacing: 0; }
.overview-stat-value { font-size: 1.18rem; margin-bottom: 5px; }
.overview-stat-helper { font-size: 0.74rem; }

.selection-panel {
    margin-bottom: 12px;
    padding: 13px 15px;
    border-radius: 8px;
    background: rgba(11, 22, 19, 0.96);
    box-shadow: none;
}

.selection-header { margin-bottom: 11px; }
.selection-counts { display: flex; gap: 6px; }
.selection-count { border-radius: 5px; }
.selection-count.primary { color: var(--accent); border-color: rgba(53, 214, 194, 0.3); }
.selection-count.background { color: #a5b0ac; }

.selection-lanes {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 10px;
}

.selection-lane {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: rgba(5, 13, 11, 0.52);
}

.selection-lane.primary-lane { border-color: rgba(53, 214, 194, 0.22); }

.selection-lane-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 9px;
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.selection-lane-label strong { color: var(--text-primary); font-size: 0.74rem; }
.selection-lane-label > span:last-child { margin-left: auto; }

.lane-mark {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}
.lane-mark.primary { background: var(--accent); }
.lane-mark.background { background: #7b8794; }

.selection-chip {
    padding: 8px 9px;
    border-radius: 6px;
    background: #091310;
}

.selection-chip.background {
    border-color: rgba(165, 176, 172, 0.18);
    background: rgba(123, 135, 148, 0.06);
}

.selection-empty { border-radius: 6px; }

.chart-card {
    border-radius: 8px;
    background: rgba(12, 22, 20, 0.95);
}

.chart-card:hover {
    transform: none;
    border-color: rgba(53, 214, 194, 0.3);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.22);
}

.chart-header {
    min-height: 46px;
    padding: 10px 14px;
    border-bottom-color: rgba(166, 190, 181, 0.12);
}

.chart-badge {
    border: 1px solid var(--border);
    border-radius: 4px;
    background: rgba(3, 10, 8, 0.5);
}

.chart-param-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 14px;
    min-height: 42px;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(166, 190, 181, 0.11);
    background: rgba(2, 9, 8, 0.32);
}

.chart-param-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 26px;
    color: #aebbb7;
    font-size: 0.72rem;
    cursor: pointer;
    user-select: none;
}

.chart-param-option input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.chart-param-box {
    position: relative;
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    border: 1px solid #636366;
    border-radius: 5px;
    background: rgba(118, 118, 128, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.chart-param-box::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    opacity: 0;
    transform: rotate(45deg) scale(0.7);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.chart-param-option input:checked + .chart-param-box {
    border-color: #0a84ff;
    background: #0a84ff;
}

.chart-param-option input:checked + .chart-param-box::after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

.chart-param-option input:focus-visible + .chart-param-box {
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.28);
}

.chart-param-option:active .chart-param-box { transform: scale(0.9); }
.chart-param-option:hover { color: #f2f2f7; }
.chart-param-label { line-height: 1.25; }

/* ── iOS dark controls ────────────────────── */
:root {
    --ios-blue: #0a84ff;
    --ios-blue-pressed: #0071e3;
    --ios-control: rgba(118, 118, 128, 0.18);
    --ios-control-hover: rgba(118, 118, 128, 0.28);
    --ios-separator: rgba(84, 84, 88, 0.52);
}

button {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", var(--font-sans);
    letter-spacing: 0;
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.3);
}

button:disabled {
    opacity: 0.38;
    cursor: default;
    box-shadow: none;
}

.btn-refresh,
.btn-upload,
.btn-analysis-toggle,
.btn-table-toggle {
    border-color: var(--ios-separator);
    background: rgba(44, 44, 46, 0.82);
    color: #f2f2f7;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 3px 12px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(18px) saturate(140%);
}

.btn-refresh,
.btn-upload { border-radius: 10px; }

.btn-refresh:hover,
.btn-upload:hover,
.btn-analysis-toggle:hover,
.btn-table-toggle:hover {
    border-color: rgba(10, 132, 255, 0.7);
    background: rgba(58, 58, 60, 0.92);
    color: var(--ios-blue);
}

.btn-refresh:active:not(:disabled),
.btn-upload:active:not(:disabled),
.btn-analysis-toggle:active:not(:disabled),
.btn-table-toggle:active:not(:disabled) {
    transform: scale(0.94);
    background: rgba(72, 72, 74, 0.92);
}

.phase-tabs {
    gap: 2px;
    padding: 3px;
    border-color: var(--ios-separator);
    border-radius: 11px;
    background: var(--ios-control);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.phase-tab {
    min-height: 30px;
    border-radius: 8px;
    transition: color 0.16s ease, background 0.16s ease, transform 0.12s ease;
}

.phase-tab:hover { background: var(--ios-control-hover); color: #f2f2f7; }
.phase-tab.active {
    color: #fff;
    background: var(--ios-blue);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.phase-tab:active { transform: scale(0.97); }

.batch-quick-actions button,
.sidebar-action,
.btn-primary {
    min-height: 34px;
    border: 1px solid var(--ios-separator);
    border-radius: 10px;
    background: var(--ios-control);
    color: #f2f2f7;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.batch-quick-actions button:hover,
.sidebar-action:hover {
    border-color: rgba(10, 132, 255, 0.52);
    background: var(--ios-control-hover);
    color: #fff;
}

.btn-primary {
    padding: 8px 20px;
    border-color: var(--ios-blue);
    background: var(--ios-blue);
    color: #fff;
    font-weight: 600;
}

.btn-primary:hover {
    border-color: var(--ios-blue);
    background: var(--ios-blue-pressed);
    color: #fff;
    box-shadow: 0 4px 14px rgba(10, 132, 255, 0.24);
    transform: none;
}

.batch-quick-actions button:active:not(:disabled),
.sidebar-action:active:not(:disabled),
.btn-primary:active:not(:disabled) { transform: scale(0.97); }

.batch-role-control {
    gap: 2px;
    padding: 3px;
    margin-left: 18px;
    border: 1px solid rgba(84, 84, 88, 0.34);
    border-radius: 10px;
    background: var(--ios-control);
}

.batch-role-button {
    height: 28px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #a1a1a6;
    transition: color 0.16s ease, background 0.16s ease, transform 0.12s ease;
}

.batch-role-button:hover { border-color: transparent; background: var(--ios-control-hover); color: #fff; }
.batch-role-button.primary.active {
    border-color: transparent;
    background: var(--ios-blue);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.batch-role-button.background.active {
    border-color: transparent;
    background: #636366;
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.batch-role-button:active { transform: scale(0.97); }

.selection-chip {
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-close-analysis,
.btn-close-modal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: var(--ios-control);
    color: #a1a1a6;
}

.btn-close-analysis:hover,
.btn-close-modal:hover { background: var(--ios-control-hover); color: #fff; }

@media (max-width: 1100px) {
    :root { --sidebar-w: 320px; }
    .selection-lanes { grid-template-columns: 1fr; }
    .selection-lane-label > span:last-child { display: none; }
}

@media (max-width: 768px) {
    .header { padding: 0 12px; }
    .header-left { flex: 1; min-width: 0; }
    .header-right { flex-shrink: 0; gap: 7px; }
    .logo { min-width: 0; gap: 8px; }
    .author-avatar { width: 38px; height: 38px; flex-shrink: 0; }
    .logo-text { min-width: 0; }
    .logo-text h1 {
        max-width: 190px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.9rem;
    }
    .author-info {
        max-width: 190px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.66rem;
    }
    .status-text, .last-update { display: none; }
    .sidebar { width: 100%; min-width: 0; }
    .sidebar-headline { align-items: flex-start; }
    .role-counters { min-width: 88px; }
    .batch-tools { grid-template-columns: 1fr; }
    .overview-hero { padding: 13px 14px; }
    .overview-meta { display: none; }
    .overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .selection-counts { width: 100%; }
    .selection-count { flex: 1; }
    .selection-lanes { grid-template-columns: 1fr; }
}
/* 20260719 生物小胖个人系统入口 */
.portal-back-link {
    position: fixed;
    z-index: 9999;
    left: 18px;
    bottom: 18px;
    padding: 10px 15px;
    border: 1px solid rgba(0, 229, 255, .34);
    border-radius: 999px;
    color: #e7fdff;
    background: rgba(2, 18, 17, .94);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .32);
    text-decoration: none;
    font-size: 12px;
    backdrop-filter: blur(12px);
}

.portal-back-link:hover {
    border-color: #00e5ff;
    transform: translateY(-2px);
}
