@font-face {
    font-family: "DeepJing GB2312";
    src: local("Times New Roman"), url("/lingxi/fonts/times-regular");
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    unicode-range: U+0000-024F, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-214F;
}

@font-face {
    font-family: "DeepJing GB2312";
    src: local("Times New Roman Bold"), url("/lingxi/fonts/times-bold");
    font-style: normal;
    font-weight: 600 700;
    font-display: swap;
    unicode-range: U+0000-024F, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-214F;
}

@font-face {
    font-family: "DeepJing GB2312";
    src: local("Times New Roman Italic"), url("/lingxi/fonts/times-italic");
    font-style: italic;
    font-weight: 400 500;
    font-display: swap;
    unicode-range: U+0000-024F, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-214F;
}

@font-face {
    font-family: "DeepJing GB2312";
    src: local("Times New Roman Bold Italic"), url("/lingxi/fonts/times-bold-italic");
    font-style: italic;
    font-weight: 600 700;
    font-display: swap;
    unicode-range: U+0000-024F, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-214F;
}

@font-face {
    font-family: "DeepJing GB2312";
    src: local("FangSong_GB2312"), local("仿宋_GB2312"), local("FangSong"), url("/lingxi/fonts/gb2312-regular");
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    unicode-range: U+2E80-2EFF, U+3000-303F, U+31C0-31EF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE30-FE4F, U+FF00-FFEF;
}

@font-face {
    font-family: "DeepJing GB2312";
    src: local("FangSong_GB2312"), local("仿宋_GB2312"), local("FangSong"), url("/lingxi/fonts/gb2312-bold");
    font-style: normal;
    font-weight: 600 700;
    font-display: swap;
    unicode-range: U+2E80-2EFF, U+3000-303F, U+31C0-31EF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE30-FE4F, U+FF00-FFEF;
}

:root {
    --font-ui: "DeepJing GB2312", "FangSong_GB2312", "仿宋_GB2312", "Times New Roman", serif;
    --font-display: "DeepJing GB2312", "FangSong_GB2312", "仿宋_GB2312", "Times New Roman", serif;
    --type-display: 48px;
    --type-display-compact: 40px;
    --type-page-title: 32px;
    --type-section-title: 24px;
    --type-card-title: 20px;
    --type-navigation: 17px;
    --type-body-large: 16px;
    --type-body: 14px;
    --type-label: 13px;
    --type-caption: 12px;
    --leading-display: 54px;
    --leading-display-compact: 48px;
    --leading-page-title: 38px;
    --leading-section-title: 31px;
    --leading-card-title: 26px;
    --leading-navigation: 24px;
    --leading-body-large: 26px;
    --leading-body: 22px;
    --leading-label: 19px;
    --leading-caption: 18px;
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --bg: #f5f5f7;
    --surface: rgba(255, 255, 255, 0.74);
    --surface-strong: rgba(255, 255, 255, 0.9);
    --text: #1d1d1f;
    --muted: #6e6e73;
    --line: #d2d2d7;
    --blue: #007aff;
    --blue-soft: #e8f2ff;
    --green: #34c759;
    --orange: #ff9500;
    --red: #ff3b30;
    --purple: #5856d6;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: #f5f5f7;
    color: var(--text);
    font-family: var(--font-ui);
    letter-spacing: 0;
}

body:not(.fundma-screen-body) {
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.92) 0, rgba(255, 255, 255, 0) 30%),
        radial-gradient(circle at 82% 4%, rgba(100, 210, 255, 0.22) 0, rgba(100, 210, 255, 0) 28%),
        radial-gradient(circle at 72% 88%, rgba(88, 86, 214, 0.13) 0, rgba(88, 86, 214, 0) 32%),
        linear-gradient(180deg, #fbfbfd 0%, #f2f5f9 48%, #eef3f7 100%);
    background-attachment: fixed;
}

@font-face {
    font-family: screenDigital;
    src: url("/lingxi/static/vendor/fundma/DS-DIGIT.TTF");
}

.fundma-screen-body {
    min-height: 100vh;
    overflow-x: hidden;
    background: #030b1a url("/lingxi/static/vendor/fundma/bg.jpg") no-repeat top center / cover;
    font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0 32px;
    background: rgba(245, 245, 247, 0.86);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(210, 210, 215, 0.7);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.brand-mark {
    position: relative;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background:
        radial-gradient(circle at 34% 32%, rgba(255, 255, 255, 0.92) 0 7%, transparent 8%),
        linear-gradient(145deg, #0a84ff 0%, #64d2ff 46%, #1d1d1f 47%, #050608 100%);
    display: inline-block;
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.18),
        0 10px 22px rgba(0, 122, 255, 0.24);
}

.brand-mark::before,
.brand-mark::after {
    content: "";
    position: absolute;
}

.brand-mark::before {
    inset: 7px 5px;
    border: 2px solid rgba(255, 255, 255, 0.82);
    border-radius: 50%;
    transform: rotate(-21deg) scaleX(1.32);
}

.brand-mark::after {
    left: 8px;
    right: 8px;
    top: 14px;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow:
        0 -5px 0 rgba(255, 255, 255, 0.24),
        0 5px 0 rgba(100, 210, 255, 0.58);
    transform: rotate(-21deg);
}

.brand-logo {
    display: block;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border: 1px solid rgba(29, 29, 31, 0.08);
    border-radius: 9px;
    background: #fff;
    object-fit: contain;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.18),
        0 8px 20px rgba(0, 0, 0, 0.1);
}

.nav {
    display: flex;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}

.nav a,
.userbar span {
    color: var(--muted);
    font-size: 14px;
}

.nav a {
    padding: 8px 12px;
    border-radius: 8px;
}

.nav a:hover {
    background: #fff;
    color: var(--text);
}

.userbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shell {
    width: min(1240px, calc(100vw - 40px));
    margin: 0 auto;
    padding: 34px 0 56px;
}

.screen-shell {
    width: 100%;
    max-width: none;
    padding: 0;
}

.page-head,
.graph-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.page-head h1,
.graph-head h1,
.auth-panel h1 {
    margin: 6px 0 0;
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.05;
}

.page-head p {
    max-width: 760px;
    margin: 10px 0 0;
    color: var(--muted);
}

.page-head.case-subjects-head {
    align-items: flex-start;
    margin-bottom: 18px;
}

.page-head.case-subjects-head h1 {
    margin-top: 4px;
    font-size: 32px;
    line-height: 1.1;
}

.page-head.case-subjects-head p {
    margin-top: 7px;
    font-size: 14px;
}

.section-kicker {
    font-size: 12px;
    font-weight: 700;
    color: var(--blue);
}

.button {
    border: 1px solid transparent;
    min-height: 38px;
    padding: 9px 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    background: #f9f9fb;
    color: var(--text);
    font-weight: 600;
}

.button.primary {
    background: var(--blue);
    color: #fff;
}

.button.ghost {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.78);
}

.button.danger {
    background: #fff1f0;
    color: var(--red);
    border-color: #ffd2ce;
}

.button.small {
    min-height: 32px;
    padding: 6px 12px;
    font-size: 13px;
}

.button.tiny {
    min-height: 26px;
    padding: 4px 8px;
    font-size: 12px;
}

.is-hidden {
    display: none !important;
}

.inline-link {
    color: var(--blue);
    font-weight: 600;
}

.muted {
    color: var(--muted);
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.flash {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.flash.success {
    border-color: rgba(52, 199, 89, 0.35);
    color: #127a33;
}

.flash.error {
    border-color: rgba(255, 59, 48, 0.35);
    color: #b42318;
}

.flash.warning {
    border-color: rgba(255, 149, 0, 0.45);
    color: #9a5b00;
}

.panel,
.metric-card,
.case-card,
.auth-panel {
    background: var(--surface);
    border: 1px solid rgba(210, 210, 215, 0.78);
    border-radius: 8px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.74),
        0 18px 48px rgba(31, 35, 45, 0.08);
    backdrop-filter: blur(24px) saturate(1.18);
}

.panel {
    padding: 20px;
}

.panel.compact {
    margin-bottom: 22px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-head h2,
.subsection h3 {
    margin: 0;
    font-size: 20px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

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

.metric-card {
    padding: 18px;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 14px;
}

.metric-card strong {
    display: block;
    margin-top: 6px;
    font-size: 34px;
    line-height: 1;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 18px;
}

.detail-layout {
    align-items: start;
}

.list {
    display: grid;
    gap: 10px;
}

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px;
    border: 1px solid #ededf0;
    border-radius: 8px;
    background: #fbfbfd;
}

.list-row:hover {
    border-color: #b8d7ff;
}

.list-row.static:hover {
    border-color: #ededf0;
}

.list-row strong,
.review-item strong,
.person-chip strong {
    display: block;
    margin-bottom: 4px;
}

.list-row span,
.case-topline,
.case-stats,
.review-item span,
.review-item em,
.person-chip span {
    color: var(--muted);
    font-size: 13px;
}

.list-row em {
    color: var(--muted);
    font-style: normal;
    white-space: nowrap;
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.case-grid.compact-cases {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.year-section {
    margin-top: 18px;
}

.year-section h3 {
    margin: 0 0 12px;
    font-size: 18px;
    color: var(--muted);
}

.case-card {
    padding: 18px;
}

.case-card h2 {
    min-height: 54px;
    margin: 12px 0 8px;
    font-size: 22px;
    line-height: 1.2;
}

.case-card p {
    display: -webkit-box;
    height: 40px;
    margin: 0 0 14px;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.52;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.case-title-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: end;
    margin: 12px 0 8px;
}

.case-workflow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}

.case-workflow a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 10px 14px;
    border: 1px solid rgba(210, 210, 215, 0.78);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--muted);
    font-weight: 700;
}

.case-workflow a.active {
    border-color: rgba(0, 122, 255, 0.42);
    color: var(--text);
    background: #f3f8ff;
}

.case-workflow b {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 13px;
}

.subject-guide {
    margin-bottom: 16px;
}

.subject-guide p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.subject-merge-tools {
    margin-bottom: 16px;
    position: relative;
    z-index: 60;
    overflow: visible;
}

.subject-merge-console {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 14px;
}

.subject-merge-box {
    padding: 14px;
    border: 1px solid rgba(210, 210, 215, 0.68);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.58);
}

.subject-merge-box h3 {
    margin: 0 0 12px;
    font-size: 17px;
}

.subject-merge-box p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.subject-merge-form,
.subject-batch-search {
    display: grid;
    gap: 10px;
}

.subject-merge-form {
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
    align-items: end;
}

.subject-batch-search {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.subject-autocomplete {
    position: relative;
}

.subject-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 260;
    display: none;
    max-height: 280px;
    overflow: auto;
    padding: 6px;
    border: 1px solid rgba(210, 210, 215, 0.86);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(18px);
}

.subject-suggestions.visible {
    display: grid;
    gap: 4px;
}

.subject-suggestions button {
    width: 100%;
    padding: 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.subject-suggestions button:hover {
    background: #f3f8ff;
}

.subject-suggestions strong,
.subject-suggestions span {
    display: block;
}

.subject-suggestions strong {
    color: var(--text);
    font-size: 13px;
}

.subject-suggestions span,
.subject-suggestion-empty {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.subject-suggestion-empty {
    padding: 8px;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 16px 0;
}

.subject-pagination {
    position: relative;
    z-index: 1;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid rgba(210, 210, 215, 0.72);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(18px);
}

.bottom-pagination {
    margin-top: 18px;
}

.page-number-list {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 6px;
    min-width: 0;
}

.page-number,
.page-ellipsis,
.pagination-summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.page-number {
    border: 1px solid rgba(210, 210, 215, 0.72);
    background: rgba(255, 255, 255, 0.72);
}

.page-number.active {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.button.disabled,
.button.disabled:hover {
    opacity: 0.42;
    pointer-events: none;
}

.subject-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(210, 210, 215, 0.78);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.subject-card.needs-info {
    border-color: #ffd66b;
    background: linear-gradient(180deg, #fffdf3, #fff9df);
}

.subject-card.is-merged {
    opacity: 0.62;
}

.subject-card.is-drop-target {
    border-color: #007aff;
    background: linear-gradient(180deg, #f5fbff, #ffffff);
    box-shadow: 0 12px 34px rgba(0, 122, 255, 0.16);
}

.subject-card-mini {
    box-shadow: none;
}

.subject-card-mini.is-target-subject {
    border-color: #34c759;
    background: linear-gradient(180deg, rgba(240, 255, 245, 0.96), rgba(255, 255, 255, 0.92));
}

.subject-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.subject-card-head h2 {
    margin: 4px 0 0;
    font-size: 22px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.subject-warning {
    padding: 9px 10px;
    border: 1px solid #ffd66b;
    border-radius: 8px;
    background: #fff8e1;
    color: #8a5a00;
    font-size: 13px;
    font-weight: 700;
}

.subject-fields {
    display: grid;
    gap: 8px;
}

.subject-fields div {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

.subject-fields span,
.subject-meta,
.subject-detail summary {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.subject-fields p {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.subject-fields b {
    padding: 3px 7px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #f3f8ff;
    color: #0057b8;
    font-size: 12px;
}

.subject-field-chip {
    cursor: grab;
    user-select: none;
}

.subject-field-chip[draggable="false"] {
    cursor: default;
}

.subject-field-chip.is-dragging {
    opacity: 0.45;
    cursor: grabbing;
}

.subject-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(18, 20, 26, 0.28);
    backdrop-filter: blur(16px);
}

.subject-modal {
    width: min(1180px, calc(100vw - 48px));
    max-height: min(780px, calc(100vh - 48px));
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid rgba(210, 210, 215, 0.78);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.24);
}

.subject-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border-bottom: 1px solid rgba(210, 210, 215, 0.72);
}

.subject-modal-head h2 {
    margin: 0;
    font-size: 24px;
}

.subject-modal-head p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.subject-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    overflow: auto;
    padding: 16px;
}

.subject-detail-body {
    min-height: 0;
    overflow: auto;
    padding: 16px;
}

.subject-detail-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.subject-detail-fields div,
.subject-record-row {
    border: 1px solid rgba(210, 210, 215, 0.68);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.62);
}

.subject-detail-fields div {
    display: grid;
    gap: 5px;
    padding: 10px;
}

.subject-detail-fields strong,
.subject-record-row b {
    color: var(--text);
    font-size: 13px;
}

.subject-detail-fields span,
.subject-record-row span,
.subject-record-row em {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.subject-record-list {
    display: grid;
    gap: 8px;
}

.subject-record-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
}

.subject-record-row div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.subject-record-row strong,
.subject-record-row span,
.subject-record-row em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subject-record-row em {
    font-style: normal;
}

.subject-record-row i {
    color: var(--blue);
    font-size: 13px;
    font-style: normal;
    font-weight: 700;
}

.subject-detail-workspace {
    position: relative;
    width: min(1480px, calc(100vw - 48px));
    max-height: min(920px, calc(100vh - 48px));
}

.subject-detail-workspace.subject-modal,
.screen-subject-modal.subject-detail-workspace {
    height: min(920px, calc(100vh - 48px));
    grid-template-columns: minmax(0, 3fr) minmax(360px, 2fr);
    grid-template-rows: minmax(250px, 3fr) minmax(0, 7fr);
    gap: 16px;
    padding: 16px;
}

.subject-detail-modal-head {
    min-height: 0;
    max-height: none;
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(340px, 1fr) minmax(330px, 0.92fr);
    gap: 16px;
    align-items: stretch;
    overflow: hidden;
}

.subject-detail-title-block h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.subject-detail-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 4px 0 6px;
}

.subject-detail-title-block p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.subject-detail-head-info,
.subject-detail-modal-head > .subject-profile-card {
    min-width: 0;
    min-height: 0;
}

.subject-detail-head-info {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
}

.subject-detail-modal-head > .subject-profile-card {
    max-height: 100%;
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-areas:
        "radar"
        "dims";
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
    margin: 0;
    padding: 10px;
    overflow: auto;
}

.subject-detail-modal-head > .subject-profile-card .subject-profile-head {
    display: none;
}

.subject-detail-modal-head > .subject-profile-card .subject-profile-radar {
    grid-area: radar;
    height: 100%;
    min-height: 150px;
}

.subject-detail-modal-head > .subject-profile-card .subject-dimension-strip {
    grid-area: dims;
    justify-content: flex-start;
    align-content: start;
    max-height: none;
    overflow: auto;
}

.subject-detail-workspace > [data-close-subject-detail] {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

.subject-detail-head-info .subject-detail-fields,
.subject-detail-head-info .screen-subject-field-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 4px;
    margin-bottom: 0;
}

.subject-detail-modal-head .subject-person-info {
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    padding: 6px;
}

.subject-detail-modal-head .subject-person-info.screen {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.subject-detail-modal-head .subject-person-info-head {
    display: none;
}

.subject-detail-modal-head .subject-detail-fields,
.subject-detail-modal-head .screen-subject-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: flex-start;
    align-items: stretch;
}

.subject-detail-modal-head .subject-detail-fields div,
.subject-detail-modal-head .screen-subject-field-grid div {
    min-width: 0;
    max-width: 100%;
    display: grid;
    align-items: start;
    gap: 1px;
    min-height: 32px;
    padding: 2px 6px;
}

.subject-detail-modal-head .subject-detail-fields strong,
.subject-detail-modal-head .screen-subject-field-grid strong {
    font-size: 11px;
    line-height: 1.2;
}

.subject-detail-head-info .subject-detail-fields span,
.subject-detail-head-info .screen-subject-field-grid span {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.subject-detail-head-info [data-fit-text].needs-text-wrap {
    overflow: visible;
    text-overflow: clip;
    word-break: break-all;
}

.subject-detail-main {
    min-height: 0;
    display: contents;
    overflow: hidden;
    padding: 0;
}

.subject-detail-main .subject-detail-graph-block {
    min-height: 0;
    grid-column: 1;
    grid-row: 2;
}

.subject-detail-main .subject-relation-card {
    height: 100%;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
    padding: 8px;
    margin-bottom: 0;
}

.subject-detail-main .subject-relation-graph {
    min-height: 0 !important;
    height: 100% !important;
}

.subject-detail-main .subject-hit-panel {
    min-height: 0;
    height: 100%;
    grid-template-rows: minmax(0, 1fr);
    grid-column: 2;
    grid-row: 1 / span 2;
}

.subject-detail-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(380px, 520px) minmax(0, 1fr);
    gap: 16px;
    overflow: hidden;
    padding: 16px;
}

.subject-detail-left {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(320px, 1fr) auto;
    gap: 14px;
    overflow: auto;
    padding-right: 2px;
}

.subject-detail-block {
    min-width: 0;
}

.subject-detail-block .subject-profile-card,
.subject-detail-block .subject-relation-card {
    margin-bottom: 0;
}

.subject-detail-workspace .subject-profile-card .subject-rule-box {
    display: none;
}

.subject-detail-dimension-block {
    grid-row: 1;
}

.subject-detail-graph-block {
    grid-row: 2;
    min-height: 0;
}

.subject-detail-person-block {
    grid-row: 3;
}

.subject-detail-graph-block .subject-relation-card {
    height: 100%;
    min-height: 360px;
}

.subject-detail-workspace .subject-detail-layout .subject-relation-graph {
    height: clamp(320px, 34vh, 440px) !important;
    min-height: clamp(320px, 34vh, 440px) !important;
}

.subject-detail-workspace .subject-detail-graph-block .selected-node-info {
    display: none;
}

.subject-person-info {
    min-height: 0;
    padding: 14px;
    border: 1px solid rgba(210, 210, 215, 0.72);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    overflow: auto;
}

.subject-person-info-head,
.subject-hit-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.subject-person-info-head h3,
.subject-hit-panel-head h3 {
    margin: 0;
    color: var(--text);
    font-size: 19px;
}

.subject-person-info-head span,
.subject-hit-panel-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.subject-hit-panel {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid rgba(210, 210, 215, 0.74);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 249, 252, 0.74));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
    overflow: hidden;
}

.subject-hit-panel-head {
    margin: 0;
    padding: 14px 14px 12px;
    border-bottom: 1px solid rgba(210, 210, 215, 0.66);
}

.subject-hit-scroll {
    min-height: 0;
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 14px;
}

.subject-hit-overview {
    padding: 14px;
    border: 1px solid rgba(0, 122, 255, 0.16);
    border-radius: 8px;
    background: rgba(242, 248, 255, 0.82);
}

.subject-hit-overview span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.subject-hit-overview strong {
    display: block;
    margin-top: 4px;
    color: var(--blue);
    font-size: 24px;
    line-height: 1.2;
}

.subject-hit-section {
    display: grid;
    gap: 10px;
}

.subject-hit-section h3 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
}

.subject-dimension-strip [data-subject-dimension] {
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.subject-dimension-strip [data-subject-dimension]:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 122, 255, 0.34);
    box-shadow: 0 10px 24px rgba(0, 122, 255, 0.12);
}

.subject-search-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.subject-search-form input {
    width: min(360px, 58vw);
}

.data-subject-card {
    cursor: pointer;
}

.data-subject-card:hover {
    border-color: rgba(0, 122, 255, 0.42);
    box-shadow: 0 18px 44px rgba(0, 122, 255, 0.12);
}

.subject-profile-card {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid rgba(0, 122, 255, 0.18);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(247, 250, 255, 0.92), rgba(255, 255, 255, 0.82));
}

.subject-profile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.subject-profile-head h3 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    line-height: 1.3;
}

.subject-profile-head h3 span {
    color: var(--blue);
}

.subject-score-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.subject-score-badge.red {
    background: #ff3b30;
}

.subject-score-badge.yellow {
    background: #f0a500;
}

.subject-score-badge.green {
    background: #34c759;
}

.subject-profile-radar {
    width: 100%;
    height: 250px;
    min-height: 250px;
}

.subject-dimension-strip {
    --dimension-font-size: 12px;
    --dimension-item-padding: 4px 8px;
    --dimension-gap: 10px;
    display: flex;
    justify-content: center;
    gap: var(--dimension-gap);
    flex-wrap: nowrap;
    padding: 10px;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(0, 122, 255, 0.08);
}

.subject-dimension-strip span {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 28px;
    padding: var(--dimension-item-padding);
    border: 1px solid rgba(0, 122, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--muted);
    font-size: var(--dimension-font-size);
    font-weight: 700;
}

.subject-dimension-strip b {
    color: var(--text);
}

.subject-dimension-strip em {
    color: var(--blue);
    font-style: normal;
}

.subject-rule-box {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(245, 247, 251, 0.82);
}

.subject-rule-box > strong {
    color: var(--text);
    font-size: 14px;
}

.subject-rule-list {
    display: grid;
    gap: 8px;
}

.rule-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(0, 122, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.rule-chip > span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.rule-chip > span:last-child {
    flex: 0 0 auto;
    color: var(--blue);
}

.rule-badge {
    display: inline-flex;
    margin-right: 8px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(0, 122, 255, 0.12);
    color: #0057b8;
    font-size: 11px;
    font-weight: 700;
}

.subject-relation-card {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid rgba(0, 122, 255, 0.16);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 250, 255, 0.78));
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.07);
    backdrop-filter: blur(18px);
}

.subject-relation-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.subject-relation-head h3 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
}

.subject-relation-head span {
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
}

.subject-relation-graph {
    display: block;
    width: 100%;
    height: 250px;
    min-height: 250px;
    border: 1px solid rgba(0, 122, 255, 0.14);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(242, 247, 255, 0.86)),
        repeating-linear-gradient(90deg, rgba(0, 122, 255, 0.055) 0 1px, transparent 1px 48px),
        repeating-linear-gradient(0deg, rgba(0, 122, 255, 0.045) 0 1px, transparent 1px 48px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        inset 0 -20px 60px rgba(0, 122, 255, 0.04);
}

.subject-svg-node,
.subject-svg-edge {
    cursor: pointer;
}

.subject-svg-node.is-draggable {
    cursor: grab;
}

.subject-svg-node.is-dragging {
    cursor: grabbing;
}

.subject-svg-node:hover rect {
    stroke-width: 3.2;
}

.subject-svg-edge:hover path:first-child {
    stroke-opacity: 0.86;
    stroke-width: 5.4;
}

.subject-svg-edge-label {
    letter-spacing: 0;
    user-select: none;
}

.subject-svg-node text {
    letter-spacing: 0;
    pointer-events: none;
    user-select: none;
}

.selected-node-info {
    min-height: 54px;
    padding: 10px;
    border: 1px solid rgba(0, 122, 255, 0.12);
    border-radius: 8px;
    background: rgba(245, 247, 251, 0.82);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.node-rule-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.node-rule-title strong {
    color: var(--text);
}

.node-rule-title span {
    color: var(--blue);
    font-size: 12px;
}

.subject-fields em {
    color: var(--muted);
    font-style: normal;
}

.subject-meta,
.subject-merge-fields {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.subject-detail {
    border-top: 1px solid rgba(210, 210, 215, 0.62);
    padding-top: 10px;
}

.subject-detail summary {
    cursor: pointer;
}

.subject-edit-form,
.subject-merge-form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.subject-edit-form textarea {
    resize: vertical;
}

.subject-merge-fields label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid #ededf0;
    border-radius: 8px;
    background: #fbfbfd;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.editable-case-title-view {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
}

.editable-case-title.is-editing .editable-case-title-view,
.case-info-panel.is-editing .case-info-view {
    display: none;
}

.editable-case-title.is-editing .case-title-form,
.case-info-panel.is-editing .case-info-form {
    display: grid !important;
}

.case-title-form label {
    min-width: 0;
}

.case-title-form label span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.case-title-form input {
    width: 100%;
    min-height: 38px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
}

.case-topline,
.case-stats,
.card-actions,
.action-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.case-topline {
    justify-content: space-between;
}

.case-stats {
    padding: 12px 0;
    border-top: 1px solid #ededf0;
    border-bottom: 1px solid #ededf0;
}

.card-actions {
    margin-top: 14px;
}

.case-card .card-actions {
    flex-wrap: nowrap;
    gap: 6px;
}

.case-card .card-actions .button {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding-right: 9px;
    padding-left: 9px;
    white-space: nowrap;
}

.pill,
.status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    background: #f1f1f4;
    color: #424245;
}

.status.completed {
    background: #e9f8ee;
    color: #167a3a;
}

.status.needs_mapping {
    background: #fff4df;
    color: #9a5b00;
}

.status.ready_review {
    background: #e8f2ff;
    color: #0057b8;
}

.status.active {
    background: #e9f8ee;
    color: #167a3a;
}

.status.closed {
    background: #eef0ff;
    color: #4d4ab4;
}

.status.disabled {
    background: #fff1f0;
    color: #b42318;
}

.auth-layout {
    min-height: calc(100vh - 150px);
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    align-items: center;
    gap: 34px;
}

.auth-layout.single {
    grid-template-columns: minmax(320px, 460px);
    justify-content: center;
}

.auth-panel {
    padding: 30px;
}

.auth-panel .muted {
    margin: 16px 0 8px;
}

.login-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.auth-visual {
    min-height: 460px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.2)),
        #eceef3;
    border: 1px solid rgba(210, 210, 215, 0.78);
    overflow: hidden;
}

.orbital {
    position: relative;
    width: min(480px, 80vw);
    aspect-ratio: 1;
    border: 1px solid rgba(0, 122, 255, 0.18);
    border-radius: 50%;
}

.orbital::before,
.orbital::after {
    content: "";
    position: absolute;
    inset: 16%;
    border: 1px solid rgba(110, 110, 115, 0.18);
    border-radius: 50%;
}

.orbital::after {
    inset: 32%;
}

.node {
    position: absolute;
    display: grid;
    place-items: center;
    min-width: 74px;
    height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    font-weight: 700;
}

.node.center {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #1d1d1f;
    color: #fff;
}

.node.n1 { left: 8%; top: 18%; }
.node.n2 { right: 6%; top: 28%; }
.node.n3 { left: 18%; bottom: 10%; }
.node.n4 { right: 18%; bottom: 14%; }

.form-stack,
.inline-form {
    display: grid;
    gap: 14px;
}

.inline-form {
    grid-template-columns: minmax(200px, 0.7fr) minmax(280px, 1fr) auto;
    align-items: end;
}

.admin-create-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

label span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 9px 11px;
    outline: none;
}

input[type="checkbox"] {
    width: 16px;
    min-height: 16px;
    padding: 0;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.14);
}

.upload-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    margin-bottom: 16px;
    background: #fbfbfd;
    border: 1px dashed #b8d7ff;
    border-radius: 8px;
}

.upload-box input {
    background: #fff;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid #ededf0;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

td span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.subsection {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #ededf0;
}

.person-list,
.review-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.high-frequency-panel {
    margin-top: 18px;
}

.person-list-wide {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    align-items: stretch;
}

.case-info-view {
    display: grid;
    gap: 12px;
}

.case-info-view div {
    padding: 12px;
    border: 1px solid #ededf0;
    border-radius: 8px;
    background: #fbfbfd;
}

.case-info-view span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.case-info-view strong,
.case-info-view p {
    margin: 0;
}

.person-chip,
.review-item {
    padding: 12px;
    border: 1px solid #ededf0;
    border-radius: 8px;
    background: #fbfbfd;
}

.review-item.duplicate {
    background: #fff9f1;
    border-color: #ffe0ad;
}

.mapping-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.mapping-toolbar label {
    width: min(320px, 100%);
}

.mapping-table td:first-child {
    min-width: 170px;
}

.mapping-table select {
    min-width: 180px;
}

.check-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.check-line span {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.sample-values {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sample-values span {
    display: inline-flex;
    margin: 0;
    padding: 4px 8px;
    border-radius: 8px;
    background: #f5f5f7;
    color: #424245;
}

.confirm-bar {
    position: sticky;
    bottom: 18px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 8px;
    background: rgba(29, 29, 31, 0.92);
    color: #fff;
    box-shadow: var(--shadow);
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.field-card {
    padding: 12px;
    border: 1px solid #ededf0;
    border-radius: 8px;
    background: #fbfbfd;
}

.field-card strong,
.field-card span {
    display: block;
}

.field-card span {
    margin-top: 3px;
    color: var(--blue);
    font-size: 12px;
}

.field-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.template-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.template-group {
    border: 1px solid #ededf0;
    border-radius: 8px;
    background: #fbfbfd;
}

.template-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px;
    cursor: pointer;
    list-style: none;
}

.template-group summary::-webkit-details-marker {
    display: none;
}

.template-group summary strong,
.template-group summary span {
    display: block;
}

.template-group summary span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.template-upload-list {
    display: grid;
    gap: 8px;
    padding: 0 12px 12px;
}

.filter-grid,
.sql-command-form {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

.wide-filter {
    grid-column: span 3;
}

.admin-command-list {
    display: grid;
    gap: 12px;
}

.admin-command-row {
    display: grid;
    grid-template-columns: minmax(140px, 0.75fr) minmax(120px, 0.5fr) minmax(180px, 1fr) minmax(280px, 1.5fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid #ededf0;
    border-radius: 8px;
    background: #fbfbfd;
}

.admin-user-list {
    display: grid;
    gap: 12px;
}

.admin-user-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.15fr) minmax(140px, 0.8fr) minmax(120px, 0.65fr) minmax(120px, 0.65fr) minmax(150px, 0.8fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid #ededf0;
    border-radius: 8px;
    background: #fbfbfd;
}

.admin-user-main strong,
.admin-user-main span {
    display: block;
}

.admin-user-main span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.admin-user-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-user-authorization {
    margin-top: -6px;
    padding: 0 16px;
    border: 1px solid #ededf0;
    border-radius: 12px;
    background: rgba(251, 251, 253, 0.82);
}

.admin-user-authorization summary {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    line-height: 22px;
}

.admin-user-authorization summary small,
.admin-user-authorization > p {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 19px;
}

.admin-user-authorization > p {
    margin: 0 0 16px;
}

.admin-case-authorization-grid {
    max-height: 280px;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 4px 0 12px;
}

.admin-case-authorization-grid label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.admin-case-authorization-grid input {
    width: 18px;
    min-height: 18px;
    flex: 0 0 18px;
}

.admin-case-authorization-grid span,
.admin-case-authorization-grid strong,
.admin-case-authorization-grid small {
    display: block;
}

.admin-case-authorization-grid strong {
    font-size: 14px;
    line-height: 22px;
}

.admin-case-authorization-grid small {
    color: var(--muted);
    font-size: 12px;
    line-height: 18px;
}

.admin-resource-list {
    display: grid;
    gap: 10px;
}

.admin-resource-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 16px;
    border: 1px solid #ededf0;
    border-radius: 14px;
    background: #fbfbfd;
}

.admin-resource-row.is-disabled {
    opacity: 0.66;
}

.admin-resource-row strong,
.admin-resource-row p,
.admin-resource-row small {
    display: block;
}

.admin-resource-row strong {
    font-size: 17px;
    line-height: 24px;
    font-weight: 600;
}

.admin-resource-row p {
    margin: 4px 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 22px;
}

.admin-resource-row small {
    color: var(--muted);
    font-size: 12px;
    line-height: 18px;
}

.admin-resource-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.graph-page {
    width: min(1480px, calc(100vw - 40px));
    margin: 0 auto;
}

.graph-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
}

.graph-row,
.legend,
.ring-legend {
    display: flex;
}

.graph-row,
.snapshot-row {
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.graph-row-label {
    flex: 0 0 42px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 30px;
}

.legend,
.ring-legend {
    align-items: center;
    flex: 1 1 auto;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.legend span,
.ring-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}

.legend i,
.ring-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 4px;
}

.ring-legend {
    gap: 8px 12px;
}

.ring-legend i {
    width: 18px;
    height: 12px;
    border: 1px solid;
    border-radius: 6px;
}

.zoom-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 210px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.zoom-control input[type="range"] {
    width: 130px;
    min-height: 20px;
    padding: 0;
    accent-color: var(--blue);
}

.zoom-control output {
    min-width: 42px;
    color: var(--text);
    text-align: right;
}

.layout-mode-control {
    display: inline-flex;
    align-items: center;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 6px;
}

.layout-mode-control button,
.render-mode-control button {
    min-height: 32px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.render-mode-control {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.layout-mode-control button:hover,
.render-mode-control button:hover {
    border-color: #9dccff;
    color: var(--text);
}

.layout-mode-control button.active,
.render-mode-control button.active {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 122, 255, 0.18);
}

.graph-performance-status {
    align-self: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.graph-tools {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex: 1 1 auto;
    flex-wrap: wrap;
}

.snapshot-row {
    display: flex;
    padding: 10px 0 0;
    border-top: 1px solid rgba(210, 210, 215, 0.55);
}

.snapshot-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    flex-wrap: wrap;
    min-height: 30px;
}

.snapshot-create-button {
    flex: 0 0 auto;
    min-height: 30px;
    padding-right: 12px;
    padding-left: 12px;
    white-space: nowrap;
}

.snapshot-tag {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 4px 8px;
    border: 1px solid #cfe2ff;
    border-radius: 8px;
    background: #f3f8ff;
    color: #0057b8;
    font-size: 13px;
    font-weight: 700;
}

.snapshot-check {
    padding-right: 24px;
}

.snapshot-tag a {
    color: inherit;
}

.snapshot-tag button {
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: rgba(0, 87, 184, 0.12);
    color: #0057b8;
    cursor: pointer;
    line-height: 18px;
}

.snapshot-tag .snapshot-delete-button {
    position: absolute;
    top: -7px;
    right: -7px;
    z-index: 2;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 59, 48, 0.22);
    background: #fff1f0;
    color: #ff3b30;
    font-size: 13px;
    font-weight: 700;
    line-height: 15px;
    box-shadow: 0 4px 10px rgba(255, 59, 48, 0.14);
}

.snapshot-tag .snapshot-delete-button:hover {
    background: #ff3b30;
    color: #fff;
}

.snapshot-tag .snapshot-load-button {
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: inherit;
    text-align: left;
}

.graph-workspace {
    position: relative;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 320px;
    gap: 16px;
    min-height: calc(100vh - 180px);
}

#relationGraph {
    width: min(100%, calc(100vh - 220px));
    height: auto;
    aspect-ratio: 1 / 1;
    min-height: 0;
    justify-self: center;
    background: #fff;
    border: 1px solid rgba(210, 210, 215, 0.78);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
}

.cfa-graph {
    position: relative;
    overflow: hidden;
}

.cfa-graph canvas {
    display: block;
}

.large-graph-stage {
    position: relative;
    width: 100%;
    height: 100%;
    background: #fff;
}

.large-graph-stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.large-graph-overlay {
    pointer-events: none;
}

.large-graph-badge {
    position: absolute;
    left: 16px;
    top: 16px;
    z-index: 3;
    max-width: min(520px, calc(100% - 32px));
    padding: 9px 12px;
    border: 1px solid rgba(0, 122, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    color: #424245;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.large-graph-empty {
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.graph-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
    pointer-events: none;
}

.graph-loading-card {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-width: min(320px, calc(100% - 48px));
    padding: 18px 22px;
    border: 1px solid rgba(0, 122, 255, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.12);
}

.graph-loading-card strong {
    font-size: 15px;
}

.graph-loading-card small {
    color: var(--muted);
    font-weight: 700;
}

.graph-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(0, 122, 255, 0.18);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: graph-loading-spin 0.8s linear infinite;
}

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

.cluster-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.popup-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.graph-legend-panel {
    align-self: start;
    position: sticky;
    top: 82px;
    max-height: calc(100vh - 112px);
    overflow: auto;
    padding: 14px;
    border: 1px solid rgba(210, 210, 215, 0.78);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.legend-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(210, 210, 215, 0.65);
}

.legend-panel-head strong {
    color: var(--text);
    font-size: 18px;
    line-height: 1.2;
}

.legend-section + .legend-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(210, 210, 215, 0.55);
}

.legend-section h2 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.2;
}

.legend-stack,
.mode-legend {
    display: grid;
    gap: 8px;
}

.relation-legend-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.legend-line-notes {
    margin-top: 10px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.legend-node,
.legend-bg {
    flex: 0 0 auto;
    width: 24px;
    height: 16px;
    border: 2px solid #d2d2d7;
    border-radius: 6px;
    background: #fff;
}

.legend-node-case {
    border-color: #1d1d1f;
    background: #fff;
}

.legend-node-external {
    border-color: #0057b8;
    background: #e8f2ff;
}

.legend-node-center {
    border-color: #007aff;
    background: #fff;
}

.legend-node-high {
    border-color: #ff3b30;
    background: #fff;
}

.legend-node-suspect {
    border-color: #ff9500;
    background: #fff;
}

.legend-node-confirmed {
    border-color: #34c759;
    background: #fff;
}

.legend-bg {
    border-width: 1px;
}

.legend-bg-white {
    border-color: #d2d2d7;
    background: #fff;
}

.legend-edge {
    position: relative;
    flex: 0 0 auto;
    width: 28px;
    height: 10px;
}

.legend-edge::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    border-top: 3px solid var(--edge-color, #5ac8fa);
    border-radius: 999px;
    transform: translateY(-50%);
}

.legend-edge-dashed::before {
    border-top-style: dashed;
    border-top-color: #8e8e93;
}

.legend-edge-solid::before {
    border-top-color: #5ac8fa;
}

.legend-edge-bold::before {
    border-top-width: 5px;
    border-top-color: #ff3b30;
}

.mode-legend {
    display: none;
}

.mode-legend.active {
    display: grid;
}

.inspector {
    background: #fff;
    border: 1px solid rgba(210, 210, 215, 0.78);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 16px;
    min-height: 360px;
    align-self: start;
    position: sticky;
    top: 82px;
}

.inspector h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.inspector-empty,
.empty {
    color: var(--muted);
    padding: 12px 0;
}

.wide-empty {
    grid-column: 1 / -1;
}

.tag-stack {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.tag {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 3px 8px;
    border-radius: 8px;
    background: #f1f1f4;
    color: #424245;
    font-size: 12px;
    font-weight: 700;
}

.tag.confirmed {
    background: #e9f8ee;
    color: #167a3a;
}

.tag.auto {
    background: #fff4df;
    color: #9a5b00;
}

.inspector-tag-section {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid rgba(210, 210, 215, 0.66);
    border-radius: 14px;
    background: #f8f8fa;
}

.inspector-tag-section.manual-tag-section {
    background: #f5f9ff;
}

.inspector-tag-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.inspector-tag-heading strong {
    color: #1d1d1f;
    font-size: 13px;
}

.inspector-tag-heading span,
.inspector-tag-empty {
    color: #86868b;
    font-size: 11px;
}

.inspector-tag-section .tag-stack {
    margin: 9px 0 0;
}

button.tag {
    border: 0;
    font: inherit;
}

button.tag-suggestion {
    cursor: pointer;
    transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button.tag-suggestion:hover:not(:disabled) {
    background: #ffe8bd;
    color: #734300;
    box-shadow: 0 5px 14px rgba(154, 91, 0, 0.12);
    transform: translateY(-1px);
}

button.tag-suggestion:focus-visible {
    outline: 3px solid var(--ui-focus);
    outline-offset: 2px;
}

button.tag-suggestion.is-added,
button.tag-suggestion.is-loading {
    cursor: default;
    opacity: 0.7;
}

button.tag-suggestion.is-added {
    background: #e9f8ee;
    color: #167a3a;
}

.tag.manual {
    background: #eaf3ff;
    color: #075fad;
}

.tag-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 14px;
}

.tag-form-feedback {
    min-height: 17px;
    margin: 7px 2px 0;
    color: #6e6e73;
    font-size: 11px;
    line-height: 1.45;
}

.edge-list {
    margin-top: 16px;
    display: grid;
    gap: 8px;
}

.edge-list div,
.edge-list button {
    padding: 8px;
    border-radius: 8px;
    background: #fbfbfd;
    border: 1px solid #ededf0;
    color: var(--muted);
    font-size: 13px;
    text-align: left;
}

.edge-list button {
    cursor: pointer;
}

.edge-list button:hover {
    border-color: #b8d7ff;
    color: var(--text);
}

.popup-body {
    background: var(--bg);
}

.graph-popup-page {
    width: min(100vw - 24px, 1720px);
    margin: 0 auto;
    padding: 16px 0;
}

.popup-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 10px;
}

.popup-head h1 {
    margin: 4px 0 0;
    font-size: 28px;
    line-height: 1.1;
}

.popup-snapshot-row {
    margin-bottom: 10px;
}

.popup-graph-workspace {
    min-height: calc(100vh - 82px);
}

.popup-graph-workspace #relationGraph {
    width: min(100%, calc(100vh - 104px));
    height: auto;
    min-height: 0;
}

.graph-filter-page {
    position: relative;
    left: 50%;
    width: min(1720px, calc(100vw - 24px));
    margin: 0 auto;
    transform: translateX(-50%);
    overflow-x: hidden;
}

.filter-home-page {
    width: min(1280px, calc(100vw - 24px));
}

.filter-home-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.filter-create-button {
    min-height: 44px;
    padding: 10px 19px;
    border-radius: 999px;
    box-shadow: 0 9px 22px rgba(0, 113, 227, 0.2);
    font-size: 15px;
}

.filter-create-button > span {
    font-size: 19px;
    font-weight: 500;
    line-height: 1;
}

.filter-card-create-panel {
    width: min(680px, 100%);
    margin-bottom: 16px;
    padding: 16px;
}

.filter-card-create-panel .panel-head {
    align-items: flex-start;
    margin-bottom: 12px;
}

.filter-card-create-panel .panel-head h2 {
    font-size: 18px;
}

.filter-card-create-panel .panel-head .muted {
    max-width: 320px;
    text-align: right;
    font-size: 12px;
    line-height: 1.45;
}

.filter-card-create-panel .inline-form {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 10px;
}

.filter-card-create-panel .inline-form label {
    min-width: 0;
}

.filter-card-timeline {
    display: grid;
    gap: 20px;
}

.filter-card-day-group {
    display: grid;
    gap: 10px;
}

.filter-card-day {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.filter-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.filter-card-item {
    padding: 18px;
    border: 1px solid rgba(210, 210, 215, 0.78);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.filter-card-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.filter-card-main > div {
    min-width: 0;
}

.filter-card-main > .button,
.filter-card-rename .button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.filter-card-main h2 {
    margin: 4px 0 6px;
    color: var(--text);
    font-size: 20px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.filter-card-main p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.filter-card-main p:first-of-type {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.filter-card-analysis-meta {
    margin-top: 7px !important;
    color: #007aff !important;
}

.graph-popup-page .popup-head p {
    max-width: min(760px, 70vw);
    margin: 3px 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.graph-popup-page .popup-head .graph-performance-status {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eaf3ff;
    color: #075fad;
    font-size: 11px;
    font-weight: 700;
}

.filter-card-rename {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 10px;
}

.filter-card-rename input {
    min-width: 0;
}

.filter-card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(210, 210, 215, 0.62);
}

.filter-card-actions form {
    margin: 0;
}

.empty-filter-card {
    grid-column: 1 / -1;
}

.overview-card {
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.overview-card .filter-card-actions {
    margin-top: auto;
}

.overview-card .filter-card-main h2 {
    margin-top: 6px;
    font-size: 36px;
    line-height: 1;
}

.overview-card-meta {
    min-height: 38px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.snapshot-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(29, 29, 31, 0.28);
    backdrop-filter: blur(10px);
}

.custom-panel-dialog-backdrop {
    z-index: 2500;
}

.snapshot-dialog {
    width: min(460px, 100%);
    padding: 22px;
    border: 1px solid rgba(210, 210, 215, 0.82);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22);
}

.mysql-picker-dialog {
    width: min(960px, calc(100vw - 32px));
    max-height: min(760px, calc(100vh - 36px));
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 14px;
}

.mysql-picker-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.mysql-picker-head h2,
.mysql-picker-head p {
    margin-left: 0;
    margin-right: 0;
}

.mysql-picker-search {
    display: grid;
    gap: 7px;
    margin-top: 0;
}

.mysql-picker-search-label {
    display: flex;
    align-items: center;
    gap: 7px;
}

.mysql-picker-search-label em {
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.1);
    color: #0056b3;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
}

.mysql-picker-search small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
}

.mysql-picker-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 22px;
    min-height: 160px;
    overflow: auto;
    padding: 3px 7px 8px 2px;
}

.mysql-picker-category {
    --mysql-category-accent: #0071e3;
    --mysql-category-surface: #eaf3ff;
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--mysql-category-accent) 22%, #d2d2d7);
    border-radius: 16px;
    background: color-mix(in srgb, var(--mysql-category-surface) 45%, #fff);
    box-shadow: 0 10px 28px color-mix(in srgb, var(--mysql-category-accent) 7%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.mysql-picker-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 11px 14px;
    border: 1px solid color-mix(in srgb, var(--mysql-category-accent) 18%, transparent);
    border-left: 6px solid var(--mysql-category-accent);
    border-radius: 12px;
    background: var(--mysql-category-surface);
    color: var(--mysql-category-accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.mysql-category-tone-1 {
    --mysql-category-accent: #a15c00;
    --mysql-category-surface: #fff4df;
}

.mysql-category-tone-2 {
    --mysql-category-accent: #167a3a;
    --mysql-category-surface: #e9f8ee;
}

.mysql-category-tone-3 {
    --mysql-category-accent: #6e4eb8;
    --mysql-category-surface: #f2edff;
}

.mysql-picker-category-head h3 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: inherit;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mysql-picker-category-title {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.mysql-picker-category-title small {
    color: color-mix(in srgb, var(--mysql-category-accent) 72%, #6e6e73);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.mysql-picker-category-head span {
    flex: 0 0 auto;
    color: inherit;
    font-size: 13px;
    font-weight: 700;
}

.mysql-picker-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 12px;
    min-width: 0;
}

.mysql-picker-card {
    grid-template-rows: minmax(0, 1fr) auto 32px;
    min-width: 0;
    max-width: 100%;
    height: 190px;
    min-height: 190px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mysql-picker-card:hover {
    border-color: rgba(0, 113, 227, 0.48);
    transform: translateY(-1px);
}

.mysql-picker-card:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.3);
    outline-offset: 2px;
}

.mysql-picker-card.is-selected {
    border-color: #0071e3;
    background-color: #0071e3;
    background-image: none;
    color: #fff;
    box-shadow: 0 8px 22px rgba(0, 113, 227, 0.24);
}

.mysql-picker-card > *,
.mysql-picker-card .search-card-head {
    min-width: 0;
    max-width: 100%;
}

.mysql-picker-card .search-card-meta,
.mysql-picker-card-meta span {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.mysql-picker-card .search-card-head {
    overflow: hidden;
}

.mysql-picker-card .search-card-title strong {
    display: block;
    overflow: hidden;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mysql-picker-card .search-card-title span {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
}

.mysql-picker-card-meta,
.mysql-detail-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mysql-picker-card-meta span,
.mysql-detail-meta span {
    min-width: 0;
    max-width: 100%;
    padding: 4px 7px;
    border: 1px solid rgba(210, 210, 215, 0.78);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.mysql-picker-card .search-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    width: 100%;
}

.mysql-picker-card .search-card-actions .button {
    width: auto;
    min-width: 0;
    min-height: 32px;
    padding-right: 10px;
    padding-left: 10px;
    line-height: 1.25;
    white-space: normal;
}

.mysql-picker-card.is-selected .search-card-title strong,
.mysql-picker-card.is-selected .search-card-title span,
.mysql-picker-card.is-selected .search-card-meta {
    color: #fff;
}

.mysql-picker-card.is-selected .mysql-picker-card-meta span {
    border-color: rgba(255, 255, 255, 0.48);
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.mysql-picker-card.is-selected .search-card-actions .button {
    border-color: rgba(255, 255, 255, 0.72);
    background: #fff;
    color: #0056b3;
}

.tactic-picker-card .mysql-picker-card-meta {
    flex-wrap: wrap;
}

.tactic-picker-select-state {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.08);
    color: #0056b3;
    font-size: 11px;
    font-weight: 700;
}

.tactic-picker-card.is-selected .tactic-picker-select-state {
    background: #fff;
    color: #0056b3;
}

.tactic-picker-dialog .snapshot-dialog-actions {
    align-items: center;
    justify-content: space-between;
}

.mysql-picker-card-meta {
    min-width: 0;
    flex-wrap: nowrap;
    overflow: hidden;
}

.mysql-picker-card-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mysql-query-detail-backdrop {
    z-index: 1010;
}

.mysql-query-detail-dialog {
    width: min(680px, calc(100vw - 32px));
}

.mysql-query-detail-dialog h3 {
    margin: 16px 0 8px;
    font-size: 15px;
}

.mysql-detail-sql {
    max-height: 320px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.snapshot-dialog h2 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 24px;
}

.snapshot-dialog p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.snapshot-dialog label {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.snapshot-dialog input,
.snapshot-dialog textarea {
    width: 100%;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
    resize: vertical;
}

.snapshot-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.shell:has(.graph-filter-page) {
    width: min(1720px, calc(100vw - 24px));
}

.shell:has(.graph-filter-page) .graph-filter-page {
    left: auto;
    width: 100%;
    transform: none;
}

.filter-console,
.filter-support-grid,
.filter-results-grid {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.filter-console {
    grid-template-columns: 1fr;
    align-items: start;
    margin-bottom: 16px;
}

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

.filter-results-grid {
    grid-template-columns: 1fr;
}

.filter-control-panel {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.filter-console > .panel,
.filter-support-grid > .panel,
.filter-results-grid > .panel {
    min-width: 0;
}

.graph-filter-page .panel {
    min-width: 0;
}

.graph-filter-page .graph-row {
    min-width: 0;
    align-items: flex-start;
}

.graph-filter-page .layout-mode-control,
.graph-filter-page .filter-check-row,
.graph-filter-page .graph-tools,
.graph-filter-page .snapshot-tags {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.graph-filter-page .layout-mode-control,
.graph-filter-page .filter-check-row,
.graph-filter-page .graph-tools {
    flex-wrap: nowrap;
}

.graph-filter-page .layout-mode-control button,
.graph-filter-page .filter-check,
.graph-filter-page .graph-tools > *,
.graph-filter-page .snapshot-tag {
    flex: 0 0 auto;
}

.filter-check-row {
    align-items: center;
    gap: 8px 12px;
}

.filter-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 3px 8px;
    border: 1px solid #ededf0;
    border-radius: 8px;
    background: #fbfbfd;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.filter-check input {
    width: 14px;
    min-height: 14px;
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.filter-form .wide-filter {
    grid-column: 1 / -1;
}

.filter-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: end;
}

.filter-method-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

.filter-method-card {
    --method-accent: #0a84ff;
    --method-soft: rgba(10, 132, 255, 0.1);
    position: relative;
    min-width: 0;
    min-height: 238px;
    display: grid;
    grid-template-rows: auto auto minmax(46px, auto) auto;
    align-content: start;
    gap: 12px;
    overflow: hidden;
    padding: 16px;
    border: 1px solid rgba(210, 210, 215, 0.78);
    border-radius: 20px;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.92));
    box-shadow: 0 12px 34px rgba(31, 35, 45, 0.075), inset 0 1px 0 #fff;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.filter-method-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 16px;
    left: 16px;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, transparent, var(--method-accent), transparent);
    opacity: 0.72;
}

.filter-method-card::after {
    content: "";
    position: absolute;
    top: -58px;
    right: -56px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--method-soft), transparent 70%);
    pointer-events: none;
}

.filter-method-card:hover {
    border-color: color-mix(in srgb, var(--method-accent) 34%, #d2d2d7);
    box-shadow: 0 16px 42px rgba(31, 35, 45, 0.1), inset 0 1px 0 #fff;
    transform: translateY(-1px);
}

.filter-method-card:focus-within,
.filter-method-card.has-selection {
    border-color: color-mix(in srgb, var(--method-accent) 58%, #d2d2d7);
    box-shadow: 0 16px 42px color-mix(in srgb, var(--method-accent) 13%, transparent), inset 0 1px 0 #fff;
}

.mysql-method-card {
    --method-accent: #5856d6;
    --method-soft: rgba(88, 86, 214, 0.12);
}

.tactic-method-card {
    --method-accent: #6e4eb8;
    --method-soft: rgba(110, 78, 184, 0.12);
}

.filter-method-head {
    position: relative;
    z-index: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.filter-method-symbol {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--method-accent) 22%, transparent);
    border-radius: 13px;
    background: var(--method-soft);
    color: var(--method-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.035em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.filter-method-head > div {
    min-width: 0;
}

.filter-method-head .section-kicker {
    color: var(--method-accent);
    font-size: 9px;
    letter-spacing: 0.11em;
}

.filter-method-head h3 {
    margin: 3px 0 0;
    color: var(--text);
    font-size: 17px;
    letter-spacing: -0.02em;
}

.filter-method-head em {
    align-self: start;
    padding: 4px 7px;
    border-radius: 999px;
    background: var(--method-soft);
    color: var(--method-accent);
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
}

.filter-method-input {
    position: relative;
    z-index: 1;
    min-width: 0;
    display: grid;
    gap: 7px;
}

.filter-method-input > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.filter-method-input input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
}

.filter-method-actions {
    position: relative;
    z-index: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-method-actions .button:first-child {
    flex: 1 1 auto;
}

.filter-method-selection {
    position: relative;
    z-index: 1;
    min-height: 52px;
    align-self: stretch;
    background: rgba(255, 255, 255, 0.72);
}

.filter-method-card.has-selection .filter-method-selection {
    border-color: rgba(0, 113, 227, 0.26);
    background: rgba(239, 247, 255, 0.82);
}

.filter-method-hint {
    position: relative;
    z-index: 1;
    align-self: end;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.mysql-filter-field {
    display: grid;
    gap: 8px;
}

.mysql-picker-control {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.mysql-picker-selected {
    display: flex;
    align-items: center;
    align-content: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid rgba(210, 210, 215, 0.78);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
}

.mysql-picker-selected strong,
.mysql-picker-selected span,
.mysql-picker-selected em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mysql-picker-selected strong {
    color: var(--text);
    font-size: 13px;
}

.mysql-picker-selected span,
.mysql-picker-selected em {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.mysql-picker-selected em {
    font-style: normal;
}

.mysql-picker-selected .mysql-selected-query-title {
    display: inline-flex;
    max-width: min(100%, 360px);
    padding: 5px 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 113, 227, 0.2);
    border-radius: 8px;
    background: rgba(0, 113, 227, 0.08);
    color: #0056b3;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mysql-picker-selected .mysql-selection-empty {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.mysql-filter-row,
.custom-save-query-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.custom-save-query-box {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.mysql-filter-field textarea {
    width: 100%;
    resize: vertical;
}

.mysql-query-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    align-items: end;
}

.mysql-query-form textarea {
    width: 100%;
    min-height: 150px;
    resize: vertical;
}

.mysql-query-category-tag {
    display: inline-flex;
    max-width: 100%;
    margin-left: 6px;
    padding: 3px 7px;
    overflow: hidden;
    border: 1px solid rgba(0, 113, 227, 0.18);
    border-radius: 8px;
    background: rgba(0, 113, 227, 0.08);
    color: #0056b3;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.sql-snippet {
    max-height: 180px;
    overflow: auto;
    margin: 12px 0 0;
    padding: 12px;
    border: 1px solid rgba(210, 210, 215, 0.78);
    border-radius: 8px;
    background: rgba(247, 247, 250, 0.86);
    color: #1d1d1f;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ml-entry-grid {
    margin-bottom: 18px;
}

.ml-feature-card {
    color: inherit;
    text-decoration: none;
}

.model-catalog {
    margin-bottom: 30px;
}

.model-filter-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 26px;
    padding: 8px;
    border: 1px solid rgba(210, 210, 215, 0.7);
    border-radius: 22px;
    background: rgba(242, 242, 247, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 34px rgba(31, 35, 45, 0.07);
    backdrop-filter: blur(24px) saturate(1.12);
}

.model-filter-row {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.model-filter-row > span {
    min-width: 58px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.model-filter-secondary {
    padding-top: 10px;
}

.model-filter-row .segmented-control {
    min-width: 0;
    width: 100%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(72px, 1fr);
    gap: 3px;
    padding: 3px;
    border: 1px solid rgba(118, 118, 128, 0.12);
    border-radius: 12px;
    background: rgba(118, 118, 128, 0.12);
    box-shadow: inset 0 1px 2px rgba(31, 35, 45, 0.06);
}

.model-filter-row .segmented-control button {
    min-width: 0;
    min-height: 34px;
    padding: 6px 11px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #6e6e73;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.model-filter-row .segmented-control button:hover:not(.active) {
    color: #1d1d1f;
    background: rgba(255, 255, 255, 0.52);
}

.model-filter-row .segmented-control button.active {
    background: #fff;
    color: #1d1d1f;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 5px 12px rgba(31, 35, 45, 0.09);
    transform: translateY(-0.5px);
}

.model-filter-row .segmented-control button:focus-visible {
    outline: 3px solid rgba(0, 122, 255, 0.24);
    outline-offset: 1px;
}

.model-catalog-head {
    margin-bottom: 14px;
}

.model-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.model-catalog-card {
    min-width: 0;
    min-height: 224px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 15px;
    padding: 16px;
    border: 1px solid rgba(210, 210, 215, 0.82);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(20, 31, 48, 0.07);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.model-catalog-card:hover {
    border-color: rgba(0, 122, 255, 0.42);
    box-shadow: 0 16px 34px rgba(20, 31, 48, 0.11);
    transform: translateY(-2px);
}

.model-card-topline,
.model-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.model-usage-state {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.model-card-body > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.model-card-body h3 {
    margin: 7px 0 8px;
    overflow: hidden;
    font-size: 20px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-card-body p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.model-card-foot {
    padding-top: 12px;
    border-top: 1px solid rgba(210, 210, 215, 0.68);
    color: var(--muted);
    font-size: 12px;
}

.model-card-foot strong {
    color: var(--blue);
    white-space: nowrap;
}

.model-catalog .model-catalog-card[data-used="true"] {
    border-color: #007aff;
    background: #007aff;
    color: #fff;
    box-shadow: 0 16px 34px rgba(0, 122, 255, 0.24);
}

.model-catalog .model-catalog-card[data-used="true"] .model-usage-state,
.model-catalog .model-catalog-card[data-used="true"] .model-card-body > span,
.model-catalog .model-catalog-card[data-used="true"] .model-card-body p,
.model-catalog .model-catalog-card[data-used="true"] .model-card-foot {
    color: rgba(255, 255, 255, 0.82);
}

.model-catalog .model-catalog-card[data-used="true"] .model-usage-state {
    padding: 5px 9px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.model-catalog .model-catalog-card[data-used="true"] .model-card-foot {
    border-top-color: rgba(255, 255, 255, 0.28);
}

.model-catalog .model-catalog-card[data-used="true"] .model-card-foot strong {
    color: #fff;
}

.model-catalog .model-catalog-card[data-used="true"] .tactic-kind {
    border-color: rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.model-filter-empty {
    grid-column: 1 / -1;
    min-height: 140px;
}

.ml-algorithm-section {
    margin-bottom: 18px;
}

.ml-algorithm-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.ml-algorithm-card {
    padding: 16px;
    border: 1px solid rgba(210, 210, 215, 0.78);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.05);
}

.ml-algorithm-card h2 {
    margin: 5px 0 8px;
    font-size: 19px;
}

.ml-algorithm-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.ml-algorithm-meta {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(210, 210, 215, 0.72);
}

.ml-algorithm-meta strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 13px;
}

.ml-algorithm-meta span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.case-model-page,
.case-model-catalog {
    display: grid;
    gap: 20px;
}

.case-model-head {
    align-items: center;
    margin-bottom: 6px;
}

.case-model-head h1 {
    font-size: clamp(36px, 4vw, 48px);
    letter-spacing: -0.045em;
}

.case-model-head p {
    font-size: 15px;
}

.model-create-button {
    min-height: 42px;
    padding-inline: 18px;
    border-radius: 999px;
    box-shadow: 0 9px 24px rgba(0, 113, 227, 0.2);
}

.subject-prediction-card {
    position: relative;
    width: 100%;
    min-height: 300px;
    display: grid;
    grid-template-columns: 178px minmax(0, 1fr) auto;
    grid-template-rows: 1fr auto;
    gap: 24px 30px;
    overflow: hidden;
    padding: 34px;
    border: 1px solid rgba(210, 210, 215, 0.72);
    border-radius: 30px;
    background:
        radial-gradient(circle at 88% 12%, rgba(90, 200, 250, 0.2), transparent 29%),
        radial-gradient(circle at 10% 105%, rgba(175, 82, 222, 0.12), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 255, 0.93));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 24px 70px rgba(31, 45, 74, 0.1);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 180ms ease, box-shadow 240ms ease;
}

.subject-prediction-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(110deg, transparent 28%, rgba(255, 255, 255, 0.72) 48%, transparent 67%);
    transform: translateX(-130%);
    transition: transform 620ms ease;
}

.subject-prediction-card:hover {
    border-color: rgba(0, 113, 227, 0.28);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.98),
        0 30px 84px rgba(0, 85, 190, 0.15);
    transform: translateY(-4px);
}

.subject-prediction-card:hover::after {
    transform: translateX(130%);
}

.subject-prediction-card:focus-visible {
    outline: 4px solid rgba(0, 113, 227, 0.24);
    outline-offset: 3px;
}

.subject-model-visual {
    grid-row: 1 / span 2;
    width: 168px;
    height: 168px;
    display: grid;
    place-items: center;
    align-self: center;
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 42px;
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.84), transparent 30%),
        linear-gradient(145deg, #1179ed, #6b5ce7 58%, #af52de);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.5),
        0 22px 48px rgba(78, 73, 205, 0.25);
}

.subject-model-visual svg {
    width: 116px;
    height: 116px;
    overflow: visible;
    fill: none;
    stroke: rgba(255, 255, 255, 0.96);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.4;
}

.subject-model-visual svg circle:first-child {
    stroke: rgba(255, 255, 255, 0.34);
    stroke-dasharray: 4 7;
}

.subject-model-visual svg circle:not(:first-child) {
    fill: rgba(255, 255, 255, 0.16);
}

.subject-model-copy {
    min-width: 0;
    display: grid;
    align-content: center;
}

.subject-model-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 13px;
}

.subject-model-badges span,
.subject-model-badges i {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.subject-model-badges span {
    background: rgba(0, 113, 227, 0.09);
    color: #0064c9;
}

.subject-model-badges i {
    gap: 6px;
    background: rgba(52, 199, 89, 0.11);
    color: #18843a;
}

.subject-model-badges i::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34c759;
    box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.1);
}

.subject-model-copy > strong {
    display: block;
    margin-bottom: 12px;
    font-size: clamp(34px, 4vw, 50px);
    font-weight: 700;
    letter-spacing: -0.055em;
    line-height: 1;
}

.subject-model-copy > small {
    max-width: 690px;
    color: #6e6e73;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.72;
}

.subject-model-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(76px, 1fr));
    align-self: center;
    overflow: hidden;
    border: 1px solid rgba(210, 210, 215, 0.66);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(14px);
}

.subject-model-stats > span {
    min-width: 88px;
    display: grid;
    gap: 3px;
    padding: 17px 15px;
    text-align: center;
}

.subject-model-stats > span + span {
    border-left: 1px solid rgba(210, 210, 215, 0.58);
}

.subject-model-stats b {
    color: #1d1d1f;
    font-size: 26px;
    letter-spacing: -0.035em;
}

.subject-model-stats small {
    color: #86868b;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.subject-model-open {
    grid-column: 2 / 4;
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 7px;
    color: #0071e3;
    font-size: 14px;
    font-weight: 700;
}

.subject-model-open svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    transition: transform 180ms ease;
}

.subject-prediction-card:hover .subject-model-open svg {
    transform: translateX(3px);
}

body.model-dialog-open {
    overflow: hidden;
}

.model-picker-backdrop,
.subject-prediction-backdrop,
.rule-model-backdrop {
    z-index: 1400;
    background: rgba(245, 245, 247, 0.58);
    backdrop-filter: blur(26px) saturate(1.14);
}

.rule-model-backdrop {
    padding: 18px;
}

.rule-model-dialog {
    width: min(1500px, calc(100vw - 36px));
    height: min(920px, calc(100dvh - 36px));
    max-height: none;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 30px;
    background: rgba(250, 250, 252, 0.98);
    box-shadow: 0 38px 130px rgba(35, 42, 62, 0.24);
}

.rule-model-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 28px 18px;
    border-bottom: 1px solid rgba(210, 210, 215, 0.58);
    background: rgba(255, 255, 255, 0.82);
}

.rule-model-dialog-head h2 {
    margin: 4px 0 5px;
    font-size: var(--type-section-title);
    font-weight: var(--weight-bold);
    line-height: var(--leading-section-title);
    letter-spacing: -0.025em;
}

.rule-model-dialog-head p {
    max-width: 820px;
    margin: 0;
    color: var(--muted);
    font-size: var(--type-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
}

.rule-model-dialog-scroll {
    min-height: 0;
    overflow: auto;
    padding: 24px 28px 34px;
    overscroll-behavior: contain;
}

.rule-model-dialog .risk-model-workspace {
    margin: 0;
    padding: 0;
    border-top: 0;
}

.model-picker-dialog {
    width: min(650px, calc(100vw - 32px));
    padding: 28px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 34px 110px rgba(34, 39, 55, 0.22);
}

.model-dialog-head,
.subject-prediction-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.model-dialog-head h2,
.subject-prediction-head h2 {
    margin: 5px 0 7px;
    font-size: 30px;
    letter-spacing: -0.04em;
}

.model-dialog-head p,
.subject-prediction-head p {
    margin: 0;
    color: #6e6e73;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.55;
}

.model-dialog-close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0 0 2px;
    border: 0;
    border-radius: 50%;
    background: #ededf0;
    color: #6e6e73;
    cursor: pointer;
    font: 500 24px/1 -apple-system, BlinkMacSystemFont, sans-serif;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.model-dialog-close:hover {
    background: #e2e2e7;
    color: #1d1d1f;
    transform: scale(1.04);
}

.model-choice-list {
    margin-top: 24px;
}

.model-choice-card {
    width: 100%;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 15px;
    align-items: center;
    padding: 18px;
    border: 1px solid rgba(0, 113, 227, 0.34);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(238, 247, 255, 0.96), rgba(248, 245, 255, 0.94));
    color: var(--text);
    cursor: pointer;
    font: inherit;
    text-align: left;
    box-shadow: inset 0 0 0 2px rgba(0, 113, 227, 0.06);
}

.model-choice-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(145deg, #0a84ff, #6e5ce6);
    box-shadow: 0 12px 24px rgba(54, 88, 202, 0.2);
}

.model-choice-icon svg {
    width: 29px;
    height: 29px;
    fill: none;
    stroke: #fff;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.model-choice-card > span:nth-child(2) {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.model-choice-card strong {
    font-size: 18px;
}

.model-choice-card small {
    color: #6e6e73;
    font-size: 12px;
    line-height: 1.45;
}

.model-choice-card > i {
    padding: 5px 8px;
    border-radius: 999px;
    background: #fff;
    color: #0071e3;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
}

.subject-prediction-dialog {
    width: min(1320px, calc(100vw - 40px));
    height: min(850px, calc(100dvh - 40px));
    max-height: none;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 30px;
    background: rgba(250, 250, 252, 0.97);
    box-shadow: 0 38px 130px rgba(35, 42, 62, 0.24);
}

.subject-prediction-head {
    padding: 24px 28px 19px;
    border-bottom: 1px solid rgba(210, 210, 215, 0.55);
    background: rgba(255, 255, 255, 0.72);
}

.subject-prediction-head h2 {
    font-size: 28px;
}

.subject-prediction-head p {
    max-width: 760px;
}

.subject-prediction-pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 1.3vw, 18px);
    padding: 12px 24px;
    border-bottom: 1px solid rgba(210, 210, 215, 0.52);
    background: rgba(255, 255, 255, 0.52);
}

.subject-prediction-pipeline span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #424245;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.subject-prediction-pipeline span i {
    width: 23px;
    height: 23px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(0, 113, 227, 0.1);
    color: #0071e3;
    font-size: 10px;
    font-style: normal;
}

.subject-prediction-pipeline b {
    color: #b1b1b6;
    font-size: 14px;
}

.subject-prediction-workbench {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(310px, 360px) minmax(0, 1fr);
}

.prediction-filter-panel {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 20px;
    border-right: 1px solid rgba(210, 210, 215, 0.62);
    background: rgba(255, 255, 255, 0.66);
}

.prediction-panel-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 13px;
}

.prediction-panel-title > div {
    display: grid;
    gap: 3px;
}

.prediction-panel-title strong {
    font-size: 16px;
}

.prediction-panel-title small {
    color: #86868b;
    font-size: 11px;
}

.prediction-panel-title > span {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.08);
    color: #0064c9;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.prediction-filter-list {
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 9px;
    overflow-y: auto;
    padding: 2px 5px 12px 2px;
}

.prediction-filter-choice {
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    padding: 13px;
    border: 1px solid rgba(210, 210, 215, 0.72);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.prediction-filter-choice:hover {
    border-color: rgba(0, 113, 227, 0.3);
    transform: translateY(-1px);
}

.prediction-filter-choice.is-selected {
    border-color: rgba(0, 113, 227, 0.6);
    background: #f0f7ff;
    box-shadow: 0 9px 24px rgba(0, 113, 227, 0.09), inset 0 0 0 1px rgba(0, 113, 227, 0.08);
}

.prediction-filter-choice.is-disabled {
    cursor: not-allowed;
    opacity: 0.54;
}

.prediction-filter-choice > input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.prediction-filter-select {
    width: 19px;
    height: 19px;
    margin-top: 1px;
    border: 1.5px solid #b7b7bd;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 4px #fff;
}

.prediction-filter-choice.is-selected .prediction-filter-select {
    border-color: #0071e3;
    background: #0071e3;
}

.prediction-filter-copy {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.prediction-filter-copy > strong {
    overflow: hidden;
    color: #1d1d1f;
    font-size: 13px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prediction-filter-copy > small {
    display: -webkit-box;
    overflow: hidden;
    color: #86868b;
    font-size: 10px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.prediction-filter-copy > span {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.prediction-filter-copy > span i {
    padding: 3px 6px;
    border-radius: 6px;
    background: #f1f1f4;
    color: #6e6e73;
    font-size: 9px;
    font-style: normal;
    font-weight: 700;
}

.prediction-filter-choice.is-selected .prediction-filter-copy > span i {
    background: rgba(0, 113, 227, 0.08);
    color: #0064c9;
}

.prediction-filter-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid rgba(210, 210, 215, 0.6);
}

.prediction-filter-actions .button {
    min-width: 0;
    padding-inline: 10px;
    font-size: 12px;
}

.prediction-filter-empty {
    display: grid;
    gap: 6px;
    padding: 24px 16px;
    border: 1px dashed #d2d2d7;
    border-radius: 16px;
    color: #6e6e73;
    text-align: center;
}

.prediction-filter-empty strong {
    color: #424245;
}

.prediction-filter-empty small {
    font-size: 11px;
    line-height: 1.5;
}

.prediction-result-stage {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 22px;
    background:
        radial-gradient(circle at 78% 0%, rgba(90, 200, 250, 0.08), transparent 28%),
        #f7f7f9;
}

.prediction-result-empty,
.prediction-loading,
.prediction-error {
    min-height: 100%;
    display: grid;
    place-content: center;
    justify-items: center;
    padding: 36px;
    text-align: center;
}

.prediction-result-empty > strong,
.prediction-loading > strong,
.prediction-error > strong {
    margin-top: 20px;
    color: #1d1d1f;
    font-size: 23px;
    letter-spacing: -0.025em;
}

.prediction-result-empty > p,
.prediction-loading > p,
.prediction-error > p {
    max-width: 560px;
    margin: 8px 0 0;
    color: #86868b;
    font-size: 13px;
    line-height: 1.65;
}

.prediction-empty-orbit {
    position: relative;
    width: 106px;
    height: 106px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(0, 113, 227, 0.14);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 113, 227, 0.12) 0 15%, transparent 16%);
}

.prediction-empty-orbit::before,
.prediction-empty-orbit::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(0, 113, 227, 0.16);
    border-radius: 50%;
}

.prediction-empty-orbit::before {
    width: 68px;
    height: 68px;
}

.prediction-empty-orbit::after {
    width: 38px;
    height: 38px;
}

.prediction-empty-orbit i {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #0a84ff;
    box-shadow: 0 4px 10px rgba(0, 113, 227, 0.24);
}

.prediction-empty-orbit i:nth-child(1) { top: 15px; left: 23px; }
.prediction-empty-orbit i:nth-child(2) { right: 12px; bottom: 30px; background: #af52de; }
.prediction-empty-orbit i:nth-child(3) { bottom: 8px; left: 35px; background: #34c759; }

.prediction-empty-scope {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 24px;
}

.prediction-empty-scope span {
    display: grid;
    gap: 4px;
    padding: 13px 16px;
    border: 1px solid rgba(210, 210, 215, 0.65);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
    text-align: left;
}

.prediction-empty-scope b {
    font-size: 12px;
}

.prediction-empty-scope small {
    color: #86868b;
    font-size: 10px;
}

.prediction-loader {
    position: relative;
    width: 82px;
    height: 82px;
    border: 3px solid rgba(0, 113, 227, 0.1);
    border-top-color: #0071e3;
    border-right-color: #6e5ce6;
    border-radius: 50%;
    animation: prediction-spin 1s linear infinite;
}

.prediction-loader::before {
    content: "";
    position: absolute;
    inset: 13px;
    border: 2px solid rgba(175, 82, 222, 0.12);
    border-bottom-color: #af52de;
    border-radius: 50%;
    animation: prediction-spin 1.4s linear infinite reverse;
}

.prediction-loading-steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin-top: 22px;
}

.prediction-loading-steps span {
    padding: 6px 9px;
    border-radius: 999px;
    background: #fff;
    color: #6e6e73;
    font-size: 10px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.prediction-results {
    display: grid;
    gap: 15px;
}

.prediction-result-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 2px 2px 0;
}

.prediction-result-summary h3 {
    margin: 4px 0 5px;
    font-size: 24px;
    letter-spacing: -0.035em;
}

.prediction-result-summary p {
    margin: 0;
    color: #86868b;
    font-size: 11px;
    line-height: 1.55;
}

.prediction-run-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(52, 199, 89, 0.1);
    color: #17813a;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.prediction-run-state::before {
    content: "✓";
    width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #34c759;
    color: #fff;
    font-size: 9px;
}

.prediction-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.prediction-metric {
    position: relative;
    display: grid;
    gap: 2px;
    overflow: hidden;
    padding: 13px 14px;
    border: 1px solid rgba(210, 210, 215, 0.62);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 8px 24px rgba(30, 36, 50, 0.04);
}

.prediction-metric::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 48px;
    border-radius: 0 0 0 48px;
    background: var(--metric-tint);
}

.prediction-metric.blue { --metric-tint: rgba(0, 113, 227, 0.1); }
.prediction-metric.purple { --metric-tint: rgba(175, 82, 222, 0.1); }
.prediction-metric.orange { --metric-tint: rgba(255, 149, 0, 0.12); }
.prediction-metric.green { --metric-tint: rgba(52, 199, 89, 0.11); }

.prediction-metric strong {
    font-size: 26px;
    letter-spacing: -0.04em;
}

.prediction-metric span {
    color: #424245;
    font-size: 11px;
    font-weight: 700;
}

.prediction-metric small {
    color: #86868b;
    font-size: 9px;
    line-height: 1.4;
}

.prediction-result-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 3px 2px;
}

.prediction-result-toolbar > div:first-child {
    display: grid;
    gap: 3px;
}

.prediction-result-toolbar strong {
    font-size: 14px;
}

.prediction-result-toolbar small {
    color: #86868b;
    font-size: 10px;
}

.prediction-result-legend {
    display: flex;
    gap: 6px;
}

.prediction-result-legend span,
.prediction-source-badge,
.prediction-new-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-style: normal;
    font-weight: 700;
}

.prediction-result-legend .historical,
.prediction-subject-card.historical .prediction-source-badge {
    background: rgba(255, 149, 0, 0.11);
    color: #a25b00;
}

.prediction-result-legend .current,
.prediction-subject-card.current .prediction-source-badge {
    background: rgba(0, 113, 227, 0.09);
    color: #0064c9;
}

.prediction-subject-card.mixed .prediction-source-badge {
    background: rgba(175, 82, 222, 0.1);
    color: #8440a5;
}

.prediction-new-badge {
    background: rgba(52, 199, 89, 0.11);
    color: #177d38;
}

.prediction-subject-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    align-items: start;
}

.prediction-subject-card {
    min-width: 0;
    display: grid;
    gap: 12px;
    padding: 15px;
    border: 1px solid rgba(210, 210, 215, 0.66);
    border-left: 4px solid var(--prediction-accent, #0071e3);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 28px rgba(28, 35, 51, 0.055);
}

.prediction-subject-card.current { --prediction-accent: #0a84ff; }
.prediction-subject-card.historical { --prediction-accent: #ff9500; }
.prediction-subject-card.mixed { --prediction-accent: #af52de; }

.prediction-subject-head {
    display: grid;
    grid-template-columns: 29px minmax(0, 1fr) 58px;
    gap: 10px;
    align-items: center;
}

.prediction-rank {
    align-self: start;
    padding-top: 5px;
    color: #b1b1b6;
    font-size: 11px;
    font-weight: 700;
}

.prediction-subject-title {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.prediction-subject-title > span {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.prediction-subject-title h4 {
    margin: 0;
    overflow: hidden;
    color: #1d1d1f;
    font-size: 18px;
    letter-spacing: -0.025em;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prediction-subject-title > small {
    overflow: hidden;
    color: #86868b;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prediction-score {
    position: relative;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--prediction-accent, #0071e3) calc(var(--prediction-score) * 1%), #e9e9ed 0);
}

.prediction-score::before {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #fff;
}

.prediction-score span {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    line-height: 1;
}

.prediction-score b {
    font-size: 17px;
}

.prediction-score small {
    margin-top: 3px;
    color: #86868b;
    font-size: 7px;
    font-weight: 700;
    white-space: nowrap;
}

.prediction-subject-fields {
    display: grid;
    gap: 6px;
    padding: 10px;
    border-radius: 12px;
    background: #f7f7f9;
}

.prediction-subject-fields > div {
    min-width: 0;
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 7px;
    align-items: start;
}

.prediction-subject-fields span {
    padding-top: 3px;
    color: #86868b;
    font-size: 9px;
    font-weight: 700;
}

.prediction-subject-fields p {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
}

.prediction-subject-fields b,
.prediction-subject-fields em {
    max-width: 100%;
    overflow: hidden;
    color: #424245;
    font-size: 9px;
    font-style: normal;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prediction-subject-fields b {
    padding: 3px 6px;
    border: 1px solid rgba(210, 210, 215, 0.62);
    border-radius: 6px;
    background: #fff;
}

.prediction-relation-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 7px;
    align-items: start;
}

.prediction-relation-row > span {
    padding-top: 3px;
    color: #86868b;
    font-size: 9px;
    font-weight: 700;
}

.prediction-relation-row > div {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.prediction-relation-row i {
    padding: 3px 6px;
    border-radius: 6px;
    background: rgba(0, 113, 227, 0.07);
    color: #0064c9;
    font-size: 9px;
    font-style: normal;
    font-weight: 700;
}

.prediction-relation-row em {
    align-self: center;
    color: #86868b;
    font-size: 9px;
    font-style: normal;
}

.prediction-reasons {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.prediction-reasons li {
    position: relative;
    padding-left: 13px;
    color: #6e6e73;
    font-size: 9px;
    line-height: 1.5;
}

.prediction-reasons li::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 2px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--prediction-accent, #0071e3);
}

.prediction-subject-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 9px;
    border-top: 1px solid rgba(210, 210, 215, 0.58);
}

.prediction-subject-foot span {
    min-width: 0;
    overflow: hidden;
    color: #86868b;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prediction-subject-foot strong {
    flex: 0 0 auto;
    color: #ff3b30;
    font-size: 8px;
}

.prediction-no-result {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    min-height: 220px;
    padding: 30px;
    border: 1px dashed #d2d2d7;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.prediction-no-result strong {
    font-size: 18px;
}

.prediction-no-result p {
    margin: 7px 0 0;
    color: #86868b;
    font-size: 11px;
}

.prediction-error .button {
    margin-top: 18px;
}

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

@media (max-width: 1100px) {
    .subject-prediction-card {
        grid-template-columns: 140px minmax(0, 1fr);
    }

    .subject-model-visual {
        width: 136px;
        height: 136px;
        border-radius: 34px;
    }

    .subject-model-visual svg {
        width: 94px;
        height: 94px;
    }

    .subject-model-stats {
        grid-column: 2;
        grid-row: 2;
        justify-self: stretch;
    }

    .subject-model-open {
        grid-column: 2;
        grid-row: 3;
    }

    .subject-prediction-dialog {
        width: calc(100vw - 24px);
        height: calc(100dvh - 24px);
    }

    .subject-prediction-workbench {
        grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    }

    .prediction-subject-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .case-model-head {
        align-items: stretch;
    }

    .case-model-head .model-create-button {
        width: 100%;
    }

    .subject-prediction-card {
        grid-template-columns: 1fr;
        padding: 24px;
        border-radius: 24px;
    }

    .subject-model-visual {
        grid-row: auto;
        width: 96px;
        height: 96px;
        border-radius: 28px;
    }

    .subject-model-visual svg {
        width: 70px;
        height: 70px;
    }

    .subject-model-copy > strong {
        font-size: 36px;
    }

    .subject-model-stats,
    .subject-model-open {
        grid-column: 1;
        grid-row: auto;
    }

    .subject-prediction-backdrop {
        padding: 6px;
    }

    .rule-model-backdrop {
        padding: 6px;
    }

    .rule-model-dialog {
        width: calc(100vw - 12px);
        height: calc(100dvh - 12px);
        border-radius: 22px;
    }

    .rule-model-dialog-head {
        padding: 18px;
    }

    .rule-model-dialog-head p {
        display: none;
    }

    .rule-model-dialog-scroll {
        padding: 18px;
    }

    .subject-prediction-dialog {
        width: calc(100vw - 12px);
        height: calc(100dvh - 12px);
        border-radius: 22px;
    }

    .subject-prediction-head {
        padding: 18px;
    }

    .subject-prediction-head p {
        display: none;
    }

    .subject-prediction-pipeline {
        justify-content: flex-start;
        overflow-x: auto;
        padding-inline: 16px;
    }

    .subject-prediction-workbench {
        display: block;
        overflow-y: auto;
    }

    .prediction-filter-panel {
        min-height: 430px;
        border-right: 0;
        border-bottom: 1px solid rgba(210, 210, 215, 0.62);
    }

    .prediction-filter-list {
        max-height: 300px;
    }

    .prediction-result-stage {
        min-height: 540px;
        overflow: visible;
    }

    .prediction-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .prediction-result-summary,
    .prediction-result-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* 大模型控制只复用原系统标准对话框，不再生成独立演示欢迎页。 */
.ai-case-connection-backdrop {
    z-index: 1600;
}

.ai-case-connection-dialog {
    width: min(680px, calc(100vw - 40px));
    padding: 24px;
    border-radius: 18px;
}

.ai-case-connection-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 10px;
}

.ai-case-connection-head h2 {
    margin-top: 4px;
    font-size: var(--type-section-title);
    line-height: var(--leading-section-title);
}

.ai-case-connection-dialog > p {
    font-size: var(--type-body);
    font-weight: 400;
    line-height: var(--leading-body);
}

.ai-case-connection-dialog .ai-welcome-connection {
    margin-top: 14px;
}

.ai-case-control-flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid rgba(210, 210, 215, 0.82);
    border-radius: 12px;
    background: #f7f8fa;
}

.ai-case-control-flow span {
    min-width: 0;
    padding: 8px;
    border-radius: 9px;
    background: #fff;
    color: #333336;
    font-size: var(--type-label);
    font-weight: 600;
    line-height: var(--leading-label);
    text-align: center;
}

.ai-case-control-flow i {
    color: #8e8e93;
    font-size: var(--type-navigation);
    font-style: normal;
    line-height: var(--leading-navigation);
}

.ai-case-connection-dialog .ai-welcome-actions {
    align-items: center;
    justify-content: flex-end;
}

.ai-case-connection-dialog .ai-welcome-actions form {
    margin: 0;
}

.ai-qr-backdrop {
    z-index: 1700;
}

.ai-qr-dialog {
    width: min(760px, calc(100vw - 40px));
    padding: 24px;
    border-radius: 18px;
}

.ai-qr-dialog > p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: var(--type-body);
    font-weight: 400;
    line-height: var(--leading-body);
}

.ai-qr-camera {
    position: relative;
    overflow: hidden;
    display: grid;
    min-height: 280px;
    place-items: center;
    border: 1px solid rgba(210, 210, 215, 0.82);
    border-radius: 16px;
    background: #111827;
}

.ai-qr-camera video {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.ai-qr-camera span {
    position: absolute;
    inset: auto auto 14px 14px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #1d1d1f;
    font-size: var(--type-label);
    font-weight: 600;
    line-height: var(--leading-label);
}

.ai-qr-status {
    display: grid;
    gap: 2px;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(210, 210, 215, 0.82);
    border-radius: 12px;
    background: #f5f5f7;
}

.ai-qr-status strong {
    font-size: var(--type-navigation);
    font-weight: 600;
    line-height: var(--leading-navigation);
}

.ai-qr-status small {
    color: var(--muted);
    font-size: var(--type-label);
    font-weight: 500;
    line-height: var(--leading-label);
}

.ai-qr-status.is-running {
    border-color: rgba(0, 122, 255, 0.22);
    background: rgba(0, 122, 255, 0.08);
}

.ai-qr-status.is-success {
    border-color: rgba(52, 199, 89, 0.22);
    background: rgba(52, 199, 89, 0.09);
}

.ai-qr-status.is-error {
    border-color: rgba(255, 59, 48, 0.24);
    background: rgba(255, 59, 48, 0.08);
}

.ai-qr-paste {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.ai-qr-paste span {
    color: var(--muted);
    font-size: var(--type-label);
    font-weight: 600;
    line-height: var(--leading-label);
}

.ai-qr-paste textarea {
    min-height: 118px;
    resize: vertical;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 20px;
}

.ai-qr-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.ai-qr-result {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.ai-qr-step {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #e1e5ea;
    border-radius: 12px;
    background: #fff;
}

.ai-qr-step > span {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    background: rgba(0, 122, 255, 0.1);
    color: #0066cc;
    font-family: var(--font-ui);
    font-size: var(--type-label);
    font-weight: 700;
    line-height: var(--leading-label);
}

.ai-qr-step strong {
    display: block;
    font-size: var(--type-body);
    font-weight: 600;
    line-height: var(--leading-body);
}

.ai-qr-step small {
    color: var(--muted);
    font-size: var(--type-label);
    font-weight: 500;
    line-height: var(--leading-label);
}

.persistent-qr-camera {
    position: fixed;
    top: auto;
    right: 18px;
    bottom: 18px;
    z-index: 1650;
    width: min(326px, calc(100vw - 36px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 54px rgba(20, 28, 44, 0.2);
    backdrop-filter: blur(24px) saturate(150%);
    transition: width 180ms ease, border-radius 180ms ease, box-shadow 180ms ease;
}

.persistent-qr-camera.is-collapsed {
    width: 164px;
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(20, 28, 44, 0.16);
}

.persistent-qr-camera-panel,
.persistent-qr-camera-toggle {
    width: 100%;
}

.persistent-qr-camera-panel {
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    scrollbar-width: none;
}

.persistent-qr-camera-panel::-webkit-scrollbar {
    display: none;
}

.persistent-qr-camera-toggle {
    display: none;
    min-height: 46px;
    padding: 0 15px;
    border: 0;
    background: transparent;
    color: #1d1d1f;
    font-family: var(--font-ui);
    font-size: var(--type-label);
    font-weight: 600;
    line-height: var(--leading-label);
    cursor: pointer;
}

.persistent-qr-camera.is-collapsed .persistent-qr-camera-panel {
    display: none;
}

.persistent-qr-camera.is-collapsed .persistent-qr-camera-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.persistent-qr-camera-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #34c759;
    box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.14);
}

.persistent-qr-camera.is-error .persistent-qr-camera-dot {
    background: #ff3b30;
    box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.12);
}

.persistent-qr-camera-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 13px 10px 15px;
}

.persistent-qr-camera-title {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.persistent-qr-camera-title strong {
    overflow: hidden;
    color: #1d1d1f;
    font-size: var(--type-navigation);
    font-weight: 600;
    line-height: var(--leading-navigation);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.persistent-qr-camera-hide {
    min-height: 32px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: #f1f1f3;
    color: #515154;
    font-family: var(--font-ui);
    font-size: var(--type-caption);
    font-weight: 600;
    line-height: var(--leading-caption);
    cursor: pointer;
}

.persistent-qr-camera-view {
    position: relative;
    overflow: hidden;
    height: 178px;
    margin: 0 10px;
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% 45%, rgba(45, 55, 72, 0.86), #10141c 72%);
}

.persistent-qr-camera-view video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.persistent-qr-camera-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 132px;
    height: 132px;
    border: 2px solid rgba(255, 255, 255, 0.94);
    border-radius: 16px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.persistent-qr-camera-state {
    position: absolute;
    right: 8px;
    bottom: 8px;
    left: 8px;
    overflow: hidden;
    padding: 7px 9px;
    border-radius: 10px;
    background: rgba(20, 20, 22, 0.72);
    color: #fff;
    font-size: var(--type-caption);
    font-weight: 500;
    line-height: var(--leading-caption);
    text-overflow: ellipsis;
    white-space: nowrap;
    backdrop-filter: blur(12px);
}

.persistent-qr-transfer {
    margin: 10px 10px 0;
    padding: 12px;
    border: 1px solid rgba(0, 113, 227, 0.14);
    border-radius: 14px;
    background: #f5f8fc;
    color: #1d1d1f;
}

.persistent-qr-transfer[hidden] {
    display: none;
}

.persistent-qr-transfer[data-state="ready"],
.persistent-qr-transfer[data-state="executing"] {
    border-color: rgba(52, 199, 89, 0.22);
    background: #f2faf4;
}

.persistent-qr-transfer[data-state="failed"] {
    border-color: rgba(255, 59, 48, 0.2);
    background: #fff5f4;
}

.persistent-qr-transfer[data-state="cancelled"] {
    border-color: rgba(255, 149, 0, 0.24);
    background: #fff8ed;
}

.persistent-qr-transfer[data-state="confirmed"] {
    border-color: rgba(52, 199, 89, 0.2);
    background: #f2faf4;
}

.persistent-qr-transfer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.persistent-qr-transfer-head > div {
    min-width: 0;
}

.persistent-qr-transfer-head strong,
.persistent-qr-transfer-head span {
    display: block;
}

.persistent-qr-transfer-head strong {
    font-size: var(--type-body);
    font-weight: 600;
    line-height: var(--leading-body);
}

.persistent-qr-transfer-head > div > span {
    margin-top: 1px;
    color: #6e6e73;
    font-family: "Times New Roman", var(--font-ui);
    font-size: var(--type-caption);
    font-weight: 500;
    line-height: var(--leading-caption);
}

.persistent-qr-transfer-badge {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.1);
    color: #0066cc;
    font-size: var(--type-caption);
    font-weight: 600;
    line-height: var(--leading-caption);
}

.persistent-qr-transfer[data-state="ready"] .persistent-qr-transfer-badge,
.persistent-qr-transfer[data-state="executing"] .persistent-qr-transfer-badge,
.persistent-qr-transfer[data-state="confirmed"] .persistent-qr-transfer-badge {
    background: rgba(52, 199, 89, 0.13);
    color: #237a35;
}

.persistent-qr-transfer[data-state="failed"] .persistent-qr-transfer-badge {
    background: rgba(255, 59, 48, 0.1);
    color: #b42318;
}

.persistent-qr-transfer[data-state="cancelled"] .persistent-qr-transfer-badge {
    background: rgba(255, 149, 0, 0.13);
    color: #8a4b00;
}

.persistent-qr-transfer-progress {
    height: 7px;
    overflow: hidden;
    margin-top: 10px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.11);
}

.persistent-qr-transfer-progress > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #0071e3;
    transition: width 180ms ease;
}

.persistent-qr-transfer[data-state="ready"] .persistent-qr-transfer-progress > span,
.persistent-qr-transfer[data-state="executing"] .persistent-qr-transfer-progress > span,
.persistent-qr-transfer[data-state="confirmed"] .persistent-qr-transfer-progress > span {
    background: #34c759;
}

.persistent-qr-transfer[data-state="failed"] .persistent-qr-transfer-progress > span {
    background: #ff3b30;
}

.persistent-qr-transfer[data-state="cancelled"] .persistent-qr-transfer-progress > span {
    background: #ff9500;
}

.persistent-qr-transfer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
    color: #6e6e73;
    font-size: var(--type-caption);
    font-weight: 500;
    line-height: var(--leading-caption);
}

.persistent-qr-transfer-meta span:last-child {
    font-family: "Times New Roman", var(--font-ui);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.persistent-qr-transfer p {
    margin: 8px 0 0;
    color: #515154;
    font-size: var(--type-caption);
    font-weight: 400;
    line-height: var(--leading-caption);
}

.persistent-qr-transfer-details {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid rgba(52, 199, 89, 0.19);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.72);
}

.persistent-qr-transfer-details[hidden] {
    display: none;
}

.persistent-qr-transfer-trust {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #6e6e73;
    font-family: "Times New Roman", var(--font-ui);
    font-size: var(--type-caption);
    font-weight: 600;
    line-height: var(--leading-caption);
}

.persistent-qr-transfer-trust .is-verified {
    color: #237a35;
}

.persistent-qr-transfer-details dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 8px 0 0;
}

.persistent-qr-transfer-details dl > div {
    min-width: 0;
    padding: 6px 7px;
    border-radius: 8px;
    background: #f1f1f3;
}

.persistent-qr-transfer-details dt,
.persistent-qr-transfer-details dd {
    margin: 0;
    font-size: var(--type-caption);
    line-height: var(--leading-caption);
}

.persistent-qr-transfer-details dt {
    color: #6e6e73;
    font-weight: 500;
}

.persistent-qr-transfer-details dd {
    overflow: hidden;
    color: #1d1d1f;
    font-family: "Times New Roman", var(--font-ui);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.persistent-qr-transfer-details > p {
    margin-top: 8px;
    color: #1d1d1f;
}

.persistent-qr-transfer-step-labels {
    display: grid;
    gap: 3px;
    margin-top: 7px;
}

.persistent-qr-transfer-step-labels:empty {
    display: none;
}

.persistent-qr-transfer-step-labels span {
    overflow: hidden;
    color: #515154;
    font-size: var(--type-caption);
    font-weight: 500;
    line-height: var(--leading-caption);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.persistent-qr-transfer-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 10px;
}

.persistent-qr-transfer-controls button {
    min-height: 34px;
    padding: 0 9px;
    border: 0;
    border-radius: 10px;
    background: #e8e8ed;
    color: #1d1d1f;
    font-family: var(--font-ui);
    font-size: var(--type-caption);
    font-weight: 600;
    line-height: var(--leading-caption);
    cursor: pointer;
}

.persistent-qr-transfer-controls button.is-primary {
    grid-column: 1 / -1;
    background: #0071e3;
    color: #fff;
}

.persistent-qr-transfer-controls button:disabled {
    cursor: default;
    opacity: 0.48;
}

.persistent-qr-camera-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
}

.persistent-qr-camera-actions button,
.persistent-qr-camera-actions label {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    margin: 0;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    background: #f1f1f3;
    color: #1d1d1f;
    font-family: var(--font-ui);
    font-size: var(--type-caption);
    font-weight: 600;
    line-height: var(--leading-caption);
    cursor: pointer;
}

.persistent-qr-camera-actions button:first-child {
    background: #0071e3;
    color: #fff;
}

.camera-whitelist-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1900;
    display: grid;
    place-items: center;
    overflow-y: auto;
    padding: 24px;
    background: rgba(20, 24, 32, 0.46);
    backdrop-filter: blur(14px) saturate(120%);
}

.camera-whitelist-backdrop[hidden] {
    display: none;
}

body.has-camera-whitelist-dialog {
    overflow: hidden;
}

.camera-whitelist-dialog {
    width: min(660px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 26px;
    outline: none;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.3);
    color: #1d1d1f;
    font-family: var(--font-ui);
}

.camera-whitelist-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.camera-whitelist-kicker {
    display: block;
    margin-bottom: 4px;
    color: #0071e3;
    font-size: var(--type-label);
    font-weight: 600;
    line-height: var(--leading-label);
}

.camera-whitelist-head h2 {
    margin: 0;
    color: #1d1d1f;
    font-size: var(--type-section-title);
    font-weight: 700;
    line-height: var(--leading-section-title);
}

.camera-whitelist-close {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ececef;
    color: #515154;
    font-family: var(--font-ui);
    font-size: 22px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.camera-whitelist-intro {
    margin: 14px 0 18px;
    color: #515154;
    font-size: var(--type-body-large);
    font-weight: 400;
    line-height: var(--leading-body-large);
}

.camera-whitelist-address {
    padding: 14px;
    border: 1px solid rgba(0, 113, 227, 0.18);
    border-radius: 16px;
    background: #f2f7ff;
}

.camera-whitelist-address > span {
    display: block;
    margin-bottom: 8px;
    color: #515154;
    font-size: var(--type-label);
    font-weight: 600;
    line-height: var(--leading-label);
}

.camera-whitelist-address > div,
.camera-whitelist-setting-url {
    display: flex;
    align-items: center;
    gap: 10px;
}

.camera-whitelist-address code,
.camera-whitelist-setting-url code {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
    color: #0056b3;
    font-family: "Times New Roman", var(--font-ui);
    font-size: var(--type-body);
    font-weight: 600;
    line-height: var(--leading-body);
}

.camera-whitelist-address button,
.camera-whitelist-setting-url button {
    min-height: 34px;
    flex: 0 0 auto;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: #0071e3;
    color: #fff;
    font-family: var(--font-ui);
    font-size: var(--type-label);
    font-weight: 600;
    line-height: var(--leading-label);
    cursor: pointer;
}

.camera-whitelist-steps {
    display: grid;
    gap: 14px;
    margin: 20px 0;
    padding: 0;
    list-style: none;
}

.camera-whitelist-steps li {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
}

.camera-whitelist-steps li > span {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    background: #1d1d1f;
    color: #fff;
    font-family: "Times New Roman", var(--font-ui);
    font-size: var(--type-navigation);
    font-weight: 600;
    line-height: var(--leading-navigation);
}

.camera-whitelist-steps strong {
    display: block;
    color: #1d1d1f;
    font-size: var(--type-navigation);
    font-weight: 600;
    line-height: var(--leading-navigation);
}

.camera-whitelist-steps p {
    margin: 3px 0 0;
    color: #6e6e73;
    font-size: var(--type-body);
    font-weight: 400;
    line-height: var(--leading-body);
}

.camera-whitelist-setting-url {
    margin-top: 8px;
    padding: 8px 9px 8px 11px;
    border-radius: 12px;
    background: #f1f1f3;
}

.camera-whitelist-setting-url code {
    color: #1d1d1f;
}

.camera-whitelist-browser-note,
.camera-whitelist-security {
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f1f7ed;
    color: #2c6b2f;
    font-size: var(--type-label);
    font-weight: 500;
    line-height: var(--leading-label);
}

.camera-whitelist-browser-note.is-warning {
    background: #fff4e5;
    color: #8a4b00;
}

.camera-whitelist-security {
    margin-top: 10px;
    background: #fff8e8;
    color: #73520d;
}

.camera-whitelist-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.camera-whitelist-actions button {
    min-height: 40px;
    padding: 0 15px;
    border-radius: 12px;
    font-family: var(--font-ui);
    font-size: var(--type-body);
    font-weight: 600;
    line-height: var(--leading-body);
    cursor: pointer;
}

.camera-whitelist-secondary {
    border: 1px solid #d2d2d7;
    background: #fff;
    color: #1d1d1f;
}

.camera-whitelist-primary {
    border: 1px solid #0071e3;
    background: #0071e3;
    color: #fff;
}

@media (max-width: 760px) {
    .persistent-qr-camera {
        top: auto;
        right: 10px;
        bottom: 10px;
        width: min(286px, calc(100vw - 20px));
    }

    .persistent-qr-camera-view {
        height: 144px;
    }

    .persistent-qr-camera-frame {
        width: 108px;
        height: 108px;
    }

    .camera-whitelist-backdrop {
        align-items: end;
        padding: 10px;
    }

    .camera-whitelist-dialog {
        max-height: calc(100vh - 20px);
        padding: 20px 16px 16px;
        border-radius: 24px;
    }

    .camera-whitelist-address > div,
    .camera-whitelist-setting-url {
        align-items: stretch;
        flex-direction: column;
    }

    .camera-whitelist-address button,
    .camera-whitelist-setting-url button {
        width: 100%;
    }

    .camera-whitelist-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .camera-whitelist-actions .camera-whitelist-primary {
        grid-column: 1 / -1;
    }
}

/* 全局/案件共用的数字主体与数据工作台，仅由数据作用域区分内容。 */
.data-workspace-head h1,
.subject-workspace-head h1,
.page-head.case-subjects-head.subject-workspace-head h1 {
    margin-top: 4px;
    font-size: var(--type-page-title);
    font-weight: var(--weight-bold);
    line-height: var(--leading-page-title);
}

.data-workspace-head p,
.subject-workspace-head p,
.page-head.case-subjects-head.subject-workspace-head p {
    margin-top: 7px;
    font-size: var(--type-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
}

.subject-workspace-head {
    align-items: flex-end;
}

.subject-workspace-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.subject-workspace-actions > form {
    margin: 0;
}

.subject-workspace-actions .subject-search-form {
    width: min(620px, 100%);
}

.subject-workspace-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.data-workspace-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.subject-workspace-metrics .metric-card,
.data-workspace-metrics .metric-card {
    min-width: 0;
}

.subject-workspace-metrics .metric-card strong,
.data-workspace-metrics .metric-card strong {
    font-variant-numeric: tabular-nums;
}

.subject-workspace .subject-guide,
.subject-workspace .subject-merge-tools,
.data-workspace .template-review-panel,
.data-workspace .personal-template-panel,
.data-workspace .data-workspace-batches {
    margin-bottom: 24px;
}

.subject-workspace .panel-head h2,
.data-workspace .panel-head h2 {
    margin: 4px 0 0;
    font-size: var(--type-card-title);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-card-title);
}

.subject-workspace-grid {
    margin-top: 18px;
}

.subject-workspace-card {
    cursor: pointer;
}

.subject-workspace-card .subject-detail,
.subject-workspace-card .subject-edit-form {
    cursor: default;
}

.subject-workspace-card .subject-meta {
    flex-wrap: wrap;
}

.subject-workspace[data-closure-mode="true"] .subject-workspace-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.case-closure-guide {
    border-color: rgba(0, 113, 227, 0.16);
    background:
        radial-gradient(circle at 94% 0, rgba(90, 200, 250, 0.13), transparent 34%),
        rgba(255, 255, 255, 0.9);
}

.subject-card-state-stack {
    display: grid;
    justify-items: end;
    gap: 7px;
}

.subject-prediction-chip {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.09);
    color: #0064c9;
    font-size: var(--type-caption);
    font-weight: var(--weight-semibold);
    font-variant-numeric: tabular-nums;
    line-height: var(--leading-caption);
    white-space: nowrap;
}

.subject-workspace-card.is-model-predicted {
    border-color: rgba(0, 113, 227, 0.22);
    box-shadow: 0 14px 40px rgba(0, 83, 176, 0.08);
}

.subject-workspace-card.is-closure-readonly .subject-field-chip {
    cursor: default;
}

.public-data-upload-form {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.public-data-case-select {
    display: block;
}

.public-data-case-select select {
    min-width: 180px;
    min-height: 42px;
    padding: 8px 34px 8px 12px;
    border: 1px solid rgba(210, 210, 215, 0.88);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    font-size: var(--type-body);
    font-weight: var(--weight-medium);
    line-height: var(--leading-body);
}

.data-workspace-reference {
    margin-top: 24px;
    align-items: start;
}

.data-workspace-reference > .panel {
    min-width: 0;
}

.data-workspace .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.data-workspace .template-group summary {
    align-items: center;
}

@media (max-width: 1180px) {
    .subject-workspace-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .subject-workspace[data-closure-mode="true"] .subject-workspace-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .subject-workspace-head,
    .data-workspace-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .subject-workspace-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 820px) {
    .subject-workspace-metrics,
    .data-workspace-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .subject-workspace-actions,
    .case-data-head-actions,
    .public-data-upload-form {
        align-items: stretch;
        flex-direction: column;
    }

    .subject-workspace-actions .subject-search-form {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .subject-workspace-actions .subject-search-form .button.ghost {
        grid-column: 1 / -1;
    }

    .public-data-case-select select {
        width: 100%;
    }

    .data-workspace-reference {
        grid-template-columns: 1fr;
    }
}

/* 案例数据管理：模型先行、同表头聚合、清洗前后同屏切换。 */
.case-data-head-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.case-data-head-actions .case-stage-upload-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.case-data-models,
.case-data-browser {
    margin-bottom: 24px;
    padding: 28px;
    border: 1px solid rgba(210, 210, 215, 0.72);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 16px 46px rgba(25, 32, 46, 0.06);
    backdrop-filter: blur(20px);
}

.case-data-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.case-data-section-head h2 {
    margin: 4px 0 0;
    font-family: var(--font-display);
    font-size: var(--type-section-title);
    font-weight: var(--weight-bold);
    line-height: var(--leading-section-title);
    letter-spacing: -0.02em;
}

.case-data-section-head > small {
    color: var(--muted);
    font-size: var(--type-label);
    font-weight: var(--weight-medium);
    line-height: var(--leading-label);
}

.case-data-model-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.case-data-model-card {
    min-height: 142px;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto 22px;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 1px solid rgba(210, 210, 215, 0.7);
    border-radius: 20px;
    background:
        radial-gradient(circle at 0 0, rgba(0, 122, 255, 0.08), transparent 38%),
        rgba(255, 255, 255, 0.9);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.case-data-model-card:hover {
    border-color: rgba(0, 113, 227, 0.32);
    box-shadow: 0 16px 38px rgba(0, 82, 164, 0.1);
    transform: translateY(-1px);
}

.case-data-model-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(145deg, #0a84ff, #0066d6);
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 113, 227, 0.22);
}

.case-data-model-icon.time {
    background: linear-gradient(145deg, #5e5ce6, #3634a3);
    box-shadow: 0 10px 24px rgba(88, 86, 214, 0.22);
}

.case-data-model-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.case-data-model-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.case-data-model-status {
    width: max-content;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #248a3d;
    font-size: var(--type-caption);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-caption);
}

.case-data-model-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34c759;
    box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.11);
}

.case-data-model-copy > strong {
    font-family: var(--font-display);
    font-size: var(--type-card-title);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-card-title);
}

.case-data-model-copy > small {
    color: var(--muted);
    font-size: var(--type-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
}

.case-data-model-metric {
    min-width: 126px;
    display: grid;
    gap: 3px;
    padding-left: 18px;
    border-left: 1px solid rgba(210, 210, 215, 0.7);
    text-align: right;
}

.case-data-model-metric strong {
    color: #1d1d1f;
    font-size: var(--type-navigation);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-navigation);
    font-variant-numeric: tabular-nums;
}

.case-data-model-metric small {
    color: var(--muted);
    font-size: var(--type-caption);
    font-weight: var(--weight-regular);
    line-height: var(--leading-caption);
}

.case-data-model-arrow {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #86868b;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.case-data-browser {
    overflow: hidden;
    padding: 0;
}

.case-data-browser > .case-data-section-head {
    margin: 0;
    padding: 28px 28px 20px;
}

.case-schema-tabs {
    display: flex;
    gap: 8px;
    padding: 0 28px 18px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.case-schema-tabs a {
    min-width: 168px;
    max-width: 238px;
    display: grid;
    gap: 2px;
    padding: 11px 14px;
    border: 1px solid rgba(210, 210, 215, 0.72);
    border-radius: 13px;
    background: rgba(248, 248, 250, 0.78);
    color: #515154;
    transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.case-schema-tabs a:hover {
    border-color: rgba(0, 113, 227, 0.26);
    color: #1d1d1f;
}

.case-schema-tabs a.is-active {
    border-color: rgba(0, 113, 227, 0.35);
    background: #eaf4ff;
    color: #0068d1;
    box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.06);
}

.case-schema-tabs strong {
    overflow: hidden;
    font-size: var(--type-body);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-body);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-schema-tabs small {
    color: #86868b;
    font-size: var(--type-caption);
    font-weight: var(--weight-regular);
    line-height: var(--leading-caption);
    font-variant-numeric: tabular-nums;
}

.case-data-dataset-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 28px;
    border-top: 1px solid rgba(210, 210, 215, 0.65);
    border-bottom: 1px solid rgba(210, 210, 215, 0.65);
    background: rgba(248, 248, 250, 0.62);
}

.case-data-dataset-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.case-data-dataset-title h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--type-card-title);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-card-title);
}

.case-data-dataset-title > span {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.09);
    color: #0068d1;
    font-size: var(--type-caption);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-caption);
}

.case-data-dataset-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 14px;
    margin-top: 5px;
    color: var(--muted);
    font-size: var(--type-label);
    font-weight: var(--weight-regular);
    line-height: var(--leading-label);
    font-variant-numeric: tabular-nums;
}

.case-data-view-switch {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(76px, 1fr));
    gap: 3px;
    padding: 3px;
    border: 1px solid rgba(118, 118, 128, 0.12);
    border-radius: 11px;
    background: rgba(118, 118, 128, 0.1);
}

.case-data-view-switch a {
    padding: 7px 14px;
    border-radius: 8px;
    color: #515154;
    font-size: var(--type-body);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-body);
    text-align: center;
}

.case-data-view-switch a.is-active {
    background: #fff;
    color: #1d1d1f;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.case-data-identity-legend {
    min-height: 52px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    padding: 10px 28px;
    border-bottom: 1px solid rgba(210, 210, 215, 0.55);
}

.case-data-identity-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 4px;
    color: #515154;
    font-size: var(--type-label);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-label);
}

.case-data-identity-legend > span i {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    background: #0a84ff;
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.11);
}

.case-data-identity-legend em {
    padding: 3px 8px;
    border-radius: 999px;
    background: #eaf4ff;
    color: #0068d1;
    font-size: var(--type-caption);
    font-style: normal;
    font-weight: var(--weight-semibold);
    line-height: var(--leading-caption);
}

.case-data-identity-legend em.is-warning {
    background: #fff6e7;
    color: #8a5700;
}

.case-data-pending-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    border-bottom: 1px solid rgba(255, 159, 10, 0.18);
    background: rgba(255, 249, 235, 0.86);
}

.case-data-pending-strip > div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.case-data-pending-strip strong,
.case-data-pending-strip span {
    font-size: var(--type-label);
    line-height: var(--leading-label);
}

.case-data-pending-strip strong {
    color: #7a4a00;
    font-weight: var(--weight-semibold);
}

.case-data-pending-strip span {
    color: #896b3a;
    font-weight: var(--weight-regular);
}

.case-data-table-wrap {
    max-height: 620px;
    overflow: auto;
    background: #fff;
}

.case-data-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.case-data-table th,
.case-data-table td {
    min-width: 150px;
    max-width: 300px;
    padding: 12px 14px;
    border-right: 1px solid rgba(229, 229, 234, 0.78);
    border-bottom: 1px solid rgba(229, 229, 234, 0.86);
    color: #3a3a3c;
    font-size: var(--type-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
    text-align: left;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.case-data-table th {
    position: sticky;
    z-index: 4;
    top: 0;
    background: rgba(248, 248, 250, 0.97);
    color: #515154;
    font-size: var(--type-label);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-label);
    backdrop-filter: blur(16px);
}

.case-data-table th > span,
.case-data-table th > small {
    display: block;
}

.case-data-table th > small {
    margin-top: 2px;
    color: #0a72d8;
    font-size: var(--type-caption);
    font-weight: var(--weight-medium);
    line-height: var(--leading-caption);
}

.case-data-table th.is-identity {
    background: rgba(232, 244, 255, 0.97);
    color: #005fb8;
    box-shadow: inset 0 3px 0 #0a84ff;
}

.case-data-table td.is-identity {
    background: rgba(234, 244, 255, 0.58);
    color: #005fb8;
    font-weight: var(--weight-semibold);
}

.case-data-table tbody tr:hover td:not(.is-identity) {
    background: rgba(247, 249, 252, 0.8);
}

.case-data-table tbody tr:hover td.is-identity {
    background: rgba(220, 238, 255, 0.72);
}

.case-data-table th.is-processed {
    background: rgba(235, 249, 239, 0.98);
    color: #18773a;
    box-shadow: inset 0 3px 0 #34c759;
}

.case-data-table th.is-processed > small {
    color: #248a46;
}

.case-data-table td.is-processed {
    background: rgba(234, 249, 239, 0.68);
    color: #18773a;
    font-weight: var(--weight-semibold);
}

.case-data-table tbody tr:hover td.is-processed {
    background: rgba(219, 244, 227, 0.86);
}

.case-data-table .case-data-source-column,
.case-data-table .case-data-source-cell {
    position: sticky;
    left: 0;
    min-width: 190px;
    max-width: 230px;
}

.case-data-table .case-data-source-column {
    z-index: 6;
}

.case-data-table .case-data-source-cell {
    z-index: 2;
    background: #fff;
    box-shadow: 5px 0 10px rgba(29, 29, 31, 0.035);
}

.case-data-source-cell strong,
.case-data-source-cell small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-data-source-cell strong {
    color: #1d1d1f;
    font-size: var(--type-body);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-body);
}

.case-data-source-cell small {
    color: var(--muted);
    font-size: var(--type-caption);
    font-weight: var(--weight-regular);
    line-height: var(--leading-caption);
}

.case-data-empty {
    height: 180px;
    color: var(--muted) !important;
    text-align: center !important;
}

.case-data-preview-note {
    margin: 0;
    padding: 12px 28px;
    color: var(--muted);
    font-size: var(--type-caption);
    font-weight: var(--weight-regular);
    line-height: var(--leading-caption);
    text-align: right;
}

.case-data-empty-state {
    min-height: 310px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    padding: 40px;
    border-top: 1px solid rgba(210, 210, 215, 0.62);
    text-align: center;
}

.case-data-empty-state > span {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    background: #eaf4ff;
    color: #0071e3;
    font-size: var(--type-section-title);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-section-title);
}

.case-data-empty-state h3 {
    margin: 4px 0 0;
    font-size: var(--type-card-title);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-card-title);
}

.case-data-empty-state p {
    max-width: 580px;
    margin: 0 0 8px;
    color: var(--muted);
    font-size: var(--type-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
}

.case-data-search-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 18px 28px;
    border-top: 1px solid rgba(210, 210, 215, 0.62);
    background: rgba(248, 249, 251, 0.74);
}

.case-data-search-form label,
.case-data-search-form input {
    width: 100%;
}

.case-data-search-form input {
    min-height: 42px;
}

.case-data-search-form > span {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: var(--type-label);
    font-weight: var(--weight-medium);
    line-height: var(--leading-label);
}

.case-data-identity-legend > span.is-processed {
    color: #248a46;
}

.case-data-identity-legend > span.is-processed i {
    border-color: #34c759;
    background: #34c759;
    box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.13);
}

.case-upload-menu {
    position: relative;
}

.case-upload-menu-popover {
    position: absolute;
    z-index: 30;
    top: calc(100% + 10px);
    right: 0;
    width: min(330px, calc(100vw - 32px));
    display: none;
    padding: 8px;
    border: 1px solid rgba(210, 210, 215, 0.88);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 50px rgba(25, 32, 46, 0.18);
    backdrop-filter: blur(20px);
}

.case-upload-menu.is-open .case-upload-menu-popover {
    display: grid;
    gap: 4px;
}

.case-upload-menu-popover label,
.case-upload-menu-popover > button {
    display: grid;
    gap: 2px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.case-upload-menu-popover label:hover,
.case-upload-menu-popover > button:hover {
    background: rgba(0, 113, 227, 0.08);
}

.case-upload-menu-popover strong {
    color: var(--text);
    font-size: var(--type-body);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-body);
}

.case-upload-menu-popover span {
    color: var(--muted);
    font-size: var(--type-caption);
    font-weight: var(--weight-regular);
    line-height: var(--leading-caption);
}

.case-data-log-button {
    gap: 7px;
}

.case-data-log-button > span {
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: #ff3b30;
    color: #fff;
    font-size: var(--type-caption);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-caption);
}

.template-review-panel-first {
    margin-bottom: 24px;
}

.data-log-metrics .metric-card {
    color: inherit;
    text-decoration: none;
}

.data-log-metrics .metric-card.is-active {
    border-color: rgba(0, 113, 227, 0.42);
    box-shadow: 0 12px 34px rgba(0, 113, 227, 0.1);
}

.data-log-panel {
    margin-top: 24px;
}

.data-log-list {
    display: grid;
}

.data-log-item {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    gap: 14px;
    padding: 18px 20px;
    border-top: 1px solid rgba(229, 229, 234, 0.9);
}

.data-log-item:first-child {
    border-top: 0;
}

.data-log-status {
    width: 10px;
    height: 10px;
    margin-top: 7px;
    border-radius: 50%;
    background: #8e8e93;
}

.data-log-item.is-error {
    background: rgba(255, 59, 48, 0.045);
}

.data-log-item.is-error .data-log-status {
    background: #ff3b30;
    box-shadow: 0 0 0 5px rgba(255, 59, 48, 0.1);
}

.data-log-item.is-warning .data-log-status {
    background: #ff9f0a;
}

.data-log-item.is-success .data-log-status {
    background: #34c759;
}

.data-log-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.data-log-title strong {
    font-size: var(--type-navigation);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-navigation);
}

.data-log-title span,
.data-log-item small {
    color: var(--muted);
    font-size: var(--type-caption);
    font-weight: var(--weight-medium);
    line-height: var(--leading-caption);
}

.data-log-item p {
    margin: 6px 0;
    color: var(--text);
    font-size: var(--type-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
}

@media (max-width: 680px) {
    .case-data-search-form {
        grid-template-columns: 1fr;
        padding: 16px 20px;
    }

    .case-data-search-form .button {
        width: 100%;
    }

    .case-upload-menu,
    .case-upload-menu > .button {
        width: 100%;
    }

    .case-upload-menu-popover {
        right: auto;
        left: 0;
    }

    .data-log-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }
}

@media (max-width: 980px) {
    .case-data-model-grid {
        grid-template-columns: 1fr;
    }

    .case-data-dataset-head,
    .case-data-pending-strip {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 680px) {
    .case-data-head-actions,
    .case-data-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .case-data-head-actions .button,
    .case-data-head-actions .case-stage-upload-form,
    .case-data-head-actions .case-stage-upload-form label {
        width: 100%;
    }

    .case-data-models {
        padding: 20px;
    }

    .case-data-browser > .case-data-section-head,
    .case-schema-tabs,
    .case-data-dataset-head,
    .case-data-identity-legend,
    .case-data-pending-strip {
        padding-right: 20px;
        padding-left: 20px;
    }

    .case-data-model-card {
        grid-template-columns: 48px minmax(0, 1fr) 18px;
        padding: 16px;
    }

    .case-data-model-icon {
        width: 48px;
        height: 48px;
    }

    .case-data-model-metric {
        grid-column: 2 / -1;
        min-width: 0;
        padding: 10px 0 0;
        border-top: 1px solid rgba(210, 210, 215, 0.65);
        border-left: 0;
        text-align: left;
    }

    .case-data-model-arrow {
        grid-column: 3;
        grid-row: 1;
    }

    .case-data-view-switch {
        width: 100%;
    }
}

/*
 * 全站混合字形规则：
 * 中文优先仿宋_GB2312，本机缺失时由服务端同步兼容 GB2312 字符集的中文字体；
 * 拉丁字母、阿拉伯数字和西文标点优先 Times New Roman，缺失时同步兼容字体。
 */
body,
body *:not(svg):not(path):not(circle):not(rect):not(line):not(polyline):not(polygon):not(ellipse) {
    font-family: var(--font-ui) !important;
}

/* 用户管理：个人资料与密码分区，保持功能页统一语义字阶。 */
.account-settings-head {
    margin-bottom: 20px;
}

.account-identity-card {
    min-height: 146px;
    display: grid;
    grid-template-columns: 68px minmax(220px, 1fr) auto;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 24px 28px;
    border: 1px solid rgba(210, 210, 215, 0.72);
    border-radius: 24px;
    background:
        radial-gradient(circle at 0 0, rgba(0, 122, 255, 0.11), transparent 34%),
        rgba(255, 255, 255, 0.88);
    box-shadow: 0 16px 44px rgba(25, 32, 46, 0.06);
}

.account-identity-avatar {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: linear-gradient(145deg, #0a84ff, #0068d1);
    color: #fff;
    font-size: var(--type-section-title);
    font-weight: var(--weight-bold);
    line-height: var(--leading-section-title);
    box-shadow: 0 14px 28px rgba(0, 113, 227, 0.22);
}

.account-identity-copy {
    min-width: 0;
}

.account-identity-copy .status {
    margin-bottom: 6px;
}

.account-identity-copy h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--type-section-title);
    font-weight: var(--weight-bold);
    line-height: var(--leading-section-title);
}

.account-identity-copy p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: var(--type-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
}

.account-identity-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(118px, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(210, 210, 215, 0.68);
    border-radius: 16px;
    background: rgba(210, 210, 215, 0.68);
}

.account-identity-meta span {
    min-height: 72px;
    display: grid;
    align-content: center;
    gap: 3px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--muted);
    font-size: var(--type-caption);
    font-weight: var(--weight-medium);
    line-height: var(--leading-caption);
}

.account-identity-meta strong {
    overflow: hidden;
    color: var(--text);
    font-size: var(--type-body);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-body);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.78fr);
    align-items: start;
    gap: 20px;
}

.account-settings-panel {
    padding: 26px;
}

.account-settings-panel-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.account-settings-panel-head h2 {
    margin: 4px 0 0;
    font-family: var(--font-display);
    font-size: var(--type-section-title);
    font-weight: var(--weight-bold);
    line-height: var(--leading-section-title);
}

.account-settings-panel-head > small {
    color: var(--muted);
    font-size: var(--type-caption);
    font-weight: var(--weight-medium);
    line-height: var(--leading-caption);
}

.account-settings-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.account-settings-form > label {
    min-width: 0;
}

.account-settings-form > label > span {
    color: #515154;
    font-size: var(--type-label);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-label);
}

.account-settings-form input:disabled {
    background: rgba(118, 118, 128, 0.07);
    color: #86868b;
    cursor: not-allowed;
}

.account-settings-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
}

.account-password-form {
    grid-template-columns: 1fr;
}

.account-password-note {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0, 113, 227, 0.07);
    color: #35607f;
    font-size: var(--type-caption);
    font-weight: var(--weight-regular);
    line-height: var(--leading-caption);
}

@media (max-width: 980px) {
    .account-identity-card {
        grid-template-columns: 68px minmax(0, 1fr);
    }

    .account-identity-meta {
        grid-column: 1 / -1;
    }

    .account-settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .account-identity-card {
        padding: 20px;
    }

    .account-identity-meta {
        grid-template-columns: 1fr;
    }

    .account-settings-panel {
        padding: 20px;
    }

    .account-settings-form {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .subject-prediction-card,
    .subject-prediction-card::after,
    .prediction-loader,
    .prediction-loader::before {
        animation: none;
        transition: none;
    }
}

.ml-train-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.ml-train-form textarea {
    width: 100%;
    resize: vertical;
}

.ml-train-form .wide-filter {
    grid-column: 1 / -1;
}

.ml-sql-block {
    display: grid;
    gap: 8px;
}

.ml-sql-block label {
    display: grid;
    gap: 4px;
}

.ml-sql-block em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    line-height: 1.5;
}

.sql-preview-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ml-sql-preview-panel {
    margin-top: 16px;
}

.ml-sql-preview {
    min-height: 110px;
}

.ml-preview-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.ml-preview-summary-grid div {
    padding: 12px;
    border: 1px solid rgba(210, 210, 215, 0.78);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
}

.ml-preview-summary-grid span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.ml-preview-summary-grid strong {
    display: block;
    color: var(--text);
    font-size: 18px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.ml-preview-split-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
    gap: 12px;
}

.ml-preview-split-grid section {
    min-width: 0;
}

.ml-preview-split-grid h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.ml-sql-table-wrap {
    overflow: auto;
    max-height: 460px;
    border: 1px solid rgba(210, 210, 215, 0.8);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
}

.ml-sql-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    font-size: 12px;
}

.ml-sql-table th,
.ml-sql-table td {
    max-width: 260px;
    padding: 9px 10px;
    border-bottom: 1px solid rgba(210, 210, 215, 0.62);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ml-sql-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(245, 245, 247, 0.96);
    color: var(--muted);
    font-weight: 700;
}

.ml-result-metrics {
    margin: 16px 0;
}

.ml-result-box {
    min-height: 120px;
}

.ml-result-summary {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(0, 122, 255, 0.16);
    border-radius: 8px;
    background: rgba(245, 250, 255, 0.88);
    margin-bottom: 14px;
}

.ml-result-summary strong {
    color: var(--blue);
    font-size: 34px;
    line-height: 1;
}

.ml-result-summary span {
    color: var(--muted);
    font-weight: 700;
}

.ml-sample-grid {
    max-height: 560px;
    overflow: auto;
}

.address-standardization-page .page-head {
    margin-bottom: 18px;
}

.address-metrics .metric-card strong {
    font-size: clamp(20px, 2vw, 30px);
}

.address-workbench {
    align-items: stretch;
    margin-bottom: 18px;
}

.address-model-box,
.address-preview-result,
.address-apply-summary {
    margin-top: 12px;
}

.address-source-list {
    display: grid;
    gap: 8px;
    margin: 14px 0;
}

.address-source-list a {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    color: inherit;
    text-decoration: none;
    border: 1px solid rgba(210, 210, 215, 0.74);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.62);
}

.address-source-list strong {
    font-size: 13px;
}

.address-source-list span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.address-result-card {
    padding: 14px;
    border: 1px solid rgba(0, 122, 255, 0.18);
    border-radius: 8px;
    background: rgba(245, 250, 255, 0.82);
}

.address-result-card > div span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.address-result-card > div strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: 20px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.address-result-card dl {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px 10px;
    margin: 14px 0 0;
}

.address-result-card dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.address-result-card dd {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.address-apply-form {
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(160px, 0.45fr) minmax(240px, 0.8fr) auto;
    gap: 12px;
    align-items: end;
}

.toggle-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.toggle-line input {
    width: auto;
}

.address-result-table-wrap {
    margin-top: 12px;
}

.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.catalog-section {
    position: relative;
    display: grid;
    gap: 14px;
    margin-bottom: 22px;
    padding: 16px;
    border: 1px solid rgba(210, 210, 215, 0.72);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 248, 252, 0.74));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(18px);
}

.catalog-section::before {
    content: "";
    position: absolute;
    top: 0;
    right: 16px;
    left: 16px;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background: rgba(0, 122, 255, 0.48);
}

.catalog-section-system {
    border-color: rgba(94, 92, 230, 0.24);
    background: linear-gradient(180deg, rgba(250, 249, 255, 0.94), rgba(247, 248, 252, 0.78));
}

.catalog-section-own {
    border-color: rgba(0, 122, 255, 0.24);
    background: linear-gradient(180deg, rgba(246, 251, 255, 0.94), rgba(247, 250, 255, 0.78));
}

.catalog-section-shared {
    border-color: rgba(255, 149, 0, 0.26);
    background: linear-gradient(180deg, rgba(255, 250, 242, 0.94), rgba(250, 248, 244, 0.78));
}

.catalog-section-system::before {
    background: #5e5ce6;
}

.catalog-section-own::before {
    background: #007aff;
}

.catalog-section-shared::before {
    background: #ff9500;
}

.catalog-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 2px 14px;
    border-bottom: 1px solid rgba(210, 210, 215, 0.68);
}

.catalog-section-head h2 {
    margin: 4px 0;
    color: var(--text);
    font-size: 24px;
    line-height: 1.2;
}

.catalog-section-head p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.catalog-section-head > strong {
    display: grid;
    place-items: center;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border: 1px solid rgba(0, 122, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--blue);
    font-size: 30px;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.catalog-section-system .catalog-section-head > strong {
    border-color: rgba(94, 92, 230, 0.18);
    color: #5e5ce6;
}

.catalog-section-own .catalog-section-head > strong {
    border-color: rgba(0, 122, 255, 0.18);
    color: #007aff;
}

.catalog-section-shared .catalog-section-head > strong {
    border-color: rgba(255, 149, 0, 0.2);
    color: #a15c00;
}

.catalog-section .filter-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.catalog-section .filter-card-item {
    display: flex;
    min-width: 0;
    min-height: 168px;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    border-color: rgba(210, 210, 215, 0.72);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.catalog-section .filter-card-item:hover {
    border-color: rgba(0, 122, 255, 0.28);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.catalog-section .filter-card-main {
    display: block;
}

.catalog-section .filter-card-main h2 {
    margin-top: 8px;
    font-size: 19px;
    line-height: 1.25;
}

.catalog-section .filter-card-main p {
    margin-top: 7px;
    line-height: 1.5;
}

.catalog-section .filter-card-actions {
    margin-top: 14px;
    padding-top: 12px;
}

.catalog-section .empty-filter-card {
    min-height: 116px;
    border-style: dashed;
    background: rgba(255, 255, 255, 0.52);
    box-shadow: none;
}

.tactic-create-panel,
.custom-dashboard-create,
.mysql-query-create {
    border-color: rgba(0, 122, 255, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 250, 255, 0.78));
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.06);
}

.catalog-section .sql-snippet {
    max-height: 150px;
    border-color: rgba(210, 210, 215, 0.66);
    background: rgba(247, 248, 252, 0.72);
}

.catalog-section .ml-algorithm-section {
    margin: 0;
}

.catalog-section .ml-algorithm-section + .ml-algorithm-section {
    padding-top: 14px;
    border-top: 1px solid rgba(210, 210, 215, 0.68);
}

.catalog-section .ml-algorithm-section .panel-head {
    margin-bottom: 12px;
}

.catalog-section .ml-algorithm-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.catalog-section .ml-algorithm-card {
    background: rgba(255, 255, 255, 0.72);
    box-shadow: none;
}

.tactic-kind {
    display: inline-flex;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 122, 255, 0.1);
    color: var(--blue);
}

.tactic-kind.system {
    background: rgba(94, 92, 230, 0.12);
    color: #5e5ce6;
}

.tactic-kind.own {
    background: rgba(0, 122, 255, 0.12);
    color: #0056b3;
}

.tactic-kind.shared-own {
    background: rgba(52, 199, 89, 0.12);
    color: #248a3d;
}

.tactic-kind.shared-other {
    background: rgba(255, 149, 0, 0.14);
    color: #a15c00;
}

.tactic-kind.ai-generated {
    background: rgba(0, 122, 255, 0.14);
    color: #004f9f;
    box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.12);
}

.ai-json-source-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(0, 122, 255, 0.12);
    color: #0056b3;
    font-family: var(--font-ui);
    font-size: var(--type-caption);
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: var(--leading-caption);
    vertical-align: middle;
}

.search-card-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.search-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: linear-gradient(180deg, #fbfdff, #f6faff);
}

.search-card.is-applied {
    border-color: #9ed8a8;
    background: linear-gradient(180deg, #fbfffc, #f1fbf4);
}

.search-card.is-selected {
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.14);
}

.search-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.search-card-select {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
    min-height: 22px;
    padding-top: 2px;
}

.search-card-select input {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
}

.search-card-title {
    min-width: 0;
    flex: 1 1 auto;
}

.search-card-head strong,
.search-card-head span {
    display: block;
}

.search-card-head .search-card-meta {
    flex: 0 0 auto;
    text-align: right;
}

.search-card-head span,
.search-card-meta,
.search-node-chip {
    color: var(--muted);
    font-size: 12px;
}

.search-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-node-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.search-node-chip {
    padding: 4px 7px;
    border: 1px solid #ededf0;
    border-radius: 8px;
    background: #fff;
    font-weight: 700;
}

.snapshot-check input {
    width: 14px;
    min-height: 14px;
}

.filter-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.filter-chip-card {
    padding: 12px;
    border: 1px solid #ededf0;
    border-radius: 8px;
    background: #fbfbfd;
}

.filter-chip-card strong,
.filter-chip-card span {
    display: block;
}

.filter-chip-card span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.tactic-edit-form {
    display: grid;
    gap: 16px;
}

.tactic-snapshot-head {
    margin-top: 4px;
}

.snapshot-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.snapshot-picker-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid rgba(210, 210, 215, 0.78);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.64);
    cursor: pointer;
}

.snapshot-picker-card:hover {
    border-color: #b9d7ff;
    background: #f6faff;
}

.snapshot-picker-card input {
    grid-row: span 3;
    width: 16px;
    min-height: 16px;
    margin-top: 2px;
}

.snapshot-picker-card strong,
.snapshot-picker-card span,
.snapshot-picker-card em {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.snapshot-picker-card span,
.snapshot-picker-card em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.tactic-create-backdrop {
    z-index: 2300;
}

.tactic-create-dialog {
    width: min(920px, calc(100vw - 32px));
    max-height: min(820px, calc(100vh - 32px));
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 16px;
    overflow: hidden;
}

.tactic-create-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.tactic-create-head h2 {
    margin: 4px 0 0;
    font-size: 24px;
}

.tactic-create-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.tactic-create-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px 14px;
}

.tactic-create-fields label {
    min-width: 0;
    display: grid;
    gap: 6px;
    margin: 0;
}

.tactic-create-fields label > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.tactic-create-fields input,
.tactic-create-fields select {
    min-width: 0;
    width: 100%;
    min-height: 42px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    padding: 9px 11px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.tactic-create-snapshots {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    padding-top: 14px;
    overflow: hidden;
    border-top: 1px solid rgba(210, 210, 215, 0.72);
}

.tactic-create-snapshots h3 {
    margin: 0;
    font-size: 17px;
}

.tactic-modal-snapshot-grid {
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-y: auto;
    padding-right: 3px;
}

.tactic-modal-snapshot-grid [hidden] {
    display: none;
}

.tactic-create-actions {
    margin-top: 0;
    padding-top: 14px;
    border-top: 1px solid rgba(210, 210, 215, 0.72);
}

.compact-table {
    max-height: 320px;
}

.filter-result-table {
    max-height: 560px;
}

.compact-table,
.filter-result-table {
    overflow: auto;
}

.graph-filter-page table {
    min-width: 760px;
}

.filter-results-grid table {
    min-width: 620px;
}

.filter-result-table tbody tr {
    cursor: pointer;
}

.filter-result-table tbody tr:hover {
    background: #f3f8ff;
}

.filter-result-table td strong {
    display: block;
    margin-bottom: 3px;
}

.filter-result-table td span {
    color: var(--muted);
    font-size: 12px;
}

.detail-list div {
    display: grid;
    gap: 4px;
}

.detail-list strong,
.detail-list span,
.relation-summary strong,
.relation-summary span {
    display: block;
}

.relation-summary {
    display: grid;
    gap: 6px;
    margin-top: 14px;
    padding: 12px;
    border-radius: 8px;
    background: #fbfbfd;
    border: 1px solid #ededf0;
}

.relation-summary span {
    color: var(--muted);
    font-size: 13px;
}

.screen-page {
    position: relative;
    left: 50%;
    width: min(1500px, calc(100vw - 32px));
    min-height: calc(100vh - 130px);
    transform: translateX(-50%);
    padding: 24px;
    border-radius: 8px;
    background: #070a0f;
    color: #e8edf5;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.screen-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.screen-head h1 {
    margin: 6px 0 0;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.05;
}

.screen-head p {
    margin: 8px 0 0;
    color: #94a3b8;
}

.screen-page .section-kicker {
    color: #64d2ff;
}

.screen-page .button.ghost {
    color: #e8edf5;
    background: #111827;
    border-color: rgba(148, 163, 184, 0.32);
}

.screen-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.screen-metric,
.screen-panel {
    background: #101820;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
}

.screen-metric {
    padding: 16px;
    min-height: 96px;
}

.screen-metric span {
    display: block;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
}

.screen-metric strong {
    display: block;
    margin-top: 8px;
    color: #e8edf5;
    font-size: 34px;
    line-height: 1;
}

.screen-metric.high {
    border-color: rgba(255, 69, 58, 0.6);
    background: #171112;
}

.screen-metric.high strong {
    color: #ff6b62;
}

.screen-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.85fr 0.9fr;
    gap: 12px;
}

.screen-panel {
    padding: 16px;
    min-height: 310px;
}

.screen-panel .panel-head {
    margin-bottom: 8px;
}

.screen-panel h2 {
    margin: 0;
    color: #e8edf5;
    font-size: 18px;
}

.screen-panel.main-chart {
    grid-column: span 2;
}

.screen-panel.people-panel {
    grid-row: span 2;
}

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

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

.risk-list {
    display: grid;
    gap: 10px;
    max-height: 650px;
    overflow: auto;
    padding-right: 4px;
}

.risk-row {
    display: grid;
    gap: 5px;
    padding: 11px;
    border-radius: 8px;
    background: #0b1220;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.risk-row.high {
    border-color: rgba(255, 69, 58, 0.55);
    background: #1b1113;
}

.risk-row strong {
    color: #f8fafc;
}

.risk-row span,
.risk-row em,
.screen-empty {
    color: #94a3b8;
    font-size: 13px;
    font-style: normal;
}

.bride-screen {
    width: min(1920px, 100vw);
    min-height: 100vh;
    padding: 12px 14px 16px;
    background:
        linear-gradient(130deg, rgba(7, 10, 15, 0.48), rgba(12, 24, 30, 0.5) 45%, rgba(19, 14, 24, 0.44)),
        radial-gradient(circle at 48% 34%, rgba(0, 199, 190, 0.18), transparent 32%),
        radial-gradient(circle at 86% 12%, rgba(255, 214, 10, 0.1), transparent 26%);
    border: 0;
    border-radius: 0;
}

.screen-top {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 16px;
    min-height: 88px;
    margin-bottom: 10px;
    text-align: center;
    background: url("/lingxi/static/vendor/fundma/head_bg.png") no-repeat top center / 100% 100%;
}

.screen-title-block h1 {
    margin: 5px 0 0;
    font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: clamp(28px, 3vw, 46px);
    font-weight: 700;
    line-height: 1.08;
    text-align: center;
}

.screen-demo-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
    color: rgba(232, 237, 245, 0.7);
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
}

.screen-demo-note span {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 1px 8px;
    border: 1px solid rgba(255, 214, 10, 0.35);
    border-radius: 999px;
    background: rgba(255, 214, 10, 0.1);
    color: #ffeb7b;
    font-weight: 600;
}

.screen-demo-note p {
    margin: 0;
}

.screen-actions {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 120px;
    min-height: 46px;
    opacity: 0;
    pointer-events: auto;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.screen-actions:hover,
.screen-actions:focus-within {
    opacity: 1;
    transform: translateY(0);
}

.screen-snapshot-select {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 31px;
    padding: 4px 8px;
    border: 1px solid rgba(100, 210, 255, 0.28);
    border-radius: 8px;
    background: rgba(8, 16, 28, 0.62);
    color: #8fa3bd;
    font-size: 12px;
    font-weight: 700;
}

.screen-snapshot-select select {
    width: 150px;
    min-height: 24px;
    border: 1px solid rgba(100, 210, 255, 0.22);
    border-radius: 6px;
    padding: 2px 6px;
    background: rgba(3, 9, 18, 0.82);
    color: #e8edf5;
    font-size: 12px;
}

.screen-hero-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.screen-hero-metrics .screen-metric {
    min-height: 82px;
    padding: 13px 15px;
    background: rgba(101, 132, 226, 0.1);
    border-color: rgba(25, 186, 139, 0.17);
}

.screen-hero-metrics .screen-metric strong {
    color: #ffeb7b;
    font-family: screenDigital, "DIN Alternate", monospace;
    font-size: 40px;
    letter-spacing: 0;
}

.screen-risk-layers {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.screen-risk-layer {
    min-width: 0;
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid rgba(100, 210, 255, 0.22);
    border-radius: 12px;
    background:
        radial-gradient(circle at 100% 0, rgba(100, 210, 255, 0.12), transparent 44%),
        rgba(8, 20, 36, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
    cursor: pointer;
}

.screen-risk-layer.is-l2 {
    border-color: rgba(255, 214, 10, 0.25);
    background:
        radial-gradient(circle at 100% 0, rgba(255, 214, 10, 0.11), transparent 44%),
        rgba(8, 20, 36, 0.82);
}

.screen-risk-layer.is-l3 {
    border-color: rgba(191, 90, 242, 0.3);
    background:
        radial-gradient(circle at 100% 0, rgba(191, 90, 242, 0.13), transparent 44%),
        rgba(8, 20, 36, 0.82);
}

.screen-risk-layer:hover {
    border-color: rgba(255, 235, 123, 0.52);
    transform: translateY(-1px);
}

.screen-risk-layer > span,
.screen-risk-layer p {
    overflow: hidden;
    margin: 0;
    color: #8fa3bd;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.screen-risk-layer > div {
    min-width: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.screen-risk-layer strong {
    overflow: hidden;
    color: #f8fafc;
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.screen-risk-layer b {
    color: #ffeb7b;
    font-family: "Times New Roman", var(--font-ui);
    font-size: 30px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 34px;
}

.screen-risk-layer em {
    color: #64d2ff;
    font-style: normal;
    font-variant-numeric: tabular-nums;
}

.screen-risk-rules {
    cursor: default;
}

.screen-risk-rules p {
    color: #d2dce9;
}

.screen-risk-layer.is-empty {
    opacity: 0.62;
}

.screen-metric.is-clickable,
.screen-panel.is-clickable {
    cursor: pointer;
}

.screen-metric.is-clickable:hover,
.screen-panel.is-clickable:hover {
    border-color: rgba(255, 214, 10, 0.42);
    background: rgba(101, 132, 226, 0.16);
}

.bride-screen-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.82fr) minmax(520px, 1.7fr) minmax(280px, 0.82fr);
    gap: 12px;
    align-items: stretch;
}

.screen-rail {
    display: grid;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.signal-panel,
.screen-map-panel,
.mini-chart-panel {
    position: relative;
    overflow: hidden;
    background: url("/lingxi/static/vendor/fundma/line.png") rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(25, 186, 139, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 42px rgba(0, 0, 0, 0.22);
}

.signal-panel::before,
.screen-map-panel::before,
.mini-chart-panel::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 10px;
    height: 10px;
    pointer-events: none;
    background: transparent;
    border-top: 2px solid #02a6b5;
    border-left: 2px solid #02a6b5;
    opacity: 1;
}

.signal-panel::after,
.screen-map-panel::after,
.mini-chart-panel::after {
    content: "";
    position: absolute;
    inset: 0 0 auto auto;
    width: 10px;
    height: 10px;
    pointer-events: none;
    border-top: 2px solid #02a6b5;
    border-right: 2px solid #02a6b5;
}

.signal-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 212px;
    padding: 13px;
}

.signal-chart {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 178px;
}

.screen-panel .panel-head span {
    display: inline-flex;
    min-width: 30px;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(100, 210, 255, 0.14);
    color: #64d2ff;
    font-size: 12px;
    font-weight: 700;
}

.screen-map-panel {
    display: grid;
    grid-template-rows: auto minmax(500px, 1fr) auto;
    gap: 10px;
    min-height: calc(100vh - 202px);
    padding: 14px;
    border-radius: 8px;
}

.map-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.map-title-row span,
.map-pulse span {
    color: #8fa3bd;
    font-size: 12px;
    font-weight: 700;
}

.map-title-row strong {
    display: block;
    margin-top: 4px;
    color: #f8fafc;
    font-size: 20px;
}

.map-pulse {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.map-pulse i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #30d158;
    box-shadow: 0 0 18px rgba(48, 209, 88, 0.9);
}

.fundma-map {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 520px;
    overflow: hidden;
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 52%, rgba(0, 252, 255, 0.18), transparent 30%),
        radial-gradient(circle at 50% 52%, rgba(25, 91, 185, 0.14), transparent 52%),
        linear-gradient(180deg, rgba(4, 13, 28, 0.28), rgba(5, 15, 29, 0.08));
}

.fundma-map::after {
    content: "";
    position: absolute;
    inset: 3%;
    z-index: 1;
    pointer-events: none;
    border-radius: 50%;
    background:
        radial-gradient(circle, transparent 51%, rgba(100, 210, 255, 0.12) 52%, transparent 53%),
        radial-gradient(circle, transparent 66%, rgba(255, 214, 10, 0.09) 67%, transparent 68%);
    opacity: 0.78;
}

.fundma-map-layer {
    position: absolute;
    top: 51%;
    left: 50%;
    pointer-events: none;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    transform: translate(-50%, -50%);
}

.fundma-map-base {
    z-index: 0;
    width: min(78%, 560px);
    aspect-ratio: 1;
    background-image: url("/lingxi/static/vendor/fundma/map.png");
    opacity: 0.28;
}

.fundma-map-ring {
    z-index: 0;
    width: min(96%, 720px);
    aspect-ratio: 1;
    background-image: url("/lingxi/static/vendor/fundma/lbx.png");
    opacity: 0.58;
    animation: fundmaRotateClockwise 18s linear infinite;
}

.fundma-map-pointer {
    z-index: 0;
    width: min(86%, 650px);
    aspect-ratio: 1;
    background-image: url("/lingxi/static/vendor/fundma/jt.png");
    opacity: 0.72;
    animation: fundmaRotateCounter 16s linear infinite;
}

.map-chart {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.map-zoom-control {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 4;
    display: grid;
    grid-template-columns: auto minmax(120px, 160px) 44px;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(70, 190, 233, 0.36);
    border-radius: 8px;
    background: rgba(4, 13, 28, 0.76);
    color: #d7f8ff;
    box-shadow: 0 0 18px rgba(0, 252, 255, 0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.fundma-map:hover .map-zoom-control,
.fundma-map:focus-within .map-zoom-control,
.map-title-row:hover + .fundma-map .map-zoom-control {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.map-zoom-control span {
    color: rgba(232, 237, 245, 0.72);
    font-size: 12px;
    font-weight: 700;
}

.map-zoom-control b {
    color: #ffeb7b;
    font-family: screenDigital, "DIN Alternate", monospace;
    font-size: 18px;
    font-weight: 400;
}

.map-zoom-control input {
    width: 100%;
    accent-color: #46bee9;
}

@keyframes fundmaRotateClockwise {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes fundmaRotateCounter {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(-360deg);
    }
}

.map-bottom-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mini-chart-panel {
    min-height: 190px;
    padding: 12px;
}

.mini-chart {
    height: 140px;
}

.screen-subject-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 8, 18, 0.72);
    backdrop-filter: blur(16px);
}

.screen-subject-modal {
    width: min(920px, 100%);
    max-height: min(760px, 86vh);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(70, 190, 233, 0.36);
    border-radius: 10px;
    background:
        url("/lingxi/static/vendor/fundma/line.png"),
        linear-gradient(180deg, rgba(7, 18, 34, 0.96), rgba(4, 11, 24, 0.98));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.screen-subject-modal.subject-detail-workspace {
    width: min(1500px, calc(100vw - 48px));
    max-height: min(900px, calc(100vh - 48px));
}

.subject-detail-layout.screen {
    background:
        radial-gradient(circle at 16% 12%, rgba(100, 210, 255, 0.12), transparent 30%),
        radial-gradient(circle at 82% 6%, rgba(255, 214, 10, 0.08), transparent 24%);
}

.subject-detail-layout.screen .subject-detail-left {
    scrollbar-color: rgba(100, 210, 255, 0.38) transparent;
}

.subject-person-info.screen {
    border-color: rgba(100, 210, 255, 0.16);
    background:
        url("/lingxi/static/vendor/fundma/line.png"),
        linear-gradient(180deg, rgba(8, 24, 44, 0.86), rgba(4, 13, 28, 0.82));
    box-shadow: inset 0 1px 0 rgba(215, 248, 255, 0.06);
}

.subject-person-info.screen .subject-person-info-head h3,
.subject-hit-panel.screen .subject-hit-panel-head h3,
.subject-hit-section.screen h3 {
    color: #f8fafc;
}

.subject-person-info.screen .subject-person-info-head span,
.subject-hit-panel.screen .subject-hit-panel-head span {
    color: #64d2ff;
}

.subject-hit-panel.screen {
    border-color: rgba(70, 190, 233, 0.26);
    background:
        url("/lingxi/static/vendor/fundma/line.png"),
        linear-gradient(180deg, rgba(8, 24, 44, 0.88), rgba(4, 13, 28, 0.9));
    box-shadow:
        0 20px 58px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(215, 248, 255, 0.06);
}

.subject-hit-panel.screen .subject-hit-panel-head {
    border-bottom-color: rgba(100, 210, 255, 0.16);
}

.subject-hit-panel.screen .subject-hit-scroll {
    scrollbar-color: rgba(100, 210, 255, 0.38) transparent;
}

.subject-hit-overview.screen {
    border-color: rgba(100, 210, 255, 0.18);
    background: rgba(4, 13, 28, 0.74);
}

.subject-hit-overview.screen span {
    color: #8fa3bd;
}

.subject-hit-overview.screen strong {
    color: #64d2ff;
}

.subject-hit-section.screen .rule-chip {
    border-color: rgba(100, 210, 255, 0.16);
    background: rgba(8, 24, 44, 0.68);
    color: #f8fafc;
}

.subject-hit-section.screen .rule-badge {
    background: rgba(100, 210, 255, 0.14);
    color: #d7f8ff;
}

.subject-hit-section.screen .rule-chip > span:last-child {
    color: #64d2ff;
}

.screen-subject-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(70, 190, 233, 0.18);
}

.screen-subject-modal-head h2 {
    margin: 4px 0 5px;
    color: #f8fafc;
    font-size: 22px;
}

.screen-subject-modal-head p {
    margin: 0;
    color: #8fa3bd;
    font-size: 13px;
}

.screen-subject-modal-head.subject-detail-modal-head,
.subject-modal-head.subject-detail-modal-head {
    display: grid;
    grid-template-columns: minmax(340px, 1fr) minmax(330px, 0.92fr);
    align-items: stretch;
    padding: 12px 14px;
}

.screen-subject-modal-head.subject-detail-modal-head {
    background:
        radial-gradient(circle at 14% 16%, rgba(100, 210, 255, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(8, 24, 44, 0.64), rgba(4, 13, 28, 0.36));
}

.screen-subject-modal-head.subject-detail-modal-head h2 {
    margin: 4px 0 6px;
}

.screen-subject-modal-head.subject-detail-modal-head .subject-detail-title-block p {
    line-height: 1.55;
}

.screen-subject-modal-backdrop.glass {
    background: rgba(18, 20, 26, 0.24);
    backdrop-filter: blur(18px) saturate(1.35);
}

.screen-subject-modal.glass {
    border-color: rgba(210, 210, 215, 0.74);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(247, 249, 252, 0.66));
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(22px) saturate(1.28);
}

.screen-subject-modal-head.subject-detail-modal-head.glass {
    border-bottom-color: rgba(210, 210, 215, 0.62);
    background:
        radial-gradient(circle at 18% 12%, rgba(0, 122, 255, 0.1), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(247, 249, 252, 0.42));
}

.screen-subject-modal-head.subject-detail-modal-head.glass h2 {
    color: var(--text);
}

.screen-subject-modal-head.subject-detail-modal-head.glass p {
    color: var(--muted);
}

.subject-detail-main.screen {
    background:
        radial-gradient(circle at 16% 12%, rgba(100, 210, 255, 0.11), transparent 30%),
        radial-gradient(circle at 82% 6%, rgba(255, 214, 10, 0.07), transparent 24%),
        rgba(2, 8, 18, 0.16);
}

.subject-detail-main.screen .subject-detail-graph-block {
    min-height: 0;
}

.subject-detail-modal-head > .subject-profile-card.screen,
.subject-detail-main .subject-relation-card.screen {
    border-color: rgba(70, 190, 233, 0.3);
    background:
        url("/lingxi/static/vendor/fundma/line.png"),
        linear-gradient(180deg, rgba(8, 24, 44, 0.9), rgba(4, 13, 28, 0.88));
    box-shadow:
        0 20px 58px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.screen-subject-table {
    display: grid;
    gap: 8px;
    overflow: auto;
    padding: 14px 18px 18px;
}

.screen-subject-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid rgba(100, 210, 255, 0.16);
    border-radius: 8px;
    background: rgba(4, 13, 28, 0.72);
}

.screen-subject-row.is-clickable {
    cursor: pointer;
}

.screen-subject-row.is-clickable:hover {
    border-color: rgba(100, 210, 255, 0.42);
    background: rgba(7, 24, 44, 0.84);
}

.screen-subject-row b {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(100, 210, 255, 0.16);
    color: #64d2ff;
    font-family: screenDigital, "DIN Alternate", monospace;
    font-size: 18px;
    font-weight: 400;
}

.screen-subject-row div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.screen-subject-row strong {
    color: #f8fafc;
    font-size: 15px;
}

.screen-subject-row span,
.screen-subject-row em,
.screen-subject-row small {
    overflow: hidden;
    color: #8fa3bd;
    font-size: 12px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.screen-subject-row em {
    color: #ffeb7b;
}

.screen-subject-row i {
    color: #64d2ff;
    font-family: screenDigital, "DIN Alternate", monospace;
    font-size: 24px;
    font-style: normal;
    white-space: nowrap;
}

.screen-subject-card-body {
    min-height: 0;
    overflow: auto;
    padding: 14px 18px 18px;
}

.screen-subject-card-body .subject-profile-card.screen {
    border-color: rgba(70, 190, 233, 0.3);
    background:
        url("/lingxi/static/vendor/fundma/line.png"),
        linear-gradient(180deg, rgba(8, 24, 44, 0.9), rgba(4, 13, 28, 0.88));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.subject-profile-card.screen .subject-profile-head h3 {
    color: #f8fafc;
}

.subject-profile-card.screen .subject-profile-head h3 span {
    color: #64d2ff;
}

.subject-profile-card.screen .subject-dimension-strip {
    background: rgba(6, 22, 42, 0.74);
}

.subject-profile-card.screen .subject-dimension-strip span {
    border-color: rgba(100, 210, 255, 0.18);
    background: rgba(4, 13, 28, 0.66);
    color: #8fa3bd;
}

.subject-profile-card.screen .subject-dimension-strip b {
    color: #f8fafc;
}

.subject-profile-card.screen .subject-dimension-strip em,
.subject-profile-card.screen .rule-chip > span:last-child {
    color: #64d2ff;
}

.subject-profile-card.screen .subject-rule-box {
    background: rgba(4, 13, 28, 0.76);
}

.subject-profile-card.screen .subject-rule-box > strong,
.subject-profile-card.screen .rule-chip {
    color: #f8fafc;
}

.subject-profile-card.screen .rule-chip {
    border-color: rgba(100, 210, 255, 0.16);
    background: rgba(8, 24, 44, 0.68);
}

.subject-profile-card.screen .rule-badge {
    background: rgba(100, 210, 255, 0.14);
    color: #d7f8ff;
}

.screen-subject-card-body .subject-relation-card.screen {
    border-color: rgba(70, 190, 233, 0.3);
    background:
        url("/lingxi/static/vendor/fundma/line.png"),
        linear-gradient(180deg, rgba(8, 24, 44, 0.88), rgba(4, 13, 28, 0.86));
    box-shadow: 0 20px 58px rgba(0, 0, 0, 0.24);
}

.subject-relation-card.screen .subject-relation-head h3 {
    color: #f8fafc;
}

.subject-relation-card.screen .subject-relation-head span,
.subject-relation-card.screen .node-rule-title span {
    color: #64d2ff;
}

.subject-relation-card.screen .subject-relation-graph {
    border-color: rgba(100, 210, 255, 0.18);
    background:
        linear-gradient(180deg, rgba(8, 24, 44, 0.82), rgba(4, 13, 28, 0.78)),
        repeating-linear-gradient(90deg, rgba(100, 210, 255, 0.07) 0 1px, transparent 1px 48px),
        repeating-linear-gradient(0deg, rgba(100, 210, 255, 0.055) 0 1px, transparent 1px 48px);
    box-shadow:
        inset 0 1px 0 rgba(215, 248, 255, 0.08),
        inset 0 -20px 60px rgba(100, 210, 255, 0.04);
}

.subject-relation-card.screen .selected-node-info {
    border-color: rgba(100, 210, 255, 0.16);
    background: rgba(4, 13, 28, 0.74);
    color: #8fa3bd;
}

.subject-relation-card.screen .node-rule-title strong {
    color: #f8fafc;
}

.screen-subject-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.screen-subject-field-grid div {
    display: grid;
    gap: 5px;
    padding: 10px;
    border: 1px solid rgba(100, 210, 255, 0.16);
    border-radius: 8px;
    background: rgba(4, 13, 28, 0.72);
}

.screen-subject-field-grid strong {
    color: #f8fafc;
    font-size: 13px;
}

.screen-subject-field-grid span {
    color: #8fa3bd;
    font-size: 12px;
    line-height: 1.5;
}

.custom-screen-page {
    display: grid;
    gap: 18px;
}

.custom-dashboard-create {
    margin-bottom: 18px;
}

.custom-screen-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: 90px;
    gap: 12px;
}

.custom-screen-panel {
    position: relative;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 13px;
    border: 1px solid rgba(25, 186, 139, 0.18);
    border-radius: 8px;
    background:
        url("/lingxi/static/vendor/fundma/line.png"),
        linear-gradient(180deg, rgba(7, 18, 34, 0.94), rgba(5, 12, 24, 0.96));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 18px 42px rgba(0,0,0,0.18);
}

.custom-screen-panel .panel-head h2 {
    color: #f8fafc;
}

.custom-chart {
    width: 100%;
    min-height: 0;
    height: 100%;
}

.dashboard-panel-tools {
    display: flex;
    align-items: center;
    gap: 7px;
}

.dashboard-panel-move,
.dashboard-panel-resize {
    border: 0;
    color: #8fa3bd;
    background: transparent;
    touch-action: none;
}

.dashboard-panel-move {
    padding: 5px 7px;
    cursor: grab;
    font-size: 18px;
    line-height: 1;
}

.dashboard-panel-resize {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 22px;
    height: 22px;
    cursor: nwse-resize;
}

.dashboard-panel-resize::after {
    content: "";
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 9px;
    height: 9px;
    border-right: 2px solid #64d2ff;
    border-bottom: 2px solid #64d2ff;
}

.custom-screen-panel.is-moving,
.custom-screen-panel.is-resizing {
    z-index: 5;
    border-color: rgba(100, 210, 255, 0.7);
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.34);
}

.system-dashboard-editor-guide {
    display: grid;
    grid-template-columns: auto auto minmax(140px, 1fr) auto minmax(140px, 1fr) auto minmax(220px, 1.45fr);
    align-items: center;
    gap: 8px 12px;
    padding: 14px 16px;
    border: 1px solid rgba(0, 113, 227, 0.14);
    border-radius: 18px;
    background: linear-gradient(135deg, #f7fbff, #fff);
    box-shadow: 0 12px 34px rgba(0, 61, 130, 0.06);
}

.system-dashboard-editor-guide strong,
.system-dashboard-editor-guide span {
    white-space: nowrap;
}

.system-dashboard-editor-guide strong {
    color: var(--text);
    font-size: 13px;
}

.system-dashboard-editor-guide span {
    padding: 5px 8px;
    border-radius: 999px;
    color: #0069d2;
    background: #eaf4ff;
    font-size: 11px;
    font-weight: 700;
}

.system-dashboard-editor-guide p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.system-dashboard-editor-guide code {
    color: #5b3cb1;
    font-weight: 700;
}

.system-dashboard-slot-grid {
    grid-template-columns: repeat(4, minmax(230px, 1fr));
}

.system-dashboard-slot-grid .dashboard-editor-metric {
    min-height: 230px;
}

.system-dashboard-slot-grid .dashboard-editor-metric .custom-chart {
    min-height: 170px;
}

.system-dashboard-slot-grid .custom-screen-panel:not(.dashboard-editor-metric) {
    grid-column: span 2;
}

.dashboard-automatic-note {
    margin: 0;
    color: #6e6e73;
    font-size: 12px;
    line-height: 1.65;
}

@media (max-width: 1080px) {
    .system-dashboard-editor-guide {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .system-dashboard-slot-grid {
        grid-template-columns: repeat(2, minmax(260px, 1fr));
    }

    .system-dashboard-slot-grid .custom-screen-panel:not(.dashboard-editor-metric) {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    .system-dashboard-slot-grid {
        grid-template-columns: 1fr;
    }
}

.custom-panel-dialog {
    width: min(760px, calc(100vw - 32px));
}

.risk-list.compact {
    max-height: none;
    min-height: 0;
}

.command-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 9px;
    background: rgba(7, 12, 18, 0.68);
}

.command-row i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    color: #071015;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.command-row div {
    min-width: 0;
}

.command-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.command-row span,
.command-row em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.command-row b {
    color: #ffd60a;
    font-size: 16px;
}

@media (max-width: 1280px) {
    .screen-risk-layers {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .graph-filter-page {
        width: min(100vw - 20px, 1180px);
    }

    .filter-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .custom-screen-grid {
        grid-template-columns: repeat(2, minmax(260px, 1fr));
    }

    .ml-algorithm-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bride-screen-grid {
        grid-template-columns: 1fr;
    }

    .screen-rail {
        grid-template-columns: repeat(3, minmax(260px, 1fr));
        grid-template-rows: auto;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .signal-panel {
        min-width: 260px;
        min-height: 240px;
    }

    .filter-console,
    .filter-support-grid,
    .filter-results-grid {
        grid-template-columns: 1fr;
    }

    .filter-search-row,
    .mysql-query-form,
    .ml-train-form,
    .ml-algorithm-grid,
    .ml-preview-summary-grid,
    .ml-preview-split-grid {
        grid-template-columns: 1fr;
    }

    .mysql-picker-control {
        grid-template-columns: 1fr;
    }

    .address-apply-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .topbar {
        height: auto;
        min-height: 64px;
        padding: 14px 20px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .nav {
        order: 3;
        width: 100%;
    }

    .shell,
    .graph-page,
    .graph-filter-page {
        width: min(100vw - 24px, 760px);
        padding-top: 24px;
    }

    .page-head,
    .graph-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .metric-grid,
    .metric-grid.narrow,
    .two-column,
    .screen-metrics,
    .screen-grid,
    .auth-layout,
    .inline-form,
    .admin-create-form,
    .admin-user-row,
    .admin-case-authorization-grid,
    .admin-resource-row,
    .filter-grid,
    .filter-form,
    .sql-command-form,
    .admin-command-row,
    .graph-workspace,
    .filter-console,
    .filter-support-grid,
    .filter-results-grid {
        grid-template-columns: 1fr;
    }

    .wide-filter {
        grid-column: auto;
    }

    .filter-card-create-panel .inline-form {
        grid-template-columns: 1fr;
    }

    .custom-screen-grid,
    .custom-save-query-box {
        grid-template-columns: 1fr;
    }

    .filter-card-create-panel .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-card-create-panel .panel-head .muted {
        max-width: none;
        text-align: left;
    }

    .subject-merge-console,
    .subject-merge-form,
    .subject-batch-search {
        grid-template-columns: 1fr;
    }

    .screen-page {
        width: min(100vw - 24px, 760px);
        margin-left: 0;
        left: auto;
        transform: none;
        padding: 16px;
    }

    .bride-screen {
        width: min(100vw - 18px, 760px);
        padding: 12px;
    }

    .screen-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .screen-top {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .screen-actions {
        position: static;
        justify-content: flex-start;
    }

    .screen-title-block h1 {
        text-align: left;
    }

    .screen-hero-metrics,
    .map-bottom-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .screen-rail {
        grid-template-columns: 1fr;
    }

    .signal-panel {
        min-width: 0;
    }

    .screen-map-panel {
        grid-template-rows: auto minmax(360px, 1fr) auto;
        min-height: 640px;
    }

    .fundma-map {
        min-height: 420px;
    }

    .screen-panel.main-chart,
    .screen-panel.people-panel {
        grid-column: auto;
        grid-row: auto;
    }

    .auth-visual {
        display: none;
    }

    .upload-box,
    .mapping-toolbar,
    .confirm-bar {
        align-items: stretch;
        flex-direction: column;
    }

    #relationGraph {
        width: min(100%, calc(100vw - 24px));
        min-height: 0;
    }

    .case-workflow,
    .subject-grid {
        grid-template-columns: 1fr;
    }

    .graph-legend-panel {
        position: static;
        max-height: none;
    }

    .relation-legend-stack {
        grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    }

    .inspector {
        position: static;
    }

    .popup-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-form {
        grid-template-columns: 1fr;
    }

    .filter-method-grid {
        grid-template-columns: 1fr;
    }

    .filter-method-card {
        min-height: 0;
    }

    .filter-card-grid {
        grid-template-columns: 1fr;
    }

    .catalog-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .catalog-section-head > strong {
        text-align: left;
    }

    .address-apply-form {
        grid-template-columns: 1fr;
    }

    .address-result-card dl {
        grid-template-columns: 1fr;
    }
}

/* 案例状态筛选与卡片状态：进行中使用绿色，已办结使用低干扰蓝灰色。 */
.case-status-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: -4px 0 20px;
    padding: 8px 10px 8px 16px;
    border: 1px solid rgba(29, 29, 31, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 30px rgba(31, 35, 45, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(1.12);
}

.case-status-filter > span {
    flex: 0 0 auto;
    color: #515154;
    font-size: 13px;
    font-weight: 700;
}

.case-status-segments {
    min-width: min(430px, 100%);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    padding: 3px;
    border: 1px solid rgba(118, 118, 128, 0.12);
    border-radius: 13px;
    background: rgba(118, 118, 128, 0.12);
    box-shadow: inset 0 1px 2px rgba(31, 35, 45, 0.06);
}

.case-status-segments a {
    min-height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 10px;
    color: #6e6e73;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.case-status-segments a:hover:not(.is-active) {
    color: #1d1d1f;
    background: rgba(255, 255, 255, 0.55);
}

.case-status-segments a.is-active {
    color: #1d1d1f;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 5px 12px rgba(31, 35, 45, 0.09);
    transform: translateY(-0.5px);
}

.case-status-segments b {
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(118, 118, 128, 0.1);
    color: inherit;
    font-size: 11px;
}

.case-card .case-topline {
    align-items: flex-start;
}

.case-updated-at {
    padding-top: 4px;
    color: #86868b;
    font-size: 12px;
}

.case-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.case-status-badge i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45);
}

.case-status-badge.active {
    background: #e8f8ed;
    color: #16833a;
}

.case-status-badge.closed {
    background: #edf2f7;
    color: #536579;
}

.case-status-badge.archived {
    background: #f1f1f4;
    color: #6e6e73;
}

.case-filter-empty {
    min-height: 180px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(118, 118, 128, 0.28);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.58);
}

/* 数字主体卡片中的疑似标签与人工备注摘要。 */
.subject-card-tags {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(29, 29, 31, 0.08);
    border-radius: 14px;
    background: #f8f8fa;
}

.subject-card-tag-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
}

.subject-card-tag-row > span {
    padding-top: 4px;
    color: #6e6e73;
    font-size: 11px;
    font-weight: 700;
}

.subject-card-tag-row p {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
}

.subject-card-tag-row b,
.subject-card-tag-row em {
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    overflow: hidden;
    border-radius: 999px;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subject-card-tag-row.suspected b {
    background: #fff3dc;
    color: #8a5600;
}

.subject-card-tag-row.manual b {
    background: #eaf3ff;
    color: #005ec4;
}

.subject-card-tag-row em {
    background: rgba(118, 118, 128, 0.1);
    color: #6e6e73;
}

.subject-card-tag-row i {
    padding: 4px 0;
    color: #aeaeb2;
    font-size: 11px;
    font-style: normal;
}

/* 主体详情在基础信息与风险维度之间加入可编辑备注区，并适度扩展工作区。 */
.subject-detail-workspace.has-subject-tag-editor-layout,
.screen-subject-modal.subject-detail-workspace.has-subject-tag-editor-layout {
    width: min(1720px, calc(100vw - 32px));
    grid-template-columns: minmax(0, 7fr) minmax(360px, 3fr);
    grid-template-rows: minmax(285px, 3.3fr) minmax(0, 6.7fr);
}

.subject-detail-modal-head.has-subject-tag-editor,
.screen-subject-modal-head.subject-detail-modal-head.has-subject-tag-editor,
.subject-modal-head.subject-detail-modal-head.has-subject-tag-editor {
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.78fr) minmax(0, 0.94fr);
    gap: 12px;
}

.subject-detail-modal-head.has-subject-tag-editor > .subject-profile-card {
    grid-column: 3;
    grid-row: 1;
}

.subject-head-tag-editor {
    min-width: 0;
    min-height: 0;
    height: 100%;
    grid-column: 2;
    grid-row: 1;
    display: grid;
    align-content: start;
    gap: 7px;
    padding: 10px;
    overflow: auto;
    border: 1px solid rgba(70, 190, 233, 0.3);
    border-radius: 14px;
    background:
        url("/lingxi/static/vendor/fundma/line.png"),
        linear-gradient(180deg, rgba(8, 24, 44, 0.94), rgba(4, 13, 28, 0.92));
    box-shadow:
        0 18px 48px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(215, 248, 255, 0.06);
    color: #f8fafc;
    scrollbar-color: rgba(100, 210, 255, 0.38) transparent;
}

.subject-head-tag-title,
.subject-head-tag-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.subject-head-tag-title h3 {
    margin: 1px 0 0;
    color: #f8fafc;
    font-size: 16px;
    line-height: 1.2;
}

.subject-head-tag-editor .section-kicker {
    color: #64d2ff;
}

.subject-head-tag-title > span,
.subject-head-tag-heading span,
.subject-head-tag-empty {
    color: #8fa3bd;
    font-size: 10px;
    font-weight: 600;
}

.subject-head-tag-group {
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid rgba(100, 210, 255, 0.16);
    border-radius: 11px;
    background: rgba(4, 13, 28, 0.72);
}

.subject-head-tag-heading strong {
    color: #d7f8ff;
    font-size: 11px;
}

.subject-head-tag-stack {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.subject-head-tag-chip {
    max-width: 100%;
    min-height: 23px;
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

button.subject-head-tag-chip.suspected {
    border: 1px solid rgba(255, 190, 92, 0.2);
    background: rgba(255, 159, 10, 0.15);
    color: #ffd591;
    cursor: pointer;
}

button.subject-head-tag-chip.suspected:hover:not(:disabled) {
    border-color: rgba(255, 214, 145, 0.42);
    background: rgba(255, 159, 10, 0.24);
    transform: translateY(-1px);
}

button.subject-head-tag-chip.is-added {
    border-color: rgba(48, 209, 88, 0.24);
    background: rgba(48, 209, 88, 0.15);
    color: #8ce99f;
    cursor: default;
}

.subject-head-tag-chip.manual {
    border: 1px solid rgba(100, 210, 255, 0.2);
    background: rgba(100, 210, 255, 0.14);
    color: #d7f8ff;
}

.subject-head-tag-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
}

.subject-head-tag-form input {
    width: 100%;
    min-height: 32px;
    padding: 6px 9px;
    border: 1px solid rgba(100, 210, 255, 0.2);
    border-radius: 10px;
    background: rgba(2, 8, 18, 0.68);
    color: #f8fafc;
    font-size: 11px;
    outline: none;
}

.subject-head-tag-form input::placeholder {
    color: #70849e;
}

.subject-head-tag-form input:focus {
    border-color: rgba(100, 210, 255, 0.62);
    box-shadow: 0 0 0 3px rgba(100, 210, 255, 0.12);
}

.subject-head-tag-form .button {
    min-height: 32px;
    padding: 5px 11px;
    border-color: rgba(100, 210, 255, 0.5);
    background: #0a84ff;
    color: #ffffff;
}

.subject-head-tag-feedback {
    min-height: 14px;
    margin: 0;
    color: #8fa3bd;
    font-size: 10px;
    line-height: 1.35;
}

.subject-head-tag-editor.is-saving {
    cursor: progress;
}

@media (max-width: 720px) {
    .case-status-filter {
        align-items: stretch;
        flex-direction: column;
        padding: 12px;
    }

    .case-status-segments {
        min-width: 0;
        width: 100%;
    }

    .case-status-segments a {
        padding-right: 7px;
        padding-left: 7px;
        font-size: 12px;
    }

    .case-status-segments b {
        display: none;
    }

    .subject-card-tag-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}

/* 案件办结与 AI 办案：保持苹果式克制层次，用状态色表达连接与确认。 */
.ai-case-button {
    position: relative;
    gap: 7px;
    overflow: hidden;
    border-color: rgba(0, 113, 227, 0.24);
    background: linear-gradient(135deg, rgba(236, 247, 255, 0.96), rgba(244, 238, 255, 0.96));
    color: #1758a6;
}

.ai-case-button::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 22%, rgba(255, 255, 255, 0.72) 48%, transparent 72%);
    transform: translateX(-120%);
    transition: transform 520ms ease;
    pointer-events: none;
}

.ai-case-button:hover::after {
    transform: translateX(120%);
}

.ai-case-button.is-waiting {
    border-color: rgba(255, 149, 0, 0.34);
    background: #fff8ec;
    color: #9a5a00;
}

.ai-case-button.is-connected {
    border-color: rgba(52, 199, 89, 0.34);
    background: #effbf2;
    color: #137a35;
}

.ai-case-dot {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0071e3;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.ai-case-button.is-waiting .ai-case-dot,
.ai-welcome-connection.is-waiting .ai-case-dot {
    background: #ff9500;
    box-shadow: 0 0 0 4px rgba(255, 149, 0, 0.12);
    animation: ai-status-pulse 1.8s ease-in-out infinite;
}

.ai-case-button.is-connected .ai-case-dot,
.ai-welcome-connection.is-connected .ai-case-dot {
    background: #34c759;
    box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.12);
}

.close-case-button {
    border-color: rgba(88, 86, 214, 0.22);
    background: #f4f3ff;
    color: #4d4ab4;
}

.close-case-button.is-closed {
    border-color: rgba(52, 199, 89, 0.28);
    background: #effbf2;
    color: #137a35;
}

body.case-close-open {
    overflow: hidden;
}

.case-close-backdrop {
    z-index: 1250;
    padding: 18px;
}

.case-close-dialog {
    width: min(1080px, calc(100vw - 36px));
    height: min(820px, calc(100dvh - 36px));
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 16px;
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 32px 100px rgba(30, 36, 52, 0.24);
}

.case-close-head,
.case-close-toolbar,
.case-close-footer,
.case-close-subject-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.case-close-head {
    align-items: flex-start;
}

.case-close-head-actions,
.case-close-toolbar-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
}

.case-close-head h2 {
    margin: 4px 0 7px;
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: -0.035em;
}

.case-close-head p,
.case-close-footer p,
.case-close-subject-meta {
    margin: 0;
    color: var(--muted);
}

.case-close-toolbar {
    padding: 12px;
    border-radius: 16px;
    background: #f5f5f7;
}

.case-close-search {
    flex: 1 1 420px;
}

.case-close-search input {
    width: 100%;
    min-height: 42px;
    border-color: transparent;
    border-radius: 12px;
    background: #fff;
}

.case-close-progress {
    flex: 0 0 auto;
    color: #6e6e73;
    font-size: 13px;
    font-weight: 700;
}

.case-close-progress.is-complete {
    color: #137a35;
}

.case-close-subjects {
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 0;
    padding: 2px 8px 2px 2px;
    overflow: auto;
    overscroll-behavior: contain;
}

.case-close-subject-item {
    padding: 16px;
    border: 1px solid rgba(210, 210, 215, 0.72);
    border-radius: 18px;
    background: #fff;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.case-close-subject-item.needs-choice {
    border-color: rgba(255, 149, 0, 0.38);
    box-shadow: 0 8px 24px rgba(255, 149, 0, 0.08);
}

.case-close-subject-item.missing-manual-tag {
    border-color: rgba(255, 59, 48, 0.28);
    background: linear-gradient(135deg, #fff 58%, #fff8f7);
    box-shadow: 0 8px 24px rgba(255, 59, 48, 0.06);
}

.case-close-subject-item.is-confirmed {
    border-color: rgba(52, 199, 89, 0.3);
}

.case-close-subject-item.is-model-predicted {
    border-left: 4px solid #0a84ff;
}

.case-close-subject-head h3 {
    margin: 2px 0 0;
    font-size: 19px;
}

.case-close-prediction-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    margin-top: 7px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.09);
    color: #0064c9;
    font-size: var(--type-caption);
    font-weight: var(--weight-semibold);
    font-variant-numeric: tabular-nums;
    line-height: var(--leading-caption);
}

.case-choice-state {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff4df;
    color: #9a5a00;
    font-size: 12px;
    font-weight: 700;
}

.is-confirmed .case-choice-state {
    background: #ebf9ef;
    color: #137a35;
}

.missing-manual-tag .case-choice-state {
    background: #fff0ee;
    color: #b42318;
}

.case-close-subject-meta {
    margin-top: 7px;
    font-size: 12px;
}

.case-identity-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 13px;
}

.case-no-manual-tag {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px dashed rgba(255, 59, 48, 0.32);
    border-radius: 999px;
    background: #fff7f6;
    color: #9f2d24;
    font-size: 12px;
    font-weight: 700;
}

.case-identity-choice {
    position: relative;
    display: inline-flex;
    min-width: 0;
    cursor: pointer;
}

.case-identity-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.case-identity-choice span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid rgba(210, 210, 215, 0.86);
    border-radius: 999px;
    background: #f7f7f9;
    color: #424245;
    font-size: 12px;
    line-height: 1.35;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.case-identity-choice input:checked + span {
    border-color: rgba(0, 113, 227, 0.42);
    background: #eaf3ff;
    color: #075fad;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.08);
}

.case-identity-choice input:focus-visible + span {
    outline: 3px solid var(--ui-focus);
    outline-offset: 2px;
}

.case-close-footer {
    align-items: flex-end;
    padding-top: 14px;
    border-top: 1px solid var(--ui-separator);
}

.case-close-footer > p {
    max-width: 560px;
    font-size: 13px;
}

.case-close-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.ai-orbit-loader {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(0, 113, 227, 0.16);
    border-top-color: #0071e3;
    border-radius: 50%;
    animation: ai-loader-spin 800ms linear infinite;
}

/* AI 欢迎界面与持续状态提示：流动边界光束 + 局部极光，不覆盖页面主体。 */
body.ai-case-mode::before {
    content: "";
    position: fixed;
    inset: 8px;
    z-index: 1450;
    border-radius: 24px;
    background:
        linear-gradient(90deg, transparent 0, #67e8f9 28%, #0a84ff 52%, #8b5cf6 76%, transparent 100%) -48% 0 / 34% 3px no-repeat,
        linear-gradient(270deg, transparent 0, #f0abfc 30%, #8b5cf6 57%, #38bdf8 78%, transparent 100%) 128% 0 / 18% 2px no-repeat,
        linear-gradient(180deg, transparent 0, #60a5fa 26%, #8b5cf6 53%, #ec4899 78%, transparent 100%) 100% -48% / 3px 34% no-repeat,
        linear-gradient(0deg, transparent 0, #f9a8d4 28%, #a78bfa 56%, #60a5fa 80%, transparent 100%) 100% 128% / 2px 18% no-repeat,
        linear-gradient(270deg, transparent 0, #a78bfa 25%, #0a84ff 53%, #22d3ee 79%, transparent 100%) 148% 100% / 34% 3px no-repeat,
        linear-gradient(90deg, transparent 0, #5eead4 27%, #38bdf8 56%, #a78bfa 80%, transparent 100%) -28% 100% / 18% 2px no-repeat,
        linear-gradient(0deg, transparent 0, #34d399 25%, #22d3ee 52%, #0a84ff 79%, transparent 100%) 0 148% / 3px 34% no-repeat,
        linear-gradient(180deg, transparent 0, #93c5fd 27%, #22d3ee 55%, #34d399 80%, transparent 100%) 0 -28% / 2px 18% no-repeat;
    pointer-events: none;
    opacity: 0.96;
    filter: drop-shadow(0 0 5px rgba(10, 132, 255, 0.66)) drop-shadow(0 0 12px rgba(103, 232, 249, 0.22));
    will-change: background-position;
    animation: ai-border-beam-travel 7.2s linear infinite;
}

body.ai-case-mode::after {
    content: "";
    position: fixed;
    inset: -3%;
    z-index: 1449;
    background:
        radial-gradient(ellipse 50% 53% at 0 0, rgba(18, 55, 96, 0.38), rgba(29, 78, 145, 0.16) 42%, transparent 76%),
        radial-gradient(ellipse 53% 54% at 100% 0, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.105) 44%, transparent 76%),
        radial-gradient(ellipse 52% 53% at 100% 100%, rgba(59, 130, 246, 0.255), rgba(18, 55, 96, 0.14) 44%, transparent 76%),
        radial-gradient(ellipse 50% 52% at 0 100%, rgba(52, 211, 153, 0.255), rgba(18, 55, 96, 0.14) 44%, transparent 76%);
    pointer-events: none;
    opacity: 0.76;
    filter: blur(23px) saturate(1.3);
    will-change: opacity, filter, transform;
    animation: ai-corner-aurora 5.2s ease-in-out infinite;
}

.ai-control-beacon {
    --ai-control-state: #0a84ff;
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1451;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: min(330px, calc(100vw - 44px));
    min-height: 58px;
    padding: 9px 10px 9px 9px;
    border: 1px solid rgba(10, 132, 255, 0.2);
    border-radius: 19px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 54px rgba(15, 68, 142, 0.17), 0 3px 12px rgba(15, 23, 42, 0.08), inset 0 1px 0 #fff;
    color: #111827;
    font: inherit;
    text-align: left;
    cursor: pointer;
    backdrop-filter: blur(22px) saturate(1.3);
    -webkit-backdrop-filter: blur(22px) saturate(1.3);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    animation: ai-control-beacon-arrive 440ms cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.ai-control-beacon::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    border-radius: inherit;
    background: linear-gradient(110deg, rgba(34, 211, 238, 0.5), rgba(10, 132, 255, 0.1) 38%, rgba(139, 92, 246, 0.42) 78%, rgba(236, 72, 153, 0.24)) border-box;
    -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.ai-control-beacon:hover {
    transform: translateY(-2px);
    border-color: rgba(10, 132, 255, 0.3);
    box-shadow: 0 22px 62px rgba(15, 68, 142, 0.22), 0 4px 14px rgba(15, 23, 42, 0.09), inset 0 1px 0 #fff;
}

.ai-control-beacon:focus-visible {
    outline: 3px solid rgba(10, 132, 255, 0.24);
    outline-offset: 3px;
}

.ai-control-beacon-mark {
    position: relative;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 13px;
    background: conic-gradient(from 210deg, #22d3ee, #0a84ff 36%, #8b5cf6 68%, #ec4899, #22d3ee);
    box-shadow: 0 8px 22px rgba(10, 132, 255, 0.24);
}

.ai-control-beacon-mark::before {
    content: "";
    position: absolute;
    width: 52px;
    height: 12px;
    background: rgba(255, 255, 255, 0.72);
    filter: blur(7px);
    transform: rotate(-28deg) translateY(-15px);
    animation: ai-control-mark-scan 3.2s ease-in-out infinite;
}

.ai-control-beacon-mark i {
    position: relative;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.96);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18), 0 0 16px rgba(255, 255, 255, 0.74);
}

.ai-control-beacon-mark i::before,
.ai-control-beacon-mark i::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 25px;
    height: 1px;
    background: rgba(255, 255, 255, 0.78);
    transform: translate(-50%, -50%);
}

.ai-control-beacon-mark i::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.ai-control-beacon-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.ai-control-beacon-copy small {
    color: #3972bd;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.ai-control-beacon-copy strong {
    overflow: hidden;
    color: #101828;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.012em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-control-beacon-state {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    border-radius: 999px;
    background: rgba(10, 132, 255, 0.09);
    color: #1768bd;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
}

.ai-control-beacon-state::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ai-control-state);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ai-control-state) 13%, transparent);
    animation: ai-control-state-pulse 1.8s ease-in-out infinite;
}

.ai-control-beacon.is-waiting {
    --ai-control-state: #ff9500;
}

.ai-control-beacon.is-waiting .ai-control-beacon-state {
    background: rgba(255, 149, 0, 0.1);
    color: #9a5a00;
}

.ai-control-beacon.is-connected {
    --ai-control-state: #22a447;
}

.ai-control-beacon.is-connected .ai-control-beacon-state {
    background: rgba(34, 164, 71, 0.1);
    color: #137a35;
}

.ai-case-welcome-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1550;
    display: grid;
    place-items: center;
    padding: 22px;
    overflow: hidden;
    background: rgba(245, 245, 247, 0.62);
    backdrop-filter: blur(26px) saturate(1.15);
    opacity: 0;
    transition: opacity 260ms ease;
}

.ai-case-welcome-backdrop.is-visible {
    opacity: 1;
}

.ai-case-welcome-backdrop.is-leaving {
    opacity: 0;
}

.ai-edge-glow {
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(circle at 20% 22%, rgba(0, 199, 190, 0.22), transparent 24%),
        radial-gradient(circle at 82% 18%, rgba(175, 82, 222, 0.2), transparent 24%),
        radial-gradient(circle at 78% 82%, rgba(255, 45, 85, 0.16), transparent 24%),
        radial-gradient(circle at 18% 78%, rgba(52, 199, 89, 0.18), transparent 24%);
    animation: ai-aurora-drift 9s ease-in-out infinite alternate;
}

.ai-welcome-card {
    position: relative;
    z-index: 2;
    width: min(650px, calc(100vw - 36px));
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid rgba(255, 255, 255, 0.94);
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.91);
    box-shadow: 0 34px 110px rgba(36, 43, 62, 0.2), inset 0 1px 0 #fff;
    text-align: center;
    transform: translateY(14px) scale(0.98);
    transition: transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.is-visible .ai-welcome-card {
    transform: translateY(0) scale(1);
}

.ai-welcome-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f1f3;
    color: #6e6e73;
    font-size: 22px;
    cursor: pointer;
}

.ai-welcome-mark {
    position: relative;
    width: 76px;
    height: 76px;
    margin: 0 auto 20px;
    border-radius: 24px;
    background: linear-gradient(145deg, #eef9ff, #f5efff);
    box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.1), 0 18px 40px rgba(0, 113, 227, 0.12);
}

.ai-welcome-mark span,
.ai-welcome-mark i {
    position: absolute;
    inset: 19px;
    border: 2px solid #007aff;
    border-radius: 50%;
}

.ai-welcome-mark i {
    inset: 28px;
    border-color: #af52de;
    background: #fff;
    box-shadow: 0 0 18px rgba(175, 82, 222, 0.32);
}

.ai-welcome-mark::before,
.ai-welcome-mark::after {
    content: "";
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 37px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(#34c759, #00c7be, #007aff, #af52de);
    transform: rotate(45deg);
}

.ai-welcome-mark::after {
    transform: rotate(-45deg);
}

.ai-welcome-card h2 {
    margin: 8px 0 12px;
    font-size: clamp(34px, 6vw, 54px);
    letter-spacing: -0.055em;
    line-height: 1.02;
}

.ai-welcome-lead {
    max-width: 540px;
    margin: 0 auto 22px;
    color: #6e6e73;
    font-size: 15px;
    line-height: 1.65;
}

.ai-welcome-connection {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 12px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid rgba(255, 149, 0, 0.22);
    border-radius: 18px;
    background: #fffaf1;
    text-align: left;
}

.ai-welcome-connection.is-connected {
    border-color: rgba(52, 199, 89, 0.24);
    background: #f1fbf4;
}

.ai-welcome-connection .ai-case-dot {
    grid-row: 1 / span 2;
}

.ai-welcome-connection strong {
    color: #1d1d1f;
    font-size: 14px;
}

.ai-welcome-connection small {
    color: #6e6e73;
    font-size: 12px;
}

.ai-link-box {
    margin-top: 16px;
    padding: 14px;
    border-radius: 18px;
    background: #f5f5f7;
    text-align: left;
}

.ai-link-box label > span {
    display: block;
    margin: 0 0 8px 2px;
    color: #6e6e73;
    font-size: 12px;
    font-weight: 700;
}

.ai-link-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.ai-link-control input {
    min-width: 0;
    border-color: rgba(210, 210, 215, 0.82);
    border-radius: 12px;
    background: #fff;
    color: #424245;
    font-size: 12px;
}

.ai-link-guidance {
    min-height: 20px;
    margin: 12px 0 0;
    color: #6e6e73;
    font-size: 12px;
    line-height: 1.5;
}

.ai-welcome-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.ai-flying-card {
    position: absolute;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 12px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 12px 34px rgba(38, 45, 65, 0.14);
    opacity: 0.82;
    animation: ai-card-float 6s ease-in-out infinite alternate;
}

.ai-flying-card.c1 { top: 12%; left: 9%; animation-delay: -1.2s; }
.ai-flying-card.c2 { top: 26%; right: 7%; animation-delay: -2.8s; }
.ai-flying-card.c3 { bottom: 17%; left: 7%; animation-delay: -4.1s; }
.ai-flying-card.c4 { bottom: 10%; right: 13%; animation-delay: -0.8s; }
.ai-flying-card.c5 { top: 8%; right: 26%; animation-delay: -3.5s; }
.ai-flying-card.c6 { bottom: 7%; left: 29%; animation-delay: -2s; }
.ai-flying-card.c7 { top: 42%; left: 3%; animation-delay: -4.8s; }
.ai-flying-card.c8 { top: 48%; right: 2%; animation-delay: -1.7s; }
.ai-flying-card.cyan { background: #30b0c7; }
.ai-flying-card.blue { background: #007aff; }
.ai-flying-card.violet { background: #af52de; }
.ai-flying-card.orange { background: #ff9500; }
.ai-flying-card.pink { background: #ff2d55; }
.ai-flying-card.green { background: #34c759; }
.ai-flying-card.mint { background: #00c7be; }
.ai-flying-card.yellow { background: #d69a00; }

@keyframes ai-status-pulse {
    50% { box-shadow: 0 0 0 7px rgba(255, 149, 0, 0.04); }
}

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

@keyframes ai-border-beam-travel {
    0% {
        background-position: -48% 0, 50% 0, 100% -48%, 100% 50%, 148% 100%, 50% 100%, 0 148%, 0 50%;
    }
    49.9% {
        background-position: 50% 0, 148% 0, 100% 50%, 100% 148%, 50% 100%, -48% 100%, 0 50%, 0 -48%;
    }
    50% {
        background-position: 50% 0, -48% 0, 100% 50%, 100% -48%, 50% 100%, 148% 100%, 0 50%, 0 148%;
    }
    100% {
        background-position: 148% 0, 50% 0, 100% 148%, 100% 50%, -48% 100%, 50% 100%, 0 -48%, 0 50%;
    }
}

@keyframes ai-corner-aurora {
    0%, 100% {
        opacity: 0.44;
        filter: blur(27px) saturate(1.12) brightness(0.92);
        transform: scale(0.985);
    }
    50% {
        opacity: 0.94;
        filter: blur(18px) saturate(1.55) brightness(1.12);
        transform: scale(1.025);
    }
}

@keyframes ai-control-beacon-arrive {
    from { opacity: 0; transform: translate3d(0, 12px, 0) scale(0.97); }
    to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes ai-control-mark-scan {
    0%, 18% { transform: rotate(-28deg) translateY(-20px); opacity: 0; }
    42%, 58% { opacity: 0.86; }
    82%, 100% { transform: rotate(-28deg) translateY(20px); opacity: 0; }
}

@keyframes ai-control-state-pulse {
    50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ai-control-state) 4%, transparent); }
}

@keyframes ai-aurora-drift {
    from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
    to { transform: translate3d(1.5%, 1%, 0) scale(1.05); }
}

@keyframes ai-card-float {
    from { transform: translate3d(0, -7px, 0) rotate(-2deg); }
    to { transform: translate3d(6px, 9px, 0) rotate(3deg); }
}

@media (max-width: 720px) {
    .case-close-backdrop {
        padding: 8px;
    }

    .case-close-dialog {
        width: calc(100vw - 16px);
        height: calc(100dvh - 16px);
        padding: 16px;
        border-radius: 20px;
    }

    .case-close-head,
    .case-close-toolbar,
    .case-close-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .case-close-toolbar {
        gap: 8px;
    }

    .case-close-head-actions,
    .case-close-toolbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .case-close-head-actions .button:first-child {
        flex: 1 1 auto;
    }

    .case-close-footer .snapshot-dialog-actions,
    .case-close-footer .button {
        width: 100%;
    }

    .case-identity-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .case-identity-choice span {
        width: 100%;
    }

    .ai-case-welcome-backdrop {
        padding: 12px;
    }

    .ai-welcome-card {
        max-height: calc(100dvh - 24px);
        padding: 34px 20px 24px;
        overflow-y: auto;
        border-radius: 26px;
    }

    .ai-link-control {
        grid-template-columns: 1fr;
    }

    .ai-welcome-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .ai-flying-card {
        opacity: 0.38;
        transform: scale(0.86);
    }

    .ai-control-beacon {
        right: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ai-case-button::after,
    .ai-case-dot,
    .ai-orbit-loader,
    body.ai-case-mode::before,
    body.ai-case-mode::after,
    .ai-control-beacon,
    .ai-control-beacon-mark::before,
    .ai-control-beacon-state::before,
    .ai-edge-glow,
    .ai-flying-card {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 900px) {
    .model-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .model-filter-row {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 8px;
    }

    .model-filter-row > span {
        flex-basis: auto;
    }

    .model-filter-row .segmented-control {
        width: 100%;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .model-card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .page-head h1,
    .graph-head h1,
    .auth-panel h1 {
        font-size: 34px;
    }

    .metric-card strong {
        font-size: 28px;
    }

    .subject-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .page-number-list {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .subject-modal-backdrop,
    .screen-subject-modal-backdrop {
        padding: 10px;
    }

    .subject-modal {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .subject-modal-head {
        flex-direction: column;
    }

    .subject-detail-workspace,
    .screen-subject-modal.subject-detail-workspace {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        max-height: calc(100vh - 20px);
    }

    .subject-detail-workspace.subject-modal,
    .screen-subject-modal.subject-detail-workspace {
        grid-template-columns: 1fr;
        grid-template-rows: max-content minmax(520px, 1fr);
        overflow: auto;
    }

    .subject-detail-modal-head,
    .screen-subject-modal-head.subject-detail-modal-head,
    .subject-modal-head.subject-detail-modal-head {
        grid-template-columns: 1fr;
        grid-column: 1;
        grid-row: 1;
        overflow: visible;
    }

    .subject-detail-modal-head > .subject-profile-card {
        grid-column: 1;
        grid-row: auto;
    }

    .subject-detail-modal-head > .subject-profile-card {
        grid-template-areas:
            "radar"
            "dims";
        grid-template-columns: 1fr;
        grid-template-rows: 150px auto;
        max-height: none;
        overflow: hidden;
    }

    .subject-detail-modal-head > .subject-profile-card .subject-profile-radar {
        height: 150px;
        min-height: 150px;
    }

    .subject-detail-main {
        display: grid;
        grid-template-columns: 1fr;
        grid-column: 1;
        grid-row: 2;
        gap: 16px;
        overflow: auto;
    }

    .subject-detail-main .subject-detail-graph-block,
    .subject-detail-main .subject-hit-panel {
        grid-column: 1;
        grid-row: auto;
    }

    .subject-detail-main .subject-hit-panel {
        height: auto;
    }

    .subject-detail-main .subject-relation-card {
        min-height: 520px;
    }

    .subject-detail-layout {
        grid-template-columns: 1fr;
        overflow: auto;
    }

    .subject-detail-left {
        overflow: visible;
    }

    .subject-hit-panel {
        min-height: 520px;
    }

    .subject-modal-grid {
        grid-template-columns: 1fr;
    }

    th,
    td {
        padding: 10px 8px;
    }
}

/* 增加模型：左侧选择系统算法，右侧独立展示详情与模型配置。 */
.shell:has(.ml-model-create-page),
.shell:has(.ml-model-detail-page) {
    width: min(1540px, calc(100vw - 48px));
}

.ml-model-builder {
    display: grid;
    grid-template-columns: minmax(340px, 0.72fr) minmax(0, 1.58fr);
    align-items: start;
    gap: 18px;
}

.ml-algorithm-picker {
    position: sticky;
    top: 76px;
    min-width: 0;
    max-height: calc(100dvh - 96px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 14px;
    overflow: hidden;
}

.ml-builder-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 4px 13px;
}

.ml-builder-panel-head h2 {
    margin: 3px 0 4px;
    font-size: 22px;
    letter-spacing: -0.025em;
}

.ml-builder-panel-head p {
    margin: 0;
    color: #6e6e73;
    font-size: 12px;
    line-height: 1.5;
}

.ml-builder-panel-head > strong {
    min-width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #edf5ff;
    color: #0066cc;
    font-size: 14px;
}

.ml-algorithm-picker-scroll {
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 16px;
    overflow: auto;
    padding: 2px 3px 3px;
    scrollbar-width: thin;
}

.ml-algorithm-picker-group {
    display: grid;
    gap: 8px;
}

.ml-algorithm-picker-group + .ml-algorithm-picker-group {
    padding-top: 14px;
    border-top: 1px solid rgba(29, 29, 31, 0.1);
}

.ml-algorithm-picker-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ml-algorithm-picker-group-head strong {
    color: #1d1d1f;
    font-size: 14px;
}

.ml-algorithm-picker-group-head span {
    min-width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #f1f1f4;
    color: #6e6e73;
    font-size: 11px;
    font-weight: 700;
}

.ml-algorithm-picker-group > p {
    margin: -3px 0 2px;
    color: #86868b;
    font-size: 11px;
    line-height: 1.45;
}

.ml-algorithm-picker-list {
    display: grid;
    gap: 6px;
}

.ml-algorithm-option {
    position: relative;
    min-width: 0;
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 10px;
    padding: 10px 38px 10px 12px;
    border: 1px solid rgba(29, 29, 31, 0.09);
    border-radius: 14px;
    background: #f8f8fa;
    color: #1d1d1f;
    text-align: left;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.ml-algorithm-option:hover:not(.is-selected) {
    border-color: rgba(0, 113, 227, 0.24);
    background: #f2f7fd;
    transform: translateY(-1px);
}

.ml-algorithm-option.is-selected {
    border-color: rgba(0, 113, 227, 0.42);
    background: #eaf3ff;
    box-shadow: 0 8px 22px rgba(0, 113, 227, 0.1);
}

.ml-algorithm-option span,
.ml-algorithm-option strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ml-algorithm-option span {
    grid-column: 1;
    color: #6e6e73;
    font-size: 10px;
    font-weight: 700;
}

.ml-algorithm-option strong {
    grid-column: 1;
    font-size: 13px;
}

.ml-algorithm-option i {
    position: absolute;
    top: 50%;
    right: 14px;
    color: #86868b;
    font-size: 22px;
    font-style: normal;
    transform: translateY(-50%);
}

.ml-algorithm-option.is-selected i {
    color: #0071e3;
}

.ml-model-builder-main {
    min-width: 0;
    display: grid;
    gap: 18px;
}

.ml-algorithm-detail {
    padding: 0;
    overflow: hidden;
}

.ml-algorithm-detail-hero {
    min-height: 250px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 30px;
    padding: clamp(26px, 4vw, 46px);
    background:
        radial-gradient(circle at 88% 18%, rgba(175, 82, 222, 0.13), transparent 28%),
        radial-gradient(circle at 72% 90%, rgba(0, 199, 190, 0.12), transparent 30%),
        linear-gradient(145deg, #f7fbff, #fbf8ff 70%, #fff);
}

.ml-algorithm-category {
    display: inline-flex;
    margin-right: 8px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eaf3ff;
    color: #0066cc;
    font-size: 11px;
    font-weight: 700;
}

.ml-algorithm-detail-hero h2 {
    margin: 12px 0 10px;
    font-size: clamp(34px, 5vw, 56px);
    letter-spacing: -0.045em;
    line-height: 1.04;
}

.ml-algorithm-detail-hero p {
    max-width: 780px;
    margin: 0;
    color: #515154;
    font-size: 15px;
    line-height: 1.75;
}

.ml-algorithm-detail-mark {
    width: 114px;
    height: 114px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 34px;
    background: linear-gradient(145deg, #0071e3, #5ac8fa 52%, #af52de);
    color: #fff;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.04em;
    box-shadow: 0 24px 60px rgba(0, 113, 227, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.ml-algorithm-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid rgba(29, 29, 31, 0.1);
}

.ml-algorithm-detail-grid article {
    min-width: 0;
    padding: 22px 26px 25px;
}

.ml-algorithm-detail-grid article + article {
    border-left: 1px solid rgba(29, 29, 31, 0.1);
}

.ml-algorithm-detail-grid article > span {
    color: #0071e3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.ml-algorithm-detail-grid h3 {
    margin: 5px 0 7px;
    font-size: 18px;
}

.ml-algorithm-detail-grid p {
    margin: 0;
    color: #6e6e73;
    font-size: 13px;
    line-height: 1.7;
}

.ml-model-create-form-panel {
    padding: 20px;
}

.ml-model-create-form {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.55fr);
    gap: 14px;
}

.ml-model-create-form label {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.ml-model-create-form label > span {
    color: #515154;
    font-size: 12px;
    font-weight: 700;
}

.ml-model-create-form :is(input, select, textarea) {
    width: 100%;
    border-radius: 13px;
    background: #f8f8fa;
}

.ml-model-create-form input,
.ml-model-create-form select {
    min-height: 46px;
}

.ml-model-create-form textarea {
    resize: vertical;
}

.ml-model-create-form .wide {
    grid-column: 1 / -1;
}

.ml-model-create-summary {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 113, 227, 0.14);
    border-radius: 14px;
    background: #f3f8ff;
}

.ml-model-create-summary span {
    color: #6e6e73;
    font-size: 12px;
}

.ml-model-create-summary strong {
    color: #005eb8;
    text-align: right;
    font-size: 13px;
}

.ml-model-create-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

/* 自建模型详情。 */
.ml-model-detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.6fr);
    gap: 28px;
    align-items: center;
    margin-bottom: 18px;
    padding: clamp(26px, 4vw, 44px);
    background:
        radial-gradient(circle at 88% 18%, rgba(90, 200, 250, 0.15), transparent 30%),
        linear-gradient(145deg, #fff, #f5f9ff);
}

.ml-model-detail-title > span + span {
    margin-left: 10px;
    color: #6e6e73;
    font-size: 12px;
    font-weight: 700;
}

.ml-model-detail-title h2 {
    margin: 12px 0 8px;
    font-size: clamp(32px, 5vw, 52px);
    letter-spacing: -0.045em;
}

.ml-model-detail-title p {
    max-width: 760px;
    margin: 0;
    color: #515154;
    line-height: 1.75;
}

.ml-model-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid rgba(29, 29, 31, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
}

.ml-model-detail-stats div {
    min-width: 0;
    padding: 16px 12px;
    text-align: center;
}

.ml-model-detail-stats div + div {
    border-left: 1px solid rgba(29, 29, 31, 0.1);
}

.ml-model-detail-stats span,
.ml-model-detail-stats strong {
    display: block;
}

.ml-model-detail-stats span {
    color: #86868b;
    font-size: 11px;
}

.ml-model-detail-stats strong {
    margin-top: 5px;
    overflow: hidden;
    color: #1d1d1f;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ml-model-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.ml-model-detail-grid article {
    min-height: 220px;
    padding: 28px;
}

.ml-model-detail-grid h2 {
    margin: 10px 0 12px;
    font-size: 26px;
}

.ml-model-detail-grid p {
    margin: 0;
    color: #515154;
    font-size: 14px;
    line-height: 1.8;
}

.ml-model-detail-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0;
    overflow: hidden;
}

.ml-model-detail-meta div {
    min-width: 0;
    padding: 18px 20px;
}

.ml-model-detail-meta div + div {
    border-left: 1px solid rgba(29, 29, 31, 0.1);
}

.ml-model-detail-meta span,
.ml-model-detail-meta strong {
    display: block;
}

.ml-model-detail-meta span {
    color: #86868b;
    font-size: 11px;
}

.ml-model-detail-meta strong {
    margin-top: 5px;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1050px) {
    .ml-model-builder,
    .ml-model-detail-hero {
        grid-template-columns: 1fr;
    }

    .ml-algorithm-picker {
        position: static;
        max-height: none;
    }

    .ml-algorithm-picker-scroll {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    .ml-model-detail-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ml-model-detail-meta div:nth-child(3) {
        border-left: 0;
        border-top: 1px solid rgba(29, 29, 31, 0.1);
    }

    .ml-model-detail-meta div:nth-child(4) {
        border-top: 1px solid rgba(29, 29, 31, 0.1);
    }
}

@media (max-width: 680px) {
    .shell:has(.ml-model-create-page),
    .shell:has(.ml-model-detail-page) {
        width: min(100vw - 20px, 640px);
    }

    .ml-algorithm-picker-scroll,
    .ml-algorithm-detail-grid,
    .ml-model-create-form,
    .ml-model-detail-grid,
    .ml-model-detail-meta {
        grid-template-columns: 1fr;
    }

    .ml-algorithm-detail-hero {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .ml-algorithm-detail-mark {
        width: 76px;
        height: 76px;
        border-radius: 24px;
        font-size: 24px;
    }

    .ml-algorithm-detail-grid article + article,
    .ml-model-detail-meta div + div {
        border-top: 1px solid rgba(29, 29, 31, 0.1);
        border-left: 0;
    }

    .ml-model-create-form .wide {
        grid-column: 1;
    }

    .ml-model-create-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .ml-model-create-summary strong {
        text-align: left;
    }

    .ml-model-detail-stats {
        grid-template-columns: 1fr;
    }

    .ml-model-detail-stats div + div {
        border-top: 1px solid rgba(29, 29, 31, 0.1);
        border-left: 0;
    }
}

/* 原版智慧大屏使用独立的大屏字阶。 */
.fundma-screen-body,
.fundma-screen-body button,
.fundma-screen-body input,
.fundma-screen-body select {
    font-family: var(--font-ui);
    font-kerning: normal;
    text-rendering: optimizeLegibility;
}

.fundma-screen-body .screen-title-block h1 {
    font-family: var(--font-display);
    font-size: clamp(40px, 2.6vw, 46px);
    font-weight: var(--weight-bold);
    line-height: 52px;
    letter-spacing: -0.025em;
}

.fundma-screen-body .screen-hero-metrics .screen-metric strong {
    font-size: 40px;
    font-weight: var(--weight-bold);
    line-height: 44px;
    font-variant-numeric: tabular-nums;
}

.fundma-screen-body .screen-panel h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: var(--weight-semibold);
    line-height: 24px;
    letter-spacing: -0.01em;
}

.fundma-screen-body .map-title-row strong {
    font-size: var(--type-card-title);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-card-title);
}

.fundma-screen-body :is(
    .screen-metric span,
    .screen-panel .panel-head span,
    .map-title-row span,
    .map-pulse span,
    .screen-snapshot-select,
    .screen-snapshot-select select,
    .map-zoom-control span
) {
    font-size: var(--type-caption);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-caption);
}

.fundma-screen-body :is(.risk-row span, .risk-row em, .screen-empty, .screen-subject-modal-head p) {
    font-size: var(--type-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
}

.fundma-screen-body .screen-actions .button {
    font-size: var(--type-label);
    font-weight: var(--weight-semibold);
    line-height: 18px;
}

/* ==========================================================================
   Apple 风格字体系统
   所有功能页面只使用全局语义字阶；智慧大屏在各自样式文件中使用大屏字阶。
   ========================================================================== */

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) {
    color: var(--text);
    font-family: var(--font-ui);
    font-size: var(--type-body-large);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body-large);
    font-kerning: normal;
    text-rendering: optimizeLegibility;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) main p {
    font-size: var(--type-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) main small {
    font-size: var(--type-caption);
    font-weight: var(--weight-regular);
    line-height: var(--leading-caption);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .page-head h1,
    .graph-head h1
) {
    margin-top: 4px;
    font-family: var(--font-display);
    font-size: var(--type-page-title);
    font-weight: var(--weight-bold);
    line-height: var(--leading-page-title);
    letter-spacing: -0.03em;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .page-head p,
    .graph-head p
) {
    margin-top: 7px;
    font-size: var(--type-body-large);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body-large);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .page-head.case-stage-head {
    min-height: 88px;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .page-head.case-stage-head h1 {
    font-size: var(--type-page-title);
    line-height: var(--leading-page-title);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .page-head.case-stage-head p {
    font-size: var(--type-body-large);
    line-height: var(--leading-body-large);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .auth-panel h1 {
    font-family: var(--font-display);
    font-size: var(--type-display-compact);
    font-weight: var(--weight-bold);
    line-height: var(--leading-display-compact);
    letter-spacing: -0.035em;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .dashboard-intro h1 {
    font-family: var(--font-display);
    font-size: var(--type-display);
    font-weight: var(--weight-bold);
    line-height: var(--leading-display);
    letter-spacing: -0.045em;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .dashboard-intro > p {
    font-size: 18px;
    font-weight: var(--weight-regular);
    line-height: 29px;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .continue-case h2,
    .dashboard-section-head h2
) {
    font-family: var(--font-display);
    font-size: var(--type-page-title);
    font-weight: var(--weight-bold);
    line-height: var(--leading-page-title);
    letter-spacing: -0.03em;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .case-overview-identity h2 {
    font-family: var(--font-display);
    font-size: var(--type-display-compact);
    font-weight: var(--weight-bold);
    line-height: var(--leading-display-compact);
    letter-spacing: -0.035em;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    main > section > h2,
    .panel-head h2,
    .catalog-section-head h2,
    .case-overview-section-head h2,
    .dashboard-section-head:not(.app-dashboard .dashboard-section-head) h2
) {
    font-family: var(--font-display);
    font-size: var(--type-section-title);
    font-weight: var(--weight-bold);
    line-height: var(--leading-section-title);
    letter-spacing: -0.02em;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .case-card h2,
    .subject-card-head h2,
    .filter-card-main h2,
    .dashboard-card h2,
    .model-card-body h3,
    .ml-algorithm-card h2,
    .asset-model-card h2,
    .prediction-result-summary h3,
    .prediction-subject-title h4
) {
    font-family: var(--font-display);
    font-size: var(--type-card-title);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-card-title);
    letter-spacing: -0.015em;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    main h3,
    main h4
) {
    font-family: var(--font-display);
    font-size: var(--type-card-title);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-card-title);
    letter-spacing: -0.015em;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .section-kicker {
    font-size: var(--type-caption);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-caption);
    letter-spacing: 0.08em;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    input,
    select,
    textarea
) {
    font-family: var(--font-ui);
    font-size: var(--type-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) form label > span:first-child {
    font-size: var(--type-label);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-label);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .button {
    font-size: var(--type-body);
    font-weight: var(--weight-semibold);
    line-height: 20px;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .button.small {
    font-size: var(--type-label);
    font-weight: var(--weight-semibold);
    line-height: 18px;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .button.tiny {
    font-size: var(--type-caption);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-caption);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .dashboard-hero-actions .button {
    font-size: var(--type-body-large);
    line-height: 22px;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    table th,
    .table-head
) {
    font-size: var(--type-caption);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-caption);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) table td {
    font-size: var(--type-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .status,
    .case-status-badge,
    .tactic-kind,
    .model-usage-state,
    .mysql-query-category-tag
) {
    font-size: var(--type-caption);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-caption);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    [role="dialog"],
    .snapshot-dialog,
    .modal-card,
    .dialog-card
) h2 {
    font-family: var(--font-display);
    font-size: var(--type-section-title);
    font-weight: var(--weight-bold);
    line-height: var(--leading-section-title);
    letter-spacing: -0.02em;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .metric-card strong,
    .dashboard-metrics dd,
    .case-overview-metrics strong,
    .prediction-metric strong
) {
    font-size: var(--type-page-title);
    font-weight: var(--weight-bold);
    line-height: 36px;
    font-variant-numeric: tabular-nums;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .metric-card span,
    .dashboard-metrics dt,
    .prediction-metric span
) {
    font-size: var(--type-label);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-label);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .case-card > p,
    .filter-card-main > p,
    .dashboard-card > p,
    .model-card-body > p,
    .case-overview-identity > div > p
) {
    font-size: var(--type-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .case-overview-stage small,
    .case-overview-list small,
    .case-overview-list article > em,
    .case-overview-metrics small,
    .prediction-filter-copy > small,
    .prediction-filter-copy > span i,
    .prediction-panel-title small,
    .prediction-panel-title > span
) {
    font-size: var(--type-caption);
    font-weight: var(--weight-medium);
    line-height: var(--leading-caption);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .case-overview-stage strong {
    font-size: var(--type-navigation);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-navigation);
}

.case-stage-upload-form {
    position: relative;
}

.case-stage-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.case-stage-upload-form.is-submitting .case-stage-create-button {
    opacity: 0.64;
    pointer-events: none;
}

.prediction-filter-select {
    position: relative;
    border-radius: 6px;
    box-shadow: none;
}

.prediction-filter-choice.is-selected .prediction-filter-select::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 6px;
    width: 5px;
    height: 9px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
}

@media (max-width: 680px) {
    body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .dashboard-intro h1 {
        font-size: var(--type-display-compact);
        line-height: var(--leading-display-compact);
    }

    body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .page-head.case-stage-head {
        min-height: 0;
    }
}

/* ========================================================================== */
/* 灵析无边记 · 人类任务导向 / Puppertino 全局体验覆盖层（2026-07）               */
/* 仅在既有样式之后做低风险覆盖；大屏专用页面保持其独立视觉体系。             */
/* ========================================================================== */

:root {
    --ui-radius-xs: 8px;
    --ui-radius-sm: 12px;
    --ui-radius-md: 18px;
    --ui-radius-lg: 28px;
    --ui-space-1: 4px;
    --ui-space-2: 8px;
    --ui-space-3: 12px;
    --ui-space-4: 16px;
    --ui-space-5: 20px;
    --ui-space-6: 24px;
    --ui-space-8: 32px;
    --ui-space-10: 40px;
    --ui-space-12: 48px;
    --ui-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
    --ui-shadow-md: 0 18px 48px rgba(0, 0, 0, 0.09);
    --ui-focus: rgba(0, 113, 227, 0.32);
    --ui-blue: #0071e3;
    --ui-blue-hover: #0077ed;
    --ui-surface: #ffffff;
    --ui-surface-muted: #f5f5f7;
    --ui-separator: rgba(29, 29, 31, 0.12);
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body:not(.fundma-screen-body) {
    background:
        radial-gradient(circle at 78% -8%, rgba(100, 210, 255, 0.14), transparent 28rem),
        linear-gradient(180deg, #fbfbfd 0, #f5f5f7 36rem, #f5f5f7 100%);
    background-attachment: scroll;
}

body:not(.fundma-screen-body) :is(.panel, .metric-card, .case-card, .auth-panel) {
    border: 1px solid var(--ui-separator);
    border-radius: var(--ui-radius-md);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-sm);
    backdrop-filter: none;
}

.shell:not(.screen-shell) {
    width: min(1320px, calc(100vw - 48px));
    padding-top: var(--ui-space-10);
}

.button {
    border-radius: 980px;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button.primary {
    background: var(--ui-blue);
}

.button.primary:hover {
    background: var(--ui-blue-hover);
}

.button.quiet {
    border-color: transparent;
    background: transparent;
    color: var(--ui-blue);
}

.button.quiet:hover {
    background: rgba(0, 113, 227, 0.08);
}

.button:active {
    transform: scale(0.98);
}

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid var(--ui-focus);
    outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    border-color: var(--ui-blue);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

/* 全局导航：所有工作入口直接平铺，窄屏时统一收进主菜单。 */
.topbar {
    height: 58px;
    padding: 0;
    border-bottom-color: rgba(29, 29, 31, 0.1);
    background: rgba(250, 250, 252, 0.88);
    backdrop-filter: saturate(180%) blur(20px);
}

.topbar-inner {
    width: min(1400px, 100%);
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--ui-space-6);
    display: flex;
    align-items: center;
    gap: var(--ui-space-6);
}

.topbar .brand {
    flex: 0 0 auto;
    gap: 9px;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.topbar .brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 6px 14px rgba(0, 113, 227, 0.2);
}

.topbar-menu {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ui-space-6);
}

.topbar .nav {
    min-width: 0;
    flex: 0 1 auto;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--ui-space-1);
}

.topbar .nav > a {
    min-height: 36px;
    padding: 8px 12px;
    border: 0;
    border-radius: 980px;
    background: transparent;
    color: #515154;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    cursor: pointer;
    white-space: nowrap;
}

.topbar .nav > a:hover,
.topbar .nav > a.active {
    background: rgba(29, 29, 31, 0.055);
    color: #1d1d1f;
}

.topbar .nav > a.active {
    font-weight: 700;
}

.nav-more {
    position: relative;
}

.nav-more-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.nav-chevron {
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 160ms ease;
}

.nav-more.is-open .nav-chevron,
.case-action-more[open] .nav-chevron {
    transform: translateY(2px) rotate(225deg);
}

.nav-more-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 60;
    width: 290px;
    padding: var(--ui-space-2);
    border: 1px solid rgba(29, 29, 31, 0.1);
    border-radius: var(--ui-radius-md);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--ui-shadow-md);
}

.topbar .nav .nav-more-panel a {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border-radius: var(--ui-radius-sm);
    color: var(--text);
}

.topbar .nav .nav-more-panel a:hover,
.topbar .nav .nav-more-panel a.active {
    background: #f5f5f7;
}

.nav-more-panel a strong {
    font-size: 14px;
}

.nav-more-panel a span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.topbar .userbar {
    flex: 0 0 auto;
    gap: var(--ui-space-3);
}

.topbar .user-name {
    max-width: 140px;
    overflow: hidden;
    color: #515154;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    width: 38px;
    height: 38px;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.nav-toggle-lines,
.nav-toggle-lines::before {
    display: block;
    width: 17px;
    height: 1.5px;
    margin: auto;
    border-radius: 999px;
    background: currentColor;
    transition: transform 160ms ease;
}

.nav-toggle-lines {
    transform: translateY(-3px);
}

.nav-toggle-lines::before {
    content: "";
    transform: translateY(6px);
}

.topbar.is-nav-open .nav-toggle-lines {
    transform: rotate(45deg);
}

.topbar.is-nav-open .nav-toggle-lines::before {
    transform: rotate(-90deg);
}

/* 系统消息成为轻量 toast，不再推挤主内容。 */
.flash-stack {
    position: fixed;
    top: 74px;
    right: var(--ui-space-6);
    z-index: 1000;
    width: min(390px, calc(100vw - 32px));
    margin: 0;
    pointer-events: none;
}

.flash {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--ui-space-3);
    padding: 13px 12px 13px 15px;
    border-radius: var(--ui-radius-sm);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--ui-shadow-md);
    pointer-events: auto;
    transition: opacity 200ms ease, transform 200ms ease;
}

.flash.is-leaving {
    opacity: 0;
    transform: translateY(-6px);
}

.flash-close {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f1f3;
    color: #6e6e73;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

/* 总览：先继续工作，再扫一眼指标，最后按任务进入。 */
.app-dashboard .shell {
    padding-bottom: 88px;
}

.dashboard-hero {
    min-height: 450px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
    align-items: center;
    gap: clamp(40px, 7vw, 96px);
    padding: clamp(44px, 7vw, 88px) clamp(24px, 5vw, 72px);
    margin-bottom: 72px;
    overflow: hidden;
    border-radius: var(--ui-radius-lg);
    background:
        radial-gradient(circle at 88% 18%, rgba(100, 210, 255, 0.28), transparent 22rem),
        radial-gradient(circle at 12% 118%, rgba(88, 86, 214, 0.12), transparent 28rem),
        #eef6ff;
}

.dashboard-intro h1 {
    max-width: 760px;
    margin: 10px 0 18px;
    font-size: clamp(44px, 6vw, 76px);
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.dashboard-intro h1 span {
    display: block;
}

.dashboard-intro > p {
    max-width: 680px;
    margin: 0;
    color: #515154;
    font-size: clamp(17px, 2vw, 21px);
    line-height: 1.55;
}

.dashboard-hero-actions {
    display: flex;
    align-items: center;
    gap: var(--ui-space-2);
    margin-top: var(--ui-space-8);
}

.continue-case {
    min-width: 0;
    padding: clamp(24px, 4vw, 38px);
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: var(--ui-radius-lg);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 24px 70px rgba(0, 77, 145, 0.13);
}

.continue-case-topline,
.continue-case-stats,
.continue-case-actions {
    display: flex;
    align-items: center;
    gap: var(--ui-space-3);
    flex-wrap: wrap;
}

.continue-case-topline {
    justify-content: space-between;
    margin-bottom: var(--ui-space-6);
    color: var(--muted);
    font-size: 12px;
}

.continue-label {
    color: var(--ui-blue);
    font-size: 13px;
    font-weight: 700;
}

.continue-case h2 {
    margin: 8px 0 12px;
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.12;
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}

.continue-case > p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.continue-case-stats {
    margin: var(--ui-space-6) 0;
    padding: var(--ui-space-4) 0;
    border-top: 1px solid var(--ui-separator);
    border-bottom: 1px solid var(--ui-separator);
    color: var(--muted);
    font-size: 13px;
}

.continue-case-stats span + span::before {
    content: "·";
    margin-right: var(--ui-space-3);
    color: #c7c7cc;
}

.continue-case-stats strong {
    color: var(--text);
}

.continue-case-actions {
    justify-content: space-between;
}

.dashboard-metric-section,
.dashboard-tasks,
.case-people-section {
    margin-bottom: 72px;
}

.dashboard-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--ui-space-6);
    margin-bottom: var(--ui-space-6);
}

.dashboard-section-head h2 {
    margin: 6px 0 0;
    font-size: clamp(28px, 3.2vw, 42px);
    line-height: 1.1;
    letter-spacing: -0.025em;
}

.dashboard-section-head > span {
    color: var(--muted);
    font-size: 13px;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--ui-separator);
    border-bottom: 1px solid var(--ui-separator);
}

.dashboard-metrics > div {
    min-width: 0;
    padding: var(--ui-space-6) clamp(16px, 2.5vw, 32px);
}

.dashboard-metrics > div:first-child {
    padding-left: 0;
}

.dashboard-metrics > div + div {
    border-left: 1px solid var(--ui-separator);
}

.dashboard-metrics dt {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.dashboard-metrics dd {
    margin: 7px 0 8px;
    font-size: clamp(34px, 4vw, 52px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.035em;
}

.dashboard-metrics div > span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.task-entry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--ui-separator);
}

.task-entry {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--ui-space-4);
    padding: var(--ui-space-5) var(--ui-space-4);
    border-bottom: 1px solid var(--ui-separator);
    transition: background-color 160ms ease, transform 160ms ease;
}

.task-entry:nth-child(odd) {
    border-right: 1px solid var(--ui-separator);
}

.task-entry:hover {
    background: rgba(0, 113, 227, 0.045);
}

.task-entry-glyph {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: var(--ui-radius-sm);
    background: #edf6ff;
    color: var(--ui-blue);
    font-size: 15px;
    font-weight: 700;
}

.task-entry-copy,
.task-entry-side {
    min-width: 0;
    display: grid;
}

.task-entry-title {
    font-size: 16px;
    font-weight: 700;
}

.task-entry-detail,
.task-entry-meta {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-entry-detail {
    margin-top: 3px;
    color: #515154;
    font-size: 13px;
}

.task-entry-side {
    justify-items: end;
    gap: 5px;
    color: var(--ui-blue);
    font-size: 12px;
}

.task-entry-side strong {
    color: var(--text);
    font-size: 25px;
    line-height: 1;
}

/* 案例页：四步路线始终可见，危险操作远离主任务。 */
.case-detail-page .shell {
    padding-bottom: 88px;
}

.case-hero {
    align-items: flex-end;
    margin-bottom: var(--ui-space-8);
}

.case-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--ui-space-5);
    color: var(--ui-blue);
    font-size: 13px;
    font-weight: 600;
}

.case-hero h1 {
    max-width: 850px;
    font-size: clamp(38px, 5vw, 64px);
    letter-spacing: -0.04em;
    overflow-wrap: anywhere;
}

.case-hero-meta {
    display: flex;
    align-items: center;
    gap: var(--ui-space-3);
    margin-top: var(--ui-space-4);
    color: var(--muted);
    font-size: 13px;
}

.case-primary-actions {
    justify-content: flex-end;
}

.case-action-more {
    position: relative;
}

.case-action-more summary {
    list-style: none;
}

.case-action-more summary::-webkit-details-marker {
    display: none;
}

.case-action-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    width: 260px;
    padding: var(--ui-space-2);
    border: 1px solid var(--ui-separator);
    border-radius: var(--ui-radius-md);
    background: #fff;
    box-shadow: var(--ui-shadow-md);
}

.case-action-menu a {
    display: grid;
    gap: 2px;
    padding: 11px 12px;
    border-radius: var(--ui-radius-sm);
}

.case-action-menu a:hover {
    background: #f5f5f7;
}

.case-action-menu a strong {
    font-size: 14px;
}

.case-action-menu a span {
    color: var(--muted);
    font-size: 12px;
}

.case-workflow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin-bottom: var(--ui-space-8);
    padding: var(--ui-space-3);
    border: 1px solid var(--ui-separator);
    border-radius: var(--ui-radius-md);
    background: #fff;
    box-shadow: var(--ui-shadow-sm);
}

.case-workflow a.workflow-step {
    position: relative;
    min-width: 0;
    min-height: 70px;
    gap: var(--ui-space-3);
    padding: 12px 16px;
    border: 0;
    border-radius: var(--ui-radius-sm);
    background: transparent;
    color: var(--muted);
    font-weight: 600;
}

.case-workflow a.workflow-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -1px;
    width: 1px;
    height: 34px;
    background: var(--ui-separator);
    transform: translateY(-50%);
}

.case-workflow a.workflow-step:hover {
    background: #f8f8fa;
}

.case-workflow a.workflow-step.is-current {
    background: #eef6ff;
    color: var(--text);
}

.case-workflow a.workflow-step b {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    background: #e8e8ed;
    color: #6e6e73;
}

.case-workflow a.workflow-step.is-current b {
    background: var(--ui-blue);
    color: #fff;
}

.case-workflow a.workflow-step.is-complete b {
    background: #e7f7eb;
    color: #1b7f3a;
}

.case-workflow a.workflow-step.is-complete b::before {
    content: "✓";
}

.case-workflow a.workflow-step.is-complete b {
    font-size: 0;
}

.case-workflow a.workflow-step.is-complete b::before {
    font-size: 14px;
}

.workflow-step > span {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.workflow-step strong {
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-step small {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-workspace {
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.55fr);
    gap: var(--ui-space-6);
    align-items: start;
}

.case-data-panel,
.case-info-panel {
    min-width: 0;
    padding: clamp(20px, 3vw, 30px);
}

.case-section-head {
    align-items: flex-start;
    margin-bottom: var(--ui-space-5);
}

.case-section-head h2 {
    margin-top: 5px;
    font-size: 24px;
}

.case-section-head p {
    max-width: 680px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.case-batch-count {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 980px;
    background: #f1f1f3;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.task-upload-form.upload-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: var(--ui-space-3);
    padding: 0;
    margin: 0 0 var(--ui-space-8);
    border: 0;
    background: transparent;
}

.task-upload-form > .button {
    min-width: 140px;
}

.file-dropzone {
    position: relative;
    min-width: 0;
    min-height: 92px;
    display: flex;
    align-items: center;
    gap: var(--ui-space-4);
    padding: var(--ui-space-4) var(--ui-space-5);
    border: 1.5px dashed #9cc9f5;
    border-radius: var(--ui-radius-md);
    background: #f5faff;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.file-dropzone:hover,
.file-dropzone:focus-within,
.file-dropzone.is-dragging {
    border-color: var(--ui-blue);
    background: #edf6ff;
}

.file-dropzone.is-dragging {
    transform: scale(1.005);
}

.file-dropzone.has-file {
    border-style: solid;
    border-color: rgba(52, 199, 89, 0.5);
    background: #f2fbf4;
}

.dropzone-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    opacity: 0;
}

.dropzone-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    color: var(--ui-blue);
    box-shadow: 0 1px 4px rgba(0, 113, 227, 0.12);
}

.dropzone-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dropzone-copy {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.dropzone-copy strong {
    overflow: hidden;
    color: var(--text);
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropzone-copy span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ui-space-4);
    margin-bottom: var(--ui-space-2);
}

.upload-history-head h3 {
    margin: 0;
    font-size: 16px;
}

.upload-history-head span {
    color: var(--muted);
    font-size: 12px;
}

.upload-table th {
    padding-top: 10px;
    padding-bottom: 10px;
    border-bottom-color: var(--ui-separator);
}

.upload-table td {
    padding-top: var(--ui-space-4);
    padding-bottom: var(--ui-space-4);
    border-bottom-color: var(--ui-separator);
}

.upload-table tbody tr:last-child td {
    border-bottom: 0;
}

.upload-history-more {
    margin-top: var(--ui-space-3);
    border-top: 1px solid var(--ui-separator);
}

.upload-history-more > summary {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ui-space-3);
    padding: var(--ui-space-3) var(--ui-space-1);
    list-style: none;
    color: var(--ui-blue);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.upload-history-more > summary::-webkit-details-marker {
    display: none;
}

.upload-history-more > summary small {
    display: inline-flex;
    align-items: center;
    gap: var(--ui-space-2);
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.upload-history-more > summary small::after {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 160ms ease;
}

.upload-history-more[open] > summary small::after {
    transform: rotate(225deg) translate(-1px, -1px);
}

.upload-history-more > .upload-table-wrap {
    margin-top: var(--ui-space-1);
}

.upload-name {
    display: block;
    max-width: 290px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-next-action {
    text-align: right;
    white-space: nowrap;
}

.upload-ready {
    color: #1b7f3a;
    font-size: 12px;
    font-weight: 700;
}

.upload-empty {
    padding: var(--ui-space-8) !important;
}

.case-info-panel {
    position: sticky;
    top: 82px;
}

.case-info-panel .case-info-view {
    gap: 0;
}

.case-info-panel .case-info-view div {
    padding: var(--ui-space-4) 0;
    border: 0;
    border-bottom: 1px solid var(--ui-separator);
    border-radius: 0;
    background: transparent;
}

.case-info-panel .case-info-view div:first-child {
    padding-top: 0;
}

.case-info-panel .case-info-view span {
    margin-bottom: 6px;
}

.case-info-panel .case-info-view p {
    color: #515154;
    line-height: 1.55;
}

.case-info-form {
    gap: var(--ui-space-4);
}

.case-form-actions {
    display: flex;
    align-items: center;
    gap: var(--ui-space-2);
}

.danger-zone {
    margin-top: var(--ui-space-6);
    padding-top: var(--ui-space-4);
    border-top: 1px solid var(--ui-separator);
}

.danger-zone summary {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.danger-zone > div {
    margin-top: var(--ui-space-3);
    padding: var(--ui-space-4);
    border-radius: var(--ui-radius-sm);
    background: #fff7f6;
}

.danger-zone p {
    margin: 0 0 var(--ui-space-3);
    color: #7d3530;
    font-size: 12px;
    line-height: 1.55;
}

.danger-zone form {
    margin: 0;
}

/* MYSQL 卡片新增与公共数据管理 */
.mysql-create-dialog {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 36px);
    overflow-y: auto;
}

.mysql-create-dialog select,
.mysql-create-dialog textarea {
    width: 100%;
}

.asset-case-list {
    display: grid;
    gap: 36px;
}

.asset-case-group {
    min-width: 0;
    padding-top: 28px;
    border-top: 3px solid #b8c6d8;
}

.asset-case-group:first-child {
    padding-top: 0;
    border-top: 0;
}

.asset-case-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-left: 4px solid var(--blue);
    border-radius: 4px;
    background: #f5f8fc;
}

.asset-case-head h3 {
    margin: 3px 0 4px;
    font-size: 20px;
    line-height: 1.3;
}

.asset-case-head h3 small {
    color: var(--red);
    font-size: 12px;
}

.asset-case-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.asset-upload-table td:first-child strong,
.asset-upload-table td:first-child span {
    display: block;
}

.asset-upload-table td:first-child span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.asset-upload-table th:last-child,
.asset-upload-table td:last-child {
    width: 120px;
    text-align: right;
}

.asset-upload-table tbody tr + tr td {
    border-top: 1px solid rgba(210, 210, 215, 0.72);
}

.asset-upload-table td {
    padding-top: 14px;
    padding-bottom: 14px;
}

.asset-model-section {
    margin-bottom: 22px;
}

.asset-model-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.asset-model-card {
    min-width: 0;
    min-height: 224px;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(210, 210, 215, 0.82);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 28px rgba(20, 31, 48, 0.07);
}

.asset-model-card h3 {
    margin: 10px 0 5px;
    font-size: 19px;
}

.asset-model-card p {
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    line-height: 19px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-model-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.asset-model-card dl div {
    min-width: 0;
    padding: 9px 10px;
    border-radius: 6px;
    background: #f5f7fa;
}

.asset-model-card dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.asset-model-card dd {
    margin: 3px 0 0;
    overflow: hidden;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-model-card > .button {
    justify-self: start;
}

.time-model-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 0.75fr);
    gap: 24px;
    align-items: end;
    margin-bottom: 18px;
    padding: 4px 0 18px;
    border-bottom: 1px solid rgba(210, 210, 215, 0.8);
}

.time-model-summary h2 {
    margin: 9px 0 5px;
    font-size: 24px;
}

.time-model-summary p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.time-model-summary dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.time-model-summary dl div {
    padding: 11px 12px;
    border-left: 2px solid var(--blue);
    background: #f5f7fa;
}

.time-model-summary dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.time-model-summary dd {
    margin: 4px 0 0;
    font-size: 24px;
    font-weight: 700;
}

.time-standardization-layout {
    display: grid;
    grid-template-columns: minmax(340px, 0.8fr) minmax(0, 1.2fr);
    gap: 16px;
    align-items: start;
}

.time-preview-panel label {
    display: grid;
    gap: 7px;
}

.time-preview-panel label > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.time-preview-panel textarea {
    width: 100%;
    resize: vertical;
}

.time-result-list {
    display: grid;
    gap: 8px;
}

.time-result-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #dfe2e8;
    border-radius: 7px;
    background: #fff;
}

.time-result-row.invalid {
    border-color: #ffd2ce;
    background: #fff7f6;
}

.time-result-row div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.time-result-row span,
.time-result-row em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
}

.time-result-row strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.time-result-row > i {
    color: var(--blue);
    font-style: normal;
}

.time-result-row > em {
    color: var(--blue);
    font-weight: 700;
}

/* 案件与智慧大屏管理 */
body.case-create-open {
    overflow: hidden;
}

.case-create-backdrop {
    z-index: 1320;
    padding: 18px;
}

.case-create-dialog {
    width: min(620px, calc(100vw - 36px));
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 34px 110px rgba(30, 36, 52, 0.24), inset 0 1px 0 #fff;
}

.case-create-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.case-create-head h2 {
    margin: 5px 0 7px;
    font-size: 32px;
    letter-spacing: -0.035em;
}

.case-create-head p {
    max-width: 440px;
    margin: 0;
    font-weight: 500;
    line-height: 1.55;
}

.case-create-fields {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.case-create-dialog .case-create-fields label {
    margin: 0;
}

.case-create-dialog .case-create-fields input,
.case-create-dialog .case-create-fields textarea {
    min-height: 48px;
    padding: 12px 14px;
    border-color: rgba(210, 210, 215, 0.86);
    border-radius: 14px;
    background: #f8f8fa;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.case-create-dialog .case-create-fields input:focus,
.case-create-dialog .case-create-fields textarea:focus {
    border-color: rgba(0, 122, 255, 0.48);
    outline: 0;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.case-create-actions {
    padding-top: 18px;
    border-top: 1px solid rgba(210, 210, 215, 0.66);
}

.case-card .card-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.case-card .card-actions .button {
    width: 100%;
}

.button.danger:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.destructive-dialog strong {
    color: var(--text);
}

.dashboard-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 16px;
}

.dashboard-card {
    min-width: 0;
    min-height: 438px;
    display: grid;
    grid-template-rows: 176px minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(210, 210, 215, 0.82);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 12px 34px rgba(20, 31, 48, 0.08);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.dashboard-card:hover {
    border-color: rgba(0, 122, 255, 0.3);
    box-shadow: 0 18px 42px rgba(20, 31, 48, 0.13);
    transform: translateY(-2px);
}

.dashboard-card-builtin {
    border-color: rgba(0, 122, 255, 0.28);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 255, 0.94));
    box-shadow: 0 18px 46px rgba(0, 92, 196, 0.13);
}

.dashboard-card-builtin:hover {
    border-color: rgba(0, 122, 255, 0.46);
    box-shadow: 0 24px 54px rgba(0, 92, 196, 0.18);
}

.dashboard-card-builtin .dashboard-thumbnail {
    background:
        radial-gradient(circle at 22% 18%, rgba(0, 199, 190, 0.24), transparent 34%),
        radial-gradient(circle at 82% 78%, rgba(175, 82, 222, 0.22), transparent 38%),
        #07111f;
}

.dashboard-thumbnail {
    min-width: 0;
    padding: 10px;
    overflow: hidden;
    background: #07111f;
    color: #eaf2ff;
}

.dashboard-thumbnail-head {
    min-width: 0;
    height: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 5px 5px 5px;
    align-items: center;
    gap: 5px;
    padding: 0 2px 7px;
}

.dashboard-thumbnail-head span {
    overflow: hidden;
    font-size: 9px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-thumbnail-head > i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #64d2ff;
}

.dashboard-thumbnail-head > i:nth-last-child(2) {
    background: #ffd60a;
}

.dashboard-thumbnail-head > i:last-child {
    background: #ff453a;
}

.dashboard-thumbnail-grid {
    height: 134px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.dashboard-thumbnail-panel {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 5px;
    padding: 6px;
    overflow: hidden;
    border: 1px solid rgba(100, 210, 255, 0.18);
    border-radius: 4px;
    background: #0c1a2b;
}

.dashboard-thumbnail-panel > span {
    overflow: hidden;
    color: #aabbd0;
    font-size: 7px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-thumbnail-panel > b {
    min-height: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 4px;
}

.dashboard-thumbnail-panel > b > i {
    width: 18%;
    height: 48%;
    border-radius: 2px 2px 0 0;
    background: #64d2ff;
}

.dashboard-thumbnail-panel > b > i:nth-child(2) {
    height: 78%;
    background: #30d158;
}

.dashboard-thumbnail-panel > b > i:nth-child(3) {
    height: 62%;
    background: #ff9f0a;
}

.dashboard-thumbnail-panel.chart-line > b,
.dashboard-thumbnail-panel.chart-area > b {
    height: 56%;
    align-self: center;
    border-top: 2px solid #64d2ff;
    transform: rotate(-8deg);
}

.dashboard-thumbnail-panel.chart-line > b > i,
.dashboard-thumbnail-panel.chart-area > b > i,
.dashboard-thumbnail-panel.chart-pie > b > i,
.dashboard-thumbnail-panel.chart-gauge > b > i {
    display: none;
}

.dashboard-thumbnail-panel.chart-pie > b {
    width: 34px;
    height: 34px;
    align-self: center;
    justify-self: center;
    border: 7px solid #64d2ff;
    border-right-color: #ff9f0a;
    border-radius: 50%;
}

.dashboard-thumbnail-panel.chart-gauge > b {
    width: 42px;
    height: 22px;
    align-self: end;
    justify-self: center;
    border: 6px solid #30d158;
    border-bottom: 0;
    border-radius: 28px 28px 0 0;
}

.dashboard-thumbnail-empty {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(143, 163, 189, 0.3);
    color: #8fa3bd;
    font-size: 11px;
}

.dashboard-card-body {
    min-width: 0;
    padding: 14px 16px 10px;
}

.dashboard-card-heading,
.dashboard-card-meta {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.dashboard-card-heading > span:last-child {
    white-space: nowrap;
}

.dashboard-card h2 {
    margin: 10px 0 7px;
    overflow: hidden;
    font-size: 20px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-card-body > p {
    height: 40px;
    display: -webkit-box;
    margin: 0 0 10px;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    line-height: 20px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.dashboard-card-meta {
    display: grid;
    gap: 3px;
}

.dashboard-card-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-card-actions {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 16px;
    border-top: 1px solid rgba(210, 210, 215, 0.7);
}

.dashboard-card-actions form {
    margin: 0;
}

.dashboard-list-section {
    margin-top: 18px;
}

.dashboard-create-backdrop {
    z-index: 2300;
}

.dashboard-create-dialog {
    width: min(1120px, calc(100vw - 32px));
    max-height: min(880px, calc(100vh - 32px));
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 16px;
    overflow: hidden;
}

.dashboard-create-head,
.dashboard-template-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.dashboard-create-head h2,
.dashboard-template-head h3 {
    margin: 4px 0 0;
}

.dashboard-create-head h2 {
    font-size: var(--type-section-title);
    line-height: var(--leading-section-title);
}

.dashboard-create-head p,
.dashboard-template-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.dashboard-create-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px 14px;
}

.dashboard-create-fields label {
    min-width: 0;
    display: grid;
    gap: 6px;
    margin: 0;
}

.dashboard-create-fields label > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.dashboard-create-fields input,
.dashboard-create-fields select {
    min-width: 0;
    width: 100%;
    min-height: 42px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    padding: 9px 11px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.dashboard-create-fields input:disabled {
    background: #f5f5f7;
    color: var(--muted);
}

.dashboard-template-picker {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 11px;
    padding-top: 14px;
    overflow: hidden;
    border-top: 1px solid rgba(210, 210, 215, 0.72);
}

.dashboard-template-head h3 {
    font-size: var(--type-navigation);
    line-height: var(--leading-navigation);
}

.dashboard-template-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.dashboard-template-search {
    min-width: 260px;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0 11px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    background: #fff;
}

.dashboard-template-search:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.dashboard-template-search svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: #8e8e93;
    stroke-linecap: round;
    stroke-width: 1.8;
}

.dashboard-template-search input {
    min-width: 0;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: var(--type-body);
    line-height: var(--leading-body);
    outline: 0;
}

.dashboard-template-filter {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 3px;
    padding: 3px;
    border-radius: 8px;
    background: #f0f1f4;
}

.dashboard-template-filter button {
    min-height: 32px;
    border: 0;
    border-radius: 6px;
    padding: 6px 12px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.dashboard-template-filter button.is-active {
    background: #fff;
    color: var(--blue);
    box-shadow: 0 2px 7px rgba(20, 31, 48, 0.09);
}

.dashboard-template-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    overflow-y: auto;
    padding: 2px 3px 4px 2px;
}

.dashboard-template-option {
    position: relative;
    min-width: 0;
    align-self: start;
    display: grid;
    grid-template-rows: 116px 142px;
    margin: 0;
    overflow: hidden;
    border: 1px solid #d9dce2;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.dashboard-template-option[hidden] {
    display: none;
}

.dashboard-template-option:has(input:checked) {
    border-color: var(--blue);
    background: #edf5ff;
    box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.18), 0 8px 22px rgba(0, 122, 255, 0.12);
}

.dashboard-template-option > input {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 2;
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--blue);
}

.dashboard-template-visual {
    min-width: 0;
    overflow: hidden;
}

.dashboard-template-option .dashboard-thumbnail {
    height: 116px;
    padding: 7px;
}

.dashboard-template-option .dashboard-thumbnail-head {
    height: 17px;
    padding-bottom: 5px;
}

.dashboard-template-option .dashboard-thumbnail-grid {
    height: 87px;
    gap: 4px;
}

.dashboard-template-option .dashboard-thumbnail-panel {
    gap: 3px;
    padding: 4px;
}

.dashboard-template-copy {
    min-width: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 6px;
    padding: 10px 12px 11px;
}

.dashboard-template-meta {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dashboard-template-meta strong,
.dashboard-template-meta em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-template-meta em {
    color: var(--muted);
    font-size: var(--type-caption);
    line-height: var(--leading-caption);
    font-style: normal;
    font-weight: 700;
}

.dashboard-template-copy > b,
.dashboard-template-copy > small {
    min-width: 0;
    overflow: hidden;
}

.dashboard-template-copy > b {
    color: var(--text);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-template-copy > small {
    display: -webkit-box;
    color: var(--muted);
    font-size: var(--type-caption);
    line-height: var(--leading-caption);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.dashboard-template-capabilities {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
}

.dashboard-template-capabilities i {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.08);
    color: #0068d1;
    font-size: var(--type-caption);
    font-style: normal;
    font-weight: var(--weight-medium);
    line-height: var(--leading-caption);
}

.dashboard-template-blank-visual {
    display: grid;
    place-items: center;
    background: #f5f7fa;
}

.dashboard-template-blank-visual i {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid #c7cad1;
    border-radius: 50%;
    color: var(--blue);
    font-size: 28px;
    font-style: normal;
    font-weight: 400;
}

.dashboard-template-empty {
    min-height: 120px;
}

.dashboard-create-actions {
    margin-top: 0;
    padding-top: 14px;
    border-top: 1px solid rgba(210, 210, 215, 0.72);
}

.custom-panel-heading {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.custom-panel-heading h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-panel-heading span {
    color: #8fa3bd;
    font-size: 11px;
    font-weight: 700;
}

.custom-panel-dialog {
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.dashboard-mode-fieldset {
    min-width: 0;
    margin: 14px 0 0;
    padding: 0;
    border: 0;
}

.dashboard-mode-fieldset legend {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.dashboard-mode-control {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border-radius: 8px;
    background: #f0f1f4;
}

.dashboard-mode-control label {
    margin: 0;
    cursor: pointer;
}

.dashboard-mode-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.dashboard-mode-control span {
    min-height: 36px;
    display: grid;
    place-items: center;
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #5f6368;
    font-size: 13px;
    font-weight: 700;
}

.dashboard-mode-control input:checked + span {
    border-color: rgba(0, 122, 255, 0.18);
    background: #fff;
    color: var(--blue);
    box-shadow: 0 2px 7px rgba(20, 31, 48, 0.09);
}

.dashboard-mode-control input:focus-visible + span {
    outline: 2px solid rgba(0, 122, 255, 0.45);
    outline-offset: 1px;
}

.dashboard-data-editor {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(210, 210, 215, 0.8);
    border-radius: 8px;
    background: #f8f9fb;
}

.dashboard-data-editor[hidden] {
    display: none;
}

.dashboard-data-editor > label:first-child {
    margin-top: 0;
}

.custom-panel-dialog.has-mysql-drag-workbench {
    width: min(1060px, calc(100vw - 32px));
}

.dashboard-mysql-workbench {
    display: grid;
    grid-template-columns: minmax(300px, 0.88fr) minmax(360px, 1.12fr);
    gap: 12px;
}

.dashboard-mysql-library,
.dashboard-mysql-canvas {
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(210, 210, 215, 0.78);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
}

.dashboard-mysql-workbench-head {
    display: grid;
    gap: 9px;
    margin-bottom: 10px;
}

.dashboard-mysql-workbench-head > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.dashboard-mysql-workbench-head strong {
    color: var(--text);
    font-size: 13px;
}

.dashboard-mysql-workbench-head span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.dashboard-mysql-workbench-head input {
    min-height: 36px;
    border-radius: 10px;
    background: #f5f5f7;
}

.dashboard-mysql-query-list {
    max-height: 390px;
    display: grid;
    gap: 8px;
    padding-right: 4px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.dashboard-mysql-query-card {
    min-width: 0;
    display: grid;
    gap: 5px;
    padding: 11px 12px;
    border: 1px solid #d9dce2;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(24, 39, 64, 0.04);
    cursor: grab;
    user-select: none;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.dashboard-mysql-query-card:hover,
.dashboard-mysql-query-card:focus-visible {
    border-color: rgba(0, 122, 255, 0.42);
    box-shadow: 0 9px 24px rgba(0, 85, 180, 0.1);
    transform: translateY(-1px);
    outline: none;
}

.dashboard-mysql-query-card.is-recommended {
    border-color: rgba(0, 122, 255, 0.34);
    background: linear-gradient(145deg, #f1f7ff, #fff 72%);
    box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.07), 0 8px 22px rgba(0, 85, 180, 0.08);
}

.dashboard-mysql-query-card.is-selected {
    border-color: #007aff;
    background: #eaf4ff;
    box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.24), 0 9px 24px rgba(0, 85, 180, 0.12);
}

.dashboard-mysql-query-card.is-dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: scale(0.985);
}

.dashboard-mysql-query-card > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dashboard-mysql-query-card span,
.dashboard-mysql-query-card i {
    color: #0069d2;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
}

.dashboard-mysql-query-card i {
    padding: 3px 6px;
    border-radius: 999px;
    background: #edf5ff;
}

.dashboard-mysql-query-card strong {
    overflow: hidden;
    color: #1d1d1f;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-mysql-query-card p,
.dashboard-mysql-query-card small {
    margin: 0;
    color: #6e6e73;
    font-size: 11px;
    line-height: 1.45;
}

.dashboard-mysql-query-card small {
    color: #8e8e93;
    font-weight: 700;
}

.dashboard-mysql-canvas {
    display: grid;
    align-content: start;
    gap: 10px;
}

.dashboard-mysql-dropzone {
    min-height: 128px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    padding: 18px;
    border: 1.5px dashed rgba(0, 122, 255, 0.34);
    border-radius: 14px;
    background: linear-gradient(145deg, #f6faff, #fff);
    text-align: center;
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.dashboard-mysql-dropzone > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #eaf4ff;
    color: #007aff;
    font-size: 19px;
    font-weight: 700;
}

.dashboard-mysql-dropzone strong {
    color: #1d1d1f;
    font-size: 14px;
}

.dashboard-mysql-dropzone small,
.dashboard-mysql-dropzone em {
    max-width: 430px;
    color: #6e6e73;
    font-size: 11px;
    font-style: normal;
    line-height: 1.45;
}

.dashboard-mysql-dropzone em {
    color: #8e8e93;
    font-weight: 700;
}

.dashboard-mysql-dropzone.is-ready,
.dashboard-mysql-dropzone.is-drag-over {
    border-color: #007aff;
    background: #edf6ff;
    box-shadow: 0 0 0 5px rgba(0, 122, 255, 0.09), 0 16px 32px rgba(0, 85, 180, 0.12);
}

.dashboard-mysql-dropzone.is-drag-over {
    transform: scale(1.012);
}

.dashboard-mysql-dropzone.has-query {
    border-style: solid;
    border-color: rgba(52, 199, 89, 0.4);
    background: linear-gradient(145deg, #effbf3, #fff);
}

.dashboard-mysql-dropzone.has-query > span {
    background: #e6f8eb;
    color: #248a3d;
}

.dashboard-mysql-sql-field {
    margin: 0 !important;
}

.dashboard-mysql-sql-field textarea {
    min-height: 150px;
    resize: vertical;
    border-radius: 11px;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
    line-height: 1.5;
}

.dashboard-mysql-preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.dashboard-mysql-preview {
    min-height: 42px;
    padding: 9px 10px;
    border-radius: 10px;
    background: #f5f5f7;
    color: #6e6e73;
    font-size: 11px;
    line-height: 1.45;
}

.dashboard-mysql-preview > strong {
    display: block;
    margin-bottom: 7px;
    color: #248a3d;
}

.dashboard-mysql-preview > div {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.dashboard-mysql-preview span {
    display: inline-flex;
    gap: 6px;
    padding: 4px 7px;
    border-radius: 999px;
    background: #fff;
    color: #3a3a3c;
}

.dashboard-mysql-preview span em {
    color: #007aff;
    font-style: normal;
    font-weight: 700;
}

.dashboard-mysql-empty {
    min-height: 120px;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 900px) {
    .dashboard-mysql-workbench {
        grid-template-columns: 1fr;
    }

    .dashboard-mysql-query-list {
        max-height: 240px;
    }
}

.dashboard-data-editor-head {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
    color: var(--text);
    font-size: 13px;
}

.dashboard-data-editor-head > span {
    color: var(--muted);
}

.dashboard-manual-list {
    display: grid;
    gap: 7px;
}

.dashboard-manual-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(110px, 0.45fr) 32px;
    gap: 7px;
    align-items: center;
}

.dashboard-manual-row input {
    min-width: 0;
}

.dashboard-search-card-list {
    max-height: 276px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow-y: auto;
}

.dashboard-search-option {
    min-width: 0;
    display: grid !important;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 9px !important;
    margin: 0 !important;
    padding: 10px;
    border: 1px solid #d9dce2;
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
}

.dashboard-search-option:has(input:checked) {
    border-color: var(--blue);
    background: #edf5ff;
    box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.18);
}

.dashboard-search-option input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
}

.dashboard-search-option > span {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.dashboard-search-option strong,
.dashboard-search-option small,
.dashboard-search-option em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-search-option strong {
    color: var(--text);
    font-size: 13px;
}

.dashboard-search-option small,
.dashboard-search-option em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
}

.dashboard-panel-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.dashboard-empty {
    grid-column: 1 / -1;
    min-height: 220px;
    display: grid;
    place-items: center;
    color: var(--muted);
}

@media (max-width: 720px) {
    .case-create-backdrop {
        padding: 8px;
    }

    .case-create-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
        padding: 20px;
        overflow-y: auto;
        border-radius: 22px;
    }

    .case-create-head {
        gap: 12px;
    }

    .case-create-head h2 {
        font-size: 28px;
    }

    .case-create-head p {
        display: none;
    }

    .case-create-actions .button {
        flex: 1 1 0;
    }

    .asset-model-grid,
    .time-standardization-layout {
        grid-template-columns: 1fr;
    }

    .time-model-summary {
        grid-template-columns: 1fr;
    }

    .time-model-summary dl {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tactic-create-backdrop {
        padding: 10px;
    }

    .tactic-create-dialog {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        display: block;
        padding: 16px;
        overflow-y: auto;
    }

    .tactic-create-dialog > * + * {
        margin-top: 16px;
    }

    .tactic-create-fields,
    .tactic-modal-snapshot-grid {
        grid-template-columns: 1fr;
    }

    .tactic-create-snapshots,
    .tactic-modal-snapshot-grid {
        display: grid;
        overflow: visible;
    }

    .tactic-create-actions {
        position: sticky;
        bottom: -16px;
        z-index: 3;
        padding: 12px 0 16px;
        background: rgba(255, 255, 255, 0.98);
    }

    .custom-dashboard-create .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .asset-case-head {
        flex-direction: column;
    }

    .asset-case-head .button {
        width: 100%;
    }

    .case-card .card-actions,
    .dashboard-card-grid,
    .dashboard-search-card-list {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-card-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-manual-row {
        grid-template-columns: minmax(0, 1fr) 104px 32px;
    }

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

    .dashboard-panel-actions span {
        display: none;
    }

    .dashboard-create-backdrop {
        padding: 10px;
    }

    .dashboard-create-dialog {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        display: block;
        padding: 16px;
        overflow-y: auto;
    }

    .dashboard-create-dialog > * + * {
        margin-top: 16px;
    }

    .dashboard-create-fields {
        grid-template-columns: 1fr;
    }

    .dashboard-template-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 11px;
        overflow: visible;
    }

    .dashboard-template-head,
    .dashboard-template-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-template-search {
        min-width: 0;
        width: 100%;
    }

    .dashboard-template-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-template-picker {
        display: block;
        overflow: visible;
    }

    .dashboard-create-actions {
        position: sticky;
        bottom: -16px;
        z-index: 3;
        padding: 12px 0 16px;
        background: rgba(255, 255, 255, 0.98);
    }
}

@media (max-width: 480px) {
    .dashboard-template-grid {
        grid-template-columns: 1fr;
    }

    .time-model-summary dl {
        grid-template-columns: 1fr;
    }

    .time-result-row {
        grid-template-columns: 1fr auto;
    }

    .time-result-row > i {
        display: none;
    }

    .time-result-row div:nth-of-type(2) {
        grid-column: 1;
    }

    .time-result-row > em {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .tactic-create-head {
        align-items: stretch;
        flex-direction: column;
    }

    .tactic-create-head .button {
        align-self: flex-end;
    }

    .dashboard-mode-control,
    .dashboard-search-card-list {
        grid-template-columns: 1fr;
    }

    .dashboard-manual-row {
        grid-template-columns: minmax(0, 1fr) 32px;
    }

    .dashboard-manual-row input[name="manualValue"] {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .dashboard-manual-row [data-remove-manual-row] {
        grid-column: 2;
        grid-row: 1;
    }

    .dashboard-create-head,
    .dashboard-template-head {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-create-head .button {
        align-self: flex-end;
    }

    .dashboard-template-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-template-grid {
        grid-template-columns: 1fr;
    }
}

.case-people-section {
    margin-top: 64px;
}

.case-people-section .person-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    border-top: 1px solid var(--ui-separator);
}

.case-people-section .person-chip {
    padding: var(--ui-space-5) var(--ui-space-4);
    border: 0;
    border-bottom: 1px solid var(--ui-separator);
    border-radius: 0;
    background: transparent;
}

.case-people-section .person-chip:not(:nth-child(4n)) {
    border-right: 1px solid var(--ui-separator);
}

.case-people-section .person-chip span {
    color: var(--muted);
    font-size: 12px;
}

.case-people-empty {
    grid-column: 1 / -1;
    padding: var(--ui-space-8);
    border-bottom: 1px solid var(--ui-separator);
}

/* 表单忙状态：提交后给出明确反馈，并阻止重复操作。 */
form.is-submitting {
    cursor: progress;
}

.button.is-busy {
    gap: 8px;
    cursor: progress;
    opacity: 0.78;
}

.button.is-busy::before {
    content: "";
    width: 13px;
    height: 13px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: app-button-spin 700ms linear infinite;
}

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

@media (max-width: 1100px) {
    .dashboard-hero {
        grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
        gap: var(--ui-space-10);
        padding-right: var(--ui-space-10);
        padding-left: var(--ui-space-10);
    }

    .case-workspace {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 0.48fr);
    }

    .case-people-section .person-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .case-people-section .person-chip:not(:nth-child(4n)) {
        border-right: 0;
    }

    .case-people-section .person-chip:not(:nth-child(3n)) {
        border-right: 1px solid var(--ui-separator);
    }
}

@media (max-width: 900px) {
    .topbar {
        height: 58px;
        min-height: 58px;
        padding: 0;
        flex-wrap: nowrap;
    }

    .topbar-inner {
        position: relative;
        padding: 0 var(--ui-space-4);
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: grid;
        place-items: center;
    }

    .topbar-menu {
        position: absolute;
        top: 58px;
        right: 0;
        left: 0;
        z-index: 55;
        display: none;
        max-height: calc(100vh - 58px);
        overflow-y: auto;
        padding: var(--ui-space-3) var(--ui-space-4) var(--ui-space-4);
        border-bottom: 1px solid var(--ui-separator);
        background: rgba(250, 250, 252, 0.98);
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
    }

    .topbar.is-nav-open .topbar-menu {
        display: grid;
        gap: var(--ui-space-3);
    }

    .topbar .nav {
        width: 100%;
        display: grid;
        gap: 2px;
    }

    .topbar .nav > a {
        width: 100%;
        justify-content: space-between;
        padding: 10px 12px;
        border-radius: var(--ui-radius-sm);
        text-align: left;
    }

    .nav-more-panel {
        position: static;
        width: 100%;
        margin-top: var(--ui-space-1);
        border: 0;
        border-radius: var(--ui-radius-sm);
        background: #f1f1f3;
        box-shadow: none;
    }

    .topbar .userbar {
        width: 100%;
        justify-content: space-between;
        padding-top: var(--ui-space-3);
        border-top: 1px solid var(--ui-separator);
    }

    .shell:not(.screen-shell) {
        width: min(100vw - 28px, 760px);
        padding-top: var(--ui-space-8);
    }

    .dashboard-hero {
        min-height: 0;
        grid-template-columns: 1fr;
        gap: var(--ui-space-10);
        padding: var(--ui-space-10);
        margin-bottom: 56px;
    }

    .dashboard-intro h1 {
        font-size: clamp(42px, 10vw, 64px);
    }

    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-metrics > div:nth-child(3) {
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid var(--ui-separator);
    }

    .dashboard-metrics > div:nth-child(4) {
        border-top: 1px solid var(--ui-separator);
    }

    .case-hero {
        align-items: flex-start;
    }

    .case-primary-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .case-workflow {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .case-workflow a.workflow-step:nth-child(2)::after {
        display: none;
    }

    .case-workflow a.workflow-step:nth-child(-n + 2) {
        border-bottom: 1px solid var(--ui-separator);
    }

    .case-workspace {
        grid-template-columns: 1fr;
    }

    .case-workspace > * {
        min-width: 0;
    }

    .case-info-panel {
        position: static;
    }

    .case-people-section .person-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .case-people-section .person-chip:not(:nth-child(3n)) {
        border-right: 0;
    }

    .case-people-section .person-chip:nth-child(odd) {
        border-right: 1px solid var(--ui-separator);
    }
}

@media (max-width: 680px) {
    .shell:not(.screen-shell) {
        width: min(100vw - 24px, 560px);
        padding-top: var(--ui-space-6);
    }

    .flash-stack {
        position: static;
        width: 100%;
        margin: 0 0 var(--ui-space-3);
    }

    .dashboard-hero {
        padding: var(--ui-space-8) var(--ui-space-5);
        border-radius: var(--ui-radius-md);
    }

    .dashboard-intro h1 {
        font-size: 42px;
    }

    .dashboard-intro > p {
        font-size: 17px;
    }

    .continue-case {
        padding: var(--ui-space-6);
        border-radius: var(--ui-radius-md);
    }

    .dashboard-section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: var(--ui-space-2);
    }

    .dashboard-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-metrics > div {
        padding: var(--ui-space-5) var(--ui-space-4);
    }

    .dashboard-metrics > div:nth-child(odd) {
        padding-left: 0;
    }

    .dashboard-metrics dd {
        font-size: 36px;
    }

    .task-entry-grid {
        grid-template-columns: 1fr;
    }

    .task-entry:nth-child(odd) {
        border-right: 0;
    }

    .case-workflow {
        grid-template-columns: 1fr;
        padding: var(--ui-space-2);
    }

    .case-workflow a.workflow-step {
        min-height: 62px;
    }

    .case-workflow a.workflow-step:not(:last-child) {
        border-bottom: 1px solid var(--ui-separator);
    }

    .case-workflow a.workflow-step:not(:last-child)::after {
        display: none;
    }

    .task-upload-form.upload-box {
        grid-template-columns: 1fr;
    }

    .task-upload-form > .button {
        min-height: 46px;
    }

    .upload-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .upload-table,
    .upload-table tbody,
    .upload-table tr,
    .upload-table td {
        display: block;
        width: 100%;
    }

    .upload-table tr {
        padding: var(--ui-space-4) 0;
        border-bottom: 1px solid var(--ui-separator);
    }

    .upload-table td {
        position: relative;
        padding: 6px 0 6px 100px;
        border: 0;
    }

    .upload-table td[data-label]::before {
        content: attr(data-label);
        position: absolute;
        top: 7px;
        left: 0;
        width: 86px;
        color: var(--muted);
        font-size: 12px;
        font-weight: 600;
    }

    .upload-table .upload-next-action {
        padding-top: var(--ui-space-3);
        padding-left: 100px;
        text-align: left;
    }

    .upload-table .upload-empty {
        padding: var(--ui-space-6) !important;
    }

    .case-people-section .person-list {
        grid-template-columns: 1fr;
    }

    .case-people-section .person-chip:nth-child(odd) {
        border-right: 0;
    }
}

@media (max-width: 420px) {
    .dashboard-hero-actions,
    .continue-case-actions,
    .case-primary-actions,
    .case-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-hero-actions .button,
    .continue-case-actions .button,
    .case-primary-actions > .button,
    .case-primary-actions > details,
    .case-primary-actions summary,
    .case-form-actions .button {
        width: 100%;
    }

    .case-action-menu {
        right: auto;
        left: 0;
        width: min(280px, calc(100vw - 48px));
    }

    .dashboard-metrics div > span,
    .task-entry-meta {
        display: none;
    }

    .task-entry {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .task-entry-side {
        grid-column: 2;
        justify-items: start;
        grid-template-columns: auto auto;
        align-items: center;
        gap: var(--ui-space-2);
    }
}

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

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================================================== */
/* 关联图谱工作区：画布优先、工具紧凑、辅助信息按屏幕空间逐级折叠。           */
/* ========================================================================== */

.shell:has(.graph-page) {
    width: min(1800px, calc(100vw - 24px));
    padding-top: 22px;
}

.shell:has(.graph-page) .graph-page {
    left: auto;
    width: 100%;
    transform: none;
}

.graph-page .graph-head {
    display: grid;
    grid-template-columns: minmax(250px, 0.58fr) minmax(620px, 1.42fr);
    align-items: center;
    gap: 8px 28px;
    margin-bottom: 16px;
    padding: 18px 20px;
    border: 1px solid var(--ui-separator);
    border-radius: var(--ui-radius-md);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--ui-shadow-sm);
}

.graph-page .graph-head > :first-child {
    grid-row: 1 / span 3;
    align-self: start;
}

.graph-page .graph-head h1 {
    margin-top: 5px;
    font-size: clamp(28px, 3vw, 42px);
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

.graph-page .graph-row {
    min-width: 0;
    padding: 3px 0;
    border: 0;
}

.graph-page .graph-row-label {
    flex: 0 0 42px;
    color: var(--muted);
    font-size: 12px;
}

.graph-page :is(.layout-mode-control, .render-mode-control) {
    padding: 3px;
    border: 1px solid var(--ui-separator);
    border-radius: 999px;
    background: #f5f5f7;
}

.graph-page :is(.layout-mode-control, .render-mode-control) button {
    min-height: 30px;
    padding: 5px 11px;
    border: 0;
    border-radius: 999px;
    background: transparent;
}

.graph-page :is(.layout-mode-control, .render-mode-control) button.active {
    background: #fff;
    color: var(--ui-blue);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.graph-page .graph-performance-status {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef6ff;
    color: #005eb8;
    font-size: 12px;
}

.graph-page .graph-tools {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.graph-page .graph-tools > * {
    flex: 0 0 auto;
}

.graph-page .graph-workspace,
.graph-popup-page .graph-workspace {
    grid-template-areas: "legend canvas inspector";
    grid-template-columns: 220px minmax(560px, 1fr) 290px;
    gap: 12px;
    min-height: min(760px, calc(100dvh - 245px));
}

.graph-workspace > .graph-legend-panel {
    grid-area: legend;
}

.graph-workspace > #relationGraph {
    grid-area: canvas;
}

.graph-workspace > .inspector {
    grid-area: inspector;
}

.graph-page #relationGraph,
.graph-popup-page #relationGraph {
    width: 100%;
    height: min(760px, calc(100dvh - 245px));
    min-height: 620px;
    aspect-ratio: auto;
    border-radius: var(--ui-radius-md);
    box-shadow: var(--ui-shadow-sm);
}

.graph-page .graph-legend-panel,
.graph-popup-page .graph-legend-panel,
.graph-page .inspector,
.graph-popup-page .inspector {
    height: min(760px, calc(100dvh - 245px));
    max-height: none;
    border-radius: var(--ui-radius-md);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--ui-shadow-sm);
}

.graph-popup-page {
    width: 100%;
    min-height: 100dvh;
    padding: 12px;
}

.graph-popup-page .popup-head {
    min-height: 56px;
    margin-bottom: 10px;
    padding: 0 4px;
}

.graph-popup-page .popup-head h1 {
    margin: 3px 0 0;
    font-size: clamp(24px, 3vw, 34px);
}

.graph-popup-page .graph-workspace {
    min-height: calc(100dvh - 92px);
}

.graph-popup-page #relationGraph,
.graph-popup-page .graph-legend-panel,
.graph-popup-page .inspector {
    height: calc(100dvh - 92px);
    min-height: 620px;
}

.graph-loading-overlay {
    background: rgba(248, 250, 253, 0.9);
    backdrop-filter: none;
}

.graph-loading-card {
    min-width: min(360px, calc(100% - 40px));
    padding: 22px 26px;
    border-color: rgba(0, 113, 227, 0.16);
    border-radius: var(--ui-radius-md);
    box-shadow: var(--ui-shadow-md);
}

.graph-loading-card small {
    color: var(--muted);
    font-weight: 600;
}

.large-graph-badge {
    border-radius: var(--ui-radius-sm);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
}

@media (max-width: 1180px) {
    .graph-page .graph-head {
        grid-template-columns: 1fr;
    }

    .graph-page .graph-head > :first-child {
        grid-row: auto;
    }

    .graph-page .graph-workspace,
    .graph-popup-page .graph-workspace {
        grid-template-areas:
            "canvas canvas"
            "legend inspector";
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        min-height: 0;
    }

    .graph-page #relationGraph,
    .graph-popup-page #relationGraph {
        height: min(70dvh, 720px);
        min-height: 540px;
    }

    .graph-page .graph-legend-panel,
    .graph-popup-page .graph-legend-panel,
    .graph-page .inspector,
    .graph-popup-page .inspector {
        position: static;
        height: 340px;
        min-height: 260px;
        overflow: auto;
    }
}

@media (max-width: 700px) {
    .shell:has(.graph-page) {
        width: min(100vw - 16px, 680px);
        padding-top: 12px;
    }

    .graph-page .graph-head {
        padding: 14px;
    }

    .graph-page .graph-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .graph-page .graph-row-label {
        flex-basis: auto;
    }

    .graph-page :is(.layout-mode-control, .render-mode-control),
    .graph-page .graph-tools {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .graph-page .graph-workspace,
    .graph-popup-page .graph-workspace {
        grid-template-areas:
            "canvas"
            "inspector"
            "legend";
        grid-template-columns: 1fr;
    }

    .graph-page #relationGraph,
    .graph-popup-page #relationGraph {
        width: 100%;
        height: min(66dvh, 620px);
        min-height: 430px;
        touch-action: pan-y;
    }

    .graph-page .graph-legend-panel,
    .graph-popup-page .graph-legend-panel,
    .graph-page .inspector,
    .graph-popup-page .inspector {
        width: 100%;
        height: auto;
        min-height: 220px;
        max-height: 360px;
    }

    .graph-popup-page {
        padding: 8px;
    }

    .graph-popup-page .popup-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* 筛选关系较多时完整换行展示，避免最后几项藏在横向滚动区。 */
.graph-filter-page .filter-check-row {
    flex-wrap: wrap;
    overflow-x: visible;
    white-space: normal;
}

/* 窄屏横向工具条以边缘渐隐提示还有内容，并保持键盘可滚动。 */
@media (max-width: 920px) {
    [data-horizontal-scroll].has-horizontal-overflow {
        -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 30px), transparent 100%);
        mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 30px), transparent 100%);
    }

    [data-horizontal-scroll].has-horizontal-overflow:not(.is-scroll-start):not(.is-scroll-end) {
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
    }

    [data-horizontal-scroll].has-horizontal-overflow.is-scroll-end {
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 30px, #000 100%);
        mask-image: linear-gradient(to right, transparent 0, #000 30px, #000 100%);
    }
}

@media (max-width: 560px) {
    .subject-detail-modal-head.has-subject-tag-editor,
    .screen-subject-modal-head.subject-detail-modal-head.has-subject-tag-editor,
    .subject-modal-head.subject-detail-modal-head.has-subject-tag-editor {
        grid-template-columns: 1fr;
    }

    .subject-detail-modal-head.has-subject-tag-editor > .subject-detail-head-info,
    .subject-detail-modal-head.has-subject-tag-editor > .subject-head-tag-editor,
    .subject-detail-modal-head.has-subject-tag-editor > .subject-profile-card {
        grid-column: 1;
        grid-row: auto;
    }

    .subject-detail-modal-head.has-subject-tag-editor > .subject-head-tag-editor {
        max-height: 300px;
    }
}

/* 案件六步页头：统一采用数字主体的尺寸与右上角操作基线。 */
.page-head.case-stage-head {
    min-height: 74px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.page-head.case-stage-head > div:first-child {
    min-width: 0;
}

.page-head.case-stage-head h1 {
    margin-top: 4px;
    font-size: 32px;
    letter-spacing: -0.035em;
    line-height: 1.1;
}

.page-head.case-stage-head p {
    margin-top: 7px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.case-stage-actions,
.page-head.case-stage-head > form {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    align-self: flex-start;
    gap: 9px;
    margin: 0;
}

.case-stage-create-button {
    min-height: 42px;
    padding: 9px 18px;
    border-radius: 999px;
    box-shadow: 0 9px 24px rgba(0, 113, 227, 0.18);
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.case-stage-create-button > span {
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
}

.graph-filter-stage-head {
    width: 100%;
}

.shell:has(.graph-filter-page) .graph-filter-page.filter-home-page {
    width: 100%;
}

.case-model-head {
    margin-bottom: 18px;
}

/* 模型预测：三种模型共用原工作区，不再建立独立风险预警页面。 */
.model-catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 16px;
}

.model-catalog-card.subject-prediction-card {
    min-height: 330px;
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 16px;
    padding: 24px;
    border-radius: 24px;
}

.model-catalog-card .subject-model-visual {
    grid-row: auto;
    width: 68px;
    height: 68px;
    border-radius: 20px;
}

.model-catalog-card .subject-model-visual svg {
    width: 46px;
    height: 46px;
}

.model-catalog-card .subject-model-copy {
    align-content: start;
}

.model-catalog-card .subject-model-copy > strong {
    margin-bottom: 9px;
    font-size: var(--type-card-title);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-card-title);
    letter-spacing: -0.025em;
}

.model-catalog-card .subject-model-copy > small {
    font-size: var(--type-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
}

.model-catalog-card .subject-model-badges {
    margin-bottom: 9px;
}

.model-catalog-card .subject-model-badges span,
.model-catalog-card .subject-model-badges i,
.model-catalog-card .subject-model-stats small {
    font-size: var(--type-caption);
    line-height: var(--leading-caption);
}

.model-catalog-card .subject-model-stats {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: end;
}

.model-catalog-card .subject-model-stats > span {
    min-width: 0;
    padding: 13px 9px;
}

.model-catalog-card .subject-model-stats b {
    font-size: var(--type-card-title);
    line-height: var(--leading-card-title);
}

.model-catalog-card .subject-model-open {
    grid-column: 1 / -1;
    grid-row: 3;
    font-size: var(--type-body);
    line-height: var(--leading-body);
}

.model-catalog-card.is-rule .subject-model-visual {
    background: linear-gradient(145deg, #ff5a52, #ff375f 58%, #bf5af2);
}

.model-catalog-card.is-relation .subject-model-visual {
    background: linear-gradient(145deg, #1179ed, #6b5ce7 58%, #af52de);
}

.model-catalog-card.is-semantic .subject-model-visual {
    background: linear-gradient(145deg, #00a896, #0a84ff 58%, #5856d6);
}

.model-choice-list {
    display: grid;
    gap: 10px;
}

.model-choice-card {
    border-color: rgba(210, 210, 215, 0.76);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: none;
}

.model-choice-card.is-selected {
    border-color: rgba(0, 113, 227, 0.48);
    background: linear-gradient(145deg, rgba(238, 247, 255, 0.96), rgba(248, 245, 255, 0.94));
    box-shadow: inset 0 0 0 2px rgba(0, 113, 227, 0.06);
}

.model-choice-card small,
.model-choice-card > i,
.prediction-filter-copy > small,
.prediction-filter-copy > span i,
.prediction-panel-title small,
.prediction-panel-title > span,
.prediction-empty-scope small,
.prediction-loading-steps span,
.prediction-result-summary p,
.prediction-run-state {
    font-size: var(--type-caption);
    line-height: var(--leading-caption);
}

.prediction-role-badge,
.prediction-hard-badge,
.prediction-rule-badge,
.prediction-semantic-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: var(--type-caption);
    font-style: normal;
    font-weight: var(--weight-semibold);
    line-height: var(--leading-caption);
}

.prediction-role-badge {
    background: rgba(175, 82, 222, 0.1);
    color: #8b36b3;
}

.prediction-hard-badge {
    background: rgba(255, 59, 48, 0.11);
    color: #c62d25;
}

.prediction-rule-badge {
    background: rgba(255, 149, 0, 0.11);
    color: #a95d00;
}

.prediction-semantic-badge {
    background: rgba(0, 199, 190, 0.11);
    color: #087f79;
}

@media (max-width: 1180px) {
    .model-catalog-grid {
        grid-template-columns: 1fr;
    }

    .model-catalog-card.subject-prediction-card {
        min-height: 240px;
    }
}

.case-close-head h2 {
    font-size: 32px;
}

/* 点击流程栏案件名称后展示的独立案件总览。 */
.case-overview-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(372px, 430px) minmax(300px, 0.9fr);
    gap: 20px;
    align-items: stretch;
    overflow: hidden;
    margin-bottom: 22px;
    padding: 30px;
    border: 1px solid rgba(210, 210, 215, 0.72);
    border-radius: 28px;
    background:
        radial-gradient(circle at 93% 3%, rgba(90, 200, 250, 0.2), transparent 30%),
        radial-gradient(circle at 6% 110%, rgba(175, 82, 222, 0.12), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 255, 0.94));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 22px 64px rgba(30, 42, 68, 0.09);
}

.case-overview-connection {
    position: relative;
    min-width: 0;
    display: grid;
    /* 末行留给扫码引导演示(2026-09-01) */
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    place-items: center;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(0, 113, 227, 0.18);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 14px 34px rgba(0, 83, 176, 0.09);
    backdrop-filter: blur(16px);
}

.case-overview-connection > header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.case-overview-connection > header > span {
    color: #6e6e73;
    font-size: var(--type-caption);
    font-weight: var(--weight-semibold);
}

.case-overview-connection > header a {
    color: #0066cc;
    font-size: 10px;
    font-weight: var(--weight-semibold);
    white-space: nowrap;
}

.case-overview-connection > header a:hover {
    text-decoration: underline;
}

.case-overview-connection-qr {
    position: relative;
    display: grid;
    place-items: center;
    align-self: center;
    padding: 7px;
    border-radius: 13px;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(29, 29, 31, 0.055);
}

.case-overview-connection-qr img {
    width: clamp(328px, 24vw, 420px);
    height: auto;
    display: block;
    image-rendering: pixelated;
}

.case-overview-connection-qr span {
    position: absolute;
    right: 7px;
    bottom: 7px;
    padding: 3px 6px;
    border-radius: 999px;
    background: rgba(29, 29, 31, 0.82);
    color: #fff;
    font-size: 9px;
    font-weight: var(--weight-semibold);
    font-variant-numeric: tabular-nums;
}

.case-overview-connection > strong {
    color: #1d1d1f;
    font-size: 13px;
    line-height: 1.25;
    text-align: center;
}

.case-overview-connection > small {
    max-width: 100%;
    overflow: hidden;
    color: #6e6e73;
    font-size: 9px;
    line-height: 1.3;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-overview-connection.is-unavailable {
    align-content: center;
}

.case-overview-connection.is-rebind-target {
    border-color: rgba(0, 113, 227, 0.72);
    box-shadow: 0 0 0 6px rgba(0, 113, 227, 0.11), 0 18px 44px rgba(0, 83, 176, 0.16);
}

.case-data-rebind-dialog {
    /* 用户要求放大:里面要摊开每张表的字段名、类型和选择型取值。 */
    width: min(1080px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 26px;
    background: rgba(250, 250, 252, 0.97);
    color: #1d1d1f;
    box-shadow: 0 30px 90px rgba(20, 32, 60, 0.28);
    backdrop-filter: blur(28px) saturate(1.35);
}

.case-data-rebind-dialog::backdrop {
    background: rgba(18, 24, 38, 0.36);
    backdrop-filter: blur(8px);
}

.case-data-rebind-dialog > section {
    display: grid;
    gap: 18px;
    padding: 26px;
}

.case-data-rebind-dialog header {
    display: flex;
    gap: 14px;
    align-items: center;
}

.case-data-rebind-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(145deg, #0a84ff, #5e5ce6);
    color: #fff;
    font-size: 25px;
    box-shadow: 0 12px 26px rgba(36, 94, 201, 0.24);
}

.case-data-rebind-dialog header div {
    min-width: 0;
}

.case-data-rebind-dialog header small {
    color: #0071e3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.case-data-rebind-dialog h2 {
    margin: 3px 0 0;
    font-size: 21px;
    line-height: 1.25;
}

.case-data-rebind-dialog > section > p,
.case-data-rebind-scope {
    margin: 0;
    color: #6e6e73;
    font-size: 13px;
    line-height: 1.65;
}

.case-data-rebind-version {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(0, 113, 227, 0.08);
    color: #0066cc;
    font-size: 12px;
}

.case-data-rebind-version strong {
    font-size: 17px;
    font-variant-numeric: tabular-nums;
}

.case-data-rebind-list {
    display: grid;
    gap: 8px;
    max-height: 240px;
    overflow: auto;
}

.case-data-rebind-list article {
    min-width: 0;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 11px 12px;
    border: 1px solid rgba(210, 210, 215, 0.72);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.78);
}

.case-data-rebind-list article span {
    color: #5856d6;
    font-size: 10px;
    font-weight: 700;
}

.case-data-rebind-list article strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-data-rebind-dialog footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.case-overview-connection-error {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    align-self: center;
    border-radius: 50%;
    background: rgba(255, 149, 0, 0.12);
    color: #b76400;
    font-size: 28px;
    font-weight: var(--weight-semibold);
}

.case-overview-identity {
    min-width: 0;
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
}

.case-overview-identity-editor {
    min-width: 0;
}

.case-overview-identity-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.case-overview-edit-button {
    min-height: 30px;
    padding: 5px 11px;
}

.case-overview-identity-editor.is-editing .case-overview-identity-view {
    display: none;
}

.case-overview-identity-editor.is-editing .case-overview-identity-form {
    display: grid !important;
}

.case-overview-identity-form {
    gap: 12px;
    padding: 18px;
    border: 1px solid rgba(0, 113, 227, 0.18);
    border-radius: var(--ui-radius-md);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--ui-shadow-sm);
}

.case-overview-identity-form label {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.case-overview-identity-form textarea {
    min-height: 92px;
    resize: vertical;
}

.case-overview-identity-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.case-overview-folder {
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border-radius: 25px;
    background: linear-gradient(145deg, #0a84ff, #5e5ce6 62%, #af52de);
    color: #fff;
    box-shadow: 0 18px 36px rgba(57, 79, 192, 0.23), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.case-overview-folder svg {
    width: 47px;
    height: 47px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.case-overview-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.09);
    color: #0064c9;
    font-size: var(--type-caption);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-caption);
}

.case-overview-state i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0a84ff;
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.1);
}

.case-overview-state.closed {
    background: rgba(52, 199, 89, 0.1);
    color: #177d38;
}

.case-overview-state.closed i {
    background: #34c759;
    box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.1);
}

.case-overview-identity h2 {
    margin: 10px 0 7px;
    overflow-wrap: anywhere;
    font-family: var(--font-display);
    font-size: var(--type-page-title);
    font-weight: var(--weight-bold);
    letter-spacing: -0.03em;
    line-height: var(--leading-page-title);
}

.case-overview-identity p {
    max-width: 680px;
    margin: 0;
    color: #6e6e73;
    font-size: var(--type-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
}

.case-overview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 14px;
    margin-top: 12px;
    color: #86868b;
    font-size: var(--type-caption);
    font-weight: var(--weight-medium);
    line-height: var(--leading-caption);
}

.case-overview-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    align-self: stretch;
    border: 1px solid rgba(210, 210, 215, 0.66);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(16px);
}

.case-overview-metrics article {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 2px;
    padding: 16px 18px;
}

.case-overview-metrics article:nth-child(even) {
    border-left: 1px solid rgba(210, 210, 215, 0.58);
}

.case-overview-metrics article:nth-child(n + 3) {
    border-top: 1px solid rgba(210, 210, 215, 0.58);
}

.case-overview-metrics strong {
    overflow: hidden;
    font-size: 27px;
    letter-spacing: -0.04em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-overview-metrics span {
    color: #424245;
    font-size: 11px;
    font-weight: 700;
}

.case-overview-metrics small {
    color: #86868b;
    font-size: 9px;
}

.case-overview-section {
    min-width: 0;
    margin-bottom: 20px;
    padding: 22px;
    border: 1px solid rgba(210, 210, 215, 0.7);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 14px 38px rgba(28, 36, 53, 0.055);
    backdrop-filter: blur(18px);
}

.case-overview-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.case-overview-section-head h2 {
    margin: 4px 0 0;
    font-size: 20px;
    letter-spacing: -0.025em;
}

.case-overview-section-head > small {
    color: #86868b;
    font-size: 11px;
}

.case-overview-section-head > a {
    color: #0071e3;
    font-size: 11px;
    font-weight: 700;
}

.case-overview-stage-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.case-overview-stage {
    min-width: 0;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    min-height: 86px;
    padding: 14px;
    border: 1px solid rgba(210, 210, 215, 0.7);
    border-radius: 16px;
    background: #fbfbfd;
    color: var(--text);
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.case-overview-stage:hover {
    border-color: rgba(0, 113, 227, 0.32);
    background: #f5f9ff;
    box-shadow: 0 10px 26px rgba(0, 113, 227, 0.08);
    transform: translateY(-2px);
}

.case-overview-stage > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #ededf0;
    color: #6e6e73;
    font-size: 11px;
    font-weight: 700;
}

.case-overview-stage.is-complete > span,
.case-overview-stage.is-ready > span {
    background: rgba(0, 113, 227, 0.1);
    color: #0071e3;
}

.case-overview-stage.is-complete > span {
    background: rgba(52, 199, 89, 0.11);
    color: #17813a;
}

.case-overview-stage > div {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.case-overview-stage strong,
.case-overview-stage small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-overview-stage strong {
    font-size: 14px;
}

.case-overview-stage small {
    color: #86868b;
    font-size: 10px;
}

.case-overview-stage em {
    flex: 0 0 auto;
    padding: 4px 7px;
    border-radius: 999px;
    background: #fff;
    color: #6e6e73;
    font-size: 9px;
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
}

.case-overview-activity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.case-overview-activity-grid .case-overview-section {
    margin-bottom: 0;
}

.case-overview-list {
    display: grid;
}

.case-overview-list article {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 11px 0;
}

.case-overview-list article + article {
    border-top: 1px solid rgba(210, 210, 215, 0.56);
}

.case-overview-list-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(0, 113, 227, 0.09);
    color: #0071e3;
    font-size: 13px;
    font-weight: 700;
}

.case-overview-list-icon.filter {
    background: rgba(175, 82, 222, 0.1);
    color: #8a42aa;
}

.case-overview-list article > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.case-overview-list strong,
.case-overview-list small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-overview-list strong {
    font-size: 12px;
}

.case-overview-list small {
    color: #86868b;
    font-size: 9px;
}

.case-overview-list article > em {
    color: #6e6e73;
    font-size: 9px;
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
}

.case-overview-empty {
    padding: 26px 10px;
    color: #86868b;
    font-size: 11px;
    text-align: center;
}

@media (max-width: 1180px) {
    .case-overview-hero {
        grid-template-columns: 1fr;
    }

    .case-overview-stage-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .case-overview-activity-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .page-head.case-stage-head {
        min-height: 0;
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .case-stage-actions,
    .page-head.case-stage-head > form,
    .case-stage-create-button {
        width: 100%;
    }

    .case-overview-hero {
        padding: 22px;
        border-radius: 22px;
    }

    .case-overview-connection-qr img {
        width: min(328px, calc(100vw - 104px));
    }

    .case-overview-identity {
        grid-template-columns: 1fr;
    }

    .case-overview-folder {
        width: 68px;
        height: 68px;
        border-radius: 20px;
    }

    .case-overview-folder svg {
        width: 38px;
        height: 38px;
    }

    .case-overview-stage-grid {
        grid-template-columns: 1fr;
    }

    .case-overview-section {
        padding: 17px;
        border-radius: 18px;
    }

    .case-overview-section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }
}

/* ==========================================================================
   字体审计最终收口
   功能页可读信息最低使用 12px；缩略图中的装饰文字继续沿用独立预览比例。
   ========================================================================== */

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .rule-badge,
    .graph-performance-status,
    .inspector-tag-heading span,
    .inspector-tag-empty,
    .tag-form-feedback,
    .mysql-picker-search-label em,
    .mysql-picker-search small,
    .mysql-picker-category-title small,
    .tactic-picker-select-state,
    .filter-method-head em,
    .filter-method-hint,
    .subject-model-badges span,
    .subject-model-badges i,
    .subject-model-stats small,
    .model-choice-card > i,
    .subject-prediction-pipeline span i,
    .prediction-panel-title small,
    .prediction-panel-title > span,
    .prediction-filter-copy > small,
    .prediction-filter-copy > span i,
    .prediction-filter-empty small,
    .prediction-empty-scope small,
    .prediction-loading-steps span,
    .prediction-result-summary p,
    .prediction-run-state,
    .prediction-metric small,
    .prediction-result-toolbar small,
    .prediction-result-legend span,
    .prediction-source-badge,
    .prediction-new-badge,
    .prediction-rank,
    .prediction-subject-title > small,
    .prediction-score small,
    .prediction-subject-fields span,
    .prediction-subject-fields b,
    .prediction-subject-fields em,
    .prediction-relation-row > span,
    .prediction-relation-row i,
    .prediction-relation-row em,
    .prediction-reasons li,
    .prediction-subject-foot span,
    .prediction-subject-foot strong,
    .prediction-no-result p,
    .case-status-segments b,
    .subject-card-tag-row > span,
    .subject-card-tag-row b,
    .subject-card-tag-row em,
    .subject-card-tag-row i,
    .subject-head-tag-title > span,
    .subject-head-tag-heading span,
    .subject-head-tag-empty,
    .subject-head-tag-heading strong,
    .subject-head-tag-chip,
    .subject-head-tag-input,
    .subject-head-tag-feedback,
    .ai-control-beacon-copy small,
    .ai-control-beacon-copy em,
    .ml-algorithm-picker-index,
    .ml-algorithm-picker-group > p,
    .ml-algorithm-option span,
    .ml-algorithm-detail-grid article > span,
    .ml-model-detail-stats span,
    .ml-model-detail-meta span,
    .asset-upload-table td:first-child span,
    .asset-model-card dt,
    .time-model-summary dt,
    .time-result-row span,
    .time-result-row em,
    .dashboard-template-meta em,
    .dashboard-template-copy > small,
    .custom-panel-heading span,
    .dashboard-mysql-workbench-head span,
    .dashboard-mysql-query-card span,
    .dashboard-mysql-query-card i,
    .dashboard-mysql-query-card p,
    .dashboard-mysql-query-card small,
    .dashboard-mysql-dropzone small,
    .dashboard-mysql-dropzone em,
    .dashboard-mysql-sql-field textarea,
    .dashboard-mysql-preview,
    .dashboard-search-option small,
    .dashboard-search-option em,
    .case-overview-state,
    .case-overview-meta,
    .case-overview-section-head > small,
    .case-overview-section-head > a,
    .case-overview-stage > span,
    .case-overview-stage small,
    .case-overview-stage em,
    .case-overview-list small,
    .case-overview-list article > em,
    .case-overview-empty
) {
    font-size: var(--type-caption);
    line-height: var(--leading-caption);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .prediction-run-state::before {
    font-size: var(--type-caption);
    line-height: 16px;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .subject-detail-modal-head .subject-detail-fields strong,
    .subject-detail-modal-head .screen-subject-field-grid strong
) {
    font-size: var(--type-caption);
    line-height: 16px;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .case-status-segments b,
    .subject-model-badges span,
    .subject-model-badges i,
    .filter-method-head em,
    .prediction-panel-title > span,
    .prediction-filter-copy > span i,
    .prediction-loading-steps span,
    .prediction-run-state,
    .prediction-result-legend span,
    .prediction-source-badge,
    .prediction-new-badge,
    .subject-card-tag-row > span,
    .subject-card-tag-row b,
    .subject-card-tag-row em,
    .subject-head-tag-chip,
    .case-overview-state,
    .case-overview-stage > span,
    .case-overview-stage em,
    .case-overview-list article > em
) {
    font-weight: var(--weight-semibold);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .subject-model-copy > strong {
    font-family: var(--font-display);
    font-size: var(--type-display-compact);
    font-weight: var(--weight-bold);
    line-height: var(--leading-display-compact);
    letter-spacing: -0.035em;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .case-overview-metrics span,
    .prediction-metric span
) {
    font-size: var(--type-label);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-label);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .prediction-subject-head {
    grid-template-columns: 30px minmax(0, 1fr) 66px;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .prediction-score {
    width: 64px;
    height: 64px;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) .prediction-score small {
    line-height: 14px;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .prediction-subject-fields > div,
    .prediction-relation-row
) {
    grid-template-columns: 64px minmax(0, 1fr);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .ml-algorithm-picker-group-head span,
    .ml-algorithm-category
) {
    font-size: var(--type-caption);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-caption);
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .ml-builder-panel-head h2,
    .ml-model-create-form-panel h2,
    .ml-model-detail-grid h2
) {
    font-family: var(--font-display);
    font-size: var(--type-section-title);
    font-weight: var(--weight-bold);
    line-height: var(--leading-section-title);
    letter-spacing: -0.02em;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .ml-algorithm-detail-hero h2,
    .ml-model-detail-title h2
) {
    font-family: var(--font-display);
    font-size: var(--type-page-title);
    font-weight: var(--weight-bold);
    line-height: var(--leading-page-title);
    letter-spacing: -0.03em;
}

body:not(.fundma-screen-body):not(.workflow-demo-body):not(.bride-statistics-screen-body) :is(
    .task-entry-side strong,
    .catalog-section-head > strong,
    .ml-result-summary strong,
    .subject-model-stats b
) {
    font-size: var(--type-page-title);
    font-weight: var(--weight-bold);
    line-height: 36px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.035em;
}

/* ==========================================================================
   数据管理与分层模板：个人表头记忆先审后用，管理员模板始终优先。
   ========================================================================== */

.case-data-workspace {
    width: 100%;
}

.case-data-workspace .case-data-panel {
    width: 100%;
    padding: 26px 30px;
}

.case-data-workspace .upload-name {
    max-width: 440px;
}

.status.pending_admin {
    background: #fff5df;
    color: #8a5700;
}

.status.superseded {
    background: #edf6ff;
    color: #075fad;
}

.case-overview-settings-row {
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid rgba(210, 210, 215, 0.72);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 12px 34px rgba(28, 36, 53, 0.05);
    backdrop-filter: blur(18px);
}

.case-overview-settings-view {
    display: grid;
    grid-template-columns: minmax(150px, 0.58fr) minmax(180px, 0.9fr) minmax(260px, 1.7fr) minmax(90px, 0.42fr) auto;
    align-items: center;
    min-height: 96px;
    padding: 16px 20px;
}

.case-overview-settings-title,
.case-overview-settings-item {
    min-width: 0;
}

.case-overview-settings-title {
    padding-right: 20px;
}

.case-overview-settings-title h2 {
    margin: 4px 0 0;
    font-family: var(--font-display);
    font-size: var(--type-card-title);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-card-title);
    letter-spacing: -0.02em;
}

.case-overview-settings-item {
    min-height: 50px;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 0 20px;
    border-left: 1px solid rgba(210, 210, 215, 0.64);
}

.case-overview-settings-item > span {
    color: var(--muted);
    font-size: var(--type-caption);
    font-weight: var(--weight-medium);
    line-height: var(--leading-caption);
}

.case-overview-settings-item > strong,
.case-overview-settings-item > p {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--text);
    font-size: var(--type-body);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-body);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-overview-settings-description > p {
    color: #515154;
    font-weight: var(--weight-regular);
}

.case-overview-settings-form {
    grid-template-columns: minmax(180px, 0.9fr) minmax(300px, 1.8fr) minmax(140px, 0.5fr) auto;
    align-items: end;
    gap: 14px;
    padding: 20px;
    border-bottom: 1px solid rgba(210, 210, 215, 0.58);
}

.case-overview-settings-row.is-editing .case-overview-settings-view {
    display: none;
}

.case-overview-settings-row.is-editing .case-overview-settings-form {
    display: grid !important;
}

.case-overview-settings-form label {
    min-width: 0;
}

.case-overview-settings-form textarea {
    min-height: 42px;
    resize: vertical;
}

.case-overview-settings-form .case-form-actions {
    flex-wrap: nowrap;
    padding-bottom: 1px;
}

.case-overview-danger {
    padding: 0 20px 13px;
}

.case-overview-danger > summary {
    width: max-content;
    margin-left: auto;
    color: var(--muted);
    font-size: var(--type-caption);
    font-weight: var(--weight-medium);
    line-height: var(--leading-caption);
    cursor: pointer;
    list-style-position: inside;
}

.case-overview-danger > div {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: var(--ui-radius-sm);
    background: #fff7f6;
}

.case-overview-danger p {
    margin: 0;
    color: #7d3530;
    font-size: var(--type-caption);
    line-height: var(--leading-caption);
}

/* 项目主页：数据来源、全部内容与流程成果总览 */
.case-overview-page,
.plugin-management-page {
    display: grid;
    gap: 22px;
}

.case-overview-primary-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.case-create-welcome {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    max-width: 920px;
    margin-inline: auto;
    padding: 30px;
    border-radius: 26px;
    background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(244,248,255,.94));
}

.case-create-welcome h2 {
    margin: 0 0 7px;
    font-size: 25px;
    letter-spacing: -0.025em;
}

.case-create-welcome p {
    margin: 0;
    color: #6e6e73;
    line-height: 1.6;
}

.admin-log-filters {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-log-filters label {
    min-width: 210px;
    display: grid;
    gap: 6px;
}

.admin-error-log-list {
    display: grid;
    gap: 10px;
}

.admin-error-log-list article {
    padding: 15px 16px;
    border: 1px solid rgba(29, 29, 31, 0.09);
    border-radius: 15px;
    background: #fbfbfd;
}

.admin-error-log-list header,
.admin-error-log-list footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.admin-error-log-list header strong {
    flex: 1;
    min-width: 220px;
}

.admin-error-log-list time,
.admin-error-log-list footer {
    color: #86868b;
    font-size: var(--type-caption);
}

.admin-error-log-list p {
    margin: 10px 0;
    color: #424245;
    line-height: 1.55;
}

.case-overview-binding {
    background:
        radial-gradient(circle at 94% 0, rgba(10, 132, 255, 0.13), transparent 34%),
        rgba(255, 255, 255, 0.9);
}

.case-overview-binding-card {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: 26px;
    align-items: center;
    padding: 18px;
    border: 1px solid rgba(0, 113, 227, 0.14);
    border-radius: 20px;
    background: rgba(247, 250, 255, 0.82);
}

.case-overview-binding-qr {
    position: relative;
    display: grid;
    place-items: center;
    padding: 14px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(28, 54, 92, 0.1);
}

.case-overview-binding-qr img {
    width: min(100%, 270px);
    aspect-ratio: 1;
    display: block;
}

.case-overview-binding-qr span {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(29, 29, 31, 0.78);
    color: #fff;
    font-size: var(--type-caption);
}

.case-overview-binding-card h3 {
    margin: 10px 0 8px;
    font-size: 25px;
    letter-spacing: -0.025em;
}

.case-overview-binding-card p,
.case-overview-binding-card ol {
    color: #515154;
    font-size: var(--type-body);
    line-height: 1.65;
}

.case-overview-binding-card ol {
    padding-left: 20px;
}

.case-overview-data-workspace {
    min-width: 0;
    scroll-margin-top: 18px;
}

.data-workspace-head.is-embedded {
    padding: 22px;
    border: 1px solid rgba(210, 210, 215, 0.7);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.86);
}

.data-workspace-head.is-embedded h2 {
    margin: 4px 0 0;
    font-size: 26px;
    letter-spacing: -0.025em;
}

.case-overview-source-grid,
.case-overview-resource-columns,
.plugin-management-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.case-overview-source-card,
.case-overview-resource-columns > section,
.plugin-management-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(29, 29, 31, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
}

.case-overview-source-card > header,
.case-overview-resource-columns > section > header,
.case-overview-data-preview > header,
.plugin-management-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.case-overview-source-card > header strong,
.case-overview-resource-columns > section > header strong {
    font-size: var(--type-navigation);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-navigation);
}

.case-overview-source-card > header span,
.case-overview-resource-columns > section > header > span,
.case-overview-resource-columns > section > header a,
.case-overview-resource-columns > section > header button {
    border: 0;
    background: transparent;
    color: #0068d1;
    font-size: var(--type-label);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-label);
    cursor: pointer;
}

.case-overview-source-card > a,
.case-overview-resource-columns > section > a,
.case-overview-workflow-list > a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 9px 7px;
    border-top: 1px solid rgba(29, 29, 31, 0.07);
    color: #1d1d1f;
}

.case-overview-source-card > a:hover,
.case-overview-resource-columns > section > a:hover,
.case-overview-workflow-list > a:hover {
    border-radius: 10px;
    background: rgba(0, 113, 227, 0.06);
}

.case-overview-source-card > a > div,
.case-overview-resource-columns > section > a > div,
.case-overview-workflow-list > a > div {
    flex: 1;
    min-width: 0;
}

.case-overview-source-card a strong,
.case-overview-source-card a small,
.case-overview-resource-columns a strong,
.case-overview-resource-columns a small,
.case-overview-workflow-list a strong,
.case-overview-workflow-list a small,
.case-overview-source-origin {
    display: block;
}

.case-overview-source-card a strong,
.case-overview-resource-columns a strong,
.case-overview-workflow-list a strong {
    overflow: hidden;
    font-size: var(--type-body);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-body);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-overview-source-card a small,
.case-overview-resource-columns a small,
.case-overview-workflow-list a small,
.case-overview-source-origin,
.case-overview-source-card > p,
.case-overview-resource-columns > section > p {
    color: #6e6e73;
    font-size: var(--type-caption);
    line-height: var(--leading-caption);
}

.case-overview-source-card a > em,
.case-overview-workflow-list a > em {
    flex: 0 0 auto;
    color: #6e6e73;
    font-size: var(--type-label);
    font-style: normal;
    font-variant-numeric: tabular-nums;
}

.case-overview-data-preview {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(29, 29, 31, 0.1);
    border-radius: 15px;
    background: #fff;
}

.case-overview-data-preview header strong,
.case-overview-data-preview header small {
    display: block;
}

.case-overview-data-preview header small {
    color: #6e6e73;
    font-size: var(--type-caption);
    line-height: var(--leading-caption);
}

.case-overview-data-preview > div {
    overflow: auto;
}

.case-overview-data-preview table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--type-label);
    line-height: var(--leading-label);
}

.case-overview-data-preview th,
.case-overview-data-preview td {
    max-width: 260px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(29, 29, 31, 0.08);
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.case-overview-workflow-list {
    display: grid;
}

.plugin-management-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 26px;
    border-radius: 22px;
    background: linear-gradient(145deg, #fff, #f5f5f7);
}

.plugin-management-hero h1 {
    margin: 3px 0 7px;
    font-size: var(--type-page-title);
    font-weight: var(--weight-bold);
    line-height: var(--leading-page-title);
}

.plugin-management-hero p,
.plugin-management-card > p {
    color: #6e6e73;
    font-size: var(--type-body-large);
    line-height: var(--leading-body-large);
}

.plugin-management-hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 9px;
}

.plugin-management-hero-actions > span {
    width: 100%;
    color: #6e6e73;
    font-size: var(--type-caption);
    text-align: right;
}

.plugin-management-guide ol {
    display: grid;
    gap: 8px;
    margin: 12px 0 0;
    padding-left: 22px;
    color: #515154;
    line-height: 1.65;
}

.local-model-plugin-settings {
    display: grid;
    gap: 18px;
    padding-top: 4px;
    scroll-margin-top: 20px;
}

.plugin-management-card header h2 {
    margin: 5px 0 0;
    font-size: var(--type-card-title);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-card-title);
}

.plugin-management-status {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(52, 199, 89, 0.11);
    color: #248a3d;
    font-size: var(--type-caption);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-caption);
}

.plugin-management-status.compatibility {
    background: rgba(142, 142, 147, 0.12);
    color: #6e6e73;
}

.plugin-management-status.disabled {
    background: rgba(255, 59, 48, 0.1);
    color: #c72d25;
}

.plugin-management-control {
    display: flex;
    align-items: center;
    gap: 11px;
}

.plugin-management-control form {
    margin: 0;
}

.plugin-switch {
    position: relative;
    width: 44px;
    height: 26px;
    flex: 0 0 auto;
    padding: 2px;
    border: 0;
    border-radius: 999px;
    background: #d1d1d6;
    box-shadow: inset 0 0 0 1px rgba(29, 29, 31, 0.05);
    cursor: pointer;
    transition: background 160ms ease, box-shadow 160ms ease;
}

.plugin-switch span {
    width: 22px;
    height: 22px;
    display: block;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(29, 29, 31, 0.24);
    transition: transform 160ms ease;
}

.plugin-switch.is-on {
    background: #34c759;
}

.plugin-switch.is-on span {
    transform: translateX(18px);
}

.plugin-switch:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.28);
    outline-offset: 3px;
}

.plugin-switch-readonly {
    color: #86868b;
    font-size: var(--type-caption);
}

.plugin-management-card dl {
    display: grid;
    gap: 7px;
    margin: 14px 0;
}

.plugin-management-card dl > div {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    font-size: var(--type-label);
    line-height: var(--leading-label);
}

.plugin-management-card dt {
    color: #86868b;
}

.plugin-management-card dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.plugin-management-prompts {
    padding: 12px;
    border-radius: 12px;
    background: rgba(0, 113, 227, 0.055);
}

.plugin-management-prompts > strong {
    font-size: var(--type-label);
    line-height: var(--leading-label);
}

.plugin-management-prompts ul {
    display: grid;
    gap: 5px;
    margin: 8px 0 0;
    padding-left: 20px;
    color: #515154;
    font-size: var(--type-label);
    line-height: var(--leading-label);
}

.plugin-management-entry {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    margin-top: 12px;
    padding: 9px 14px;
    border-radius: 10px;
    background: #0071e3;
    color: #fff;
    font-size: var(--type-body);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-body);
    text-decoration: none;
}

.plugin-management-entry:hover {
    background: #0068d1;
}

.plugin-management-entry.is-secondary {
    margin-left: 6px;
    background: rgba(0, 113, 227, 0.09);
    color: #0068d1;
}

.plugin-management-entry.is-secondary:hover {
    background: rgba(0, 113, 227, 0.15);
}

@media (max-width: 980px) {
    .case-overview-source-grid,
    .case-overview-resource-columns,
    .plugin-management-grid {
        grid-template-columns: 1fr;
    }

    .case-overview-binding-card {
        grid-template-columns: 1fr;
    }

    .plugin-management-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .plugin-management-hero-actions {
        justify-content: flex-start;
    }

    .plugin-management-hero-actions > span {
        text-align: left;
    }

    .case-overview-binding-qr {
        width: min(100%, 340px);
        justify-self: center;
    }
}

.identity-requirement {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    padding: 18px 20px;
    border: 1px solid rgba(0, 113, 227, 0.18);
    border-radius: var(--ui-radius-md);
    background:
        radial-gradient(circle at 100% 0, rgba(100, 210, 255, 0.16), transparent 34%),
        linear-gradient(145deg, #fff, #f4f9ff);
    box-shadow: var(--ui-shadow-sm);
}

.identity-requirement.compact {
    padding-top: 14px;
    padding-bottom: 14px;
}

.identity-requirement-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(145deg, #0a84ff, #5e5ce6);
    color: #fff;
    box-shadow: 0 10px 24px rgba(58, 89, 195, 0.2);
}

.identity-requirement-icon svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.identity-requirement > div {
    min-width: 0;
}

.identity-requirement strong {
    display: block;
    font-size: var(--type-navigation);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-navigation);
}

.identity-requirement p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: var(--type-body);
    line-height: var(--leading-body);
}

.identity-selection-count {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.09);
    color: #0064c9;
    font-size: var(--type-label);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-label);
    white-space: nowrap;
}

.identity-selection-count b {
    font-size: var(--type-navigation);
    font-variant-numeric: tabular-nums;
}

.schema-mapping-panel {
    padding: 24px;
}

.schema-mapping-panel .mapping-toolbar {
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--ui-separator);
}

.schema-mapping-panel .mapping-toolbar > label {
    flex: 0 1 240px;
}

.mapping-toolbar-copy {
    min-width: 210px;
    display: grid;
    gap: 2px;
    margin-left: auto;
    text-align: right;
}

.mapping-toolbar-copy strong {
    font-size: var(--type-label);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-label);
}

.mapping-toolbar-copy span {
    color: var(--muted);
    font-size: var(--type-caption);
    line-height: var(--leading-caption);
}

.schema-mapping-panel .mapping-table th:nth-child(3),
.schema-mapping-panel .mapping-table td:nth-child(3) {
    min-width: 250px;
}

.identity-check-line {
    min-height: 38px;
}

.identity-check-line input {
    flex: 0 0 auto;
}

.identity-check-line span {
    font-size: var(--type-label);
    line-height: var(--leading-label);
}

.mapping-table tr.is-identity-eligible .identity-check-line span {
    color: #075fad;
    font-weight: var(--weight-semibold);
}

.mapping-table tr:not(.is-identity-eligible) .identity-check-line {
    opacity: 0.64;
}

.schema-mapping-panel .button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

.template-review-panel,
.personal-template-panel {
    margin-bottom: 22px;
    padding: 24px;
}

.template-review-panel .panel-head,
.personal-template-panel .panel-head {
    align-items: flex-end;
    margin-bottom: 16px;
}

.template-review-panel .panel-head h2,
.personal-template-panel .panel-head h2 {
    margin: 4px 0 0;
    font-family: var(--font-display);
    font-size: var(--type-card-title);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-card-title);
    letter-spacing: -0.02em;
}

.template-review-count {
    padding: 5px 9px;
    border-radius: 999px;
    background: #fff3d9;
    color: #865500;
    font-size: var(--type-label);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-label);
}

.template-review-list,
.personal-template-list {
    display: grid;
    gap: 10px;
}

.template-review-card {
    overflow: hidden;
    border: 1px solid var(--ui-separator);
    border-radius: var(--ui-radius-sm);
    background: #fbfbfd;
}

.template-review-card > summary {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}

.template-review-card > summary::-webkit-details-marker {
    display: none;
}

.template-review-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, #eaf3ff, #eeeaff);
    color: #075fad;
    font-size: var(--type-navigation);
    font-weight: var(--weight-semibold);
}

.template-review-card > summary > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.template-review-card > summary strong,
.template-review-card > summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-review-card > summary strong {
    font-size: var(--type-body-large);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-body-large);
}

.template-review-card > summary span,
.template-review-card > summary em {
    color: var(--muted);
    font-size: var(--type-caption);
    font-style: normal;
    line-height: var(--leading-caption);
}

.template-review-card > summary em {
    padding: 5px 8px;
    border-radius: 999px;
    background: #edf6ff;
    color: #075fad;
    font-weight: var(--weight-semibold);
    white-space: nowrap;
}

.template-review-body {
    padding: 0 16px 16px;
    border-top: 1px solid var(--ui-separator);
}

.template-review-mapping {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 16px 0;
}

.template-review-mapping > div {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid rgba(210, 210, 215, 0.66);
    border-radius: 10px;
    background: #fff;
}

.template-review-mapping > div.is-identity {
    border-color: rgba(0, 113, 227, 0.22);
    background: #f5faff;
}

.template-review-mapping span,
.template-review-mapping strong {
    overflow: hidden;
    font-size: var(--type-label);
    line-height: var(--leading-label);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-review-mapping span {
    color: var(--muted);
}

.template-review-mapping i {
    color: #a1a1a6;
    font-size: var(--type-caption);
    font-style: normal;
}

.template-review-mapping em {
    padding: 3px 6px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.1);
    color: #075fad;
    font-size: var(--type-caption);
    font-style: normal;
    font-weight: var(--weight-semibold);
    line-height: var(--leading-caption);
    white-space: nowrap;
}

.template-review-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--ui-separator);
}

.template-review-actions p {
    margin: 0;
    color: var(--muted);
    font-size: var(--type-body);
    line-height: var(--leading-body);
}

.template-review-actions form {
    flex: 0 0 auto;
    margin: 0;
}

.personal-template-list article {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.personal-template-list article + article {
    border-top: 1px solid var(--ui-separator);
}

.personal-template-list article > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.personal-template-list strong,
.personal-template-list span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.personal-template-list strong {
    font-size: var(--type-body);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-body);
}

.personal-template-list span {
    color: var(--muted);
    font-size: var(--type-caption);
    line-height: var(--leading-caption);
}

@media (max-width: 1040px) {
    .case-overview-settings-view {
        grid-template-columns: minmax(150px, 0.7fr) minmax(180px, 1fr) minmax(240px, 1.5fr) auto;
    }

    .case-overview-settings-view > .case-overview-settings-item:nth-of-type(3) {
        display: none;
    }

    .case-overview-settings-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .case-overview-settings-form .case-form-actions {
        justify-content: flex-end;
    }

    .schema-mapping-panel .mapping-toolbar {
        align-items: flex-end;
        flex-wrap: wrap;
    }

    .mapping-toolbar-copy {
        order: 3;
        width: 100%;
        margin-left: 0;
        padding-top: 12px;
        border-top: 1px solid var(--ui-separator);
        text-align: left;
    }
}

@media (max-width: 760px) {
    .case-data-workspace .case-data-panel,
    .schema-mapping-panel,
    .template-review-panel,
    .personal-template-panel {
        padding: 18px;
    }

    .case-overview-settings-view {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
    }

    .case-overview-settings-title {
        padding-right: 0;
    }

    .case-overview-settings-view > .case-overview-settings-item {
        display: none;
    }

    .case-overview-settings-form {
        grid-template-columns: 1fr;
    }

    .case-overview-settings-form .case-form-actions,
    .case-overview-danger > div,
    .template-review-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .case-overview-danger > div {
        justify-content: flex-start;
    }

    .identity-requirement {
        grid-template-columns: 42px minmax(0, 1fr);
        padding: 16px;
    }

    .identity-requirement-icon {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .identity-selection-count {
        grid-column: 2;
        justify-self: start;
    }

    .template-review-mapping {
        grid-template-columns: 1fr;
    }

    .template-review-actions form,
    .template-review-actions .button {
        width: 100%;
    }

    .personal-template-list article {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .personal-template-list article > .button {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

/* 数字主体方案：项目内方案卡片与 1/4 + 3/4 构成编辑器 */
.subject-scheme-page,
.subject-scheme-editor-page {
    width: min(1680px, calc(100vw - 48px));
    margin: 0 auto;
}

.subject-scheme-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.subject-scheme-metrics article {
    padding: 18px 20px;
    border: 1px solid rgba(29, 29, 31, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 16px 40px rgba(30, 44, 70, 0.06);
}

.subject-scheme-metrics span,
.subject-scheme-metrics small {
    display: block;
    font-size: var(--font-meta-size, 13px);
    line-height: var(--font-meta-line, 19px);
    color: var(--text-secondary);
}

.subject-scheme-metrics strong {
    display: block;
    margin: 5px 0 2px;
    font-size: 32px;
    line-height: 38px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.subject-scheme-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.subject-scheme-card {
    position: relative;
    display: flex;
    min-height: 430px;
    flex-direction: column;
    overflow: hidden;
    padding: 22px;
    border: 1px solid rgba(29, 29, 31, 0.09);
    border-radius: 26px;
    background: linear-gradient(160deg, rgba(255,255,255,.96), rgba(244,247,252,.9));
    box-shadow: 0 22px 60px rgba(35, 47, 72, 0.08);
}

.subject-scheme-card.is-active { border-color: rgba(0, 113, 227, 0.42); box-shadow: 0 24px 70px rgba(0, 113, 227, 0.14); }
.subject-scheme-card.accent-purple.is-active { border-color: rgba(175, 82, 222, 0.45); box-shadow: 0 24px 70px rgba(175, 82, 222, 0.13); }

.subject-scheme-card-topline,
.subject-scheme-card-stats,
.subject-scheme-card-open {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.subject-scheme-card-topline span {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.1);
    color: #0066cc;
    font-size: 12px;
    line-height: 18px;
    font-weight: 600;
}

.subject-scheme-card-topline em { color: var(--text-secondary); font-size: 12px; font-style: normal; }
.subject-scheme-card-visual { position: relative; height: 126px; margin: 14px -4px 6px; }
.scheme-orbit { position: absolute; inset: 50% auto auto 50%; border: 1px solid rgba(0,113,227,.18); border-radius: 50%; transform: translate(-50%,-50%); }
.scheme-orbit.orbit-one { width: 126px; height: 72px; }
.scheme-orbit.orbit-two { width: 210px; height: 105px; }
.scheme-node { position: absolute; width: 18px; height: 18px; border: 4px solid #fff; border-radius: 50%; background: #0071e3; box-shadow: 0 5px 14px rgba(0,113,227,.28); }
.scheme-node.node-center { left: calc(50% - 9px); top: calc(50% - 9px); width: 26px; height: 26px; }
.scheme-node.node-left { left: 22%; top: 58%; }
.scheme-node.node-right { right: 20%; top: 28%; }
.accent-purple .scheme-node { background: #af52de; }
.accent-gray .scheme-node { background: #8e8e93; }
.subject-scheme-card-copy small { color: #607080; font-size: 12px; line-height: 18px; font-weight: 600; letter-spacing: .04em; }
.subject-scheme-card-copy h2 { margin: 7px 0 8px; font-size: 20px; line-height: 26px; font-weight: 600; }
.subject-scheme-card-copy p { min-height: 66px; margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 22px; }
.subject-scheme-card-stats { gap: 8px; margin: 18px 0; }
.subject-scheme-card-stats span { flex: 1; padding: 10px; border-radius: 14px; background: rgba(118,118,128,.07); text-align: center; }
.subject-scheme-card-stats b,.subject-scheme-card-stats small { display: block; }
.subject-scheme-card-stats b { font-size: 17px; line-height: 24px; font-variant-numeric: tabular-nums; }
.subject-scheme-card-stats small { color: var(--text-secondary); font-size: 12px; line-height: 18px; }
.subject-scheme-card-open { margin-top: auto; padding-top: 15px; border-top: 1px solid rgba(29,29,31,.08); color: #0066cc; font-size: 14px; line-height: 20px; font-weight: 600; text-decoration: none; }
.subject-scheme-card-open svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.subject-scheme-create-dialog { width: min(720px, calc(100vw - 32px)); }
.subject-scheme-template-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 20px 0; }
.subject-scheme-template-options label { cursor: pointer; }
.subject-scheme-template-options input { position: absolute; opacity: 0; }
.subject-scheme-template-options span { display: block; height: 100%; padding: 16px; border: 1px solid var(--ui-separator); border-radius: 16px; background: #fff; }
.subject-scheme-template-options input:checked + span { border-color: #0071e3; background: rgba(0,113,227,.06); box-shadow: 0 0 0 3px rgba(0,113,227,.1); }
.subject-scheme-template-options strong,.subject-scheme-template-options small { display: block; }
.subject-scheme-template-options small { margin-top: 5px; color: var(--text-secondary); font-size: 12px; line-height: 18px; }
.subject-scheme-create-field { display: block; margin-top: 14px; }
.subject-scheme-create-field span { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; }
.subject-scheme-create-field input,.subject-scheme-create-field textarea { width: 100%; }

.subject-scheme-editor-layout { display: grid; grid-template-columns: minmax(270px, 1fr) minmax(0, 3fr); gap: 18px; align-items: start; }
.subject-source-browser { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow: auto; padding: 20px; }
.subject-source-browser-head h2 { margin: 5px 0 6px; font-size: 20px; line-height: 26px; }
.subject-source-browser-head p { margin: 0 0 16px; color: var(--text-secondary); font-size: 13px; line-height: 19px; }
.subject-source-item { margin-bottom: 10px; border: 1px solid var(--ui-separator); border-radius: 16px; background: #fff; }
.subject-source-item summary { display: grid; grid-template-columns: auto 1fr; gap: 3px 9px; padding: 13px; cursor: pointer; list-style: none; }
.subject-source-item summary::-webkit-details-marker { display: none; }
.subject-source-type { grid-row: 1 / span 2; align-self: center; padding: 6px 8px; border-radius: 9px; background: rgba(0,113,227,.08); color: #0066cc; font-size: 12px; font-weight: 600; }
.subject-source-item summary strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 19px; }
.subject-source-item summary small { color: var(--text-secondary); font-size: 12px; line-height: 18px; }
.subject-source-meta { display: grid; grid-template-columns: 58px 1fr; gap: 5px 8px; padding: 0 13px 12px; color: var(--text-secondary); font-size: 12px; line-height: 18px; }
.subject-source-meta strong { min-width: 0; overflow-wrap: anywhere; color: var(--text-primary); font-weight: 500; }
.subject-source-headers { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 13px; border-top: 1px solid var(--ui-separator); }
.subject-source-headers button { display: inline-flex; gap: 5px; align-items: center; padding: 6px 8px; border: 0; border-radius: 9px; background: #f2f2f7; color: #343438; font: inherit; font-size: 12px; line-height: 18px; cursor: pointer; }
.subject-source-headers button:hover { background: rgba(0,113,227,.1); color: #0066cc; }
.subject-source-headers button > span { display: grid; gap: 1px; text-align: left; }
.subject-source-headers button small { color: var(--text-secondary); font-size: 12px; font-weight: 500; line-height: 18px; }
.subject-source-headers i { font-style: normal; font-weight: 700; }
.subject-composition-workbench { display: grid; gap: 18px; min-width: 0; }
.subject-composition-canvas { padding: 0; overflow: hidden; }
.subject-composition-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--ui-separator); }
.subject-composition-toolbar h2 { margin: 3px 0 0; font-size: 20px; line-height: 26px; }
.subject-composition-toolbar > div:last-child { display: flex; gap: 8px; }
.subject-composition-stage { position: relative; height: 560px; overflow: hidden; background-color: #f7f9fc; background-image: radial-gradient(circle, rgba(86,105,133,.18) 1px, transparent 1px); background-size: 22px 22px; }
.subject-composition-stage > svg,.subject-composition-stage > [data-subject-composition-nodes] { position: absolute; inset: 0; width: 100%; height: 100%; }
.subject-composition-stage > svg { z-index: 1; overflow: visible; }
.subject-composition-stage > [data-subject-composition-nodes] { z-index: 2; pointer-events: none; }
.subject-composition-edge line { vector-effect: non-scaling-stroke; stroke: rgba(88,86,214,.42); stroke-width: 2; cursor: pointer; pointer-events: stroke; }
.subject-composition-edge.is-strong line { stroke: rgba(0,113,227,.72); stroke-width: 3; }
.subject-composition-edge.is-weak line { stroke-dasharray: 5 4; }
.subject-composition-edge text { paint-order: stroke; stroke: #f7f9fc; stroke-width: 5px; fill: #566579; font-size: 12px; font-weight: 500; text-anchor: middle; pointer-events: none; }
.subject-composition-edge marker path { fill: rgba(88,86,214,.62); }
.subject-connection-preview { vector-effect: non-scaling-stroke; stroke: #0071e3; stroke-width: 3; stroke-dasharray: 7 5; pointer-events: none; }
.subject-composition-node { position: absolute; z-index: 2; width: 154px; min-height: 72px; padding: 11px 12px; border: 1px solid rgba(29,29,31,.12); border-radius: 16px; transform: translate(-50%,-50%); background: rgba(255,255,255,.96); box-shadow: 0 12px 28px rgba(31,49,75,.12); text-align: left; cursor: grab; touch-action: none; pointer-events: auto; outline: none; }
.subject-composition-node.is-dragging { cursor: grabbing; box-shadow: 0 18px 42px rgba(0,113,227,.22); }
.subject-composition-node.is-selected { border-color: #0071e3; box-shadow: 0 0 0 3px rgba(0,113,227,.14),0 16px 34px rgba(31,49,75,.16); }
.subject-composition-node.is-connect-target { border-color: #34c759; box-shadow: 0 0 0 4px rgba(52,199,89,.18),0 16px 34px rgba(31,49,75,.16); }
.subject-composition-node .subject-node-kind,.subject-composition-node strong,.subject-composition-node small { display: block; }
.subject-composition-node .subject-node-kind { color: #617186; font-size: 12px; line-height: 18px; font-weight: 600; text-transform: uppercase; }
.subject-composition-node strong { margin-top: 3px; font-size: 13px; line-height: 19px; font-weight: 600; }
.subject-composition-node small { margin-top: 3px; overflow: hidden; color: var(--text-secondary); font-size: 12px; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
.subject-node-connector { position: absolute; z-index: 4; width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; background: #0071e3; box-shadow: 0 2px 8px rgba(0,113,227,.35); opacity: 0; pointer-events: none; transition: opacity .15s ease,transform .15s ease; }
.subject-composition-node.is-selected .subject-node-connector { opacity: 1; pointer-events: auto; }
.subject-node-connector:hover { transform: scale(1.25); }
.subject-node-connector.side-top { top: -8px; left: calc(50% - 7px); }
.subject-node-connector.side-right { top: calc(50% - 7px); right: -8px; }
.subject-node-connector.side-bottom { bottom: -8px; left: calc(50% - 7px); }
.subject-node-connector.side-left { top: calc(50% - 7px); left: -8px; }
.subject-composition-node.kind-entity { border-color: rgba(0,113,227,.55); background: linear-gradient(145deg,#fff,rgba(0,113,227,.08)); }
.subject-composition-node.kind-strong { border-left: 5px solid #0071e3; }
.subject-composition-node.kind-weak { border-left: 5px solid #ff9f0a; }
.subject-composition-node.kind-table { border-left: 5px solid #af52de; }
.subject-composition-hint { position: absolute; right: 16px; bottom: 13px; z-index: 3; margin: 0; padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,.86); color: var(--text-secondary); font-size: 12px; line-height: 18px; backdrop-filter: blur(10px); }
.subject-direct-rule-note { display: flex; align-items: center; gap: 14px; padding: 17px 20px; border-color: rgba(0,113,227,.16); background: rgba(0,113,227,.055); }
.subject-direct-rule-note strong { flex: 0 0 auto; color: #0066cc; font-size: 14px; font-weight: 600; line-height: 22px; }
.subject-direct-rule-note span { color: var(--text-secondary); font-size: 13px; font-weight: 400; line-height: 19px; }
.subject-scheme-rule-panel,.subject-scheme-version-panel { padding: 20px; }
.subject-scheme-rule-list { display: grid; gap: 9px; }
.subject-scheme-rule-list article { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.15fr auto auto; gap: 8px; align-items: end; padding: 12px; border: 1px solid var(--ui-separator); border-radius: 15px; background: #fff; }
.subject-scheme-rule-list label span { display: block; margin-bottom: 5px; color: var(--text-secondary); font-size: 12px; line-height: 18px; }
.subject-scheme-rule-list input,.subject-scheme-rule-list select { width: 100%; min-height: 38px; font-size: 12px; }
.subject-scheme-rule-list .subject-rule-enabled { align-self: center; display: flex; gap: 6px; align-items: center; padding-top: 16px; }
.subject-scheme-rule-list .subject-rule-enabled input { width: 16px; min-height: 16px; }
.subject-scheme-rule-list article > button { min-height: 38px; border: 0; background: transparent; color: #ff3b30; cursor: pointer; }
.subject-rule-empty { padding: 20px; border: 1px dashed var(--ui-separator); border-radius: 15px; color: var(--text-secondary); text-align: center; }
.subject-scheme-version-list { display: grid; gap: 8px; }
.subject-scheme-version-list article { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: 14px; background: #f7f7fa; }
.subject-scheme-version-list article div { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.subject-scheme-version-list article strong { grid-row: 1 / span 2; align-self: center; color: #0066cc; }
.subject-scheme-version-list article span { font-size: 13px; line-height: 19px; }
.subject-scheme-version-list article small { color: var(--text-secondary); font-size: 12px; line-height: 18px; }

@media (max-width: 1180px) {
    .subject-scheme-card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .subject-scheme-editor-layout { grid-template-columns: 1fr; }
    .subject-source-browser { position: static; max-height: none; }
    .subject-scheme-rule-list article { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
    .subject-scheme-page,.subject-scheme-editor-page { width: min(100% - 24px, 1680px); }
    .subject-scheme-metrics,.subject-scheme-card-grid,.subject-scheme-template-options { grid-template-columns: 1fr; }
    .subject-scheme-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .subject-composition-stage { height: 520px; }
    .subject-composition-node { width: 126px; }
    .subject-scheme-rule-list article { grid-template-columns: 1fr; }
}

.math-algorithm-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 20px;
}

.math-algorithm-strip a {
    position: relative;
    display: flex;
    min-height: 132px;
    flex-direction: column;
    padding: 16px 18px;
    border: 1px solid rgba(29,29,31,.09);
    border-radius: 19px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 14px 34px rgba(33,46,70,.06);
    color: var(--text-primary);
    text-decoration: none;
}

.math-algorithm-strip a:hover { transform: translateY(-2px); border-color: rgba(0,113,227,.3); box-shadow: 0 18px 42px rgba(0,113,227,.1); }
.math-algorithm-strip span { color: #617186; font-size: 12px; line-height: 18px; font-weight: 600; }
.math-algorithm-strip strong { margin: 7px 0 5px; font-size: 17px; line-height: 24px; font-weight: 600; }
.math-algorithm-strip small { color: var(--text-secondary); font-size: 12px; line-height: 18px; }
.math-algorithm-strip i { position: absolute; right: 14px; top: 14px; padding: 3px 7px; border-radius: 999px; background: rgba(48,209,88,.1); color: #198a39; font-size: 12px; line-height: 18px; font-style: normal; font-weight: 600; }

.custom-screen-page {
    overflow-x: auto;
}

.custom-screen-page .custom-screen-grid {
    min-width: 960px;
    grid-template-columns: repeat(12, minmax(64px, 1fr));
}
.prediction-threshold-control { display: grid; gap: 10px; width: 100%; margin-bottom: 10px; padding: 12px; border-radius: 14px; background: rgba(118,118,128,.07); }
.prediction-threshold-control label { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; align-items: center; font-size: 12px; line-height: 18px; }
.prediction-threshold-control input[type="range"] { min-width: 0; }
.prediction-threshold-control b { min-width: 28px; font-variant-numeric: tabular-nums; color: #0066cc; }
.prediction-threshold-control select { grid-column: 2 / 4; min-height: 36px; font-size: 12px; }
.math-run-history { margin-top: 20px; padding: 20px; }
.math-run-history-list { display: grid; gap: 8px; }
.math-run-history-list article { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 14px; border-radius: 14px; background: #f7f7fa; }
.math-run-history-list article div { display: grid; gap: 2px; }
.math-run-history-list article strong { font-size: 14px; line-height: 22px; }
.math-run-history-list article span,.math-run-history-list article small { color: var(--text-secondary); font-size: 12px; line-height: 18px; }
.math-run-history-list article > b { min-width: 74px; color: #0066cc; font-size: 24px; line-height: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.math-run-history-list article > b small { display: block; font-weight: 500; }

@media (max-width: 980px) {
    .math-algorithm-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 600px) {
    .math-algorithm-strip { grid-template-columns: 1fr; }
}

/* 数据源与结构二维码 */
.mysql-source-dialog {
    width: min(720px, calc(100vw - 32px));
    max-height: min(820px, calc(100vh - 32px));
    padding: 0;
    overflow: auto;
    border: 1px solid rgba(210, 210, 215, .82);
    border-radius: 24px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 28px 80px rgba(20, 29, 45, .24);
    color: var(--text);
}

.mysql-source-dialog::backdrop {
    background: rgba(18, 24, 36, .34);
    backdrop-filter: blur(8px);
}

.mysql-source-dialog > form { padding: 26px; }
.mysql-source-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.mysql-source-dialog header h2 { margin: 3px 0 4px; font-size: var(--type-section-title); line-height: var(--leading-section-title); font-weight: var(--weight-bold); }
.mysql-source-dialog header p { margin: 0; color: var(--muted); font-size: var(--type-body); line-height: var(--leading-body); }
.mysql-dialog-close { width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 50%; background: rgba(118,118,128,.1); color: var(--muted); font-size: var(--type-card-title); line-height: 1; cursor: pointer; }
.mysql-source-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.mysql-source-form-grid label { display: grid; gap: 7px; }
.mysql-source-form-grid label > span { color: var(--text); font-size: var(--type-label); line-height: var(--leading-label); font-weight: var(--weight-semibold); }
.mysql-source-form-grid input,.mysql-source-form-grid select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid rgba(210,210,215,.9); border-radius: 12px; background: #fff; color: var(--text); font-size: var(--type-body); line-height: var(--leading-body); }
.mysql-source-wide { grid-column: 1 / -1; }
.mysql-source-security-note { display: flex; gap: 10px; margin-top: 18px; padding: 13px 15px; border-radius: 14px; background: rgba(0,113,227,.07); font-size: var(--type-label); line-height: var(--leading-label); }
.mysql-source-security-note strong { flex: 0 0 auto; color: #0066cc; font-weight: var(--weight-semibold); }
.mysql-source-security-note span { color: var(--muted); }
.mysql-source-dialog footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.mysql-source-panel { margin-bottom: 24px; padding: 24px; }
.mysql-source-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.mysql-source-card { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 16px; border: 1px solid rgba(210,210,215,.72); border-radius: 18px; background: rgba(248,249,251,.8); }
.mysql-source-card.has-error { border-color: rgba(255,59,48,.28); background: rgba(255,59,48,.04); }
.mysql-source-card-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: rgba(0,113,227,.1); color: #0071e3; }
.mysql-source-card-icon svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.mysql-source-card-copy { min-width: 0; }
.mysql-source-card-copy h3 { margin: 5px 0 2px; font-size: var(--type-navigation); line-height: var(--leading-navigation); font-weight: var(--weight-semibold); }
.mysql-source-card-copy p,.mysql-source-card-copy small,.mysql-source-card-copy em { display: block; overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
.mysql-source-card-copy p { color: var(--text); font-size: var(--type-body); line-height: var(--leading-body); }
.mysql-source-card-copy small { color: var(--muted); font-size: var(--type-caption); line-height: var(--leading-caption); }
.mysql-source-card-copy em { margin-top: 4px; color: #d12b21; font-size: var(--type-caption); line-height: var(--leading-caption); font-style: normal; }

.schema-qr-page .shell { width: min(1180px, calc(100% - 40px)); }
.schema-qr-layout { display: grid; grid-template-columns: minmax(0,420px) minmax(0,1fr); gap: 22px; align-items: start; }
.schema-qr-card { position: sticky; top: 24px; overflow: hidden; }
.schema-qr-image-wrap { display: grid; place-items: center; padding: 24px; background: #fff; }
.schema-qr-image-wrap img { width: min(100%, 360px); height: auto; border-radius: 12px; image-rendering: pixelated; }
.schema-qr-card-copy { padding: 0 24px 24px; }
.schema-qr-card-copy h2 { margin: 8px 0 5px; font-size: var(--type-card-title); line-height: var(--leading-card-title); font-weight: var(--weight-semibold); }
.schema-qr-card-copy p,.schema-qr-card-copy li { color: var(--muted); font-size: var(--type-body); line-height: var(--leading-body); }
.schema-qr-card-copy ul { margin: 12px 0 18px; padding-left: 20px; }
.schema-qr-payload { position: absolute; width: 1px; height: 1px; padding: 0; opacity: 0; pointer-events: none; }
.schema-column-panel { padding: 24px; }
.schema-column-table { width: 100%; border-collapse: collapse; }
.schema-column-table th,.schema-column-table td { padding: 11px 12px; border-bottom: 1px solid rgba(210,210,215,.62); text-align: left; font-size: var(--type-body); line-height: var(--leading-body); }
.schema-column-table th { color: var(--muted); font-size: var(--type-label); line-height: var(--leading-label); font-weight: var(--weight-semibold); }
.schema-column-table td strong { font-weight: var(--weight-semibold); }
.schema-type-pill { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: rgba(88,86,214,.1); color: #4f4bb6; font-size: var(--type-caption); line-height: var(--leading-caption); font-weight: var(--weight-semibold); }

@media (max-width: 900px) {
    .mysql-source-list,.schema-qr-layout { grid-template-columns: 1fr; }
    .schema-qr-card { position: static; }
}

@media (max-width: 620px) {
    .mysql-source-dialog > form { padding: 20px; }
    .mysql-source-form-grid { grid-template-columns: 1fr; }
    .mysql-source-wide { grid-column: auto; }
    .mysql-source-security-note,.mysql-source-card { align-items: flex-start; grid-template-columns: 1fr; }
    .mysql-source-card-icon { display: none; }
    .mysql-source-dialog footer { flex-direction: column-reverse; }
    .mysql-source-dialog footer .button { width: 100%; }
}

/* 系统品牌设置 */
.brand-settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 20px;
    align-items: start;
}

.brand-settings-form,
.brand-settings-preview {
    padding: 24px;
}

.brand-settings-fields {
    display: grid;
    gap: 18px;
    margin-top: 20px;
}

.brand-settings-fields label > small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: var(--type-caption);
    font-weight: var(--weight-regular);
    line-height: var(--leading-caption);
}

.brand-logo-upload input[type="file"] {
    min-height: 52px;
    padding: 10px;
    background: rgba(247, 247, 249, 0.92);
    cursor: pointer;
}

.brand-logo-upload input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 7px 13px;
    border: 0;
    border-radius: 9px;
    background: var(--blue);
    color: #fff;
    font-size: var(--type-body);
    font-weight: var(--weight-semibold);
    line-height: 20px;
    cursor: pointer;
}

.brand-logo-remove {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 11px 13px;
    border-radius: 12px;
    background: rgba(255, 59, 48, 0.07);
    color: #a51d16;
    cursor: pointer;
}

.brand-logo-remove input {
    width: 17px;
    min-height: 17px;
    margin: 0;
}

.brand-logo-remove span {
    margin: 0;
    color: inherit;
    font-size: var(--type-body);
    font-weight: var(--weight-medium);
    line-height: var(--leading-body);
}

.brand-settings-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(29, 29, 31, 0.09);
}

.brand-settings-actions > span {
    color: var(--muted);
    font-size: var(--type-caption);
    font-weight: var(--weight-regular);
    line-height: var(--leading-caption);
}

.brand-settings-preview {
    position: sticky;
    top: 24px;
}

.brand-settings-preview h2 {
    margin: 5px 0 18px;
    font-size: var(--type-section-title);
    font-weight: var(--weight-bold);
    line-height: var(--leading-section-title);
}

.brand-preview-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 84px;
    padding: 16px;
    border: 1px solid rgba(29, 29, 31, 0.09);
    border-radius: 18px;
    background: rgba(247, 247, 249, 0.9);
}

.brand-preview-logo {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    overflow: hidden;
    border-radius: 13px;
}

.brand-preview-logo img,
.brand-preview-logo .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: contain;
}

.brand-preview-card > span:last-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.brand-preview-card strong {
    overflow: hidden;
    font-size: var(--type-card-title);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-card-title);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-preview-card small,
.brand-settings-preview > p {
    color: var(--muted);
    font-size: var(--type-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
}

.brand-settings-preview > p {
    margin: 16px 2px 0;
}

@media (max-width: 920px) {
    .brand-settings-layout {
        grid-template-columns: 1fr;
    }

    .brand-settings-preview {
        position: static;
    }
}

@media (max-width: 600px) {
    .brand-settings-form,
    .brand-settings-preview {
        padding: 18px;
    }

    .brand-settings-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

/* 版本号徽标：主系统与控制端同版发布的可视凭证 */
.app-version-badge {
    /* 用户要求页面上不再显示版本号；元素保留在 DOM 中，
       供 app.js assetVersion() 读取版本号做静态资源缓存参数。 */
    display: none;
}

/* ===== 系统内置 · 知识库 ===== */
.knowledge-shell { max-width: 920px; margin: 0 auto; padding: 28px 20px 60px; }
.knowledge-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.knowledge-head h1 { margin: 4px 0 6px; font-size: 26px; }
.knowledge-head p { margin: 0; color: #52514e; font-size: 13px; max-width: 560px; }
.knowledge-toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.knowledge-toolbar input[type="search"] { flex: 1; padding: 9px 14px; border: 1px solid #d2d2d7; border-radius: 9px; font-size: 14px; }
.knowledge-toolbar select { padding: 9px 12px; border: 1px solid #d2d2d7; border-radius: 9px; font-size: 14px; background: #fff; }
.knowledge-toolbar input[type="search"] { min-width: 0; }
.knowledge-toolbar select { width: auto; }
.knowledge-toolbar button { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 640px) {
  .knowledge-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .knowledge-toolbar input[type="search"] { grid-column: 1 / -1; width: 100%; box-sizing: border-box; }
  .knowledge-toolbar select { min-width: 0; width: 100%; }
}
.knowledge-list { display: grid; gap: 10px; }
.knowledge-entry { display: flex; justify-content: space-between; gap: 16px; padding: 14px 18px; background: #fff; border: 1px solid #e3e3e8; border-radius: 12px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.knowledge-entry:hover { border-color: #0a84d0; box-shadow: 0 4px 14px rgba(10,132,208,.08); }
.knowledge-entry-main b { font-size: 15px; }
.knowledge-entry-main p { margin: 5px 0 0; font-size: 12px; color: #52514e; line-height: 1.6; }
.knowledge-entry-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; white-space: nowrap; }
.knowledge-entry-side small { color: #86868b; font-size: 11px; }
.knowledge-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: rgba(10,132,208,.09); color: #0a6cb0; font-size: 11px; }
.knowledge-tag.is-personal { background: rgba(235,104,52,.1); color: #b34a1a; }
.knowledge-empty { padding: 48px 20px; text-align: center; color: #86868b; background: #fff; border: 1px dashed #d2d2d7; border-radius: 12px; font-size: 14px; }
.knowledge-form { display: grid; gap: 16px; background: #fff; border: 1px solid #e3e3e8; border-radius: 12px; padding: 22px; }
.knowledge-form label { display: grid; gap: 6px; font-size: 13px; }
.knowledge-form label > span { color: #52514e; font-weight: 600; }
.knowledge-form input, .knowledge-form select, .knowledge-form textarea { padding: 9px 12px; border: 1px solid #d2d2d7; border-radius: 9px; font-size: 14px; font-family: inherit; }
.knowledge-form textarea { line-height: 1.7; resize: vertical; }
.knowledge-form-row { display: grid; grid-template-columns: 1fr 1.4fr 1.6fr; gap: 14px; }
.knowledge-form-actions { display: flex; justify-content: flex-end; }
.knowledge-detail-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.knowledge-detail-meta small { color: #86868b; }
.knowledge-detail-actions { display: flex; gap: 8px; align-items: center; }
.knowledge-detail-actions form { margin: 0; }
.knowledge-body { background: #fff; border: 1px solid #e3e3e8; border-radius: 12px; padding: 24px 26px; font-size: 14px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.knowledge-refer-hint { margin-top: 14px; color: #86868b; font-size: 12px; }
.app-side-nav-group { margin: 14px 10px 4px; color: #86868b; font-size: 11px; letter-spacing: .06em; }
@media (max-width: 720px) {
    .knowledge-form-row { grid-template-columns: 1fr; }
    .knowledge-head { flex-direction: column; }
}
.whiteboard-knowledge-title { margin: 2px 0 6px; font-size: 15px; }
.whiteboard-knowledge-body { font-size: 12.5px; line-height: 1.75; color: #333; }
.whiteboard-knowledge-body summary { cursor: pointer; color: #333; }

/* 知识库：与案例等入口并列的一级入口，用颜色区分（用户拍板） */
.app-side-nav-knowledge .app-side-nav-icon svg { stroke: #1baf7a; }
.app-side-nav-knowledge .app-side-nav-label { color: #0b7a54; font-weight: 600; }
.app-side-nav-knowledge.active .app-side-nav-icon svg { stroke: currentColor; }
.knowledge-attachments { margin-top: 18px; background: #fff; border: 1px solid #e3e3e8; border-radius: 12px; padding: 18px 22px; }
.knowledge-attachments h2 { margin: 0 0 10px; font-size: 15px; }
.knowledge-attachment-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.knowledge-attachment-list li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: #f7f7f9; border-radius: 8px; font-size: 13px; }
.knowledge-attachment-list li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-attachment-list li small { color: #86868b; white-space: nowrap; }
.knowledge-attachment-list li form { margin: 0; }
.knowledge-attachment-list li button { border: none; background: none; color: #b3261e; font-size: 15px; cursor: pointer; padding: 0 4px; }
.knowledge-upload { display: flex; gap: 10px; align-items: stretch; }
.knowledge-dropzone { flex: 1; display: flex; align-items: center; justify-content: center; border: 1.5px dashed #c6c6cc; border-radius: 10px; padding: 14px; color: #86868b; font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.knowledge-dropzone.is-dragging { border-color: #1baf7a; background: rgba(27,175,122,.06); color: #0b7a54; }
.knowledge-dropzone input { display: none; }
/* ===== 样板库与应用商店 ===== */
.template-entry { flex-wrap: wrap; }
.template-entry-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.template-entry-actions form { margin: 0; display: flex; gap: 6px; align-items: center; }
.template-apply-form select { padding: 7px 10px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 13px; background: #fff; max-width: 180px; }
.template-entry-actions .is-danger { color: #b3261e; }
.store-section-title { margin: 26px 0 12px; font-size: 16px; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.store-card { background: #fff; border: 1px solid #e3e3e8; border-radius: 12px; padding: 14px 16px; }
.store-card b { font-size: 14px; }
.store-card b small { color: #86868b; font-weight: 400; }
.store-card p { margin: 6px 0; font-size: 12px; color: #52514e; line-height: 1.6; }
.store-card small { color: #86868b; font-size: 11px; }
.app-side-nav-store .app-side-nav-icon svg { stroke: #7b5bd6; }
.app-side-nav-store .app-side-nav-label { color: #5b3fb8; font-weight: 600; }
.store-tabs { display: flex; gap: 8px; margin: 4px 0 18px; border-bottom: 1px solid #e3e3e8; }
.store-tab { border: none; background: none; padding: 9px 16px 11px; font-size: 14px; color: #52514e; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.store-tab.is-active { color: #0a84d0; border-bottom-color: #0a84d0; font-weight: 600; }
.knowledge-hit { color: #333; }
.knowledge-hit, .knowledge-entry-main .knowledge-hit b { background: transparent; }
.knowledge-main-upload { margin-bottom: 18px; }
.knowledge-main-upload .knowledge-dropzone { padding: 26px 16px; text-align: center; line-height: 1.7; background: #fff; }
.knowledge-main-upload .knowledge-dropzone b { color: #0b7a54; font-size: 14px; }
.knowledge-main-upload .knowledge-dropzone small { color: #86868b; }

/* 扫码登录：登录页出登录码，等控制端扫码授权后自动进入 */
.login-scan {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.login-scan-code {
    align-self: center;
    display: grid;
    place-items: center;
    /* 登录网址按配置自适应，保留原图像素和静区。 */
    width: fit-content;
    min-width: 266px;
    min-height: 266px;
    max-width: 100%;
    padding: 10px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
}

.login-scan-code img {
    /* 不要 width:100%：把图拉伸到非整数倍会让模块变成 2px/3px 交替，
       摄像头解码器找不到定位图案。这里让它保持原始像素，超了才等比缩。 */
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    image-rendering: pixelated;
}

.login-scan-hint {
    font-size: 12px;
    color: #9ca3af;
}

.login-scan-placeholder {
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

.login-scan-status {
    align-self: center;
    margin: 0;
    font-size: 13px;
    color: #4b5563;
    text-align: center;
}

.login-scan-status.is-error {
    color: #b42318;
}

.login-scan-status.is-success {
    color: #067647;
}

.login-scan-fallback {
    width: 100%;
}

.login-scan-fallback summary {
    cursor: pointer;
    font-size: 13px;
    color: #4b5563;
}

.login-scan-fallback textarea {
    width: 100%;
    margin-top: 8px;
}

.login-scan-bind {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
}

.login-scan-bind input {
    margin-top: 3px;
}

/* 单向网闸送来的待建项目：与扫码入口并列，走同一套执行管道。 */
.project-oneway-pending {
    margin-top: 18px;
}

.project-oneway-pending .panel-head small {
    color: var(--muted);
    font-size: 13px;
}

.oneway-pending-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.oneway-pending-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--hairline, rgba(0, 0, 0, 0.1));
    border-radius: 12px;
    background: var(--surface, #fff);
}

.oneway-pending-item > div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.oneway-pending-item strong {
    font-size: 15px;
    line-height: 21px;
}

.oneway-pending-item small {
    color: var(--muted);
    font-size: 12px;
    word-break: break-all;
}


/* ===== 控制端扫码引导演示(2026-09-01,用户要求) =====
   循环演示「打开控制端 → 点头像 → 选扫一扫 → 对准这张码」。纯 CSS 动画,
   不引外部图片:离线机器没有网,任何外链资源都会变成裂图。 */
.scan-guide {
    width: 100%;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px dashed rgba(0, 113, 227, 0.22);
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.scan-guide-phone {
    width: 62px;
    height: 106px;
    padding: 5px 4px;
    border: 2px solid #1d1d1f;
    border-radius: 12px;
    background: #1d1d1f;
}

.scan-guide-screen {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: #f5f5f7;
    overflow: hidden;
}

/* 顶栏与右上角头像:对应控制端侧栏品牌行 */
.scan-guide-bar {
    position: absolute;
    inset: 0 0 auto 0;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 4px;
    background: #fff;
    border-bottom: 1px solid rgba(60, 60, 67, 0.12);
}

.scan-guide-avatar {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0a84ff, #5e5ce6);
}

/* 头像菜单:第 2 拍展开,第 1 项高亮=扫一扫 */
.scan-guide-menu {
    position: absolute;
    top: 17px;
    right: 3px;
    width: 32px;
    padding: 2px;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
    display: grid;
    gap: 2px;
    opacity: 0;
    transform: scale(0.9);
    transform-origin: top right;
    animation: scan-guide-menu 8s infinite;
}

.scan-guide-menu i {
    height: 5px;
    border-radius: 2px;
    background: rgba(60, 60, 67, 0.18);
    font-size: 4px;
    font-style: normal;
    line-height: 5px;
    text-align: center;
    color: transparent;
}

.scan-guide-menu i:first-child {
    background: rgba(10, 132, 255, 0.22);
}

/* 取景框:第 3 拍出现,模拟摄像头对准 */
.scan-guide-viewfinder {
    position: absolute;
    left: 50%;
    top: 54%;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 2px solid #0a84ff;
    border-radius: 6px;
    opacity: 0;
    animation: scan-guide-frame 8s infinite;
}

/* 点击涟漪:第 1→2 拍落在头像位置 */
.scan-guide-tap {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(10, 132, 255, 0.45);
    opacity: 0;
    animation: scan-guide-tap 8s infinite;
}

.scan-guide-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 3px;
    font-size: 11px;
    color: #6e6e73;
    counter-reset: scan-step;
}

.scan-guide-steps li {
    position: relative;
    padding-left: 16px;
    line-height: 1.5;
    counter-increment: scan-step;
}

.scan-guide-steps li::before {
    content: counter(scan-step);
    position: absolute;
    left: 0;
    top: 1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0, 113, 227, 0.12);
    color: #0071e3;
    font-size: 9px;
    font-weight: 700;
    line-height: 12px;
    text-align: center;
}

/* 四拍循环:0-25% 点头像,25-50% 菜单展开,50-100% 取景对准 */
@keyframes scan-guide-tap {
    0%, 8% { opacity: 0; transform: scale(0.6); }
    12% { opacity: 1; transform: scale(1); }
    24% { opacity: 0; transform: scale(1.6); }
    100% { opacity: 0; transform: scale(1.6); }
}

@keyframes scan-guide-menu {
    0%, 22% { opacity: 0; transform: scale(0.9); }
    28%, 48% { opacity: 1; transform: scale(1); }
    54%, 100% { opacity: 0; transform: scale(0.9); }
}

@keyframes scan-guide-frame {
    0%, 52% { opacity: 0; transform: scale(1.35); }
    62%, 88% { opacity: 1; transform: scale(1); }
    96%, 100% { opacity: 0; transform: scale(1.35); }
}

/* 系统开了「减少动态效果」就别动:这是演示,不是必要信息。 */
@media (prefers-reduced-motion: reduce) {
    .scan-guide-menu,
    .scan-guide-viewfinder,
    .scan-guide-tap {
        animation: none;
        opacity: 1;
    }
}


/* 更新日志展示(2026-09-01):随更新包进来,校验通过后显示给管理员。 */
.update-changelog {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(60, 60, 67, 0.14);
    border-radius: 12px;
    background: rgba(60, 60, 67, 0.04);
}

.update-changelog h3 {
    margin: 0 0 8px;
    font-size: 14px;
}

.update-changelog pre {
    margin: 0;
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.7;
    color: #3c3c43;
}


/* 更新历史(2026-09-01):每次安装留一条,按时间倒序,默认只展开最新一条。 */
.update-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.update-history-item {
    border: 1px solid rgba(60, 60, 67, 0.14);
    border-radius: 12px;
    background: #fff;
}

.update-history-item > summary {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 14px;
    cursor: pointer;
    list-style: none;
}

.update-history-item > summary::-webkit-details-marker {
    display: none;
}

.update-history-item > summary strong {
    font-size: 15px;
}

.update-history-item > summary small {
    color: #86868b;
    font-size: 12px;
}

.update-history-item > summary span {
    color: #6e6e73;
    font-size: 13px;
}

.update-history-item > pre,
.update-history-item > .hint {
    margin: 0;
    padding: 0 14px 12px;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.7;
    color: #3c3c43;
}


/* ===== 重新绑定提醒:字段目录明细(2026-09-01,用户要求) ===== */
.case-data-rebind-tables {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 52vh;
    overflow-y: auto;
    padding-right: 4px;
}

.case-data-rebind-table {
    border: 1px solid rgba(60, 60, 67, 0.16);
    border-radius: 14px;
    background: #fff;
}

.case-data-rebind-table > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 11px 14px;
    cursor: pointer;
    list-style: none;
}

.case-data-rebind-table > summary::-webkit-details-marker {
    display: none;
}

.case-data-rebind-kind {
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(0, 113, 227, 0.12);
    color: #0071e3;
    font-size: 11px;
    font-weight: 600;
}

.case-data-rebind-table > summary strong {
    font-size: 15px;
}

.case-data-rebind-table > summary small {
    color: #86868b;
    font-size: 12px;
}

.case-data-rebind-columns {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.case-data-rebind-columns th,
.case-data-rebind-columns td {
    padding: 7px 14px;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid rgba(60, 60, 67, 0.09);
}

.case-data-rebind-columns th {
    color: #86868b;
    font-size: 12px;
    font-weight: 500;
}

.case-data-rebind-columns td:first-child {
    font-weight: 600;
    white-space: nowrap;
}

/* 选择型整行淡底,一眼能扫出来 */
.case-data-rebind-columns tr.is-enum {
    background: rgba(255, 149, 0, 0.07);
}

.case-data-rebind-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(60, 60, 67, 0.1);
    color: #3c3c43;
    font-size: 11px;
    white-space: nowrap;
}

.case-data-rebind-badge.enum {
    background: rgba(255, 149, 0, 0.18);
    color: #b25000;
    font-weight: 600;
}

.case-data-rebind-badge.number {
    background: rgba(10, 132, 255, 0.14);
    color: #0058c7;
}

.case-data-rebind-badge.datetime {
    background: rgba(88, 86, 214, 0.14);
    color: #4b45b5;
}

.case-data-rebind-enum-count {
    display: inline-block;
    margin-right: 6px;
    color: #b25000;
    font-weight: 600;
}

.case-data-rebind-enum-value {
    display: inline-block;
    margin: 0 4px 4px 0;
    padding: 2px 7px;
    border: 1px solid rgba(255, 149, 0, 0.3);
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
}

.case-data-rebind-enum-value i {
    margin-left: 4px;
    color: #86868b;
    font-style: normal;
}

.case-data-rebind-enum-more {
    color: #86868b;
    font-size: 12px;
}

.case-data-rebind-empty {
    color: #aeaeb2;
}

/* 选择型计数闪烁:提醒操作员这些字段的取值会随码交给控制端,先核对。 */
.case-data-rebind-enum-flash {
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(255, 149, 0, 0.2);
    color: #b25000;
    font-size: 12px;
    font-weight: 700;
    font-style: normal;
    animation: case-data-rebind-flash 1.1s ease-in-out infinite;
}

@keyframes case-data-rebind-flash {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.45); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(255, 149, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .case-data-rebind-enum-flash { animation: none; }
}

@media (max-width: 720px) {
    .case-data-rebind-tables { max-height: 44vh; }
    .case-data-rebind-columns th:nth-child(2),
    .case-data-rebind-columns td:nth-child(2) { white-space: nowrap; }
}


/* ===== 字段画像标准(2026-09-01) ===== */
.profile-kind-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(60, 60, 67, 0.1);
    color: #3c3c43;
    font-size: 12px;
    white-space: nowrap;
}

.profile-kind-badge.enum { background: rgba(255, 149, 0, 0.18); color: #b25000; }
.profile-kind-badge.number { background: rgba(10, 132, 255, 0.14); color: #0058c7; }
.profile-kind-badge.datetime { background: rgba(88, 86, 214, 0.14); color: #4b45b5; }

.profile-usage-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-usage-item {
    border: 1px solid rgba(60, 60, 67, 0.14);
    border-radius: 12px;
    background: #fff;
}

/* 判法不一致的醒目一点:管理员要先处理这些 */
.profile-usage-item.is-conflict {
    border-color: rgba(255, 149, 0, 0.45);
    background: rgba(255, 149, 0, 0.04);
}

.profile-usage-item > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 14px;
    cursor: pointer;
    list-style: none;
}

.profile-usage-item > summary::-webkit-details-marker { display: none; }

.profile-usage-conflict {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 149, 0, 0.22);
    color: #b25000;
    font-size: 12px;
}

.profile-usage-item > summary small { color: #86868b; font-size: 12px; margin-left: auto; }

.profile-usage-detail {
    padding: 0 14px 12px;
    display: grid;
    gap: 10px;
}

.profile-usage-tables {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: #6e6e73;
}

.profile-usage-tables span {
    padding: 2px 8px;
    border: 1px solid rgba(60, 60, 67, 0.14);
    border-radius: 6px;
}

.profile-usage-decide {
    display: flex;
    gap: 8px;
    align-items: center;
}


/* ===== 数据管理页(2026-09-01) ===== */
.data-manage-search { display: flex; gap: 8px; }
.data-manage-search input { flex: 1; }

.data-manage-tables { display: flex; flex-direction: column; gap: 8px; }

.data-manage-table {
    border: 1px solid rgba(60, 60, 67, 0.14);
    border-radius: 12px;
    background: #fff;
}

.data-manage-table > summary {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 11px 14px; cursor: pointer; list-style: none;
}
.data-manage-table > summary::-webkit-details-marker { display: none; }
.data-manage-table > summary small { color: #86868b; font-size: 12px; }

.data-manage-kind {
    padding: 2px 8px; border-radius: 6px;
    background: rgba(0, 113, 227, 0.12); color: #0071e3;
    font-size: 11px; font-weight: 600;
}

.data-manage-columns { margin: 0 14px; width: calc(100% - 28px); }

.data-manage-locked {
    margin-left: 6px; padding: 2px 8px; border-radius: 6px;
    background: rgba(52, 199, 89, 0.16); color: #1c7a3d;
    font-size: 11px; font-weight: 600;
}

.data-manage-preview-actions { padding: 10px 14px; }

.data-manage-preview, .data-manage-result { padding: 0 14px 12px; }

.data-manage-scroll { max-height: 360px; overflow: auto; }

.data-manage-scroll table { font-size: 13px; }

.data-manage-hit { margin-bottom: 14px; }
.data-manage-hit h3 { margin: 0 0 6px; font-size: 14px; }
.data-manage-hit h3 small { color: #86868b; font-weight: 400; }

.data-manage-sql {
    width: 100%; box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
}

.data-manage-saved { display: grid; gap: 4px; margin-bottom: 10px; }

/* 选择型字段把取值摊开(2026-09-01 用户要求:文本不显示,选择列内容)。 */
.data-manage-profile { min-width: 220px; }

.data-manage-enum {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.data-manage-enum li {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(120, 120, 128, 0.1);
    font-size: 12px;
}

.data-manage-enum em {
    font-style: normal;
    color: #86868b;
    font-size: 11px;
}

.data-manage-profile-edit {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.data-manage-profile-edit select { font-size: 12px; padding: 3px 6px; }

/* ===== 项目主页「手机连接」控件(2026-09-02;整页铺开浮层已撤) ===== */
/* 项目主页「手机连接」控件:控制条 / 密度 / 只读码文本 / 成功态 */
.case-overview-connection {
    grid-template-rows: auto minmax(0, 1fr) auto auto auto auto auto auto;
}

.case-overview-connection .schema-batch-frame-controls {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.case-overview-connection .schema-batch-frame-controls .button {
    min-height: 32px;
    padding: 0 6px;
    font-size: 11px;
    white-space: nowrap;
}

.case-overview-density {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: #6e6e73;
}

.case-overview-density select {
    flex: 1;
    min-width: 0;
    padding: 4px 6px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 11px;
}

.case-overview-payload {
    width: 100%;
    min-height: 74px;
    max-height: 120px;
    padding: 8px;
    border: 1px solid #e2e2e7;
    border-radius: 10px;
    background: #f7f7f9;
    color: #3a3a3c;
    font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    resize: vertical;
    word-break: break-all;
}

.case-overview-connection .schema-batch-success {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(36, 138, 61, 0.1);
    color: #1f7a35;
    font-weight: 600;
}

.case-overview-connection .schema-batch-success[hidden],
.case-overview-connection .scan-guide[hidden] {
    display: none;
}

/* 项目下的独立知识库：入口、资料概览与手机布局。 */
.knowledge-library-shell { max-width: 1080px; }
.knowledge-project-filter { display: flex; align-items: center; gap: 12px; margin: 22px 0; }
.knowledge-project-filter label { color: #6e6e73; white-space: nowrap; }
.knowledge-project-filter select { min-width: 0; max-width: 520px; flex: 1; }
.knowledge-library-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 18px; }
.knowledge-library-card { display: flex; flex-direction: column; padding: 24px; border: 1px solid rgba(0,0,0,.07); border-radius: 20px; background: #fff; color: #1d1d1f; text-decoration: none; box-shadow: 0 4px 20px rgba(18,42,66,.035); transition: box-shadow .2s, transform .2s; min-width: 0; }
.knowledge-library-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(18,42,66,.09); }
.knowledge-library-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.knowledge-library-icon { display: grid; place-items: center; width: 42px; height: 42px; color: #0071e3; background: #edf6ff; border-radius: 13px; font-size: 27px; }
.knowledge-library-card h2 { margin: 18px 0 8px; font-size: 21px; overflow-wrap: anywhere; }
.knowledge-library-card > p { margin: 0 0 20px; color: #6e6e73; font-size: 14px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.knowledge-library-card-meta { margin-top: auto; display: flex; flex-direction: column; gap: 6px; color: #86868b; font-size: 12px; overflow-wrap: anywhere; }
.knowledge-library-open { margin-top: 20px; color: #0071e3; font-size: 14px; }
.knowledge-library-context { color: #6e6e73; line-height: 1.7; overflow-wrap: anywhere; }
.knowledge-library-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.knowledge-library-footnote { margin-top: 24px; color: #86868b; font-size: 13px; }
.knowledge-library-archive { margin-top: 34px; text-align: right; }
@media (max-width: 640px) {
  .knowledge-project-filter { display: grid; grid-template-columns: minmax(0,1fr) auto; }
  .knowledge-project-filter label { grid-column: 1 / -1; }
  .knowledge-project-filter select { width: 100%; }
  .knowledge-library-grid { grid-template-columns: minmax(0,1fr); }
  .knowledge-library-actions { width: 100%; }
}

.knowledge-library-pagination { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-top:22px; color:#6e6e73; font-size:13px; }

/* 管理员已发布的项目样例 */
.project-sample-badge { display: inline-block; flex-shrink: 0; width: fit-content; padding: 2px 7px; border: 1px solid #b9d5f5; border-radius: 999px; background: #edf5ff; color: #17548f; font-size: 11px; font-weight: 600; line-height: 1.5; vertical-align: middle; white-space: nowrap; }

/* 网闸送达与项目落库分开显示；接收后由既有流程返回新项目。 */
.project-incoming-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.project-incoming-notice[hidden] { display: none; }
.project-incoming-notice p { margin: 6px 0 0; }
@media (max-width: 640px) { .project-incoming-notice { align-items: stretch; flex-direction: column; } }

/* 上传文件删除确认与文件管理共用原生模态层，支持嵌套确认。 */
.asset-delete-dialog {
    width: min(460px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow-y: auto;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ink);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22);
}
.asset-delete-dialog:not([open]) { display: none; }
.asset-delete-dialog::backdrop {
    background: rgba(29, 29, 31, 0.28);
    backdrop-filter: blur(6px);
}
.asset-delete-dialog .snapshot-dialog { width: 100%; }
