/* ------------------------------------------------------------------
   Soft UI / Cream / Linear-Arc-Raycast aesthetic
   - 奶油白底 + 轻紫主调 + Morandi 辅色
   - 24px 圆角 + 软阴影 + 大量留白
   ------------------------------------------------------------------ */

:root {
    /* surfaces */
    --bg: #faf7f2;
    --bg-soft: #f5f1ea;
    --surface: #ffffff;
    --surface-hover: #fbfaf7;
    --border: #ede7dd;
    --border-strong: #d8cfc1;

    /* text */
    --text: #2a2825;
    --text-2: #6c6962;
    --text-3: #a09c93;

    /* primary accent */
    --accent: #a78bfa;
    --accent-2: #8b6df0;
    --accent-soft: #efebff;
    --accent-line: #d7caff;

    /* status palette (Morandi) */
    --admitted: #6ea089;
    --admitted-bg: #e8f0eb;
    --pending: #c79d6a;
    --pending-bg: #f6ecd9;
    --rejected: #c07b78;
    --rejected-bg: #f4e1de;
    --deprecated: #8e8a82;
    --deprecated-bg: #ece9e2;

    /* ic heat */
    --ic-pos-strong: #5b9d72;
    --ic-pos: #a8cdb6;
    --ic-pos-soft: #dfeae3;
    --ic-neg-soft: #efd9d8;
    --ic-neg: #d7a5a3;
    --ic-neg-strong: #b46f6c;
    --ic-neutral: #ece8e0;

    /* shadows */
    --shadow-sm: 0 1px 2px rgba(40, 30, 60, 0.04);
    --shadow-md: 0 1px 2px rgba(40, 30, 60, 0.04), 0 8px 24px rgba(180, 170, 210, 0.08);
    --shadow-lg: 0 4px 12px rgba(40, 30, 60, 0.06), 0 24px 48px rgba(180, 170, 210, 0.14);

    /* radii */
    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 24px;
    --r-xl: 32px;
    --r-full: 999px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, "SF Pro Text", "Inter", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    background: none;
    border: 0;
    color: inherit;
}

input, select {
    font-family: inherit;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--r-full);
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-track {
    background: transparent;
}

/* ------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------ */
.app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 40px 80px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.topbar h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.topbar h1 .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.topbar .meta {
    font-size: 12px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 14px;
}
.topbar .meta .refresh {
    padding: 6px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: 12px;
    color: var(--text-2);
    transition: 150ms;
}
.topbar .meta .refresh:hover {
    background: var(--accent-soft);
    border-color: var(--accent-line);
    color: var(--accent-2);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px 4px 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: 12px;
    color: var(--text-2);
}
.user-chip .avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}
.user-chip .logout {
    margin-left: 4px;
    padding: 3px 10px;
    background: var(--bg-soft);
    color: var(--text-3);
    border-radius: var(--r-full);
    font-size: 11px;
    transition: 150ms;
}
.user-chip .logout:hover {
    background: var(--rejected-bg);
    color: var(--rejected);
}

/* KPI strip */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 32px;
}
.kpi {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 18px 22px;
    box-shadow: var(--shadow-md);
    border: 1px solid transparent;
    transition: 200ms;
}
.kpi:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}
.kpi .label {
    font-size: 12px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}
.kpi .value {
    margin-top: 8px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}
.kpi .value .unit {
    margin-left: 4px;
    font-size: 12px;
    color: var(--text-3);
    font-weight: 500;
}
.kpi.admitted .value { color: var(--admitted); }
.kpi.pending .value { color: var(--pending); }
.kpi.rejected .value { color: var(--rejected); }
.kpi.alpha .value { color: var(--accent-2); }
.kpi.alert .value .alert-red { color: var(--rejected); }
.kpi.alert .value .alert-yellow { color: var(--pending); }
.kpi.alert .value .unit { font-size: 13px; margin: 0 2px; color: var(--text-3); font-weight: 500; }
.kpi.slow .value .slow-count { color: #b18556; }
.kpi.slow .value .unit { font-size: 13px; margin: 0 2px; color: var(--text-3); font-weight: 500; }

/* 预警圆点 — 卡片右上角 */
.card .alert-dot {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--surface);
    cursor: help;
}
.card .alert-dot.red {
    background: var(--rejected);
    box-shadow: 0 0 0 4px var(--surface), 0 0 12px rgba(192, 123, 120, 0.5);
    animation: pulse-red 2s ease-in-out infinite;
}
.card .alert-dot.yellow {
    background: var(--pending);
}
@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 4px var(--surface), 0 0 12px rgba(192, 123, 120, 0.5); }
    50%      { box-shadow: 0 0 0 4px var(--surface), 0 0 18px rgba(192, 123, 120, 0.85); }
}

.tag.alert-red {
    background: var(--rejected-bg);
    color: var(--rejected);
    cursor: help;
}
.tag.alert-yellow {
    background: var(--pending-bg);
    color: var(--pending);
    cursor: help;
}

/* 详情面板的预警横幅 */
.alert-banner {
    padding: 10px 14px;
    border-radius: var(--r-md);
    font-size: 12.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-banner.red {
    background: var(--rejected-bg);
    color: var(--rejected);
}
.alert-banner.yellow {
    background: var(--pending-bg);
    color: var(--pending);
}
.alert-banner .alert-icon { font-size: 16px; }

/* ------------------------------------------------------------------
   Section heading + Category performance strip
   ------------------------------------------------------------------ */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 12px 0;
}
.section-head > span:first-child {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.005em;
}
.section-head .section-sub {
    font-size: 11px;
    color: var(--text-3);
}

.cat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}
.cat-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid transparent;
    transition: 180ms;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-line);
}
.cat-card.active {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.cat-card .name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cat-card .stats {
    font-size: 11px;
    color: var(--text-3);
    display: flex;
    gap: 6px;
    align-items: center;
}
.cat-card .stats .recent {
    font-feature-settings: "tnum";
    font-weight: 600;
    font-size: 13px;
}
.cat-card .stats .recent.pos { color: var(--admitted); }
.cat-card .stats .recent.neg { color: var(--rejected); }
.cat-card .stats .recent.dim { color: var(--text-3); }
.cat-card .stats .delta {
    margin-left: auto;
    font-size: 10.5px;
    font-feature-settings: "tnum";
    color: var(--text-3);
}
.cat-card .mini-spark {
    height: 28px;
    background: var(--bg-soft);
    border-radius: var(--r-sm);
    padding: 4px 6px;
    display: flex;
    align-items: center;
}
.cat-card .mini-spark svg {
    width: 100%;
    height: 100%;
}
.cat-card .breakdown {
    display: flex;
    gap: 4px;
    font-size: 10px;
}
.cat-card .breakdown .b {
    padding: 1px 7px;
    border-radius: var(--r-full);
    font-weight: 500;
}
.cat-card .breakdown .b.a { background: var(--admitted-bg); color: var(--admitted); }
.cat-card .breakdown .b.p { background: var(--pending-bg); color: var(--pending); }
.cat-card .breakdown .b.r { background: var(--rejected-bg); color: var(--rejected); }

/* ------------------------------------------------------------------
   Tabs
   ------------------------------------------------------------------ */
.tabs {
    display: flex;
    gap: 6px;
    background: var(--surface);
    padding: 6px;
    border-radius: var(--r-full);
    box-shadow: var(--shadow-sm);
    width: fit-content;
    margin-bottom: 22px;
}
.tab {
    padding: 8px 18px;
    border-radius: var(--r-full);
    font-size: 13px;
    color: var(--text-2);
    font-weight: 500;
    transition: 180ms;
}
.tab:hover {
    color: var(--text);
}
.tab.active {
    background: var(--accent-soft);
    color: var(--accent-2);
}
.tab .badge {
    margin-left: 6px;
    font-size: 11px;
    color: var(--text-3);
    font-weight: 500;
}
.tab.active .badge {
    color: var(--accent-2);
}

/* ------------------------------------------------------------------
   Filter bar
   ------------------------------------------------------------------ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--surface);
    padding: 14px 18px;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
}
.filter-bar .group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.filter-bar .group-label {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
    margin-right: 4px;
}
.pill {
    padding: 5px 11px;
    border-radius: var(--r-full);
    background: var(--bg-soft);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 500;
    transition: 150ms;
    border: 1px solid transparent;
    white-space: nowrap;
}
.pill:hover {
    background: var(--accent-soft);
    color: var(--accent-2);
}
.pill.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.pill.status-admitted.active { background: var(--admitted); border-color: var(--admitted); }
.pill.status-pending.active { background: var(--pending); border-color: var(--pending); }
.pill.status-rejected.active { background: var(--rejected); border-color: var(--rejected); }
.pill.status-deprecated.active { background: var(--deprecated); border-color: var(--deprecated); }

.search {
    flex: 1;
    min-width: 200px;
    margin-left: auto;
    padding: 7px 14px;
    background: var(--bg-soft);
    border: 1px solid transparent;
    border-radius: var(--r-full);
    font-size: 13px;
    color: var(--text);
    transition: 180ms;
}
.search:focus {
    outline: 0;
    background: var(--surface);
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.search::placeholder {
    color: var(--text-3);
}

.sort-select {
    padding: 7px 12px;
    background: var(--bg-soft);
    border: 1px solid transparent;
    border-radius: var(--r-full);
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
}
.sort-select:focus {
    outline: 0;
    border-color: var(--accent-line);
}

/* ------------------------------------------------------------------
   Cards (Overview)
   ------------------------------------------------------------------ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.card {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: 180ms ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-line);
}
.card .header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.card .title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.card .id {
    font-size: 11px;
    color: var(--text-3);
    font-family: "SF Mono", "Menlo", monospace;
    margin-right: 6px;
}
.card .pills {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.tag {
    padding: 3px 8px;
    border-radius: var(--r-full);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.tag.status-admitted { background: var(--admitted-bg); color: var(--admitted); }
.tag.status-pending { background: var(--pending-bg); color: var(--pending); }
.tag.status-rejected { background: var(--rejected-bg); color: var(--rejected); }
.tag.status-deprecated { background: var(--deprecated-bg); color: var(--deprecated); }
.tag.cat { background: var(--accent-soft); color: var(--accent-2); }
.tag.misalign { background: #f5e8d4; color: #a07533; cursor: help; }
.tag.slow { background: #fbe7c6; color: #8c5a17; cursor: help; }

/* 详情页 worker wall-clock 标签 */
.recompute-timing {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-3);
    background: var(--bg-soft);
    cursor: help;
}
.recompute-timing.slow { color: #8c5a17; background: #fbe7c6; font-weight: 600; }

.card .sparkline {
    background: var(--bg-soft);
    border-radius: var(--r-md);
    padding: 8px 10px;
    height: 56px;
    display: flex;
    align-items: center;
}
.card .sparkline svg {
    width: 100%;
    height: 100%;
}
.card .sparkline-empty {
    color: var(--text-3);
    font-size: 11px;
    text-align: center;
    width: 100%;
}

.card .metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.metric {
    display: flex;
    flex-direction: column;
}
.metric .k {
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}
.metric .v {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-top: 2px;
    font-feature-settings: "tnum";
}
.metric .v.pos { color: var(--admitted); }
.metric .v.neg { color: var(--rejected); }
.metric .v.dim { color: var(--text-3); font-weight: 500; }

.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-3);
    font-size: 13px;
}

/* ------------------------------------------------------------------
   Decay tracker (table)
   ------------------------------------------------------------------ */
.decay-table {
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.decay-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.6fr) 1fr 110px 110px 90px;
    gap: 12px;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    transition: 150ms;
    cursor: pointer;
    font-size: 13px;
}
.decay-row:last-child { border-bottom: 0; }
.decay-row.head {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
    cursor: default;
}
.decay-row:not(.head):hover {
    background: var(--surface-hover);
}
.decay-row .cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.decay-row .name {
    display: flex;
    align-items: center;
    gap: 8px;
}
.decay-row .name .label {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.heatstrip {
    display: flex;
    gap: 2px;
    width: 100%;
    height: 22px;
    border-radius: var(--r-sm);
    overflow: hidden;
}
.heatstrip .cell {
    flex: 1;
    height: 100%;
    background: var(--ic-neutral);
    position: relative;
}
.heatstrip .cell[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translate(-50%, -4px);
    background: var(--text);
    color: var(--bg);
    padding: 4px 8px;
    border-radius: var(--r-sm);
    font-size: 10.5px;
    white-space: nowrap;
    z-index: 10;
}
.dt-num {
    font-feature-settings: "tnum";
    text-align: right;
}
.dt-num.pos { color: var(--admitted); }
.dt-num.neg { color: var(--rejected); }
.dt-num.dim { color: var(--text-3); }

/* ------------------------------------------------------------------
   Queue (PENDING / REJECTED tables)
   ------------------------------------------------------------------ */
.queue-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
@media (max-width: 1100px) {
    .queue-grid { grid-template-columns: 1fr; }
}
.queue-section {
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    padding: 18px 20px;
}
.queue-section h3 {
    margin: 0 0 14px 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text);
}
.queue-section h3 .count {
    font-size: 11px;
    color: var(--text-3);
    font-weight: 500;
}
.queue-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 70vh;
    overflow-y: auto;
}
.queue-item {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--r-md);
    transition: 150ms;
    cursor: pointer;
    font-size: 12.5px;
}
.queue-item:hover {
    background: var(--bg-soft);
}
.queue-item .qid {
    font-family: "SF Mono", "Menlo", monospace;
    color: var(--text-3);
    font-size: 11px;
    text-align: right;
}
.queue-item .qname {
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.queue-item .qmeta {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 2px;
}
.queue-item .qval {
    font-feature-settings: "tnum";
    font-weight: 600;
    font-size: 12.5px;
    color: var(--text);
    text-align: right;
}

/* ------------------------------------------------------------------
   Big rows (Candidate Queue / Rejected lists)
   ------------------------------------------------------------------ */
.big-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.big-row {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: 180ms;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.big-row:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-line);
}

.big-row-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.big-row-head .big-id {
    font-family: "SF Mono", "Menlo", monospace;
    font-size: 11px;
    color: var(--text-3);
    background: var(--bg-soft);
    padding: 2px 8px;
    border-radius: var(--r-full);
}
.big-row-head .big-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.005em;
}
.big-row-head .eval {
    font-size: 11px;
    color: var(--text-3);
    margin-left: 8px;
    font-feature-settings: "tnum";
}
.big-row-head .row-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.big-row-head .row-hint {
    font-size: 11px;
    color: var(--accent-2);
    background: var(--accent-soft);
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-feature-settings: "tnum";
    font-weight: 500;
}
.big-row-head .open-hint {
    color: var(--text-3);
    font-size: 16px;
    transition: 150ms;
}
.big-row:hover .open-hint {
    color: var(--accent);
    transform: translateX(2px);
}

.big-cells {
    display: grid;
    grid-template-columns: repeat(11, minmax(0, 1fr));
    gap: 10px;
}
@media (max-width: 1100px) {
    .big-cells { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .big-cells { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.big-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 4px;
    border-radius: var(--r-sm);
    min-width: 0;
}
.big-cell.highlight {
    background: var(--accent-soft);
    padding: 6px 10px;
}
.big-cell .bk {
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.big-cell .bv {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    font-feature-settings: "tnum";
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.big-cell .bv.pos { color: var(--admitted); }
.big-cell .bv.neg { color: var(--rejected); }
.big-cell .bv.dim { color: var(--text-3); font-weight: 500; }

.row-reason {
    background: var(--rejected-bg);
    border-radius: var(--r-md);
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 8px;
}
.row-reason .reason-tag {
    flex-shrink: 0;
    padding: 2px 8px;
    background: var(--rejected);
    color: white;
    border-radius: var(--r-full);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ------------------------------------------------------------------
   Detail panel (modal-ish)
   ------------------------------------------------------------------ */
.detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(40, 30, 60, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 50;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 4vh 4vw;
    overflow-y: auto;
}
.detail-overlay.show { display: flex; }
.detail-panel {
    background: var(--surface);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    max-width: 1100px;
    width: 100%;
    padding: 28px 32px;
    margin: auto 0;
}
.detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}
.detail-head .title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    flex: 1;
}
.detail-head .close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--text-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: 150ms;
}
.detail-head .close:hover {
    background: var(--rose-soft, var(--rejected-bg));
    color: var(--rejected);
}
.detail-sub {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.factor-desc {
    background: var(--bg-soft);
    border-left: 3px solid var(--accent);
    border-radius: var(--r-md);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text);
}
.factor-desc .desc-label {
    display: inline-block;
    font-size: 10.5px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-right: 8px;
    font-weight: 600;
}
.factor-desc .desc-text {
    color: var(--text);
}
.factor-desc-rich {
    background: var(--bg-soft);
    border-radius: var(--r-md);
    padding: 14px 18px 4px;
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
}
.factor-desc-rich .desc-section {
    margin-bottom: 12px;
}
.factor-desc-rich .desc-section:last-child {
    margin-bottom: 4px;
}
.factor-desc-rich .ds-label {
    font-size: 10.5px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
    font-weight: 600;
}
.factor-desc-rich .ds-text {
    color: var(--text);
    white-space: pre-wrap;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}
.detail-grid .metric {
    background: var(--bg-soft);
    border-radius: var(--r-md);
    padding: 10px 12px;
}
.reason-box {
    background: var(--bg-soft);
    border-radius: var(--r-md);
    padding: 10px 14px;
    font-size: 12.5px;
    color: var(--text-2);
    margin-bottom: 18px;
}
.reason-box .label {
    font-size: 10.5px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}
.replace-hint {
    background: var(--accent-soft);
    color: var(--text);
    padding: 10px 14px;
    border-radius: var(--r-md);
    font-size: 12.5px;
    margin-bottom: 12px;
    line-height: 1.6;
}
.replace-hint b {
    color: var(--accent-2);
    font-weight: 600;
}
.replace-hint .replace-go {
    margin-left: 8px;
    padding: 2px 10px;
    background: var(--admitted);
    color: white;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 600;
}

.action-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 18px;
    padding: 14px 16px;
    background: var(--bg-soft);
    border-radius: var(--r-md);
}
.action {
    padding: 8px 16px;
    border-radius: var(--r-full);
    font-size: 12.5px;
    font-weight: 600;
    transition: 150ms;
    cursor: pointer;
    background: var(--surface);
    color: var(--text-2);
    border: 1px solid var(--border);
}
.action:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}
.action.btn-admit {
    background: var(--admitted);
    color: white;
    border-color: var(--admitted);
}
.action.btn-admit:hover { background: #5d8b76; border-color: #5d8b76; }
.action.btn-reject {
    background: var(--rejected-bg);
    color: var(--rejected);
    border-color: var(--rejected-bg);
}
.action.btn-reject:hover { background: #efd0ce; }
.action.btn-deprecate {
    background: var(--deprecated-bg);
    color: var(--deprecated);
    border-color: var(--deprecated-bg);
}
.action.btn-replace {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.action.btn-replace:hover { background: var(--accent-2); border-color: var(--accent-2); }

.replace-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.replace-select {
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: 12px;
    color: var(--text-2);
    cursor: pointer;
    max-width: 280px;
}
.replace-select:focus {
    outline: 0;
    border-color: var(--accent-line);
}

.report-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-soft);
    padding: 4px;
    border-radius: var(--r-full);
    width: fit-content;
    margin-bottom: 14px;
}
.report-tabs .rt {
    padding: 6px 14px;
    border-radius: var(--r-full);
    font-size: 12px;
    color: var(--text-2);
    font-weight: 500;
    transition: 150ms;
}
.report-tabs .rt.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}
.report-img {
    width: 100%;
    background: var(--bg-soft);
    border-radius: var(--r-md);
    padding: 8px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.report-img img {
    width: 100%;
    height: auto;
    border-radius: var(--r-sm);
    display: block;
}
.report-img .placeholder {
    color: var(--text-3);
    font-size: 12px;
}

/* hide-show */
[data-tab-content] { display: none; }
[data-tab-content].active { display: block; }

/* ------------------------------------------------------------------
   Toast
   ------------------------------------------------------------------ */
#toast.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translate(-50%, -8px);
    padding: 10px 22px;
    background: var(--surface);
    color: var(--text);
    border-radius: var(--r-full);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(40, 30, 60, 0.12),
                0 24px 48px rgba(180, 170, 210, 0.18);
    border: 1px solid var(--border);
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity 200ms, transform 200ms;
}
#toast.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
#toast.toast-ok {
    background: var(--admitted-bg);
    color: var(--admitted);
    border-color: transparent;
}
#toast.toast-warn {
    background: var(--pending-bg);
    color: var(--pending);
    border-color: transparent;
}
#toast.toast-error {
    background: var(--rejected-bg);
    color: var(--rejected);
    border-color: transparent;
}

/* 详情面板切换时的细微淡入，让 admit→next 流畅 */
.detail-panel {
    animation: panel-in 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes panel-in {
    from { opacity: 0.4; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
