:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --line: #dfe5ee;
    --text: #16203a;
    --muted: #64718a;
    --primary: #165dff;
    --primary-strong: #0f4bd2;
    --accent: #14b8a6;
    --danger: #dc4f63;
    --shadow: 0 1px 2px rgba(16, 26, 54, 0.04), 0 18px 40px -28px rgba(16, 26, 54, 0.35);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

/* hidden 属性必须永远生效：作者样式里的 display（如 .grid-form 的 grid）会盖掉浏览器默认的 [hidden] 规则 */
[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
    background:
        radial-gradient(1200px 620px at 88% -12%, rgba(22, 93, 255, 0.07), transparent 62%),
        linear-gradient(180deg, #f6f9fd 0%, #eef2f8 100%);
    color: var(--text);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

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

.shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
}

body.embedded-view .shell {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
}

body.embedded-view .sidebar {
    display: none;
}

body.embedded-view .main {
    padding: 8px 10px 16px;
}

body.embedded-view .card {
    box-shadow: none;
}

.sidebar {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #edf2f9 0%, #e5ecf5 100%);
    color: var(--text);
    border-right: 1px solid rgba(16, 26, 54, .07);
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 0 4px 16px;
    border-bottom: 1px solid rgba(16, 26, 54, .07);
}

.brand strong {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .01em;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 20px;
    background: linear-gradient(135deg, #2f9dff 0%, #165dff 100%);
    color: white;
    box-shadow: 0 6px 14px rgba(22, 93, 255, .22);
}

.nav {
    display: grid;
    gap: 4px;
    flex: 0 0 auto;
}

.nav-group {
    display: grid;
    gap: 4px;
}

.nav-group-toggle {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.nav-group-toggle::-webkit-details-marker {
    display: none;
}

.nav-group-toggle::after {
    content: "▸";
    margin-left: auto;
    font-size: 11px;
    color: var(--muted);
    transition: transform 0.18s ease;
}

.nav-group[open] .nav-group-toggle::after {
    transform: rotate(90deg);
}

.nav-submenu {
    display: grid;
    gap: 2px;
    padding-left: 28px;
}

.nav-sublink {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--muted);
    border: 1px solid transparent;
    font-size: 13.5px;
}

.nav-sublink:hover {
    color: var(--primary);
    background: rgba(22, 93, 255, .07);
}

.nav-sublink.active {
    color: var(--primary);
    background: rgba(22, 93, 255, .11);
    font-weight: 650;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #3d4a61;
    background: transparent;
    font-size: 15px;
    transition: background-color 160ms ease-out, color 160ms ease-out;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--muted);
    transition: color 160ms ease-out;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, .72);
}

.nav-link:hover .nav-icon {
    color: var(--primary);
}

.nav-link.active {
    color: var(--primary);
    background: #ffffff;
    font-weight: 650;
    box-shadow: 0 1px 2px rgba(16, 26, 54, .06), 0 8px 20px -12px rgba(16, 26, 54, .35);
}

.nav-link.active .nav-icon {
    color: var(--primary);
}

.nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 18px;
    border-radius: 0 2px 2px 0;
    background: var(--primary);
    transform: translateY(-50%);
}

.main {
    padding: 20px 24px 28px;
}

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

.topbar-heading {
    min-width: 0;
}

.topbar-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar h1 {
    margin: 0;
    font-size: 25px;
    line-height: 1.15;
    letter-spacing: -.01em;
}

.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13.5px;
}

.topbar p:empty {
    display: none;
}

.record-page-title {
    display: inline-block;
}

.record-page-title-meta {
    display: inline-block;
    margin-left: 14px;
    color: var(--muted);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
}

.dashboard-page-title {
    display: inline-block;
}

.dashboard-page-title-meta {
    display: inline-block;
    margin-left: 14px;
    color: var(--muted);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
}

.node-detail-page-title {
    display: inline-block;
}

.node-detail-page-title-meta {
    display: inline-block;
    margin-left: 14px;
    color: var(--muted);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.page-title-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.scope-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(22, 93, 255, 0.1);
    color: var(--primary-strong);
    font-size: 13px;
    font-weight: 600;
}

.topbar-actions form {
    margin: 0;
}

.scope-toolbar-card {
    margin-bottom: 18px;
}

.scope-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 18px;
    align-items: end;
}

.scope-toolbar-copy {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.scope-toolbar-copy strong {
    font-size: 16px;
}

.scope-toolbar-copy span {
    color: var(--muted);
    line-height: 1.6;
}

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

.page-busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(241, 245, 249, 0.82);
    backdrop-filter: blur(3px);
}

.page-busy-card {
    width: min(420px, 100%);
    display: grid;
    gap: 10px;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid rgba(59, 130, 246, 0.16);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.14);
}

.page-busy-body {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-busy-spinner {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: 999px;
    border: 3px solid rgba(59, 130, 246, 0.18);
    border-top-color: var(--primary);
    animation: page-busy-spin 0.8s linear infinite;
}

.page-busy-title {
    margin: 0;
    font-size: 16px;
    color: var(--text);
}

.page-busy-detail {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.is-busy-submit {
    pointer-events: none;
    opacity: 0.88;
}

@keyframes page-busy-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid transparent;
    transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.25s ease, padding 0.25s ease, margin 0.25s ease;
    max-height: 120px;
    overflow: hidden;
}

.flash.is-dismissing {
    opacity: 0;
    transform: translateY(-6px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    border-width: 0;
}

.flash-message {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.5;
}

.flash-close {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.65;
    display: inline-grid;
    place-items: center;
    padding: 0;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

.flash-close:hover {
    opacity: 1;
    background: rgba(15, 23, 42, 0.08);
}

.flash-success {
    background: rgba(20, 184, 166, 0.12);
    border-color: rgba(20, 184, 166, 0.3);
}

.flash-error {
    background: rgba(220, 79, 99, 0.12);
    border-color: rgba(220, 79, 99, 0.3);
}

.info-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--muted);
}

.info-banner strong {
    color: var(--text);
    white-space: nowrap;
}

.card {
    background: var(--surface);
    border: 1px solid rgba(16, 26, 54, .07);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(16, 26, 54, .04), 0 18px 40px -28px rgba(16, 26, 54, .35);
    padding: 24px;
    margin-bottom: 22px;
}

.section-head {
    margin-bottom: 18px;
}

.section-head-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.section-head h2 {
    margin: 0;
    font-size: 18px;
}

.section-head p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.section-head-inline {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
}

.section-head-inline p {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-head-compact {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
}

.section-head-compact h2 {
    margin: 0;
    flex: 0 0 auto;
}

.section-head-compact p {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}

.record-section-head-compact {
    margin-bottom: 6px;
}

.record-section-copy {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
    flex-wrap: nowrap;
}

.record-section-copy h2 {
    margin: 0;
    flex: 0 0 auto;
}

.record-section-copy p {
    margin: 0;
    min-width: 0;
    color: var(--muted);
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-bound-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(22, 93, 255, 0.1);
    color: var(--primary);
    font-size: 12px;
}

.collection-skill-tip {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(247, 249, 252, 0.9);
    border: 1px solid var(--line);
}

.collection-skill-tip strong {
    font-size: 13px;
}

.collection-skill-tip p {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--muted);
}

.collection-skill-card {
    margin-bottom: 18px;
}

.collection-skill-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.collection-skill-inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.collection-skill-inline-form input[type="file"] {
    max-width: 220px;
    font-size: 12px;
}

.collection-skill-current {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--text);
}

.collection-skill-current.is-empty {
    color: var(--muted);
}

.project-name-cell {
    position: relative;
}

.project-name-link {
    color: var(--primary-strong, #0f4bd2);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.project-name-link:hover,
.project-name-link:focus-visible {
    color: var(--primary);
    text-decoration: underline;
}

/* 支持宽范围点击进入的行交互反馈 */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.clickable-row > td {
    cursor: pointer;
}

.clickable-row > td:last-child {
    cursor: default;
}

.clickable-row:hover > td {
    background-color: rgba(22, 93, 255, 0.045);
}

.clickable-row:hover .project-name-link {
    color: var(--primary);
    text-decoration: underline;
}

.dashboard-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.dashboard-section-copy {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
    flex-wrap: nowrap;
}

.dashboard-section-copy h2 {
    margin: 0;
    flex: 0 0 auto;
}

.dashboard-section-copy p {
    margin: 0;
    min-width: 0;
    color: var(--muted);
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-detail-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}

.node-detail-section-copy {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
    flex-wrap: nowrap;
}

.node-detail-section-copy h2 {
    margin: 0;
    flex: 0 0 auto;
}

.node-detail-section-copy p {
    margin: 0;
    min-width: 0;
    color: var(--muted);
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-grid,
.split-grid {
    display: grid;
    gap: 18px;
}

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

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

.rule-list-grid {
    align-items: start;
    grid-template-columns: 1fr;
}

.rule-top-grid {
    align-items: stretch;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.rule-top-grid>.card {
    height: 100%;
}

.stat-card {
    background: linear-gradient(135deg, rgba(22, 93, 255, 0.95), rgba(20, 184, 166, 0.85));
    color: white;
    padding: 22px;
    border-radius: 22px;
    box-shadow: 0 22px 36px rgba(22, 93, 255, 0.18);
}

.stat-card span {
    display: block;
    opacity: 0.84;
    font-size: 14px;
}

.stat-card strong {
    display: block;
    margin-top: 12px;
    font-size: 30px;
}

.grid-form {
    display: grid;
    gap: 16px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-row-prefix,
.form-row-station {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.unit-name-prefix-hint {
    display: block;
    margin-top: -4px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 720px) {
    .form-row-2,
    .form-row-prefix,
    .form-row-station {
        grid-template-columns: 1fr;
    }
}

.unit-draft-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.unit-draft-list {
    display: grid;
    gap: 8px;
}

.unit-draft-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 92px minmax(0, 1fr) minmax(0, 1fr) 28px;
    align-items: center;
    gap: 8px;
}

.unit-draft-row input {
    height: 34px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
}

.unit-draft-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.unit-draft-remove:hover {
    border-color: rgba(220, 76, 76, 0.4);
    color: #d64545;
    background: rgba(220, 76, 76, 0.08);
}

@media (max-width: 720px) {
    .unit-draft-row {
        grid-template-columns: minmax(0, 1fr);
        position: relative;
        padding-right: 36px;
    }

    .unit-draft-remove {
        position: absolute;
        top: 3px;
        right: 0;
    }
}

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

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

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

.span-2 {
    grid-column: span 2;
}

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

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

.field-group label {
    font-weight: 600;
    font-size: 14px;
}

.field-group small {
    color: var(--muted);
}

.input-action-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-action-row input,
.input-action-row select,
.input-action-row textarea {
    flex: 1 1 auto;
    min-width: 0;
}

.input-action-row .btn-secondary {
    flex: 0 0 auto;
}

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

input,
select,
textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(22, 93, 255, 0.55);
    box-shadow: 0 0 0 4px rgba(22, 93, 255, 0.08);
}

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

.btn-primary,
.btn-secondary {
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #3f8cff 100%);
    color: white;
    box-shadow: 0 1px 2px rgba(16, 26, 54, .08), 0 10px 22px -12px rgba(22, 93, 255, .7);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-strong) 0%, #2b76f6 100%);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(16, 26, 54, .04);
}

.btn-secondary:hover {
    background: var(--surface-2);
    border-color: #cfd8e6;
}

.btn-danger-outline {
    border-color: rgba(220, 79, 99, 0.24);
    color: var(--danger);
    background: rgba(220, 79, 99, 0.06);
}

.btn-primary:disabled,
.btn-secondary:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.btn-compact {
    padding: 0 10px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    font-size: 12px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(22, 93, 255, 0.08);
    border: 1px solid rgba(22, 93, 255, 0.12);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill-published {
    background: rgba(20, 184, 166, 0.10);
    border-color: rgba(20, 184, 166, 0.24);
}

.status-pill-draft {
    background: rgba(255, 184, 77, 0.12);
    border-color: rgba(255, 184, 77, 0.24);
}

.status-pill-legacy {
    background: rgba(100, 116, 139, 0.12);
    border-color: rgba(100, 116, 139, 0.20);
}

.template-engine-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.template-engine-summary h2 {
    margin-bottom: 8px;
}

.template-engine-summary p {
    margin: 0;
}

.template-engine-summary-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.template-engine-summary-text {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.profile-version-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.range-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
}

.range-inline span {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.rule-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border: 1px dashed rgba(22, 93, 255, 0.28);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(22, 93, 255, 0.04), rgba(22, 93, 255, 0.01));
}

.rule-grid-generate {
    grid-template-columns: repeat(8, minmax(0, 1fr));
}

.rule-grid-collect {
    grid-template-columns: repeat(8, minmax(0, 1fr));
}

.rule-grid-collect {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
}

.rule-grid .field-group {
    gap: 3px;
}

.rule-grid .field-group label {
    font-size: 11px;
    line-height: 1.25;
}

.rule-item {
    padding: 6px 8px;
    border-radius: 12px;
    border: 1px solid rgba(22, 93, 255, 0.12);
    background: rgba(255, 255, 255, 0.9);
}

.rule-item-span-2 {
    grid-column: span 2;
}

.rule-item-full {
    grid-column: 1 / -1;
}

.rule-grid input,
.rule-grid select,
.rule-grid textarea {
    padding: 5px 8px;
    min-height: 30px;
    border-radius: 10px;
    background: #fbfcff;
    font-size: 13px;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    grid-column: 1 / -1;
    min-height: 0;
}

.check-line input {
    width: 18px;
    height: 18px;
    min-height: auto;
}

.check-line span {
    font-size: 12px;
    line-height: 1.25;
}

.rule-edit-card {
    padding: 16px 18px;
}

.rule-edit-form {
    gap: 8px;
}

.profile-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.profile-summary-card {
    padding: 18px 20px;
}

.profile-summary-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.profile-summary-card strong {
    display: block;
    margin-top: 10px;
    font-size: 28px;
    color: var(--text);
    transition: color 0.15s ease;
}

.profile-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-accent-soft);
}

.db-summary-grid {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 20px;
}

.path-text {
    font-family: var(--font-mono, monospace);
    font-size: 14px !important;
    word-break: break-all;
    line-height: 1.5;
    background: var(--bg-soft);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    margin-top: 12px !important;
    color: var(--text-muted) !important;
}

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

.template-edit-preview-head label,
.template-edit-preview-head small {
    margin: 0;
}

.json-editor {
    min-height: 520px;
    font-family: "Consolas", "SFMono-Regular", "Courier New", monospace;
    line-height: 1.5;
    white-space: pre;
}

.designer-switcher-form {
    align-items: end;
}

/* User dropdown styles */
.user-dropdown-details {
    position: relative;
}

.user-dropdown-details>summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    outline: none;
}

.user-dropdown-details>summary::-webkit-details-marker {
    display: none;
}

.user-dropdown-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 100%;
    min-width: 160px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    padding: 8px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-dropdown-menu form {
    margin: 0;
}

.user-dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.user-dropdown-item:hover {
    background: rgba(22, 93, 255, 0.06);
    color: var(--primary);
}

.user-dropdown-item.danger {
    color: var(--danger);
}

.user-dropdown-item.danger:hover {
    background: rgba(220, 79, 99, 0.08);
}

.designer-workspace {
    display: grid;
    grid-template-columns: minmax(0, 2.15fr) minmax(280px, 0.62fr);
    gap: 18px;
}

.designer-preview-card {
    min-width: 0;
}

.designer-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
    flex-wrap: nowrap;
}

.designer-preview-copy {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

.designer-preview-copy p {
    overflow: hidden;
    text-overflow: ellipsis;
}

.designer-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 0;
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.designer-rendered-preview-frame {
    min-height: 200px;
}

.designer-side-stack {
    display: grid;
    gap: 18px;
    align-content: start;
}

.designer-side-card {
    margin-bottom: 0;
}

.designer-linked-profile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.designer-linked-profile-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.designer-linked-rule-grid .rule-grid-generate {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px 8px;
    padding: 6px;
}

.designer-linked-rule-grid .rule-grid-generate .rule-item-span-2 {
    grid-column: span 2;
}

.designer-linked-rule-grid .rule-grid-generate .check-line {
    grid-column: 1 / -1;
}

.designer-linked-rule-grid .rule-grid-generate .rule-item {
    padding: 5px 6px;
    border-radius: 10px;
}

.designer-linked-rule-grid .rule-grid-generate .field-group {
    gap: 2px;
}

.designer-linked-rule-grid .rule-grid-generate .field-group label {
    font-size: 10px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.designer-linked-rule-grid .rule-grid-generate input,
.designer-linked-rule-grid .rule-grid-generate select,
.designer-linked-rule-grid .rule-grid-generate textarea {
    min-height: 28px;
    padding: 4px 6px;
    font-size: 12px;
}

.designer-linked-rule-grid .rule-grid-generate input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.designer-linked-rule-grid .rule-grid-generate input[type="number"]::-webkit-outer-spin-button,
.designer-linked-rule-grid .rule-grid-generate input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.designer-linked-rule-grid .rule-grid-generate .range-inline {
    grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr);
    gap: 4px;
}

.designer-linked-rule-grid .rule-grid-generate .range-inline span {
    font-size: 11px;
}

.designer-side-details {
    overflow: hidden;
}

.designer-side-details>summary {
    cursor: pointer;
    list-style: none;
    font-weight: 700;
    color: var(--ink);
    padding: 2px 0 10px;
}

.designer-side-details>summary::-webkit-details-marker {
    display: none;
}

.designer-side-details:not([open])>*:not(summary) {
    display: none;
}

.designer-repeater-stack {
    display: grid;
    gap: 18px;
}

.designer-repeater-card {
    border: 1px solid rgba(216, 222, 232, 0.92);
    background: linear-gradient(180deg, rgba(246, 249, 255, 0.86), #ffffff);
}

.designer-repeater-card>.split-grid,
.designer-repeater-card>.card {
    margin-top: 14px;
}

.designer-leading-copy {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(216, 222, 232, 0.9);
    background: linear-gradient(180deg, rgba(22, 93, 255, 0.05), rgba(20, 184, 166, 0.03));
    color: var(--muted);
}

.designer-template-stack {
    display: grid;
    gap: 18px;
}

.designer-template-block {
    display: grid;
    gap: 10px;
}

.designer-template-scroll {
    overflow: auto;
    padding: 8px;
    border: 1px solid rgba(216, 222, 232, 0.92);
    border-radius: 18px;
    background: #f9fbff;
}

.designer-template-table {
    border-collapse: separate;
    border-spacing: 8px;
    min-width: max-content;
}

.designer-template-table td {
    padding: 0;
    vertical-align: top;
}

.designer-template-cell {
    width: 132px;
    min-height: 82px;
    display: grid;
    align-content: space-between;
    gap: 8px;
    padding: 10px 10px 12px;
    text-align: left;
    border-radius: 14px;
    border: 1px solid rgba(22, 93, 255, 0.16);
    background: white;
    color: var(--text);
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.designer-template-cell:hover {
    transform: translateY(-1px);
    border-color: rgba(22, 93, 255, 0.42);
    box-shadow: 0 10px 18px rgba(22, 93, 255, 0.08);
}

.designer-template-cell.is-picked {
    border-color: rgba(22, 93, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.16);
    background: linear-gradient(180deg, rgba(22, 93, 255, 0.08), rgba(255, 255, 255, 1));
}

.designer-template-cell.is-bound {
    border-color: rgba(20, 184, 166, 0.46);
    background: linear-gradient(180deg, rgba(20, 184, 166, 0.08), rgba(255, 255, 255, 1));
}

.designer-template-cell.is-issue {
    border-color: rgba(220, 79, 99, 0.42);
    background: linear-gradient(180deg, rgba(220, 79, 99, 0.10), rgba(255, 255, 255, 1));
}

.designer-template-cell.is-conflict {
    box-shadow: 0 0 0 3px rgba(220, 79, 99, 0.16);
}

.designer-template-cell-ref {
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.designer-template-cell-text {
    white-space: pre-wrap;
    line-height: 1.4;
    font-size: 13px;
    color: var(--text);
    word-break: break-word;
}

.designer-template-cell-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.designer-template-cell-sample-kind {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.12);
    color: #0f766e;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.designer-template-cell-sample {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(20, 184, 166, 0.08);
    color: var(--text);
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.designer-template-cell-issue-count {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(220, 79, 99, 0.10);
    color: #b42318;
    font-size: 11px;
    font-weight: 700;
}

.designer-diagnostics-card {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
}

.designer-diagnostics-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.issue-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(22, 93, 255, 0.14);
    background: rgba(22, 93, 255, 0.08);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.issue-pill-error {
    border-color: rgba(220, 79, 99, 0.28);
    background: rgba(220, 79, 99, 0.10);
    color: #b42318;
}

.issue-pill-warning {
    border-color: rgba(255, 184, 77, 0.28);
    background: rgba(255, 184, 77, 0.14);
    color: #9a6700;
}

.designer-diagnostics-list {
    display: grid;
    gap: 10px;
    max-height: 420px;
    overflow: auto;
}

.designer-diagnostic-item {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(216, 222, 232, 0.9);
    background: rgba(248, 250, 253, 0.92);
}

.designer-diagnostic-item.is-error {
    border-color: rgba(220, 79, 99, 0.24);
    background: rgba(220, 79, 99, 0.06);
}

.designer-diagnostic-item.is-warning {
    border-color: rgba(255, 184, 77, 0.24);
    background: rgba(255, 184, 77, 0.08);
}

.designer-diagnostic-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.designer-diagnostic-item p {
    margin: 0;
    color: var(--text);
    line-height: 1.6;
}

.designer-diagnostic-item code {
    display: block;
    padding: 7px 9px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.06);
    font-size: 12px;
    word-break: break-word;
}

.designer-diagnostic-item[data-trace-target] {
    cursor: pointer;
}

.designer-diagnostics-empty {
    margin-bottom: 0;
}

.designer-coverage-list {
    display: grid;
    gap: 10px;
}

.designer-palette-groups {
    display: grid;
    gap: 16px;
}

.designer-palette-group {
    display: grid;
    gap: 10px;
}

.designer-palette-group h3 {
    margin: 0;
    font-size: 15px;
}

.designer-palette-list {
    display: grid;
    gap: 10px;
}

.designer-palette-item {
    display: grid;
    gap: 4px;
    text-align: left;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(22, 93, 255, 0.12);
    background: linear-gradient(180deg, rgba(22, 93, 255, 0.05), rgba(20, 184, 166, 0.02));
    color: var(--text);
}

.designer-palette-item strong {
    font-family: "Consolas", "SFMono-Regular", "Courier New", monospace;
    font-size: 12px;
    line-height: 1.4;
}

.designer-palette-item small,
.designer-palette-item em {
    color: var(--muted);
    font-style: normal;
}

.designer-trace-groups {
    display: grid;
    gap: 16px;
}

.designer-trace-group {
    display: grid;
    gap: 10px;
}

.designer-trace-group h3 {
    margin: 0;
    font-size: 15px;
}

.designer-trace-list {
    display: grid;
    gap: 10px;
}

.designer-trace-item {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(22, 93, 255, 0.12);
    background: linear-gradient(180deg, rgba(22, 93, 255, 0.05), rgba(255, 255, 255, 0.98));
}

.designer-trace-item[data-trace-target] {
    cursor: pointer;
}

.designer-trace-item span {
    color: var(--muted);
    font-size: 12px;
}

.designer-trace-item strong {
    font-size: 20px;
    color: var(--text);
    word-break: break-word;
}

.designer-trace-item code {
    display: block;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.06);
    font-size: 12px;
    word-break: break-word;
}

.designer-trace-upstream-list {
    display: grid;
    gap: 6px;
}

.designer-binding-list {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

.designer-binding-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.05fr) minmax(0, 1.65fr) auto;
    gap: 10px;
    align-items: start;
}

.designer-binding-row-compact {
    grid-template-columns: 110px minmax(0, 1fr) auto;
}

.designer-binding-row-4 {
    grid-template-columns: minmax(220px, 1fr) 120px minmax(240px, 1.2fr) minmax(220px, 1fr) auto;
}

.designer-binding-row input.is-designer-active {
    border-color: rgba(22, 93, 255, 0.86);
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.14);
}

.is-diagnostic-error {
    border-color: rgba(220, 79, 99, 0.72) !important;
    box-shadow: 0 0 0 3px rgba(220, 79, 99, 0.12);
    background: rgba(255, 246, 247, 0.98);
}

.designer-diagnostics-inline {
    margin-top: 12px;
}

.designer-page {
    display: grid;
    gap: 14px;
}

.designer-form {
    display: grid;
    gap: 14px;
}

.designer-card-compact {
    padding: 16px 18px;
    border-radius: 18px;
    margin-bottom: 0;
}

.designer-page .card {
    margin-bottom: 0;
}

.designer-page .section-head {
    margin-bottom: 12px;
}

.designer-page .section-head h2 {
    font-size: 18px;
}

.designer-page .section-head p {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.5;
}

.designer-page .designer-generation-head {
    margin-bottom: 8px;
}

.designer-page .designer-generation-head p {
    margin: 0;
}

.designer-linked-profile-head-inline {
    margin-bottom: 8px;
    align-items: center;
}

.designer-linked-profile-meta-inline {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
}

.designer-linked-profile-meta-inline strong {
    flex: 0 0 auto;
}

.designer-linked-profile-note {
    color: var(--muted);
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.designer-page .section-head-compact {
    gap: 8px;
    margin-bottom: 8px;
}

.designer-page .section-head-compact h2,
.designer-page .section-head-compact h3 {
    margin: 0;
    font-size: 15px;
}

.designer-page .section-head-compact p {
    font-size: 12px;
}

.designer-page .field-group {
    gap: 5px;
}

.designer-page .field-group label {
    font-size: 12px;
}

.designer-page input,
.designer-page select,
.designer-page textarea {
    padding: 8px 10px;
    min-height: 38px;
    border-radius: 12px;
}

.designer-page textarea {
    min-height: 88px;
}

.designer-page .readonly-input {
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 12px;
}

.designer-switcher-form {
    align-items: end;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.designer-solution-meta-row {
    grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.1fr) minmax(320px, 1.4fr);
    align-items: end;
}

.designer-solution-template-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.designer-solution-template-row .readonly-input {
    flex: 1 1 auto;
    min-width: 0;
}

.designer-solution-template-row .btn-compact {
    flex: 0 0 auto;
    white-space: nowrap;
}

.designer-page .profile-summary-grid {
    gap: 10px;
}

.designer-summary-grid-compact .profile-summary-card,
.designer-page .profile-summary-card {
    padding: 12px 14px;
    border-radius: 14px;
}

.designer-summary-grid-compact .profile-summary-card span,
.designer-page .profile-summary-card span {
    font-size: 12px;
}

.designer-summary-grid-compact .profile-summary-card strong,
.designer-page .profile-summary-card strong {
    margin-top: 6px;
    font-size: 24px;
}

.designer-page .chip-card {
    gap: 6px;
    padding: 12px 14px;
    border-radius: 14px;
}

.designer-page .chip-card strong {
    font-size: 22px;
}

.designer-page .status-pill,
.designer-page .issue-pill {
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
}

.designer-workspace-compact {
    grid-template-columns: minmax(0, 1.58fr) minmax(340px, 0.88fr);
    gap: 12px;
}

.designer-page-workbench .designer-workspace-compact {
    grid-template-columns: minmax(0, 1.72fr) minmax(340px, 0.84fr);
    gap: 10px;
}

.designer-page-solution .designer-workspace-compact {
    grid-template-columns: minmax(0, 1.42fr) minmax(360px, 0.98fr);
    gap: 12px;
    align-items: start;
}

.designer-bottom-sections {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.designer-bottom-split {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 12px;
    align-items: start;
}

.designer-page-workbench .designer-card-compact {
    padding: 12px 14px;
    border-radius: 16px;
}

.designer-page-workbench .section-head {
    margin-bottom: 10px;
}

.designer-page-workbench .section-head h2 {
    font-size: 18px;
}

.designer-page-workbench .section-head p,
.designer-page-workbench .rule-preview-tip,
.designer-page-workbench .designer-linked-profile-head p {
    font-size: 12px;
    line-height: 1.45;
}

.designer-page-workbench .profile-summary-grid {
    gap: 10px;
}

.designer-page-workbench .profile-summary-card {
    padding: 10px 12px;
}

.designer-page-workbench .profile-summary-card strong {
    font-size: 20px;
}

.designer-page-workbench .designer-switcher-form {
    gap: 8px 10px;
}

.designer-page-workbench .designer-side-stack {
    position: sticky;
    top: 14px;
    align-self: start;
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding-right: 4px;
}

.designer-page-solution .designer-side-stack {
    position: sticky;
    top: 14px;
    align-self: start;
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding-right: 4px;
}

.designer-page-solution .designer-side-stack .designer-side-card {
    margin-bottom: 0;
}

.designer-page-solution .designer-bottom-sections .designer-side-details>summary {
    padding-bottom: 6px;
    font-size: 14px;
}

.designer-page-solution .designer-bottom-sections {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

.designer-page-solution .designer-bottom-sections>.designer-bottom-split {
    grid-column: auto;
}

.designer-page-solution .designer-bottom-sections .designer-bottom-split,
.designer-page-solution .designer-bottom-sections .designer-mapping-pair {
    grid-template-columns: 1fr;
}

.designer-page-solution .designer-bottom-sections .section-head,
.designer-page-solution .designer-bottom-sections .section-head-compact {
    margin-bottom: 8px;
}

.designer-page-solution .designer-bottom-sections .section-head p,
.designer-page-solution .designer-bottom-sections .section-head-compact p {
    display: none;
}

.designer-page-solution .designer-bottom-sections .profile-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.designer-page-solution .designer-bottom-sections .designer-fixed-mapping-grid {
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 12px;
    align-items: start;
}

.designer-page-solution .designer-bottom-sections .designer-fixed-mapping-grid>.designer-side-details {
    align-self: start;
}

.designer-page-solution .designer-bottom-sections .designer-fixed-mapping-grid .designer-binding-list {
    grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
    gap: 8px;
}

.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-palette-list,
.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-coverage-list,
.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-trace-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(238px, 238px));
    gap: 8px;
    align-items: start;
    justify-content: start;
}

.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-diagnostic-item,
.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-trace-item,
.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-palette-item {
    width: 238px;
    min-width: 238px;
    max-width: 238px;
    padding: 6px 8px;
    border-radius: 10px;
    min-height: 56px;
    align-content: start;
    justify-self: start;
}

.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-palette-groups,
.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-trace-groups {
    gap: 10px;
}

.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-palette-group,
.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-trace-group {
    gap: 6px;
}

.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-palette-group h3,
.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-trace-group h3 {
    margin: 0;
    font-size: 14px;
}

.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-palette-item strong,
.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-diagnostic-item strong,
.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-trace-item strong {
    font-size: 10.5px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-palette-item small,
.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-palette-item em,
.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-diagnostic-item p,
.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-trace-item p,
.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-trace-item small {
    font-size: 10px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-palette-item em {
    display: none;
}

.designer-page-solution .designer-bottom-sections .designer-expression-panel-card .designer-diagnostics-list {
    max-height: 220px;
}

.designer-page-solution .designer-repeater-grid {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
}

.designer-page-solution .designer-repeater-config-card .grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.designer-page-solution .designer-repeater-fields-card .designer-binding-list,
.designer-page-solution .designer-repeater-summary-card .designer-binding-list {
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 8px;
}

.designer-page-solution .designer-repeater-fields-card .designer-binding-row-compact,
.designer-page-solution .designer-repeater-summary-card .designer-binding-row-compact {
    grid-template-columns: 78px minmax(0, 1fr) auto;
}

.designer-page-solution .designer-bottom-sections .designer-binding-row {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) auto;
}

.designer-page-solution .designer-bottom-sections .designer-binding-row-compact {
    grid-template-columns: 78px minmax(0, 1fr) auto;
}

.designer-page-solution .designer-bottom-sections .designer-binding-row-compactish {
    grid-template-columns: 78px minmax(0, 1fr) auto;
}

.designer-page-solution .designer-bottom-sections .designer-binding-row-4 {
    grid-template-columns: minmax(140px, 180px) 86px minmax(0, 1fr) minmax(120px, 180px) auto;
}

.designer-page-solution .designer-bottom-sections .designer-repeater-stack {
    gap: 10px;
}

.designer-page-solution .designer-repeater-grid>.card,
.designer-page-solution .designer-mapping-pair>.designer-side-details {
    align-self: start;
}

.designer-page-solution .designer-mapping-pair {
    display: grid;
    gap: 12px;
    align-items: start;
}

.designer-page-solution .designer-repeater-summary-card {
    margin-top: 10px;
}

.designer-page-solution .designer-bottom-side,
.designer-page-solution .designer-bottom-main {
    display: grid;
    gap: 12px;
    align-content: start;
}

.designer-page-solution .designer-bottom-sections .designer-diagnostics-list {
    max-height: 260px;
}

.designer-page-workbench .designer-side-card,
.designer-page-workbench .designer-side-details {
    box-shadow: none;
}

.designer-page-workbench .designer-side-details>summary {
    padding-bottom: 6px;
    font-size: 14px;
}

.designer-page-workbench .designer-page .field-group label,
.designer-page-workbench .field-group label {
    font-size: 11px;
}

.designer-page-workbench input,
.designer-page-workbench select,
.designer-page-workbench textarea,
.designer-page-workbench .readonly-input {
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 10px;
}

.designer-page-workbench textarea.compact-json-editor {
    min-height: 220px;
}

.designer-page-workbench .compact-form-grid {
    gap: 6px 8px;
}

.designer-page-workbench .designer-binding-row,
.designer-page-workbench .designer-binding-row-compact,
.designer-page-workbench .designer-binding-row-compactish {
    gap: 8px;
}

.designer-page-workbench .designer-coverage-list,
.designer-page-workbench .designer-palette-list,
.designer-page-workbench .designer-trace-list {
    gap: 6px;
}

.designer-page-workbench .designer-diagnostic-item,
.designer-page-workbench .designer-trace-item,
.designer-page-workbench .designer-palette-item,
.designer-page-workbench .solution-inspector-match {
    padding: 8px 10px;
    border-radius: 12px;
}

.designer-page-workbench .is-active-target {
    border-color: rgba(22, 93, 255, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.12);
    background: rgba(22, 93, 255, 0.04);
}

.designer-page-workbench .designer-linked-rule-grid .rule-grid-generate {
    gap: 8px 8px;
}

.designer-page-workbench .designer-linked-rule-grid .rule-grid-generate input {
    min-height: 30px;
    padding: 4px 6px;
}

.designer-page-workbench .designer-linked-rule-grid .rule-grid-generate .field-group label {
    font-size: 10px;
}

.designer-page-workbench .solution-cell-actions {
    gap: 6px;
}

.designer-page-workbench .solution-cell-actions .btn-compact,
.designer-page-workbench .btn-compact {
    min-height: 30px;
    padding: 5px 9px;
}

.designer-page-workbench .doc-preview-frame {
    min-height: 200px;
}

.designer-page-workbench .doc-preview-frame iframe {
    height: 200px;
}

.designer-page .split-grid,
.designer-page .designer-side-stack,
.designer-page .designer-repeater-stack,
.designer-page .designer-template-stack,
.designer-page .designer-palette-groups,
.designer-page .designer-trace-groups {
    gap: 14px;
}

.designer-context-preview-grid {
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
}

.designer-dual-section-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.designer-page .designer-repeater-card>.split-grid,
.designer-page .designer-repeater-card>.card {
    margin-top: 10px;
}

.designer-page .designer-leading-copy,
.designer-page .info-strip {
    padding: 10px 12px;
    border-radius: 12px;
    gap: 6px;
}

.designer-page .designer-template-scroll {
    padding: 6px;
    border-radius: 14px;
}

.designer-page .designer-template-table {
    border-spacing: 6px;
}

.designer-page .designer-template-cell {
    width: 114px;
    min-height: 68px;
    gap: 6px;
    padding: 8px 8px 10px;
    border-radius: 12px;
}

.designer-page .designer-template-cell-text {
    font-size: 12px;
    line-height: 1.3;
}

.designer-page .designer-template-cell-sample {
    padding: 6px 8px;
    font-size: 11px;
}

.designer-page .designer-diagnostics-card {
    gap: 10px;
    margin-bottom: 0;
}

.designer-page .designer-diagnostics-list {
    gap: 8px;
    max-height: 320px;
}

.designer-page .designer-coverage-list,
.designer-page .designer-trace-list,
.designer-page .designer-palette-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.designer-page .designer-diagnostic-item,
.designer-page .designer-trace-item,
.designer-page .designer-palette-item {
    gap: 6px;
    padding: 10px 12px;
    border-radius: 12px;
}

.designer-page .designer-trace-item strong {
    font-size: 16px;
}

.designer-page .designer-binding-list {
    gap: 8px;
    margin-bottom: 8px;
}

.designer-page .designer-binding-row {
    grid-template-columns: minmax(180px, 0.95fr) minmax(0, 1.45fr) auto;
    gap: 8px;
}

.designer-page .designer-binding-row-compact {
    grid-template-columns: 88px minmax(0, 1fr) auto;
}

.designer-page .designer-binding-row-4 {
    grid-template-columns: minmax(160px, 0.95fr) 110px minmax(180px, 1.2fr) minmax(160px, 1fr) auto;
}

.designer-page-generation .json-editor {
    min-height: 320px;
}

.compact-form-grid {
    gap: 8px 10px;
}

.designer-binding-row-compactish {
    grid-template-columns: minmax(128px, 0.9fr) minmax(0, 1.3fr) auto;
}

.compact-computed-row {
    grid-template-columns: minmax(140px, 0.9fr) 96px minmax(0, 1.3fr) minmax(120px, 0.8fr) auto;
}

.compact-json-editor {
    min-height: 220px;
    font-size: 12px;
}

.solution-inspector-card {
    position: sticky;
    top: 18px;
    z-index: 2;
}

.solution-cell-meta-grid {
    display: grid;
    gap: 8px;
}

.solution-cell-text-readonly {
    white-space: pre-wrap;
    min-height: 54px;
    align-content: start;
}

.solution-cell-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 12px;
}

.solution-cell-actions .btn-compact {
    min-width: 0;
    justify-content: center;
}

.compact-repeater-stack {
    gap: 12px;
}

.compact-linked-grid .rule-grid-generate {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
}

.compact-linked-grid .rule-grid-generate .field-group label {
    font-size: 11px;
}

.compact-linked-grid .rule-grid-generate input {
    min-height: 34px;
    padding: 6px 8px;
}

.compact-linked-grid .rule-grid-generate .check-line {
    gap: 6px;
}

.solution-inspector-match {
    cursor: pointer;
}

.solution-inspector-match:hover {
    border-color: rgba(22, 93, 255, 0.28);
    background: rgba(22, 93, 255, 0.05);
}

.designer-side-stack .designer-side-details>summary {
    padding-bottom: 8px;
}

.designer-side-stack .designer-side-details+.designer-side-details,
.designer-side-stack .designer-diagnostics-card+.designer-side-details {
    margin-top: 10px;
}

@media (max-width: 1500px) {
    .designer-linked-rule-grid .rule-grid-generate {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .designer-linked-rule-grid .rule-grid-generate {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .designer-page .designer-generation-head,
    .designer-linked-profile-meta-inline {
        display: flex;
        flex-wrap: wrap;
        white-space: normal;
    }

    .designer-linked-profile-note {
        white-space: normal;
    }
}

@media (max-width: 720px) {
    .designer-linked-rule-grid .rule-grid-generate {
        grid-template-columns: minmax(0, 1fr);
    }

    .designer-linked-rule-grid .rule-grid-generate .rule-item-span-2,
    .designer-linked-rule-grid .rule-grid-generate .rule-item-full {
        grid-column: auto;
    }
}

.generation-top-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.2fr) minmax(320px, 1.4fr);
    align-items: end;
    gap: 10px;
    width: 100%;
    max-width: 100%;
}

.generation-top-row .generation-meta-item {
    min-width: 0;
}

.generation-top-row .generation-meta-item-wide {
    min-width: 0;
}

.generation-top-row .generation-meta-item-reference {
    min-width: 0;
}

.generation-top-row textarea {
    min-height: 42px;
    max-height: 42px;
    resize: none;
    overflow: hidden;
}

.rule-edit-actions {
    margin-top: 2px;
}

.generation-top-row .field-group {
    gap: 4px;
}

.generation-top-row .field-group label {
    font-size: 13px;
}

.generation-top-row .field-group input,
.generation-top-row .field-group textarea {
    width: 100%;
    min-height: 42px;
    height: 42px;
    line-height: 1.2;
    box-sizing: border-box;
}

.generation-top-row .generation-meta-item-reference .file-reference-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex-wrap: nowrap;
}

.generation-top-row .generation-meta-item-reference input[type="file"] {
    width: auto !important;
    max-width: 260px;
    flex: 0 0 260px;
    min-width: 0;
}

.generation-top-row .generation-meta-item-reference .file-reference-meta-inline {
    flex: 1 1 auto;
    min-width: 0;
}

.collection-rule-top-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(240px, 1.15fr) minmax(220px, 1fr) minmax(280px, 1.2fr);
    align-items: end;
    gap: 10px;
    width: 100%;
    max-width: 100%;
}

.collection-rule-top-row .collection-meta-item {
    min-width: 0;
}

.collection-rule-top-row .field-group {
    gap: 4px;
}

.collection-rule-top-row .field-group label {
    font-size: 13px;
}

.collection-rule-top-row .field-group input,
.collection-rule-top-row .field-group textarea {
    width: 100%;
    min-height: 42px;
    height: 42px;
    line-height: 1.2;
    box-sizing: border-box;
}

.collection-rule-top-row textarea {
    min-height: 42px;
    max-height: 42px;
    resize: none;
    overflow: hidden;
}

.collection-current-doc {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
    min-width: 0;
    flex-wrap: wrap;
}

.collection-current-doc small {
    margin: 0;
    color: var(--text);
    min-width: 0;
    flex: 1 1 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collection-current-doc.is-empty small {
    color: var(--muted);
}

.collection-current-doc .inline-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.generation-rule-edit-form .field-group:not(.generation-meta-item) input,
.generation-rule-edit-form .field-group:not(.generation-meta-item) select,
.generation-rule-edit-form .field-group:not(.generation-meta-item) textarea {
    max-width: 720px;
}

.generation-rule-edit-form .rule-grid-generate .rule-item-span-2 {
    grid-column: span 1;
}

.generation-rule-edit-form .rule-grid-generate .rule-item {
    padding: 5px 6px;
}

.generation-rule-edit-form .rule-grid-generate .field-group label,
.generation-rule-edit-form .rule-grid-generate .check-line span {
    font-size: 10px;
    line-height: 1.2;
}

.generation-rule-edit-form .rule-grid-generate input,
.generation-rule-edit-form .rule-grid-generate select,
.generation-rule-edit-form .rule-grid-generate textarea {
    min-height: 28px;
    padding: 4px 6px;
    font-size: 12px;
}

.generation-rule-edit-form .rule-grid-generate .range-inline {
    grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr);
    gap: 4px;
}

.generation-rule-edit-form .rule-grid-generate .range-inline span {
    font-size: 11px;
}

.generation-rule-edit-form .rule-grid-generate .check-line {
    align-items: flex-start;
    gap: 6px;
}

.generation-rule-edit-form .rule-grid-generate .check-line input {
    width: 14px;
    height: 14px;
    margin-top: 1px;
}

@media (max-width: 900px) {
    .profile-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .designer-workspace {
        grid-template-columns: 1fr;
    }

    .designer-bottom-sections,
    .designer-switcher-form,
    .designer-solution-meta-row,
    .designer-bottom-split,
    .designer-mapping-pair,
    .designer-repeater-grid,
    .designer-context-preview-grid,
    .designer-dual-section-grid,
    .designer-page .designer-coverage-list,
    .designer-page .designer-trace-list,
    .designer-page .designer-palette-list {
        grid-template-columns: 1fr;
    }

    .designer-page-solution .designer-bottom-sections>.designer-bottom-split,
    .designer-page-solution .designer-bottom-sections> :nth-child(2),
    .designer-page-solution .designer-bottom-sections> :nth-child(3),
    .designer-page-solution .designer-bottom-sections> :nth-child(4) {
        grid-column: auto;
    }

    .designer-binding-row,
    .designer-binding-row-compact,
    .designer-binding-row-4 {
        grid-template-columns: 1fr;
    }

    .generation-top-row {
        grid-template-columns: 1fr;
    }

    .generation-top-row .generation-meta-item,
    .generation-top-row .generation-meta-item-wide,
    .generation-top-row .generation-meta-item-reference {
        min-width: 0;
    }
}

@media (max-width: 1280px) {
    .designer-switcher-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .collection-rule-top-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .designer-solution-meta-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .designer-solution-template-row {
        flex-wrap: wrap;
    }

    .designer-bottom-sections,
    .designer-bottom-split,
    .designer-mapping-pair,
    .designer-repeater-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .designer-page .designer-coverage-list,
    .designer-page .designer-trace-list,
    .designer-page .designer-palette-list {
        grid-template-columns: 1fr;
    }

    .designer-page-solution .designer-bottom-sections {
        grid-template-columns: 1fr;
    }

    .designer-page-solution .designer-bottom-sections>.designer-bottom-split,
    .designer-page-solution .designer-bottom-sections> :nth-child(2),
    .designer-page-solution .designer-bottom-sections> :nth-child(3),
    .designer-page-solution .designer-bottom-sections> :nth-child(4) {
        grid-column: auto;
    }
}

.doc-preview {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid rgba(89, 135, 255, 0.18);
    border-radius: 14px;
    background: #fdfdff;
    overflow: visible;
}

.doc-preview-line {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
    font-size: 13px;
    color: var(--muted);
}

.doc-preview-line.is-table-title {
    margin-top: 4px;
    font-weight: 700;
    color: var(--text);
}

.doc-preview-line.is-empty {
    color: var(--muted);
}

.doc-preview-frame {
    border: 1px solid rgba(89, 135, 255, 0.18);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    min-height: 520px;
    height: clamp(520px, 68vh, 840px);
}

.doc-preview-frame iframe {
    width: 100%;
    height: 100%;
    min-height: 520px;
    border: 0;
    display: block;
    background: #fff;
}

.file-reference-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    gap: 8px;
    flex-wrap: wrap;
}

.file-reference-meta form {
    margin: 0;
}

.file-reference-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.file-reference-inline>input[type="file"] {
    flex: 1 1 auto;
    min-width: 0;
}

.file-reference-meta-inline {
    flex: 0 0 auto;
    margin-top: 0;
    justify-content: flex-end;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.file-reference-meta-inline small {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.btn-inline {
    min-height: 32px;
    padding: 0 12px;
    font-size: 13px;
}

.danger-soft {
    border-color: rgba(230, 87, 87, 0.2);
    color: #d24c4c;
}

.rule-preview-layout {
    display: grid;
    grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.rule-preview-pane {
    min-width: 0;
}

.rule-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.preview-mode-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.designer-preview-head .preview-mode-switch {
    flex-wrap: nowrap;
}

.preview-mode-switch .btn-inline.is-active {
    background: linear-gradient(135deg, var(--primary) 0%, #3f8cff 100%);
    border-color: transparent;
    color: #fff;
}

.rule-preview-tip {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.rule-help-grid {
    display: grid;
    gap: 10px;
}

.rule-help-item {
    padding: 12px 14px;
    border: 1px solid rgba(89, 135, 255, 0.14);
    border-radius: 14px;
    background: #fbfcff;
}

.rule-help-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.rule-help-head strong {
    font-size: 14px;
    color: var(--text);
}

.rule-help-head span {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(47, 111, 237, 0.08);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

.rule-help-item p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

.rule-item[data-preview-focus],
.rule-help-item[data-preview-focus] {
    cursor: pointer;
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.rule-item.is-preview-focus-active,
.rule-help-item.is-preview-focus-active {
    border-color: rgba(47, 111, 237, 0.36);
    box-shadow: 0 0 0 2px rgba(47, 111, 237, 0.08);
    background: rgba(47, 111, 237, 0.04);
}

.rule-grid-collect .rule-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 0 0 auto;
    width: 120px;
    max-width: 120px;
}

.rule-grid-collect input[type="number"] {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
}

.rule-grid-collect .rule-item-full {
    width: 100%;
    max-width: none;
}

.rule-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border: 1px dashed rgba(22, 93, 255, 0.24);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(22, 93, 255, 0.03), rgba(22, 93, 255, 0.01));
}

.rule-preview-item {
    display: grid;
    gap: 4px;
    padding: 8px 9px;
    border-radius: 10px;
    border: 1px solid rgba(22, 93, 255, 0.1);
    background: rgba(255, 255, 255, 0.94);
}

.rule-preview-item label {
    font-size: 11px;
    line-height: 1.35;
    font-weight: 600;
}

.rule-preview-range {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.preview-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    max-width: 72px;
    height: 26px;
    padding: 2px 6px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fbfcff;
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
}

.preview-sep {
    color: var(--muted);
    font-size: 11px;
}

.preview-flag[data-enabled="1"] {
    color: var(--primary-strong);
    background: rgba(22, 93, 255, 0.08);
}

.preview-flag[data-enabled="0"] {
    color: var(--muted);
}

.quick-param-preview {
    min-height: 88px;
}

.quick-param-empty {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    min-height: 72px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px dashed rgba(22, 93, 255, 0.18);
    background: rgba(255, 255, 255, 0.9);
    color: var(--muted);
    font-size: 13px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 18px;
    color: var(--muted);
}

.breadcrumb strong,
.breadcrumb a:hover {
    color: var(--text);
}

.detail-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
}

.detail-list dt {
    color: var(--muted);
}

.detail-list dd {
    margin: 0;
}

.chip-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.chip-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(22, 93, 255, 0.14);
    background: linear-gradient(180deg, rgba(22, 93, 255, 0.06), rgba(20, 184, 166, 0.05));
}

.chip-card span,
.chip-card small {
    color: var(--muted);
}

.chip-card strong {
    display: block;
    font-size: 28px;
    color: var(--text);
}

.chip-card em {
    font-style: normal;
    color: var(--primary);
    font-size: 13px;
}

.info-strip {
    display: grid;
    gap: 10px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(22, 93, 255, 0.07), rgba(22, 93, 255, 0.03));
    border: 1px solid rgba(22, 93, 255, 0.12);
    margin-top: 14px;
}

.info-strip strong {
    color: var(--text);
}

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

.info-strip-soft {
    background: rgba(20, 184, 166, 0.07);
    border-color: rgba(20, 184, 166, 0.18);
}

.upload-target-strip {
    margin: 0 0 18px;
}

.path-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.path-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 47, 0.06);
    color: var(--text);
    font-size: 13px;
}

.path-pill-accent {
    background: rgba(22, 93, 255, 0.14);
    color: var(--primary-strong);
}

.directory-browser {
    display: grid;
    grid-template-columns: minmax(280px, 0.76fr) minmax(0, 1.24fr);
    gap: 18px;
}

.template-browser {
    align-items: start;
}

.template-browser .section-head-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.template-browser .section-head-row> :first-child {
    min-width: 0;
}

.template-browser .section-head-row> :last-child {
    justify-self: end;
}

.template-browser .section-head h2 {
    white-space: nowrap;
}

.template-browser .folder-list-head,
.template-browser .folder-list-row {
    grid-template-columns: minmax(170px, 1fr) minmax(0, 1.2fr) auto;
}

.template-browser .folder-list-head span:nth-child(1),
.template-browser .folder-list-head span:nth-child(2) {
    justify-self: start;
}

.template-browser .folder-list-head span:nth-child(3) {
    justify-self: end;
    text-align: right;
    white-space: nowrap;
}

.rule-browser {
    grid-template-columns: minmax(300px, 3fr) minmax(0, 7fr);
    align-items: start;
}

.rule-browser-sidebar {
    display: grid;
    gap: 18px;
    align-content: start;
    min-width: 0;
}

.rule-browser .folder-list-head,
.rule-browser .folder-list-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.rule-browser-main {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.rule-browser>.browser-panel>.section-head-row,
.rule-browser-sidebar .section-head-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.rule-browser>.browser-panel>.section-head-row> :first-child,
.rule-browser-sidebar .section-head-row> :first-child {
    min-width: 0;
}

.rule-browser>.browser-panel .browser-toolbar-actions,
.rule-browser-sidebar .browser-toolbar-actions {
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: flex-end;
}

.rule-browser>.browser-panel .browser-toolbar-actions>*,
.rule-browser-sidebar .browser-toolbar-actions>* {
    flex: 0 0 auto;
}

.rule-browser-sidebar .empty-state-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.rule-browser-sidebar .empty-state-cta> :first-child {
    min-width: 0;
}

.rule-browser-sidebar .empty-state-cta> :last-child {
    justify-self: end;
}

.rule-browser-main .section-head-row,
.rule-browser-main .empty-state-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.rule-browser-main .section-head-row> :first-child,
.rule-browser-main .empty-state-cta> :first-child {
    min-width: 0;
}

.rule-browser-main .section-head-row> :last-child,
.rule-browser-main .empty-state-cta> :last-child {
    justify-self: end;
}

.rule-browser-main .empty-state-cta {
    padding-right: 0;
}

.browser-panel {
    border: 1px solid rgba(216, 222, 232, 0.9);
    border-radius: 20px;
    padding: 18px;
    background: rgba(247, 249, 252, 0.7);
}

.browser-toolbar {
    margin-bottom: 16px;
}

.browser-toolbar-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.browser-toolbar-row .browser-filter-form {
    flex: 1;
}

.browser-toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.browser-toolbar-actions form {
    margin: 0;
}

.browser-filter-form {
    margin: 0;
}

.record-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px 12px;
    margin: 8px 0 12px;
}

.record-filter-form>.field-group {
    flex: 1 1 150px;
    min-width: 140px;
    max-width: 200px;
}

.record-filter-form>.field-group.field-group-compact {
    flex: 0 1 148px;
    max-width: 168px;
}

.record-filter-form>.form-actions {
    flex: 0 0 auto;
    margin-left: auto;
}

.record-filter-form .field-group {
    gap: 6px;
}

.record-filter-form .field-group label {
    font-size: 13px;
}

.record-filter-form input,
.record-filter-form select,
.record-filter-form .readonly-input {
    min-height: 38px;
    padding: 8px 10px;
}

.record-filter-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: flex-start;
}

.record-filter-actions .btn-compact {
    min-height: 38px;
}

.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
    color: var(--muted);
}

.node-pagination {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    padding: 10px 15px 0;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.node-pagination > .inline-page-size-form {
    grid-column: 3;
    justify-self: end;
}

.part-unit-page-navigation,
.part-unit-page-links,
.part-unit-page-jump {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.part-unit-page-navigation {
    gap: 6px 12px;
}

.part-unit-page-links a,
.part-unit-page-links button,
.part-unit-current-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.part-unit-current-page {
    padding: 0 9px;
    border-radius: 10px;
    background: #e7efff;
    color: #164cb5;
    font-weight: 700;
}

.part-unit-page-jump input[type="number"] {
    width: 66px;
    min-height: 32px;
    padding: 0 6px;
}

@media (max-width: 1100px) {
    .node-pagination {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .part-unit-page-navigation {
        grid-row: 1;
        grid-column: 1 / -1;
    }

    .node-pagination > .inline-page-size-form {
        grid-column: 2;
    }
}

.pagination-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.batch-inline-date-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.batch-inline-date-input {
    height: 34px;
    width: 146px;
    padding: 0 10px;
    font-size: 13px;
}

.record-edit-card {
    max-width: 100%;
}

.record-edit-form {
    display: grid;
    gap: 14px;
}

.record-edit-form h3 {
    margin: 2px 0 -2px;
    font-size: 16px;
}

.record-edit-grid {
    display: grid;
    gap: 10px 12px;
    align-items: start;
}

.record-edit-grid-basic {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.record-edit-grid-grouting {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.record-edit-span-2 {
    grid-column: span 2;
}

.record-edit-span-3 {
    grid-column: span 3;
}

.record-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 18px;
}

.record-edit-grid .record-inline-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
}

.record-edit-grid .record-inline-check input[type="checkbox"] {
    width: auto;
    min-height: 0;
    padding: 0;
    margin: 0;
    accent-color: var(--primary);
}

.record-edit-grid .record-station-textarea {
    min-height: 36px;
    height: 36px;
    padding: 7px 10px;
    line-height: 1.4;
    resize: vertical;
}

.record-time-pair {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 36px;
    padding: 0 8px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-2);
}

.record-time-pair:focus-within {
    border-color: rgba(22, 93, 255, 0.55);
    box-shadow: 0 0 0 4px rgba(22, 93, 255, 0.08);
}

.record-edit-grid .record-time-pair input {
    flex: 1 1 0;
    min-width: 0;
    min-height: 34px;
    padding: 6px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.record-edit-grid .record-time-pair input:focus {
    box-shadow: none;
}

.record-time-sep {
    flex: 0 0 auto;
    color: var(--muted);
    font-weight: 700;
    line-height: 1;
    user-select: none;
}

.record-edit-grid .field-group {
    gap: 5px;
    min-width: 0;
}

.record-edit-grid .field-group label {
    min-height: 18px;
    display: flex;
    align-items: center;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-edit-grid input,
.record-edit-grid select,
.record-edit-grid textarea {
    min-height: 36px;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 13px;
}

.record-edit-form .form-actions {
    margin-top: 4px;
}

@media (max-width: 1360px) {
    .record-edit-grid-grouting {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .record-edit-span-3 {
        grid-column: span 2;
    }
}

@media (max-width: 1020px) {
    .record-edit-grid-basic,
    .record-edit-grid-grouting {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .record-edit-span-3 {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .record-edit-grid-basic,
    .record-edit-grid-grouting {
        grid-template-columns: 1fr;
    }

    .record-edit-span-2,
    .record-edit-span-3 {
        grid-column: span 1;
    }
}

.readonly-input {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
}

.browser-list-head {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

.browser-list-head strong {
    color: var(--text);
}

.browser-list-head span {
    color: var(--muted);
    font-size: 13px;
}

.browser-list-head-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.node-detail-page .card {
    padding: 20px;
    margin-bottom: 18px;
}

.node-detail-page .section-head {
    margin-bottom: 12px;
}

.node-detail-page .directory-browser {
    grid-template-columns: minmax(300px, 0.54fr) minmax(0, 1.46fr);
    gap: 14px;
    align-items: start;
}

.node-detail-page .browser-panel {
    padding: 14px 16px;
}

.node-detail-page .browser-toolbar {
    margin-bottom: 10px;
}

.node-detail-page .browser-list-head {
    margin-bottom: 8px;
}

.node-detail-page .browser-list-head-row>div:first-child {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    flex-wrap: nowrap;
}

.node-detail-page .browser-list-head-row>div:first-child span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-detail-page .browser-toolbar-row {
    align-items: flex-end;
    flex-wrap: wrap;
    row-gap: 8px;
}

.node-detail-page .browser-toolbar-row .browser-toolbar-actions form {
    margin: 0;
}

.node-detail-page .browser-toolbar-row .field-group {
    gap: 6px;
}

.node-detail-page .browser-toolbar-row .field-group label {
    font-size: 13px;
}

.node-detail-page .browser-toolbar-row .browser-filter-form.unit-switch-field {
    flex: 0 0 auto;
    max-width: 320px;
}

.node-detail-page .browser-toolbar-row .unit-switch-field .field-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.node-detail-page .browser-toolbar-row .unit-switch-field label {
    white-space: nowrap;
    margin-bottom: 0;
    font-size: 12px;
}

.node-detail-page .browser-toolbar-row .unit-switch-field select {
    width: 100px;
    min-width: 80px;
    height: 32px;
    min-height: 32px;
    padding: 0 8px;
    font-size: 12px;
}

.node-detail-page .browser-toolbar-row .btn-compact {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

.node-detail-page .browser-toolbar-row input,
.node-detail-page .browser-toolbar-row select,
.node-detail-page .browser-toolbar-row .readonly-input {
    height: 32px;
    min-height: 32px;
    padding: 0 8px;
    font-size: 12px;
}

.node-detail-page .data-table th.col-filename {
    width: 504px;
}

.node-detail-page .data-table td.col-filename {
    max-width: 504px;
}

.node-detail-page .data-table td.col-filename strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.node-detail-page .data-table th.col-template {
    width: 192px;
}

.node-detail-page .data-table td.col-template {
    max-width: 192px;
}

.node-detail-page .data-table td.col-template span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.node-detail-page .data-table th,
.node-detail-page .data-table td {
    padding-top: 11px;
    padding-bottom: 11px;
}

.node-detail-page .pagination-bar {
    margin-top: 12px;
}

.node-detail-page .empty-state {
    padding: 16px 18px;
}

.folder-row {
    text-decoration: none;
}

.folder-row span {
    white-space: nowrap;
}

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

.folder-list-head,
.folder-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.folder-list-head {
    padding: 0 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.folder-list-body {
    display: grid;
    gap: 8px;
}

.folder-list-row {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(216, 222, 232, 0.9);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.folder-list-row:hover {
    border-color: rgba(22, 93, 255, 0.28);
    background: rgba(22, 93, 255, 0.03);
}

.folder-list-row.active {
    border-color: rgba(22, 93, 255, 0.42);
    background: linear-gradient(180deg, rgba(22, 93, 255, 0.08), rgba(20, 184, 166, 0.05));
}

.folder-list-row strong,
.folder-list-row span {
    min-width: 0;
}

.folder-desc {
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-count {
    justify-self: end;
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
    text-align: right;
}

.template-title-link {
    color: var(--text);
    font-weight: 700;
}

.template-title-link:hover {
    color: var(--primary);
}

.browser-table {
    min-width: 100%;
}

.template-list-table {
    table-layout: fixed;
}

.template-list-table th,
.template-list-table td {
    min-width: 0;
    vertical-align: middle;
}

.template-list-table th:nth-child(1),
.template-list-table td:nth-child(1) {
    width: 18%;
}

.template-list-table th:nth-child(2),
.template-list-table td:nth-child(2) {
    width: 20%;
}

.template-list-table th:nth-child(3),
.template-list-table td:nth-child(3) {
    width: 16%;
}

.template-list-table th:nth-child(4),
.template-list-table td:nth-child(4) {
    width: 18%;
}

.template-list-table th:nth-child(5),
.template-list-table td:nth-child(5) {
    width: 28%;
}

.template-list-table .actions {
    align-items: center;
    gap: 4px 10px;
}

.template-list-table td:has(> .actions),
.template-list-table th:last-child {
    overflow: visible;
}

.template-list-table .actions .btn-link {
    display: inline-flex;
    white-space: nowrap;
}

.unit-table {
    min-width: 0 !important;
    table-layout: fixed;
}

.unit-table td,
.unit-table th {
    white-space: nowrap;
}

.unit-table th:nth-child(1),
.unit-table td:nth-child(1) {
    width: auto;
    min-width: 0;
}

.unit-table th:nth-child(2),
.unit-table td:nth-child(2) {
    width: 84px;
}

.unit-table th:nth-child(3),
.unit-table td:nth-child(3) {
    width: 118px;
}

.unit-table td {
    padding-top: 11px;
    padding-bottom: 11px;
}

.node-detail-page .unit-table th,
.node-detail-page .unit-table td {
    padding-left: 6px;
    padding-right: 6px;
}

.unit-row-link {
    cursor: pointer;
}

.unit-row-active td {
    background: linear-gradient(180deg, rgba(22, 93, 255, 0.08), rgba(20, 184, 166, 0.05));
}

.unit-row-link:hover td {
    background: rgba(22, 93, 255, 0.04);
}

.unit-jump-link {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.unit-jump-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.unit-table .actions {
    gap: 4px;
}

.unit-table .btn-link {
    font-size: 12px;
    white-space: nowrap;
}

@media (max-width: 1400px) {
    .unit-table th:nth-child(2),
    .unit-table td:nth-child(2) {
        width: 80px;
    }

    .unit-table th:nth-child(3),
    .unit-table td:nth-child(3) {
        width: 114px;
    }
}

@media (max-width: 1180px) {
    .unit-table th:nth-child(2),
    .unit-table td:nth-child(2) {
        width: 76px;
    }

    .unit-table th:nth-child(3),
    .unit-table td:nth-child(3) {
        width: 110px;
    }
}

.collection-browser-table {
    min-width: 460px;
    table-layout: fixed;
}

.collection-browser-table th,
.collection-browser-table td {
    min-width: 0;
    vertical-align: middle;
}

.collection-browser-table td {
    white-space: nowrap;
}

.collection-browser-table.has-scope-column col.col-name {
    width: 18%;
}

.collection-browser-table.has-scope-column col.col-scope {
    width: 30%;
}

.collection-browser-table.has-scope-column col.col-template {
    width: auto;
}

.collection-browser-table.has-scope-column col.col-actions {
    width: 176px;
}

.collection-browser-table.no-scope-column col.col-name {
    width: 24%;
}

.collection-browser-table.no-scope-column col.col-template {
    width: auto;
}

.collection-browser-table.no-scope-column col.col-actions {
    width: 176px;
}

.collection-browser-table .collection-name-cell .single-line-ellipsis,
.collection-browser-table .collection-scope-cell .single-line-ellipsis,
.collection-browser-table .collection-template-cell .single-line-ellipsis {
    max-width: 100%;
}

.collection-browser-table .collection-actions {
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    white-space: nowrap;
}

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

.rule-browser-main .table-wrap {
    overflow-x: hidden;
}

.rule-browser-sidebar .table-wrap {
    overflow-x: hidden;
}

.unit-table-wrap {
    overflow-x: clip;
}

.data-table {
    width: 100%;
    min-width: 840px;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 13px 12px;
    text-align: center;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    background: rgba(247, 249, 252, 0.95);
}

.data-table :is(input[type="text"], input[type="number"], select) {
    text-align: center;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.data-table :is(.actions, .table-action-row) {
    align-items: center;
    justify-content: center;
}

.actions form {
    margin: 0;
}

/* 数据浏览页表格与容器置于通用 .table-wrap / .data-table / .actions 之后并以复合选择器提权，彻底禁止内部滚动条 */
.table-wrap.record-table-wrap {
    overflow-x: hidden;
    overflow-y: visible;
}

.data-table.record-table {
    width: 100%;
    min-width: 0;
    font-size: 13px;
}

.data-table.record-table th {
    font-size: 12px;
    line-height: 1.25;
}

.data-table.record-table th .th-unit {
    display: inline;
    margin-left: 2px;
    font-weight: 500;
    font-size: 11px;
    opacity: 0.85;
}

.data-table.record-table th,
.data-table.record-table td {
    white-space: nowrap;
    padding: 8px 5px;
    vertical-align: middle;
}

.data-table.record-table th:first-child,
.data-table.record-table td:first-child {
    padding-left: 6px;
}

.data-table.record-table .col-ellipsis {
    max-width: 76px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table.record-table .station-col {
    white-space: nowrap;
    max-width: 116px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table.record-table .check-col {
    width: 26px;
    padding-left: 2px;
    padding-right: 2px;
    text-align: center;
}

.data-table.record-table .check-col input[type="checkbox"] {
    width: 15px;
    height: 15px;
    padding: 0;
    margin: 0;
    vertical-align: middle;
    cursor: pointer;
}

.data-table.record-table .actions {
    white-space: nowrap;
    flex-wrap: nowrap;
    gap: 6px;
}

@media (max-width: 1180px) {
    .data-table.record-table {
        font-size: 12px;
    }

    .data-table.record-table th {
        font-size: 11px;
    }

    .data-table.record-table th,
    .data-table.record-table td {
        padding: 6px 3px;
    }

    .data-table.record-table .col-ellipsis {
        max-width: 60px;
    }

    .data-table.record-table .station-col {
        max-width: 92px;
    }
}

.single-line-nowrap {
    white-space: nowrap;
}

.single-line-ellipsis {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collection-rule-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.collection-rule-table th,
.collection-rule-table td {
    vertical-align: middle;
    min-width: 0;
    padding: 9px 10px;
}

.collection-rule-table th:nth-child(1),
.collection-rule-table td:nth-child(1) {
    width: 46%;
}

.collection-rule-table th:nth-child(2),
.collection-rule-table td:nth-child(2) {
    width: 12%;
}

.collection-rule-table th:nth-child(3),
.collection-rule-table td:nth-child(3) {
    width: 16%;
}

.collection-rule-table th:nth-child(4),
.collection-rule-table td:nth-child(4) {
    width: 26%;
}

.collection-rule-actions {
    flex-wrap: nowrap;
    white-space: nowrap;
    align-items: center;
    gap: 8px;
}

.skill-upload-inline-form {
    display: inline-flex;
    align-items: center;
}

.skill-upload-trigger {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.collection-rule-table td:has(> .actions),
.collection-rule-table th:last-child {
    overflow: visible;
}

.solution-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.solution-table th,
.solution-table td {
    vertical-align: middle;
    min-width: 0;
}

.solution-table th:nth-child(1),
.solution-table td:nth-child(1) {
    width: 34%;
}

.solution-table th:nth-child(2),
.solution-table td:nth-child(2) {
    width: 36%;
}

.solution-table th:nth-child(3),
.solution-table td:nth-child(3) {
    width: 10%;
}

.solution-table th:nth-child(4),
.solution-table td:nth-child(4) {
    width: 20%;
}

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

.solution-table-wrap .solution-table {
    min-width: 620px;
}

.solution-table .solution-name-cell {
    justify-content: center;
}

.solution-table .solution-actions {
    flex-wrap: wrap;
    gap: 4px 10px;
}

@media (min-width: 540px) {
    #template-bind-solution {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }
}

.solution-type-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.solution-type-table th,
.solution-type-table td {
    vertical-align: middle;
    min-width: 0;
}

.solution-type-table th:nth-child(1),
.solution-type-table td:nth-child(1) {
    width: 39%;
}

.solution-type-table th:nth-child(2),
.solution-type-table td:nth-child(2) {
    width: 16%;
}

.solution-type-table th:nth-child(3),
.solution-type-table td:nth-child(3) {
    width: 10%;
}

.solution-type-table th:nth-child(4),
.solution-type-table td:nth-child(4) {
    width: 35%;
}

.solution-type-table-wrap {
    overflow-x: hidden;
}

.solution-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.solution-name-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.solution-inline-pill {
    min-height: 22px;
    padding: 0 8px;
    font-size: 11px;
    flex: 0 0 auto;
}

.solution-actions {
    flex-wrap: nowrap;
    white-space: nowrap;
    align-items: center;
}

.solution-type-actions-cell {
    overflow: hidden;
}

.solution-type-actions {
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
    min-width: 0;
}

.solution-type-actions .btn-link,
.solution-type-actions button.btn-link {
    display: inline-flex;
    align-items: center;
    padding: 2px 0;
    font-size: 14px;
    line-height: 1.25;
    font-weight: 600;
    flex: 0 0 auto;
}

.solution-table td:has(> .actions),
.solution-table th:last-child,
.solution-type-table td:has(> .actions),
.solution-type-table th:last-child {
    overflow: visible;
}

.solution-table .actions .btn-link,
.solution-type-table .actions .btn-link {
    display: inline-flex;
    white-space: nowrap;
}

.generated-table th,
.generated-table td {
    white-space: nowrap;
    min-width: 0;
    vertical-align: middle;
}

.node-detail-page .generated-table,
.recent-generated-table {
    table-layout: fixed;
}

.node-detail-page .generated-table .col-filename,
.recent-generated-table .col-filename {
    width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-detail-page .generated-table .col-template {
    width: 18%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-detail-page .generated-table .col-template span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.generated-browser-table .col-filename {
    min-width: 360px;
}

.generated-table .col-generated-at {
    width: 132px;
}

.generated-table .col-actions {
    width: 162px;
}

.generated-table .generated-file-link {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--primary);
    font-weight: 600;
}

.generated-table .generated-file-link:hover {
    color: var(--primary-strong);
}

.generated-table .check-col {
    width: 42px;
    text-align: center;
}

.generated-table .actions {
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.generated-batch-toolbar {
    justify-content: space-between;
    align-items: center;
}

.generated-batch-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0;
}

.generated-batch-toolbar-actions::after {
    content: "";
    width: 42px;
    flex: 0 0 42px;
}

.btn-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
}

.btn-link.danger {
    color: var(--danger);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.inline-page-size-form {
    margin: 0;
}

.page-size-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.page-size-label select {
    width: 84px;
    min-width: 84px;
    padding: 8px 10px;
    min-height: 38px;
}

.checkbox-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
}

.checkbox-card input {
    width: auto;
    margin-top: 3px;
}

.checkbox-card span {
    display: grid;
    gap: 4px;
}

.checkbox-card small {
    color: var(--muted);
}

.bulk-migrate-picker {
    display: grid;
    gap: 10px;
}

.bulk-migrate-picker-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bulk-migrate-picker-list {
    display: grid;
    gap: 10px;
    max-height: 320px;
    overflow: auto;
    padding-right: 4px;
}

.bulk-migrate-option {
    margin: 0;
}

.stack-list {
    display: grid;
    gap: 14px;
}

.rule-preview-block {
    padding: 14px;
    border: 1px solid rgba(216, 222, 232, 0.9);
    border-radius: 16px;
    background: rgba(247, 249, 252, 0.72);
}

.batch-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.record-batch-toolbar {
    justify-content: space-between;
}

.record-batch-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
}

.record-toolbar-status {
    margin-bottom: 0;
    padding: 10px 12px;
    flex: 1 1 auto;
    min-width: 260px;
}

.check-all-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.check-all-line input {
    width: 16px;
    height: 16px;
}

.empty-state {
    padding: 22px;
    border-radius: 18px;
    background: rgba(102, 116, 140, 0.07);
    color: var(--muted);
}

.empty-state strong {
    display: block;
    color: var(--text);
    margin-bottom: 6px;
}

.empty-state p {
    margin: 0;
}

.empty-state-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(10, 18, 36, 0.42);
    backdrop-filter: blur(10px);
}

.modal-card {
    width: min(100%, 640px);
    background: var(--surface);
    border: 1px solid rgba(216, 222, 232, 0.9);
    border-radius: 24px;
    box-shadow: 0 28px 60px rgba(16, 26, 54, 0.18);
    padding: 24px;
    animation: modal-pop 0.18s ease-out;
}

.modal-card-wide {
    width: min(100%, 980px);
    max-height: calc(100vh - 48px);
    overflow: auto;
}

.modal-card-form {
    width: min(100%, 720px);
    max-height: calc(100vh - 48px);
    overflow: auto;
}

.crack-diagram-modal-card {
    width: min(100%, 1260px);
    max-height: calc(100vh - 44px);
    display: grid;
    gap: 8px;
    padding: 14px 16px 12px;
}

.crack-diagram-modal-body {
    display: grid;
    gap: 6px;
    min-height: 0;
}

.crack-diagram-modal-card .modal-head {
    margin-bottom: 6px;
    align-items: center;
}

.crack-diagram-modal-headline {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px 12px;
    min-width: 0;
}

.crack-diagram-modal-headline p {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crack-diagram-modal-status {
    margin: 0;
    padding: 10px 14px;
    border-radius: 14px;
    gap: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.crack-diagram-modal-card.diagram-phase-batch .crack-diagram-modal-status {
    display: none;
}

.crack-diagram-modal-loading {
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(59, 130, 246, 0.08);
    color: var(--muted);
}

.crack-diagram-modal-frame {
    width: 100%;
    height: min(60vh, 720px);
    min-height: 360px;
    border: 1px solid rgba(216, 222, 232, 0.9);
    border-radius: 18px;
    background: #ffffff;
}

.crack-diagram-modal-card.diagram-phase-batch {
    width: min(100%, 1120px);
}

.crack-diagram-modal-card.diagram-phase-batch .crack-diagram-modal-frame {
    height: min(56vh, 660px);
    min-height: 360px;
}

.crack-diagram-modal-actions {
    margin-top: 0;
    gap: 10px;
}

.crack-diagram-modal-actions .btn-primary,
.crack-diagram-modal-actions .btn-secondary {
    padding: 10px 16px;
    border-radius: 12px;
}

.modal-card-template-upload {
    width: min(100%, 860px);
    max-height: calc(100vh - 48px);
    overflow: auto;
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

#unit-generation-result-message {
    overflow-wrap: anywhere;
}

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

.modal-head p {
    margin: 8px 0 0;
    color: var(--muted);
}

.modal-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: rgba(102, 116, 140, 0.08);
    color: var(--text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    background: rgba(22, 93, 255, 0.12);
}

.solution-category-list-head,
.solution-category-row {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.solution-category-list-head {
    padding: 0 4px 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.solution-category-list {
    display: grid;
    gap: 10px;
}

.solution-category-row {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(216, 222, 232, 0.9);
    background: rgba(247, 249, 252, 0.78);
}

.solution-category-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

@keyframes modal-pop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 1200px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }
}

@media (max-width: 900px) {
    .main {
        padding: 18px;
    }

    .section-head-row,
    .empty-state-cta,
    .browser-list-head-row,
    .stat-grid,
    .split-grid,
    .grid-2,
    .grid-3,
    .topbar {
        grid-template-columns: 1fr;
    }

    .section-head-row,
    .empty-state-cta,
    .browser-list-head-row,
    .topbar {
        display: grid;
    }

    .topbar-title-row {
        align-items: flex-start;
    }

    .solution-category-list-head,
    .solution-category-row {
        grid-template-columns: 1fr;
    }

    .browser-toolbar-row {
        display: grid;
    }

    .record-filter-form>.field-group {
        flex: 1 1 200px;
        max-width: none;
    }

    .record-filter-form>.form-actions {
        margin-left: 0;
    }

    .record-page-title-meta {
        display: block;
        margin-left: 0;
        margin-top: 6px;
        font-size: 15px;
    }

    .dashboard-page-title-meta {
        display: block;
        margin-left: 0;
        margin-top: 6px;
        font-size: 15px;
    }

    .node-detail-page-title-meta {
        display: block;
        margin-left: 0;
        margin-top: 6px;
        font-size: 15px;
    }

    .record-section-head,
    .record-section-copy {
        display: grid;
        gap: 6px;
    }

    .dashboard-section-head,
    .dashboard-section-copy {
        display: grid;
        gap: 6px;
    }

    .node-detail-section-head,
    .node-detail-section-copy,
    .node-detail-page .browser-list-head-row>div:first-child {
        display: grid;
        gap: 6px;
    }

    .node-detail-page .browser-list-head-row>div:first-child span {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .record-filter-actions {
        flex-wrap: wrap;
    }

    .span-2,
    .span-3 {
        grid-column: auto;
    }

    .directory-browser {
        grid-template-columns: 1fr;
    }

    .browser-toolbar-row,
    .browser-list-head-row {
        flex-direction: column;
        align-items: stretch;
    }

    .node-detail-page .browser-toolbar-row .browser-filter-form.unit-switch-field {
        flex: 1 1 auto;
        max-width: none;
    }

    .rule-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .rule-grid-generate,
    .rule-grid-collect {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .rule-preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .collection-rule-top-row {
        grid-template-columns: 1fr;
    }

    .rule-edit-meta {
        grid-template-columns: 1fr;
    }

    .rule-preview-layout {
        grid-template-columns: 1fr;
    }

    .file-reference-inline {
        flex-wrap: wrap;
    }

    .file-reference-meta-inline {
        width: 100%;
        justify-content: space-between;
    }

    .collection-current-doc small {
        white-space: normal;
    }

    .folder-list-head,
    .folder-list-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

@media (max-width: 720px) {
    .profile-summary-grid {
        grid-template-columns: 1fr;
    }

    .designer-template-cell {
        width: 118px;
        min-height: 74px;
    }

    .rule-grid {
        grid-template-columns: 1fr;
    }

    .rule-item-span-2 {
        grid-column: auto;
    }

    .rule-item-full {
        grid-column: auto;
    }

    .rule-preview-grid {
        grid-template-columns: 1fr;
    }

    .record-filter-form>.field-group,
    .record-filter-form>.field-group.field-group-compact,
    .record-filter-form>.form-actions {
        flex: 1 1 100%;
        max-width: none;
        margin-left: 0;
    }

    .record-filter-actions {
        flex-wrap: wrap;
    }

    .folder-list-head {
        display: none;
    }

    .folder-list-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .folder-count {
        justify-self: start;
    }

    .template-browser .section-head-row {
        grid-template-columns: 1fr;
    }

    .template-browser .section-head-row> :last-child {
        justify-self: start;
    }

    .template-browser .section-head h2 {
        white-space: normal;
    }

    .modal-backdrop {
        padding: 14px;
    }
}

.help-card {
    display: grid;
    gap: 12px;
}

.help-inline-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.help-code {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(22, 93, 255, 0.22);
    background: linear-gradient(180deg, rgba(15, 23, 47, 0.95), rgba(22, 32, 62, 0.95));
    color: #dce7ff;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    word-break: break-all;
}

.help-status-row {
    display: flex;
    align-items: center;
}

.help-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.help-status.is-ok {
    color: #0f766e;
    background: rgba(20, 184, 166, 0.16);
}

.help-status.is-missing {
    color: #c2410c;
    background: rgba(251, 146, 60, 0.2);
}

.help-file-cell code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    color: #24324a;
    word-break: break-all;
}

.help-steps {
    margin: 0;
    padding-left: 20px;
    line-height: 1.8;
}

.help-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.plugin-overview-card {
    gap: 14px;
}

.plugin-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
}

.plugin-editor-form {
    display: grid;
    gap: 14px;
}

.plugin-type-table input[type="text"],
.plugin-type-table input[type="number"] {
    min-width: 120px;
    width: 100%;
}

.plugin-type-table td {
    vertical-align: middle;
}

.plugin-default-solution-field {
    max-width: 460px;
}

.plugin-v2-form {
    gap: 16px;
}

.plugin-pipeline-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.plugin-pipeline-tabs .btn-secondary.is-active {
    background: rgba(30, 96, 255, 0.12);
    border-color: rgba(30, 96, 255, 0.42);
    color: #1442b5;
}

.plugin-pipeline-panel {
    display: none;
    gap: 12px;
}

.plugin-pipeline-panel.is-active {
    display: grid;
}

.plugin-pipeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
}

.plugin-pipeline-grid .card {
    margin: 0;
}

.plugin-pipeline-grid h3 {
    margin: 0 0 8px;
    font-size: 15px;
    color: #1f2c42;
}

.plugin-inline-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.plugin-override-table textarea,
.plugin-pipeline-grid textarea {
    min-height: 88px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
}

/* 当前登录用户：放在侧栏导航下方并固定在底部，菜单向上展开 */
.sidebar-user {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(16, 26, 54, .08);
}

.sidebar-user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid rgba(16, 26, 54, .07);
    border-radius: 12px;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 1px 2px rgba(16, 26, 54, .04);
    transition: background-color 160ms ease-out, border-color 160ms ease-out;
}

.sidebar-user-box:hover {
    background: #ffffff;
    border-color: rgba(22, 93, 255, .2);
}

.sidebar-user-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2f9dff 0%, #165dff 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(22, 93, 255, .18);
}

.sidebar-user-meta {
    display: grid;
    gap: 1px;
    min-width: 0;
    text-align: left;
}

.sidebar-user-meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    color: var(--text);
}

.sidebar-user-meta small {
    font-size: 11.5px;
    color: var(--muted);
}

.sidebar-user-box > svg {
    flex: 0 0 auto;
    margin-left: auto;
    color: var(--muted);
    transition: transform 180ms ease;
}

.user-dropdown-details[open] .sidebar-user-box > svg {
    transform: rotate(180deg);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #ecf3ff 0%, #f5f8ff 50%, #f0fff8 100%);
    padding: 20px;
}

.auth-card {
    width: min(460px, 100%);
    background: #ffffff;
    border: 1px solid #dde4f2;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(19, 35, 70, 0.15);
    padding: 22px;
    display: grid;
    gap: 14px;
}

.auth-head h1 {
    margin: 0;
    font-size: 24px;
    color: #1d2f55;
}

.auth-head p {
    margin: 6px 0 0;
    color: #5f6d84;
    font-size: 14px;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.auth-note {
    margin: 0;
    font-size: 13px;
    color: #4f5e7a;
}

.system-settings-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
}

.system-settings-layout.single-panel {
    grid-template-columns: 1fr;
}

.system-settings-menu {
    display: grid;
    align-content: start;
    gap: 8px;
    border-right: 1px solid #e0e7f5;
    padding-right: 12px;
}

.system-settings-menu-link {
    display: block;
    padding: 9px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #42526d;
    border: 1px solid transparent;
    background: #f7f9fd;
}

.system-settings-menu-link:hover {
    border-color: #c6d4ee;
    color: #1f3a73;
}

.system-settings-menu-link.active {
    border-color: #7fa1e0;
    background: #eaf2ff;
    color: #16438f;
    font-weight: 700;
}

.system-settings-panel {
    display: grid;
    gap: 14px;
}

.user-management-modal {
    width: min(100%, 700px);
    max-height: calc(100dvh - 48px);
    overflow: auto;
}

.user-project-access {
    min-width: 0;
    margin: 0;
    padding: 10px 12px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.user-project-access legend {
    padding: 0 4px;
    font-weight: 650;
}

.user-project-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.user-project-options .checkbox-card {
    min-width: 0;
    padding: 8px 10px;
    overflow-wrap: anywhere;
}

.user-project-access > small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.user-management-modal form:has(select[name="role"] option[value="admin"]:checked) .user-project-access {
    display: none;
}

.user-project-summary {
    max-width: 270px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.system-settings-subcard {
    margin: 0;
}

.table-action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.table-action-row form {
    margin: 0;
}

@media (max-width: 980px) {
    .system-settings-layout {
        grid-template-columns: 1fr;
    }

    .system-settings-menu {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        border-right: 0;
        border-bottom: 1px solid #e0e7f5;
        padding-right: 0;
        padding-bottom: 10px;
    }
}

.modal-card.modal-card-generated-preview {
    width: min(1180px, 95vw);
    max-width: min(1180px, 95vw);
    height: min(88vh, 900px);
    max-height: 92vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.generated-preview-modal-head {
    margin: 0;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line, #dbe4f3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
}

.generated-preview-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.generated-preview-title-wrap h2 {
    margin: 0;
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.generated-preview-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(22, 93, 255, 0.1);
    color: var(--primary, #165dff);
    flex-shrink: 0;
}

.generated-preview-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.generated-preview-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    background: #f1f5fb;
}

.generated-preview-modal-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.modal-card.batch-grouting-modal-card {
    width: min(880px, 94vw);
    max-width: min(880px, 94vw);
}

.batch-grouting-scope-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
}

.batch-grouting-scope-label {
    font-weight: 700;
    color: var(--text);
}

.batch-grouting-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.batch-grouting-radio input[type="radio"] {
    width: auto;
    padding: 0;
    margin: 0;
    accent-color: var(--primary);
}

.batch-grouting-rules-panel {
    display: grid;
    gap: 8px;
}

.batch-grouting-rules-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.batch-grouting-rules-head > div:first-child {
    display: grid;
    gap: 2px;
}

.batch-grouting-rules-head small {
    color: var(--muted);
    font-size: 12px;
}

.batch-grouting-rule-header,
.batch-grouting-rule-row {
    display: grid;
    grid-template-columns: minmax(130px, 1.15fr) minmax(130px, 1.15fr) minmax(110px, 0.9fr) minmax(175px, 1.25fr) 28px;
    gap: 8px;
    align-items: center;
}

.batch-grouting-rule-header {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 4px 0;
    background: var(--surface);
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
}

.batch-grouting-rule-scroll {
    max-height: 44vh;
    overflow: auto;
}

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

.batch-grouting-rule-row select,
.batch-grouting-rule-row input {
    height: 36px;
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 13px;
}

.batch-grouting-rule-row select {
    text-align: center;
}

.batch-grouting-coeff-pair {
    display: flex;
    align-items: center;
    gap: 6px;
}

.batch-grouting-coeff-pair input {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
}

.batch-grouting-coeff-sep {
    flex: 0 0 auto;
    color: var(--muted);
    font-weight: 700;
}

.record-batch-actions .browser-toolbar-actions {
    flex-wrap: wrap;
}

@media (max-width: 820px) {
    .batch-grouting-rule-header {
        display: none;
    }

    .batch-grouting-rule-row {
        grid-template-columns: 1fr;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 12px;
        position: relative;
    }

    .batch-grouting-rule-row .unit-draft-remove {
        position: absolute;
        top: 8px;
        right: 8px;
    }
}

/* 采集裂缝确认弹窗 */
.collection-confirm-modal-card {
    max-width: 1040px;
    width: 95vw;
}

.modal-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin: 4px 0 0;
}

.collection-confirm-body {
    padding: 16px 20px;
}

.collection-confirm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 16px;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}

.collection-confirm-error {
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 14px;
}

.collection-confirm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.toolbar-left-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-label {
    font-size: 13px;
    color: var(--muted);
}

.btn-chip {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--line, #e2e8f0);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text, #334155);
    transition: all 0.15s ease;
}

.btn-chip:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-chip-primary {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    font-weight: 500;
}

.btn-chip-primary:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.toolbar-right-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text, #1e293b);
    user-select: none;
}

.toolbar-checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.toolbar-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-size: 11px;
    font-weight: bold;
    cursor: help;
}

.collection-confirm-stats-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
}

.stat-badge {
    padding: 2px 8px;
    border-radius: 4px;
    background: #e2e8f0;
    color: #475569;
}

.stat-badge strong {
    font-weight: 600;
}

.stat-badge.stat-new {
    background: #ecfdf5;
    color: #065f46;
}

.stat-badge.stat-existing {
    background: #fffbeb;
    color: #92400e;
}

.collection-confirm-table-wrapper {
    max-height: 440px;
    overflow-y: auto;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.collection-confirm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: auto;
}

.collection-confirm-table thead th {
    position: sticky;
    top: 0;
    background: #f1f5f9;
    z-index: 2;
    padding: 8px 10px;
    font-weight: 600;
    color: #334155;
    border-bottom: 1px solid #cbd5e1;
    text-align: center;
    white-space: nowrap;
}

.collection-confirm-table tbody td {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    text-align: center;
    white-space: nowrap; /* 单条裂缝严格单行显示，禁止内容折行 */
}

.collection-confirm-table tbody tr:hover {
    background-color: #f8fafc;
}

.collection-confirm-table tr.is-existing-crack {
    background-color: #fffdf5;
}

.collection-confirm-table tr.is-existing-crack:hover {
    background-color: #fffbeb;
}

.collection-confirm-table .col-checkbox {
    width: 38px;
    text-align: center;
}

.collection-confirm-table .col-index {
    width: 44px;
    text-align: center;
    color: var(--muted, #64748b);
}

.collection-confirm-table .col-crack-id {
    white-space: nowrap;
}

.collection-confirm-table .col-status {
    width: 64px;
    text-align: center;
    white-space: nowrap;
}

.collection-confirm-table .col-desc {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.font-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.text-muted {
    color: #64748b;
    font-size: 12px;
}

.collection-confirm-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--line, #e2e8f0);
    background: #f8fafc;
    flex-wrap: wrap;
    gap: 12px;
}

.collect-summary-text {
    font-size: 13px;
    color: #334155;
}

.collect-summary-text strong {
    color: var(--primary, #2563eb);
}

.collect-foot-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-busy-spinner-inline {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: busy-spinner-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

/* 新增采集文件弹窗中的“同时执行数据采集”选项卡片 */
.auto-collect-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: #f8faff;
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.auto-collect-card:hover {
    background: #f0f6ff;
    border-color: rgba(37, 99, 235, 0.4);
}

.auto-collect-card input[type="checkbox"] {
    margin-top: 3px;
    width: 17px;
    height: 17px;
    cursor: pointer;
    flex-shrink: 0;
}

.auto-collect-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auto-collect-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #1e293b);
}

.auto-collect-tip {
    font-size: 12px;
    color: var(--muted, #64748b);
    line-height: 1.45;
}
