:root {
    color-scheme: light;
    --bg: #f3f6f4;
    --surface: #ffffff;
    --text: #17221d;
    --muted: #607068;
    --line: #dce5df;
    --brand: #146c4a;
    --brand-dark: #0b4a31;
    --accent: #d8efe4;
    --danger: #b42318;
    --success: #217a4d;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* v0.8.1 manufacturer library */
.manufacturer-page .page-shell {
    width: min(1840px, 96vw);
    padding-top: 2.8rem;
}

.manufacturer-heading {
    max-width: none;
    align-items: center;
}

.heading-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.heading-actions .button {
    margin: 0;
}

.table-view-toggle {
    white-space: nowrap;
}

.manufacturer-filter-grid {
    display: grid;
    grid-template-columns: minmax(320px, 2fr) repeat(5, minmax(145px, 1fr));
    gap: 0.8rem;
}

.manufacturer-table-card,
.export-builder-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 14px 42px rgba(32, 70, 51, 0.06);
}

.manufacturer-table-card {
    overflow: hidden;
}

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

.manufacturer-table-wrap::-webkit-scrollbar {
    display: none;
}

.manufacturer-table {
    width: 2095px;
    min-width: 2095px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.82rem;
}

.manufacturer-table .col-manufacturer { width: 220px; }
.manufacturer-table .col-category { width: 150px; }
.manufacturer-table .col-brand { width: 150px; }
.manufacturer-table .col-usage { width: 86px; }
.manufacturer-table .col-industry { width: 110px; }
.manufacturer-table .col-employees { width: 92px; }
.manufacturer-table .col-revenue,
.manufacturer-table .col-assets { width: 102px; }
.manufacturer-table .col-size { width: 118px; }
.manufacturer-table .col-factory { width: 220px; }
.manufacturer-table .col-factory-address { width: 220px; }
.manufacturer-table .col-manufacturer-address { width: 220px; }
.manufacturer-table .col-uscc { width: 185px; }
.manufacturer-table .col-action { width: 100px; }

.manufacturer-table th,
.manufacturer-table td {
    padding: 0.76rem 0.7rem;
    border-right: 1px solid #edf1ee;
    border-bottom: 1px solid #e7ede9;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.manufacturer-table .text-left {
    text-align: left;
}

.manufacturer-table .factory-address-cell,
.manufacturer-table .manufacturer-address-cell,
.manufacturer-table .factory-name-cell,
.manufacturer-table .manufacturer-name-cell {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.manufacturer-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: #41544a;
    background: #f3f8f5;
    font-size: 0.75rem;
}

.manufacturer-table th small {
    font-size: 0.7rem;
    font-weight: 600;
}

.manufacturer-table tbody tr:hover {
    background: #f8fbf9;
}

.manufacturer-table tbody tr.is-focused-manufacturer td {
    background: #fff5bd;
    box-shadow: inset 0 2px #d39d18, inset 0 -2px #d39d18;
}

.manufacturer-table tbody tr.is-focused-manufacturer .manufacturer-name-cell {
    background: #fff0a0;
}

.manufacturer-name-cell {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    background: #fff;
    font-weight: 750;
    overflow: hidden;
}


.manufacturer-name-header {
    position: sticky !important;
    left: 0;
    z-index: 4 !important;
    width: 220px;
    min-width: 220px;
    max-width: 220px;
}

.manufacturer-table tbody tr:hover .manufacturer-name-cell {
    background: #f8fbf9;
}

.sortable-header {
    width: 100%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.sortable-header span {
    color: #6d8176;
    font-size: 0.9rem;
}

.sortable-header:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.manufacturer-scrollbar {
    position: fixed;
    bottom: 0;
    z-index: 40;
    height: 18px;
    display: none;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid #b9c8c0;
    background: #eef4f0;
    box-shadow: 0 -4px 14px rgba(23, 34, 29, 0.12);
}

.manufacturer-scrollbar.is-visible {
    display: block;
}

.manufacturer-scrollbar > div {
    height: 1px;
}

.manufacturer-action-cell {
    min-width: 90px;
}

.manufacturer-table td.has-multiple-factories {
    background: #fff1dc;
}

.multi-factory-badge {
    margin-left: 0.35rem;
    padding: 0.16rem 0.38rem;
    display: inline-flex;
    align-items: center;
    border: 1px solid #e4a249;
    border-radius: 999px;
    color: #7d4300;
    background: #ffe2b8;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
}

.table-action {
    display: inline-flex;
    min-height: 32px;
    padding: 0.38rem 0.62rem;
    align-items: center;
    border: 1px solid #9ab8a8;
    border-radius: 8px;
    background: white;
    color: var(--brand-dark);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}

.table-action.is-disabled {
    border-color: #d5ddd9;
    background: #f3f5f4;
    color: #8a9690;
    cursor: not-allowed;
}

.danger-action {
    color: var(--danger);
    border-color: #f0aaa4;
}

.manual-flag {
    margin-left: 0.3rem;
    color: #8a4700;
}

.empty-table-cell {
    padding: 2.5rem !important;
    color: var(--muted);
    text-align: center !important;
}

.export-builder-card {
    padding: clamp(1.2rem, 3vw, 1.8rem);
}

.export-builder-card {
    margin-bottom: 1.2rem;
}

.export-builder-card textarea {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.9rem;
    resize: vertical;
    border: 1px solid #becbc3;
    border-radius: 10px;
    font: inherit;
    line-height: 1.6;
}

.export-table {
    width: 1900px;
    min-width: 1900px;
    table-layout: auto;
}

.export-table input,
.export-table select {
    min-height: 38px;
    padding: 0.48rem 0.55rem;
    border: 1px solid #becbc3;
    border-radius: 8px;
    background: white;
    font: inherit;
    font-size: 0.8rem;
}

.export-table select[name="industry"] {
    min-width: 160px;
}

.export-table select[name="factory_id"] {
    min-width: 240px;
}

.export-table .factory-address {
    min-width: 180px;
    max-width: 240px;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
}

.sequence-input {
    width: 64px;
}

.product-input {
    min-width: 230px;
}

.manufacturer-combobox {
    position: relative;
    min-width: 280px;
}

.manufacturer-combobox .manufacturer-search-input {
    width: 100%;
    min-width: 280px;
}

.manufacturer-search-results {
    position: fixed;
    z-index: 200;
    max-height: 320px;
    padding: 0.35rem;
    overflow-y: auto;
    border: 1px solid #9db5a8;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(10, 42, 27, 0.22);
}

.manufacturer-search-option {
    width: 100%;
    padding: 0.58rem 0.68rem;
    display: block;
    border: 0;
    border-radius: 7px;
    color: var(--text);
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.manufacturer-search-option:hover,
.manufacturer-search-option.is-active {
    background: #e5f3eb;
}

.manufacturer-search-option strong,
.manufacturer-search-option small {
    display: block;
}

.manufacturer-search-option small {
    margin-top: 0.2rem;
    color: var(--muted);
}

.manufacturer-search-empty {
    padding: 0.75rem;
    color: var(--muted);
    text-align: center;
}

.invalid-size {
    color: var(--danger);
    font-weight: 800;
}

.export-table tr.row-invalid {
    background: #fff4f2;
}

.export-table [aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.14);
}

.export-status {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    border: 1px solid #9cc7b1;
    border-radius: 10px;
    color: var(--success);
    background: #effaf4;
}

.export-status.is-error {
    border-color: #efaaa4;
    color: var(--danger);
    background: #fff4f2;
}

.export-submit-bar {
    position: sticky;
    bottom: 0.8rem;
    z-index: 4;
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid #91bba6;
    border-radius: 15px;
    background: rgba(238, 248, 243, 0.97);
    box-shadow: 0 16px 50px rgba(11, 74, 49, 0.16);
}

.export-submit-bar small,
.export-submit-bar strong {
    display: block;
}

.export-submit-bar small {
    margin-top: 0.25rem;
    color: var(--muted);
}

.export-submit-bar .button {
    min-width: 160px;
    margin: 0;
}

.export-button-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
}

.declaration-preview-dialog {
    width: min(980px, 92vw);
    max-height: 88vh;
    padding: 0;
    border: 0;
    border-radius: 18px;
    color: var(--text);
    background: transparent;
    box-shadow: 0 28px 90px rgba(10, 30, 20, 0.28);
}

.declaration-preview-dialog::backdrop {
    background: rgba(13, 28, 20, 0.56);
    backdrop-filter: blur(3px);
}

.declaration-preview-panel {
    max-height: 88vh;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.declaration-preview-heading,
.declaration-preview-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.declaration-preview-heading h2 {
    margin: 0;
}

.dialog-close {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    background: #fff;
    cursor: pointer;
    font-size: 1.65rem;
    line-height: 1;
}

.preview-help {
    margin: 0.8rem 0;
    color: var(--muted);
}

.declaration-preview-content {
    min-height: 180px;
    padding: 1.4rem 1.6rem;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfb;
    font-family: "FangSong", "仿宋", serif;
    font-size: 12pt;
    line-height: 1.8;
}

.declaration-preview-content p {
    margin: 0;
}

.declaration-preview-content u {
    text-underline-offset: 0.16em;
}

.declaration-preview-content .preview-missing-value {
    min-width: 5em;
    display: inline-block;
    background: #ffeb3b;
}

/* Manufacturer editable grid */
.manufacturer-edit-page .page-shell {
    padding-bottom: 7rem;
}

.manufacturer-edit-toolbar {
    margin-bottom: 0.8rem;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.manufacturer-edit-toolbar small,
.manufacturer-edit-toolbar strong {
    display: block;
}

.manufacturer-edit-toolbar small {
    margin-top: 0.22rem;
    color: var(--muted);
}

.manufacturer-edit-table {
    width: 2318px;
    min-width: 2318px;
}

.manufacturer-edit-table .col-order { width: 72px; }
.manufacturer-edit-table .col-category { width: 180px; }
.manufacturer-edit-table .col-brand { width: 190px; }
.manufacturer-edit-table .col-industry { width: 140px; }
.manufacturer-edit-table .col-employees { width: 105px; }
.manufacturer-edit-table .col-revenue,
.manufacturer-edit-table .col-assets { width: 115px; }
.manufacturer-edit-table .col-size { width: 150px; }

.manufacturer-edit-table th,
.manufacturer-edit-table td {
    transition: background-color 120ms ease, box-shadow 120ms ease;
}

.manufacturer-edit-table input,
.manufacturer-edit-table select,
.manufacturer-edit-table textarea,
.grid-cell-button {
    width: 100%;
    min-height: 38px;
    padding: 0.45rem 0.5rem;
    border: 1px solid #bdcbc3;
    border-radius: 7px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.82);
    font: inherit;
}

.manufacturer-edit-table textarea {
    resize: vertical;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.manufacturer-edit-table input:focus,
.manufacturer-edit-table select:focus,
.manufacturer-edit-table textarea:focus,
.grid-cell-button:focus {
    outline: 2px solid #1976d2;
    outline-offset: 1px;
}

.grid-cell-button {
    cursor: pointer;
    text-align: left;
    white-space: normal;
}

.manufacturer-edit-table .order-cell,
.manufacturer-edit-table .order-header {
    position: sticky;
    left: 0;
    z-index: 5;
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    background: #fff;
}

.manufacturer-edit-table .manufacturer-name-cell,
.manufacturer-edit-table .manufacturer-name-header {
    left: 72px;
}

.manufacturer-edit-table .manufacturer-name-header,
.manufacturer-edit-table .order-header {
    z-index: 8 !important;
    background: #f3f8f5;
}

.manufacturer-edit-table tr.is-active-row > td {
    background: #edf8f2;
}

.manufacturer-edit-table tr > .is-active-column {
    background: #eaf4ff;
}

.manufacturer-edit-table td.is-active-cell {
    position: relative;
    z-index: 6;
    background: #dcecff !important;
    box-shadow: inset 0 0 0 2px #1976d2;
}

.manufacturer-edit-table tr.is-dirty-row > td:first-child {
    box-shadow: inset 4px 0 0 #d78919;
}

.manufacturer-edit-table tr.is-new-row > td {
    background: #f2fbf5;
}

.factory-cell-editor,
.factory-cell-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.factory-cell-editor {
    align-items: stretch;
    flex-direction: column;
}

.factory-manage-button {
    padding: 0.15rem 0;
    border: 0;
    color: var(--brand-dark);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
}

.manufacturer-save-bar {
    position: fixed;
    right: 2vw;
    bottom: 24px;
    left: 2vw;
    z-index: 50;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid #83ad98;
    border-radius: 14px;
    background: rgba(239, 249, 244, 0.98);
    box-shadow: 0 16px 48px rgba(11, 74, 49, 0.2);
}

.manufacturer-save-bar > div:last-child {
    display: flex;
    gap: 0.6rem;
}

.manufacturer-save-status {
    color: var(--success);
    font-weight: 750;
}

.manufacturer-save-status.is-error,
.factory-editor-status {
    color: var(--danger);
}

.grid-editor-dialog {
    width: min(900px, 92vw);
    max-height: 86vh;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: transparent;
    box-shadow: 0 28px 90px rgba(10, 30, 20, 0.28);
}

.grid-editor-dialog::backdrop {
    background: rgba(13, 28, 20, 0.56);
}

.grid-editor-panel {
    max-height: 86vh;
    padding: 1.35rem;
    overflow-y: auto;
    background: #fff;
}

.category-choice-grid {
    margin: 1rem 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.category-choice-grid label {
    padding: 0.55rem 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbf9;
}

.factory-editor-table-wrap {
    margin: 1rem 0 0.75rem;
    overflow-x: auto;
}

.factory-editor-table {
    width: 100%;
    border-collapse: collapse;
}

.factory-editor-table th,
.factory-editor-table td {
    padding: 0.55rem;
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.factory-editor-table input[type="text"] {
    width: 100%;
    min-height: 38px;
    padding: 0.45rem 0.55rem;
    border: 1px solid #bdcbc3;
    border-radius: 7px;
    font: inherit;
}

.factory-editor-status {
    margin-bottom: 0;
    font-weight: 750;
}

.declaration-preview-actions {
    margin-top: 1rem;
    justify-content: flex-end;
}

.declaration-preview-actions .button {
    margin: 0;
}

@media (max-width: 1100px) {
    .manufacturer-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .manufacturer-filter-grid .field-wide {
        grid-column: span 2;
    }
}

@media (max-width: 720px) {
    .manufacturer-heading,
    .heading-actions,
    .export-submit-bar,
    .export-button-group {
        align-items: stretch;
        flex-direction: column;
    }

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

    .manufacturer-filter-grid .field-wide {
        grid-column: auto;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top right, #dcefe6 0, transparent 34rem),
        var(--bg);
    min-height: 100vh;
}

a {
    color: var(--brand-dark);
}

.topbar {
    min-height: 68px;
    padding: 0 5vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
}

.brand {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 800;
    text-decoration: none;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.user-nav form {
    margin: 0;
}

.link-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--brand-dark);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.page-shell {
    width: min(1120px, 90vw);
    margin: 0 auto;
    padding: 4.5rem 0;
}

.hero {
    max-width: 720px;
    margin-bottom: 2rem;
}

h1 {
    margin: 0.4rem 0 0.8rem;
    font-size: clamp(2rem, 5vw, 3.6rem);
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.hero p,
.content-card p,
.auth-card p {
    color: var(--muted);
    line-height: 1.75;
}

.eyebrow {
    color: var(--brand) !important;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    font-weight: 800;
}

.eyebrow.danger {
    color: var(--danger) !important;
}

.eyebrow.success {
    color: var(--success) !important;
}

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

.module-card {
    min-height: 150px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(32, 70, 51, 0.08);
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease;
}

.module-card:hover {
    transform: translateY(-3px);
    border-color: #93bca8;
}

.module-card strong,
.module-card small {
    display: block;
}

.module-card strong {
    margin: 0.2rem 0 0.7rem;
    font-size: 1.25rem;
}

.module-card small {
    color: var(--muted);
    line-height: 1.6;
}

.module-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 14px;
    background: var(--accent);
    color: var(--brand-dark);
    font-size: 1.4rem;
    font-weight: 800;
}

.auth-card,
.content-card,
.empty-state {
    width: min(520px, 100%);
    margin: 2rem auto;
    padding: clamp(1.5rem, 5vw, 2.5rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 22px 70px rgba(32, 70, 51, 0.1);
}

.auth-card.wide {
    width: min(680px, 100%);
}

.auth-card h1,
.content-card h1 {
    font-size: clamp(1.9rem, 5vw, 2.8rem);
}

.stack-form {
    display: grid;
    gap: 0.7rem;
    margin-top: 1.5rem;
}

.stack-form label {
    margin-top: 0.45rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.stack-form input,
.stack-form select,
.stack-form textarea {
    width: 100%;
    min-height: 46px;
    padding: 0.7rem 0.8rem;
    border: 1px solid #becbc3;
    border-radius: 10px;
    background: white;
    color: var(--text);
    font: inherit;
}

.stack-form input:focus {
    outline: 3px solid rgba(20, 108, 74, 0.16);
    border-color: var(--brand);
}

.button {
    min-height: 46px;
    margin-top: 0.7rem;
    padding: 0.72rem 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--brand);
    border-radius: 11px;
    background: var(--brand);
    color: white;
    cursor: pointer;
    font: inherit;
    font-weight: 750;
    text-decoration: none;
}

.button:hover {
    background: var(--brand-dark);
}

.button.secondary {
    background: transparent;
    color: var(--brand-dark);
}

.muted,
.help-text {
    color: var(--muted);
}

.help-text {
    font-size: 0.82rem;
    line-height: 1.5;
}

.help-text ul {
    margin: 0.2rem 0 0;
    padding-left: 1.25rem;
}

.errorlist,
.form-error {
    color: var(--danger) !important;
}

.messages {
    padding: 0.5rem 1rem;
    border-radius: 12px;
    background: var(--accent);
}

.breadcrumbs {
    margin-bottom: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.breadcrumbs a {
    color: var(--brand-dark);
    text-decoration: none;
}

.page-heading,
.product-hero {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
}

.page-heading h1,
.product-hero h1 {
    margin: 0.2rem 0 0.6rem;
    font-size: clamp(2.2rem, 5vw, 4rem);
}

.page-heading p,
.product-summary,
.variant-title,
.section-heading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.result-pill,
.status-badge,
.scenario-badge,
.product-code {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.result-pill {
    padding: 0.65rem 0.9rem;
    color: var(--brand-dark);
    background: var(--accent);
    white-space: nowrap;
}

.filter-panel {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 14px 40px rgba(32, 70, 51, 0.06);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.field {
    display: grid;
    align-content: start;
    gap: 0.38rem;
}

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

.field label {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--muted);
}

.field input,
.field select {
    width: 100%;
    min-height: 44px;
    padding: 0.66rem 0.75rem;
    border: 1px solid #becbc3;
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.field input:focus,
.field select:focus {
    outline: 3px solid rgba(20, 108, 74, 0.13);
    border-color: var(--brand);
}

.filter-actions,
.detail-actions {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.filter-actions .button,
.detail-actions .button {
    margin-top: 0;
}

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

.product-card {
    min-width: 0;
    min-height: 310px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 16px 46px rgba(32, 70, 51, 0.07);
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
    position: relative;
}

.product-card-main-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.product-card-main-link:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.45);
    outline-offset: 3px;
}

.product-manufacturer-link {
    position: relative;
    z-index: 2;
    color: var(--brand-dark);
    font-weight: 750;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.pending-link-label {
    margin-left: 0.35rem;
    color: #92620b;
    font-size: 0.72rem;
    font-weight: 750;
    white-space: nowrap;
}

.module-entry-actions {
    margin: 0 0 14px;
    display: flex;
    justify-content: flex-end;
}

.module-entry-actions .button {
    margin: 0;
}

.product-card:hover {
    transform: translateY(-3px);
    border-color: #8eb9a3;
    box-shadow: 0 20px 54px rgba(32, 70, 51, 0.12);
}

.product-card-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.product-code {
    padding: 0.34rem 0.58rem;
    color: var(--brand-dark);
    background: var(--accent);
    letter-spacing: 0.04em;
}

.status-badge {
    padding: 0.34rem 0.58rem;
    color: #41544a;
    background: #edf2ef;
}

.status-badge.warning {
    color: #8a4700;
    background: #fff0d6;
}

.product-meta {
    margin: 0 0 0.42rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.product-card h2 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.4;
}

.product-card h2 small {
    display: block;
    margin-top: 0.32rem;
    color: var(--brand);
    font-size: 0.8rem;
    font-weight: 750;
}

.product-facts,
.detail-grid {
    margin: 0;
}

.product-facts div {
    padding: 0.5rem 0;
    display: grid;
    grid-template-columns: 4.3rem minmax(0, 1fr);
    gap: 0.5rem;
    border-bottom: 1px solid #edf1ee;
}

.product-facts dt,
.detail-grid dt {
    color: var(--muted);
    font-size: 0.78rem;
}

.product-facts dd,
.detail-grid dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.price-line {
    padding-top: 0.9rem;
    display: flex;
    align-items: baseline;
    gap: 0.32rem;
    border-top: 1px solid var(--line);
}

.price-line span {
    margin-right: auto;
    color: var(--muted);
    font-size: 0.78rem;
}

.price-line strong {
    color: var(--brand-dark);
    font-size: 1.35rem;
}

.price-line small {
    color: var(--muted);
}

.pagination {
    margin-top: 1.5rem;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--muted);
}

.pagination a {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    text-decoration: none;
}

.product-hero {
    align-items: stretch;
}

.product-hero > div {
    align-self: center;
}

.variant-title {
    margin-bottom: 0.4rem;
    color: var(--brand) !important;
    font-size: 1rem;
    font-weight: 800;
}

.price-card {
    min-width: 260px;
    padding: 1.25rem;
    display: grid;
    align-content: center;
    gap: 0.35rem;
    background: var(--brand-dark);
    color: white;
    border-radius: 18px;
    box-shadow: 0 20px 55px rgba(11, 74, 49, 0.18);
}

.price-card span,
.price-card small {
    color: #cce3d7;
}

.price-card strong {
    font-size: clamp(1.9rem, 4vw, 2.7rem);
}

.alert {
    margin-bottom: 1.3rem;
    padding: 1rem 1.15rem;
    border: 1px solid;
    border-radius: 14px;
}

.alert p {
    margin: 0.35rem 0 0;
    line-height: 1.6;
}

.warning-alert {
    color: #703d00;
    background: #fff5e3;
    border-color: #efc376;
}

.info-alert {
    color: #25453a;
    background: #eaf4ef;
    border-color: #b9d6c7;
}

.error-alert {
    color: #7a271a;
    background: #fef3f2;
    border-color: #fda29b;
}

.detail-section {
    margin-top: 1.25rem;
    padding: clamp(1.2rem, 3vw, 1.8rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.section-heading {
    margin-bottom: 1rem;
}

.section-heading h2 {
    margin: 0.25rem 0 0.5rem;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.detail-grid div {
    min-width: 0;
    padding: 0.9rem;
    display: grid;
    gap: 0.28rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.detail-grid dd {
    font-weight: 650;
}

.spec-grid {
    display: grid;
    gap: 1rem;
}

.spec-card {
    padding: 1.15rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfcfb;
}

.spec-card h3 {
    margin: 0.75rem 0;
    font-size: 1rem;
}

.scenario-badge {
    padding: 0.32rem 0.6rem;
}

.scenario-badge.inquiry {
    color: #784300;
    background: #ffedc8;
}

.scenario-badge.tender {
    color: #1f4f86;
    background: #e4eefb;
}

.scenario-badge.delivery {
    color: var(--brand-dark);
    background: var(--accent);
}

.spec-content {
    color: #304039;
    line-height: 1.72;
    overflow-wrap: anywhere;
}

.spec-content p {
    margin: 0.4rem 0;
}

.notes-panel {
    color: #304039;
    line-height: 1.75;
}

.quote-heading {
    align-items: center;
}

.quote-form {
    display: grid;
    gap: 1rem;
}

.quote-form-section,
.result-section,
.result-hero {
    padding: clamp(1.2rem, 3vw, 1.8rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 14px 42px rgba(32, 70, 51, 0.06);
}

.quote-form-section .section-heading {
    max-width: 760px;
}

.quote-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.quote-fields .field-error input,
.quote-fields .field-error select {
    border-color: var(--danger);
}

.conditional-panel {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px dashed #a9beb3;
    border-radius: 14px;
    background: #f8fbf9;
}

.conditional-panel.compact {
    max-width: 500px;
}

.conditional-panel[hidden] {
    display: none;
}

.check-group,
.option-grid {
    margin: 0 0 1rem;
    padding: 0;
    border: 0;
}

.check-group legend {
    margin-bottom: 0.65rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.check-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.check-group label,
.option-grid label {
    min-height: 46px;
    padding: 0.72rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    cursor: pointer;
}

.check-group input,
.option-grid input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--brand);
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
}

.quote-submit-bar {
    position: sticky;
    bottom: 0.8rem;
    z-index: 5;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid #91bba6;
    border-radius: 15px;
    background: rgba(238, 248, 243, 0.96);
    box-shadow: 0 16px 50px rgba(11, 74, 49, 0.16);
    backdrop-filter: blur(10px);
}

.quote-submit-bar strong,
.quote-submit-bar small {
    display: block;
}

.quote-submit-bar small {
    margin-top: 0.2rem;
    color: var(--muted);
}

.quote-submit-bar .button {
    min-width: 180px;
    margin: 0;
}

.quote-result {
    min-width: 0;
    margin-top: 2rem;
    display: grid;
    gap: 1rem;
}

.result-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    color: white;
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.result-hero h2 {
    margin: 0.3rem 0 0.6rem;
    font-size: clamp(1.6rem, 4vw, 2.6rem);
}

.result-hero p {
    margin: 0;
    color: #d9e9e1;
    line-height: 1.7;
}

.result-total {
    min-width: 300px;
    display: grid;
    gap: 0.3rem;
    text-align: right;
}

.result-total span,
.result-total small {
    color: #c8dfd4;
}

.result-total strong {
    font-size: clamp(2rem, 5vw, 3.2rem);
}

.unified-warning {
    margin: 0;
}

.unified-warning p + p {
    padding-top: 0.55rem;
    border-top: 1px solid rgba(138, 71, 0, 0.15);
}

.result-section .section-heading {
    max-width: 820px;
}

.result-section,
.room-result,
.room-result-grid {
    min-width: 0;
}

.table-scroll {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.quote-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    background: #fff;
}

.quote-table th,
.quote-table td {
    padding: 0.8rem;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.quote-table th {
    color: #405047;
    background: #f4f8f5;
    font-size: 0.78rem;
    white-space: nowrap;
}

.quote-table td {
    color: #24332c;
    font-size: 0.88rem;
    line-height: 1.55;
}

.quote-table td small {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
}

.quote-table .number {
    text-align: right;
    white-space: nowrap;
}

.quote-table tfoot th {
    color: var(--brand-dark);
    font-size: 0.92rem;
    background: var(--accent);
}

.quote-table .inquiry-row {
    background: #fffaf1;
}

.rule-details,
.spec-details {
    margin-top: 0.55rem;
}

.rule-details summary,
.spec-details summary {
    color: var(--brand-dark);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 750;
}

.rule-details p {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.spec-details > div {
    width: min(620px, 70vw);
    max-height: 360px;
    margin-top: 0.7rem;
    padding: 0.8rem;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f8faf9;
}

.spec-details p {
    margin: 0.35rem 0;
}

.room-result-grid {
    display: grid;
    gap: 0.8rem;
}

.room-result {
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fbfcfb;
    overflow: hidden;
}

.room-result > summary {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    color: var(--brand-dark);
    font-weight: 800;
}

.room-result[open] > summary {
    border-bottom: 1px solid var(--line);
    background: var(--accent);
}

.room-result .table-scroll {
    border: 0;
    border-radius: 0;
}

.compact-table {
    min-width: 760px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 680px) {
    .topbar {
        padding: 0.8rem 5vw;
        align-items: flex-start;
        flex-direction: column;
    }

    .user-nav {
        width: 100%;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .page-shell {
        padding: 2.5rem 0;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .module-card {
        min-height: 126px;
    }

    .page-heading,
    .product-hero {
        align-items: stretch;
        flex-direction: column;
        gap: 1rem;
    }

    .result-pill {
        align-self: flex-start;
    }

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

    .field-wide {
        grid-column: span 1;
    }

    .filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .product-card {
        min-height: 288px;
    }

    .price-card {
        min-width: 0;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .quote-fields,
    .option-grid {
        grid-template-columns: 1fr;
    }

    .quote-submit-bar,
    .result-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .quote-submit-bar {
        bottom: 0.4rem;
    }

    .quote-submit-bar .button {
        width: 100%;
    }

    .result-total {
        min-width: 0;
        text-align: left;
    }

    .check-group {
        display: grid;
    }

    .spec-details > div {
        width: 76vw;
    }
}

@media (min-width: 681px) and (max-width: 980px) {
    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

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

/* v0.4.0 · 报价方案、历史快照与变化提醒 */
.danger-button,
.button.danger-button {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

.danger-button:hover,
.button.danger-button:hover {
    background: #8d1b13;
}

.scheme-filter-grid {
    grid-template-columns: minmax(260px, 2fr) repeat(2, minmax(160px, 1fr));
}

.scheme-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.2rem;
}

.scheme-card {
    min-width: 0;
    padding: 1.35rem;
    display: grid;
    gap: 1rem;
    border: 1px solid var(--line);
    border-left: 5px solid #9bacb2;
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 18px 48px rgba(32, 70, 51, 0.07);
}

.scheme-card.state-changed {
    border-left-color: #d97706;
}

.scheme-card.state-blocking {
    border-left-color: var(--danger);
}

.scheme-card.state-resolved {
    border-left-color: var(--success);
}

.scheme-card-head,
.change-panel-head,
.scheme-toolbar,
.scheme-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.scheme-card h2 {
    margin: 0.55rem 0 0;
    font-size: 1.25rem;
}

.scheme-card h2 a {
    color: var(--text);
    text-decoration: none;
}

.change-state,
.revision-badge,
.legend {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
}

.change-state.state-unchanged,
.revision-badge {
    color: #41524a;
    background: #edf1ef;
}

.change-state.state-changed,
.legend.attention {
    color: #874000;
    background: #fff0d7;
}

.change-state.state-blocking,
.legend.blocking {
    color: #8a1912;
    background: #fde2df;
}

.change-state.state-resolved {
    color: #17613d;
    background: #dff3e8;
}

.legend.info {
    color: #1f5681;
    background: #e4f1fb;
}

.scheme-meta {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.scheme-meta div {
    min-width: 0;
}

.scheme-meta dt,
.snapshot-overview span,
.revision-summary span,
.revision-summary small {
    color: var(--muted);
    font-size: 0.76rem;
}

.scheme-meta dd {
    margin: 0.18rem 0 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.scheme-change-summary {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.card-link {
    font-weight: 750;
    text-decoration: none;
}

.revision-summary {
    min-width: 145px;
    padding: 1rem 1.2rem;
    display: grid;
    gap: 0.2rem;
    text-align: right;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
}

.revision-summary strong {
    color: var(--brand-dark);
    font-size: 1.8rem;
}

.scheme-toolbar {
    margin: 1rem 0;
    padding: 0.8rem 0;
    align-items: flex-start;
    flex-wrap: wrap;
}

.scheme-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.scheme-actions form,
.change-panel-head form {
    margin: 0;
}

.scheme-actions .button,
.change-panel-head .button {
    margin-top: 0;
}

.snapshot-overview {
    margin: 1rem 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.snapshot-overview > div {
    min-width: 0;
    padding: 1rem;
    display: grid;
    gap: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.snapshot-overview strong {
    overflow-wrap: anywhere;
    font-size: 1rem;
}

.change-panel {
    margin: 1.2rem 0;
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid var(--line);
    border-top: 5px solid #9bacb2;
    border-radius: 18px;
    background: var(--surface);
}

.change-panel.state-changed {
    border-top-color: #d97706;
}

.change-panel.state-blocking {
    border-top-color: var(--danger);
}

.change-panel.state-resolved {
    border-top-color: var(--success);
}

.change-panel-head {
    align-items: flex-start;
}

.change-panel-head h2 {
    margin: 0.2rem 0 0.45rem;
}

.change-panel-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.change-table-wrap {
    max-width: 100%;
    margin-top: 1.2rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.change-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
}

.change-table th,
.change-table td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    text-align: left;
    line-height: 1.55;
}

.change-table th {
    color: #405047;
    background: #f4f8f5;
    font-size: 0.78rem;
}

.change-table td {
    font-size: 0.85rem;
}

.change-table td small {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
}

.change-row.blocking .change-before {
    background: #fff1ef;
}

.change-row.blocking .change-after {
    color: #8a1912;
    background: #fde2df;
}

.change-row.attention .change-before {
    background: #fff8ed;
}

.change-row.attention .change-after {
    color: #874000;
    background: #fff0d7;
}

.change-row.info .change-before {
    background: #f5faff;
}

.change-row.info .change-after {
    color: #1f5681;
    background: #e4f1fb;
}

.change-legend {
    margin: 1rem 0 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.history-layout {
    margin-top: 1.2rem;
    display: grid;
    grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.revision-history {
    position: sticky;
    top: 1rem;
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}

.revision-history h2 {
    margin: 0.25rem 0;
    font-size: 1.15rem;
}

.revision-history > p:not(.eyebrow) {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.55;
}

.revision-history ol {
    margin: 1rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
    list-style: none;
}

.revision-history li a {
    padding: 0.65rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.15rem 0.55rem;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--text);
    text-decoration: none;
}

.revision-history li.active a {
    border-color: #93bca8;
    background: var(--accent);
}

.revision-history li span,
.revision-history li small {
    color: var(--muted);
    font-size: 0.76rem;
}

.revision-history li small {
    grid-column: 1 / -1;
}

.snapshot-content {
    min-width: 0;
    display: grid;
    gap: 1rem;
}

.quote-save-bar {
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid #93bca8;
    border-radius: 14px;
    background: var(--accent);
}

.quote-save-bar strong,
.quote-save-bar small {
    display: block;
}

.quote-save-bar small {
    margin-top: 0.3rem;
    color: var(--muted);
}

.quote-save-bar .button {
    margin-top: 0;
    flex: 0 0 auto;
}

.confirmation-panel {
    margin: 1rem 0;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    border: 1px solid var(--line);
    border-left: 5px solid #87968e;
    border-radius: 14px;
    background: var(--surface);
}

.confirmation-panel.state-confirmed {
    border-left-color: var(--success);
    background: #f2faf5;
}

.confirmation-panel.state-changed,
.confirmation-panel.state-invalid {
    border-left-color: #b13b31;
    background: #fff7f6;
}

.confirmation-panel.state-unconfirmed,
.confirmation-panel.state-superseded {
    border-left-color: #c77a16;
    background: #fffaf0;
}

.confirmation-panel h2 {
    margin: 0.2rem 0 0.4rem;
}

.confirmation-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.confirmation-panel small {
    margin-top: 0.5rem;
    display: block;
    color: var(--muted);
}

.confirmation-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.confirmation-actions form {
    margin: 0;
}

.formal-preview-section {
    margin-top: 1rem;
}

.export-history code {
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

.preview-footer {
    margin-top: 1rem;
}

@media (max-width: 760px) {
    .scheme-filter-grid,
    .scheme-grid,
    .snapshot-overview,
    .history-layout {
        grid-template-columns: 1fr;
    }

    .scheme-meta {
        grid-template-columns: 1fr 1fr;
    }

    .scheme-detail-heading,
    .change-panel-head,
    .confirmation-panel,
    .quote-save-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .revision-summary {
        min-width: 0;
        text-align: left;
    }

    .change-panel-head .button,
    .confirmation-actions .button,
    .quote-save-bar .button {
        width: 100%;
    }

    .confirmation-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .revision-history {
        position: static;
    }
}

/* v0.7.0 · compact version marker, contextual quote help and guide */
.dashboard-hero {
    position: relative;
}

.hero-version {
    position: absolute;
    top: 12px;
    right: 16px;
    min-width: 0;
    padding: 0;
    display: inline;
    border: 0;
    border-radius: 0;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
    text-align: right;
    opacity: 0.72;
}

.quote-top-action {
    gap: 10px;
    flex-wrap: wrap;
}

.contextual-help,
.option-guidance {
    display: none;
    color: #315f59;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.55;
}

.field.config-guidance-target.guidance-active .contextual-help,
.config-guidance-target.guidance-active .option-guidance {
    display: block;
    position: static;
    width: auto;
    pointer-events: auto;
}

.config-guidance-target {
    position: relative;
}

.field.config-guidance-target.guidance-active {
    z-index: 2;
}

.contextual-help,
.option-guidance {
    margin-top: 6px;
    padding: 8px 10px;
    border: 1px solid #b9dcd6;
    border-radius: 9px;
    background: #eef8f6;
}

.option-grid .option-guidance,
.check-group .option-guidance,
.product-line-option .option-guidance {
    width: 100%;
}

@media (hover: hover) and (pointer: fine) {
    .field.config-guidance-target:not(.guidance-active):hover .contextual-help,
    .field.config-guidance-target:not(.guidance-active):focus-within .contextual-help,
    .config-guidance-target:not(.guidance-active):hover .option-guidance,
    .config-guidance-target:not(.guidance-active):focus-within .option-guidance {
        display: block;
        position: absolute;
        top: calc(100% + 7px);
        left: 0;
        z-index: 40;
        width: min(360px, calc(100vw - 32px));
        max-width: calc(100vw - 32px);
        margin-top: 0;
        pointer-events: none;
        box-shadow: 0 12px 30px rgba(19, 70, 62, 0.18);
    }

    .field.config-guidance-target:not(.guidance-active):hover,
    .field.config-guidance-target:not(.guidance-active):focus-within,
    .config-guidance-target:not(.guidance-active):hover,
    .config-guidance-target:not(.guidance-active):focus-within {
        z-index: 30;
    }
}

.inline-capacity-notice {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #9ccdc5;
    border-radius: 10px;
    color: #164e48;
    background: #e9f8f5;
    font-weight: 750;
    line-height: 1.55;
}

.button-label-compact {
    display: none;
}

.quote-guide-hero,
.quote-guide-section {
    margin-bottom: 18px;
    padding: clamp(20px, 4vw, 34px);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.quote-guide-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 26px;
    align-items: center;
    background: linear-gradient(135deg, #f7fcfb, #e7f6f3);
}

.quote-guide-hero h1,
.quote-guide-section h2 {
    margin-top: 0;
}

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

.guide-flow-step {
    min-height: 92px;
    padding: 14px;
    display: grid;
    align-content: center;
    gap: 4px;
    border: 1px solid #abd7cf;
    border-radius: 14px;
    background: rgba(255, 255, 255, .9);
}

.guide-flow-step span {
    color: var(--brand);
    font-size: 12px;
    font-weight: 850;
}

.guide-flow-step strong {
    color: var(--ink);
    font-size: 16px;
}

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

.guide-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f9fbfa;
}

.guide-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.guide-card p,
.guide-card li,
.quote-guide-section li {
    color: var(--muted);
    line-height: 1.7;
}

.guide-card ul,
.quote-guide-section ul,
.quote-guide-section ol {
    margin-bottom: 0;
    padding-left: 1.3rem;
}

.guide-callout {
    margin-top: 14px;
    padding: 14px 16px;
    border-left: 4px solid var(--brand);
    border-radius: 10px;
    color: #315f59;
    background: #eef8f6;
    line-height: 1.65;
}

@media (max-width: 760px) {
    .dashboard-hero {
        padding-top: 24px;
    }

    .hero-version {
        top: 9px;
        right: 12px;
        font-size: 10px;
    }

    .quote-submit-bar {
        padding: 8px;
        display: block;
    }

    .quote-submit-bar > div:first-child {
        display: none;
    }

    .quote-submit-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .quote-submit-actions .button {
        width: 100%;
        min-width: 0;
        min-height: 42px;
        padding: 8px 4px;
        font-size: 12px;
        white-space: nowrap;
    }

    .button-label-full {
        display: none;
    }

    .button-label-compact {
        display: inline;
    }

    .quote-guide-hero,
    .guide-card-grid {
        grid-template-columns: 1fr;
    }

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

/* v0.5.1 · 营销工坊品牌与全站体验优化 */
:root {
    --bg: #f3f6f8;
    --surface: #ffffff;
    --surface-soft: #f8fbfb;
    --text: #17252d;
    --muted: #63727c;
    --line: #d8e2e5;
    --line-strong: #bdcbcf;
    --brand: #0f766e;
    --brand-dark: #0a514c;
    --brand-ink: #073f3b;
    --accent: #e2f4f1;
    --accent-strong: #bee5de;
    --danger: #b42318;
    --success: #16794d;
    --warning: #a65a05;
    --info: #2463a4;
    --shadow-sm: 0 4px 14px rgba(20, 52, 54, 0.06);
    --shadow-md: 0 14px 38px rgba(20, 52, 54, 0.09);
    --shadow-lg: 0 24px 70px rgba(20, 52, 54, 0.13);
    --radius-sm: 10px;
    --radius-md: 15px;
    --radius-lg: 22px;
    --content-width: 1280px;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
    text-size-adjust: 100%;
}

body {
    color: var(--text);
    background:
        radial-gradient(circle at 92% 0, rgba(64, 180, 163, 0.13), transparent 30rem),
        linear-gradient(180deg, #f8fbfb 0, var(--bg) 26rem);
    font-size: 16px;
    line-height: 1.6;
}

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

a,
button,
input,
select,
textarea,
summary {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.24);
    outline-offset: 2px;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 12px;
    z-index: 1000;
    padding: 10px 14px;
    border-radius: 9px;
    color: #fff;
    background: var(--brand-dark);
    transform: translateY(-150%);
    transition: transform 140ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 76px;
    padding: 0;
    border-bottom-color: rgba(177, 197, 199, 0.7);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 5px 22px rgba(20, 52, 54, 0.05);
    backdrop-filter: blur(18px);
}

.topbar-inner {
    width: min(var(--content-width), calc(100% - 48px));
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
}

.brand:hover {
    color: var(--brand-dark);
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(145deg, #129187, #0a5f59);
    box-shadow: 0 8px 20px rgba(15, 118, 110, 0.24);
    font-size: 20px;
    font-weight: 900;
}

.brand-copy {
    display: grid;
    gap: 1px;
}

.brand-copy strong {
    font-size: 18px;
    letter-spacing: 0.03em;
    line-height: 1.25;
}

.brand-copy small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.08em;
}

.brand-logo {
    width: 44px;
    height: 44px;
    display: block;
    flex: 0 0 auto;
    object-fit: contain;
}

.auth-logo {
    width: 52px;
    height: 52px;
}

.user-nav {
    gap: 6px;
    font-size: 14px;
}

.user-nav a,
.user-nav .link-button {
    min-height: 42px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #39515a;
    text-decoration: none;
}

.user-nav a:hover,
.user-nav .link-button:hover {
    border-color: var(--line);
    color: var(--brand-dark);
    background: var(--surface-soft);
}

.user-nav .nav-home {
    color: var(--brand-dark);
    background: var(--accent);
}

.user-chip,
.version-chip {
    min-height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    color: var(--brand-ink);
    background: #edf5f4;
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
}

.link-button {
    text-decoration: none;
}

.page-shell {
    width: min(var(--content-width), calc(100% - 48px));
    min-height: calc(100vh - 154px);
    padding: clamp(32px, 5vw, 64px) 0;
}

.site-footer {
    width: min(var(--content-width), calc(100% - 48px));
    min-height: 66px;
    margin: 0 auto;
    padding: 18px 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

h1 {
    margin: 6px 0 12px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.16;
    letter-spacing: -0.035em;
}

h2,
h3 {
    line-height: 1.35;
}

.eyebrow {
    font-size: 12px;
    letter-spacing: 0.14em;
}

.hero {
    max-width: none;
    margin-bottom: 28px;
}

.dashboard-hero {
    min-height: 250px;
    padding: clamp(28px, 5vw, 56px);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    overflow: hidden;
    border: 1px solid #b9dcd6;
    border-radius: 28px;
    background:
        linear-gradient(112deg, rgba(255, 255, 255, 0.96), rgba(228, 247, 243, 0.9)),
        var(--surface);
    box-shadow: var(--shadow-lg);
}

.dashboard-hero > div:first-child {
    max-width: 780px;
}

.dashboard-hero h1 {
    font-size: clamp(34px, 5vw, 58px);
}

.hero-version {
    min-width: 150px;
    padding: 16px 18px;
    display: grid;
    gap: 2px;
    border: 1px solid rgba(15, 118, 110, 0.2);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.75);
    text-align: right;
}

.hero-version span {
    color: var(--muted);
    font-size: 12px;
}

.hero-version strong {
    color: var(--brand-dark);
    font-size: 24px;
}

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

.module-card {
    min-height: 170px;
    padding: 26px;
    align-items: center;
    border-color: var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.module-card:hover {
    border-color: #86bdb4;
    box-shadow: 0 20px 46px rgba(20, 52, 54, 0.13);
    transform: translateY(-4px);
}

.module-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(145deg, #e4f7f3, #c6e9e2);
    font-size: 24px;
}

.module-card strong {
    margin: 0 0 5px;
    font-size: 21px;
}

.module-card small {
    font-size: 14px;
}

.module-arrow {
    margin-left: auto;
    color: var(--brand);
    font-size: 25px;
    transition: transform 160ms ease;
}

.module-card:hover .module-arrow {
    transform: translateX(4px);
}

.page-heading,
.product-hero {
    margin-bottom: 24px;
    align-items: center;
    gap: 28px;
}

.page-heading > div:first-child,
.product-hero > div:first-child {
    min-width: 0;
    max-width: 900px;
}

.page-heading h1,
.product-hero h1 {
    margin: 4px 0 8px;
    font-size: clamp(30px, 4vw, 48px);
}

.breadcrumbs {
    margin-bottom: 18px;
    min-height: 30px;
    gap: 8px;
    overflow-x: auto;
    font-size: 13px;
    white-space: nowrap;
}

.page-shell:has(> .breadcrumbs) {
    padding-top: clamp(16px, 2vw, 26px);
}

.breadcrumbs a {
    padding: 4px 0;
    font-weight: 700;
}

.breadcrumbs span:not(:last-child) {
    color: #9aabb0;
}

.button {
    min-height: 48px;
    margin-top: 0;
    padding: 0 18px;
    gap: 8px;
    border-radius: 11px;
    box-shadow: 0 5px 12px rgba(15, 118, 110, 0.12);
    font-size: 15px;
    font-weight: 800;
    transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.button:hover {
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.2);
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
}

.button.secondary {
    border-color: #9db9b6;
    color: var(--brand-dark);
    background: #fff;
    box-shadow: none;
}

.button.secondary:hover {
    border-color: var(--brand);
    background: var(--accent);
}

.button-block {
    width: 100%;
}

.button[disabled],
button[disabled] {
    cursor: wait;
    opacity: 0.68;
    transform: none;
}

.filter-panel,
.quote-form-section,
.result-section,
.result-hero,
.detail-section,
.change-panel,
.confirmation-panel,
.scheme-card,
.revision-history {
    border-color: var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.filter-panel {
    padding: clamp(18px, 3vw, 26px);
}

.filter-panel-heading {
    margin-bottom: 18px;
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
}

.filter-panel-heading > div {
    display: grid;
    gap: 2px;
}

.filter-panel-heading strong {
    font-size: 17px;
}

.filter-panel-heading small,
.filter-panel-heading > span {
    color: var(--muted);
    font-size: 13px;
}

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

.field,
.filter-field {
    gap: 7px;
}

.field label,
.filter-field label,
.stack-form label {
    color: #40535c;
    font-size: 14px;
    font-weight: 800;
}

.field input,
.field select,
.filter-field input,
.filter-field select,
.stack-form input,
.stack-form select,
.stack-form textarea {
    width: 100%;
    min-height: 50px;
    padding: 10px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    color: var(--text);
    background: #fff;
    font-size: 16px;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input:hover,
.field select:hover,
.filter-field input:hover,
.filter-field select:hover,
.stack-form input:hover,
.stack-form select:hover,
.stack-form textarea:hover {
    border-color: #91aaa9;
}

.field input:focus,
.field select:focus,
.filter-field input:focus,
.filter-field select:focus,
.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus {
    border-color: var(--brand);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.help-text {
    color: #718188;
    font-size: 12px;
}

.filter-actions,
.detail-actions {
    margin-top: 20px;
    gap: 10px;
}

.result-pill,
.status-badge,
.scenario-badge,
.product-code,
.change-state,
.revision-badge,
.legend {
    min-height: 28px;
    padding: 4px 9px;
    font-size: 12px;
}

.result-pill {
    min-height: 40px;
    padding: 0 14px;
}

.product-grid {
    gap: 16px;
}

.product-card {
    min-height: 300px;
    padding: 22px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.product-card:hover {
    border-color: #83b8af;
    box-shadow: var(--shadow-md);
}

.product-card h2 {
    font-size: 18px;
}

.product-meta {
    font-size: 12px;
}

.product-facts div {
    grid-template-columns: 58px minmax(0, 1fr);
}

.price-line strong {
    font-size: 22px;
}

.price-card {
    min-width: 280px;
    padding: 24px;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, #0b5d57, #073f3b);
}

.detail-section {
    padding: clamp(20px, 3vw, 30px);
}

.detail-grid div {
    min-height: 86px;
    padding: 15px;
}

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

.spec-card {
    padding: 20px;
    border-radius: 15px;
    background: var(--surface-soft);
}

.alert,
.messages {
    padding: 16px 18px;
    border-radius: 14px;
}

.messages {
    margin-bottom: 18px;
    border: 1px solid #9bcfc5;
    color: var(--brand-ink);
    box-shadow: var(--shadow-sm);
}

.messages p {
    margin: 0;
}

.auth-page {
    background:
        radial-gradient(circle at 15% 10%, rgba(80, 191, 174, 0.2), transparent 28rem),
        radial-gradient(circle at 90% 100%, rgba(63, 123, 181, 0.11), transparent 30rem),
        #f4f8f8;
}

.auth-page .topbar {
    background: transparent;
    box-shadow: none;
}

.auth-card,
.content-card,
.empty-state {
    width: min(540px, 100%);
    padding: clamp(26px, 5vw, 44px);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
}

.auth-page .auth-card {
    margin-top: clamp(20px, 7vh, 80px);
}

.auth-brand {
    margin-bottom: 28px;
    padding-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
}

.auth-brand > div {
    display: grid;
    gap: 1px;
}

.auth-brand strong {
    font-size: 18px;
}

.auth-brand small {
    color: var(--muted);
    font-size: 12px;
}

.stack-form {
    gap: 9px;
}

.quote-form {
    gap: 16px;
}

.quote-form-section,
.result-section {
    padding: clamp(22px, 3vw, 32px);
}

.quote-form-section .section-heading {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

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

.conditional-panel {
    margin-top: 18px;
    padding: 18px;
    border-color: #a7c7c1;
    background: #f5faf9;
}

.check-group,
.option-grid {
    gap: 10px;
}

.check-group label,
.option-grid label {
    min-height: 50px;
    padding: 11px 13px;
    border-color: var(--line-strong);
    border-radius: 12px;
    font-size: 14px;
    transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.check-group label:hover,
.option-grid label:hover {
    border-color: #86afa8;
    background: #f7fbfa;
}

.check-group label.is-selected,
.option-grid label.is-selected {
    border-color: var(--brand);
    color: var(--brand-ink);
    background: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.14);
}

.check-group input,
.option-grid input {
    width: 20px;
    height: 20px;
}

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

.quote-submit-bar,
.quote-save-bar {
    padding: 15px 18px;
    border-radius: 16px;
    border-color: #79afa6;
    background: rgba(237, 249, 246, 0.96);
    box-shadow: 0 14px 38px rgba(10, 81, 76, 0.16);
}

.quote-submit-bar {
    bottom: max(12px, env(safe-area-inset-bottom));
}

.quote-submit-bar .button,
.quote-save-bar .button {
    min-width: 210px;
}

.result-hero {
    padding: clamp(24px, 4vw, 38px);
    background: linear-gradient(135deg, #0b5d57, #073c3a);
}

.result-total {
    min-width: 320px;
}

.result-total strong {
    font-size: clamp(28px, 4vw, 42px);
}

.table-scroll,
.change-table-wrap {
    border: 1px solid var(--line);
    border-radius: 14px;
    scrollbar-color: #8fb3af #edf3f3;
    scrollbar-width: thin;
}

.table-scroll:focus-visible,
.change-table-wrap:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.2);
    outline-offset: 3px;
}

.quote-table,
.change-table {
    font-size: 14px;
}

.quote-table th,
.quote-table td,
.change-table th,
.change-table td {
    padding: 13px 14px;
}

.quote-table th,
.change-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: #3f535b;
    background: #f1f6f6;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.quote-table tbody tr:nth-child(even):not(.inquiry-row),
.change-table tbody tr:nth-child(even) {
    background: #fbfcfc;
}

.quote-table tbody tr:hover,
.change-table tbody tr:hover {
    background: #f0f8f6;
}

.quote-table td {
    min-height: 52px;
}

.rule-details summary,
.spec-details summary,
.room-result > summary {
    min-height: 38px;
    cursor: pointer;
}

.rule-details summary,
.spec-details summary {
    padding: 8px 0;
    color: var(--brand-dark);
    font-weight: 750;
}

.room-result {
    border-radius: 15px;
}

.room-result > summary {
    padding: 14px 16px;
}

.scheme-grid {
    gap: 16px;
}

.scheme-card {
    padding: 22px;
    border-left-width: 4px;
}

.scheme-card h2 {
    font-size: 20px;
}

.scheme-meta {
    gap: 12px;
}

.scheme-meta div,
.snapshot-overview > div {
    padding: 12px;
    border-radius: 12px;
    background: var(--surface-soft);
}

.scheme-toolbar {
    margin: 18px 0;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.scheme-actions {
    gap: 9px;
}

.snapshot-overview {
    gap: 12px;
}

.snapshot-overview > div {
    min-height: 88px;
    border-color: var(--line);
}

.snapshot-overview strong {
    font-size: 16px;
}

.change-panel,
.confirmation-panel {
    padding: clamp(20px, 3vw, 28px);
}

.change-panel-head,
.confirmation-panel {
    gap: 22px;
}

.history-layout {
    grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
    gap: 16px;
}

.revision-history {
    top: 92px;
    padding: 18px;
}

.revision-history li a {
    min-height: 62px;
    padding: 10px;
}

.confirmation-actions {
    gap: 9px;
}

.pagination {
    min-height: 62px;
}

.pagination a {
    min-height: 42px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
}

@media (max-width: 1100px) {
    .filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

@media (max-width: 820px) {
    .topbar-inner,
    .page-shell,
    .site-footer {
        width: min(100% - 32px, var(--content-width));
    }

    .topbar-inner {
        min-height: 0;
        padding: 10px 0;
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .user-nav {
        width: 100%;
        padding-bottom: 2px;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .page-shell {
        padding: 30px 0 42px;
    }

    .dashboard-hero {
        min-height: 0;
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-version {
        min-width: 0;
        text-align: left;
    }

    .page-heading,
    .product-hero {
        align-items: stretch;
        flex-direction: column;
    }

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

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

    .product-grid,
    .spec-grid,
    .scheme-grid {
        grid-template-columns: 1fr;
    }

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

    .price-card {
        min-width: 0;
    }

    .history-layout {
        grid-template-columns: 1fr;
    }

    .revision-history {
        position: static;
    }

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

@media (max-width: 580px) {
    .topbar-inner,
    .page-shell,
    .site-footer {
        width: min(100% - 24px, var(--content-width));
    }

    .brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .brand-copy strong {
        font-size: 17px;
    }

    .page-shell {
        padding-top: 24px;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    h1,
    .page-heading h1,
    .product-hero h1 {
        font-size: clamp(28px, 9vw, 38px);
    }

    .dashboard-hero {
        padding: 24px 20px;
        border-radius: 22px;
    }

    .dashboard-hero h1 {
        font-size: clamp(31px, 10vw, 43px);
    }

    .module-grid,
    .filter-grid,
    .quote-fields,
    .option-grid,
    .detail-grid,
    .snapshot-overview,
    .scheme-meta {
        grid-template-columns: 1fr;
    }

    .module-card {
        min-height: 132px;
        padding: 20px;
    }

    .module-icon {
        width: 48px;
        height: 48px;
    }

    .filter-panel,
    .quote-form-section,
    .result-section,
    .detail-section,
    .change-panel,
    .confirmation-panel,
    .scheme-card {
        padding: 18px 16px;
        border-radius: 18px;
    }

    .filter-panel-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .filter-actions,
    .detail-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .filter-actions .button,
    .detail-actions .button,
    .page-heading > .button {
        width: 100%;
    }

    .quote-submit-bar,
    .quote-save-bar,
    .result-hero,
    .change-panel-head,
    .confirmation-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .quote-submit-bar,
    .quote-save-bar {
        padding: 13px;
    }

    .quote-submit-bar .button,
    .quote-save-bar .button {
        width: 100%;
        min-width: 0;
    }

    .result-total {
        min-width: 0;
        text-align: left;
    }

    .scheme-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .scheme-actions form,
    .scheme-actions .button {
        width: 100%;
    }

    .confirmation-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    .confirmation-actions .button {
        width: 100%;
    }

    .spec-details > div {
        width: min(78vw, 620px);
    }
}

/* v0.5.2 · 信息密度、报价流程与导出预览 */
.dashboard-hero {
    min-height: 135px;
    padding: 22px 28px;
    align-items: center;
    margin-bottom: 16px;
}

.dashboard-brand-title {
    margin: 0;
    font-size: clamp(20px, 2.4vw, 24px);
    letter-spacing: 0.04em;
}

.dashboard-hero h1 {
    margin: 8px 0 0;
    font-size: clamp(30px, 4vw, 46px);
}

.quote-top-action {
    margin: 0 0 14px;
    display: flex;
    justify-content: flex-end;
}

.product-line-selector {
    padding: clamp(18px, 3vw, 26px);
    display: grid;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 14px 42px rgba(32, 70, 51, 0.06);
}

.product-line-selector > div:first-child,
.inline-section-heading {
    display: flex;
    align-items: baseline;
    gap: 12px;
    max-width: none !important;
    margin-bottom: 16px !important;
}

.product-line-selector h2,
.inline-section-heading h2 {
    margin: 0;
    font-size: clamp(1.25rem, 2.4vw, 1.65rem);
}

.inline-section-heading p {
    margin-left: 2px;
    font-size: 13px;
}

.section-number {
    color: var(--brand);
    font-size: clamp(1.25rem, 2.4vw, 1.65rem);
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

.product-line-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.product-line-option {
    min-height: 76px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
}

.product-line-option.selected {
    border-color: var(--brand);
    background: var(--accent);
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.1);
}

.product-line-option.disabled { opacity: .5; cursor: not-allowed; }
.product-line-option span { display: grid; gap: 3px; }
.product-line-option small { color: var(--muted); }

.field-stack { display: grid; align-content: start; gap: 5px; }
.urgent-note { color: #b42318; font-weight: 800; line-height: 1.45; }
.field-note { color: var(--muted); line-height: 1.45; }
.field-disabled { opacity: .5; }
.field-disabled input { cursor: not-allowed; background: #f0f3f1; }
.inline-correction-notice { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #fff4d6; color: #805300; font-weight: 750; }

.dual-action-bar { gap: 18px; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* v0.7.0 · 报价结果页签、预设、重置与下载反馈 */
.product-detail-toolbar {
    margin: 0 0 14px;
    display: flex;
    justify-content: flex-end;
}

.product-detail-toolbar .button { margin: 0; }

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

.option-grid label.option-disabled,
.option-grid label.option-disabled:hover {
    border-color: var(--line);
    color: var(--muted);
    background: #f1f3f2;
    box-shadow: none;
    cursor: not-allowed;
    opacity: .68;
}

.option-disabled span {
    display: grid;
    gap: 2px;
}

.option-disabled small {
    color: #7b8581;
    font-size: 12px;
    font-weight: 700;
}

.result-hero-content {
    min-width: 0;
}

.result-action-bar {
    padding: 12px 14px;
    display: flex;
    justify-content: flex-end;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.result-action-bar .result-actions .button {
    min-width: 150px;
    border-color: #0d8b77;
    color: #fff;
    background: #0f766e;
    box-shadow: 0 7px 18px rgba(0, 0, 0, .18);
}

.result-action-bar .result-actions .button:hover {
    border-color: #22a88f;
    background: #118577;
}

.common-options-heading {
    position: relative;
    justify-content: center;
}

.common-options-heading .section-number {
    position: absolute;
    left: 0;
}

.common-options-heading h2 {
    width: 100%;
    text-align: center;
}

.result-hero {
    padding: clamp(12px, 2vw, 18px);
}

.result-hero h2 {
    font-size: clamp(1.35rem, 3vw, 2rem);
}

.result-view-tabs {
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #eef4f2;
}

.result-view-tab {
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.result-view-tab:hover {
    color: var(--brand-dark);
    background: rgba(255, 255, 255, .65);
}

.result-view-tab.is-active {
    border-color: #8ebbb2;
    color: #fff;
    background: var(--brand);
    box-shadow: 0 5px 14px rgba(15, 118, 110, .18);
}

.result-view-panel[hidden] { display: none; }

.download-status {
    margin: 0;
    align-self: center;
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 750;
}

.download-status.is-error { color: var(--danger); }

/* v0.5.3 · 学科配置卡片与停维提醒 */
.subject-terminal-grid {
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.subject-terminal-card {
    min-width: 0;
    padding: 18px;
    display: grid;
    align-content: start;
    gap: 14px;
    border: 1px solid var(--line);
    border-top-width: 4px;
    border-radius: 16px;
}

.subject-terminal-card h3 {
    margin: 0;
    font-size: 18px;
}

.subject-terminal-card .field {
    min-width: 0;
}

.subject-physics {
    border-color: #9fc5ed;
    border-top-color: #3579bd;
    background: #f3f8fe;
}

.subject-physics h3 { color: #245f9a; }

.subject-chemistry {
    border-color: #e2c582;
    border-top-color: #b7791f;
    background: #fffaf0;
}

.subject-chemistry h3 { color: #8a5a16; }

.subject-biology {
    border-color: #9acfae;
    border-top-color: #2f855a;
    background: #f2faf5;
}

.subject-biology h3 { color: #276749; }

.subject-followup-fields {
    margin-top: 0;
}

.inline-maintenance-notice {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid #e4ba72;
    border-radius: 11px;
    color: #7a4708;
    background: #fff8e8;
    font-weight: 800;
}

.spec-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.copy-spec-button { min-width: 66px; min-height: 36px; padding: 7px 12px; border: 1px solid var(--brand); border-radius: 9px; color: var(--brand-dark); background: #fff; font-weight: 800; cursor: pointer; }
.copy-spec-button:hover { background: var(--accent); }
.copy-spec-button.copy-failed { border-color: var(--danger); color: var(--danger); }

.compact-page-heading { margin-bottom: 16px; }
.export-config-summary { margin-bottom: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.export-config-summary > div { min-width: 0; padding: 14px; display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.export-config-summary span { color: var(--muted); font-size: 12px; }
.export-config-summary strong { overflow-wrap: anywhere; }
.export-options-card { margin-bottom: 16px; }
.export-options-form { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.export-options-form fieldset { min-width: 230px; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; border: 0; }
.export-options-form legend { width: 100%; margin-bottom: 7px; font-weight: 800; }
.export-options-form ul { margin: 0; padding: 0; display: flex; gap: 9px; flex-wrap: wrap; list-style: none; }
.export-options-form label { min-height: 44px; padding: 9px 12px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.export-preview-table { min-width: 1120px; }

@media (max-width: 760px) {
    .dashboard-hero { min-height: 0; padding: 18px; gap: 14px; }
    .dashboard-brand-title { font-size: 19px; }
    .dashboard-hero h1 { font-size: clamp(27px, 8vw, 36px); }
      .product-line-options,
      .export-config-summary { grid-template-columns: 1fr; }
      .subject-terminal-grid { grid-template-columns: 1fr; }
    .product-line-selector > div:first-child,
    .inline-section-heading { align-items: flex-start; flex-wrap: wrap; gap: 7px 10px; }
    .inline-section-heading p { width: 100%; }
    .result-actions,
    .result-actions .button,
    .quote-submit-actions,
    .quote-submit-actions .button,
    .export-options-form,
    .export-options-form .button { width: 100%; }
    .export-options-form { align-items: stretch; }
    .product-detail-toolbar { justify-content: stretch; }
    .product-detail-toolbar .button { width: 100%; }
    .result-view-tab { min-height: 52px; padding: 9px 7px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* v0.6.0 · 项目跟进 */
.project-nav {
    margin: 0 0 1.5rem;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .88);
}

.project-nav-tabs {
    min-width: 0;
    display: flex;
    gap: 6px;
    overflow-x: auto;
}

.project-nav a {
    min-height: 40px;
    padding: 9px 14px;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    border-radius: 9px;
    color: var(--text);
    font-weight: 750;
    text-decoration: none;
}

.project-nav a:hover { background: var(--accent); color: var(--brand-dark); }
.project-nav a.is-active {
    color: #fff;
    background: var(--brand);
    box-shadow: 0 6px 16px rgba(20, 108, 74, .2);
}
.project-nav a.is-active:hover { color: #fff; background: var(--brand-dark); }
.project-nav .project-nav-action { color: var(--brand-dark); background: var(--accent); }
.project-nav-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.project-nav .project-nav-home { color: var(--brand-dark); border: 1px solid var(--line); }
.project-page-head { margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.project-page-head.compact h1 { font-size: clamp(2rem, 4vw, 3rem); }
.project-page-head p { max-width: 760px; margin: .5rem 0 0; color: var(--muted); line-height: 1.6; }
.project-detail-head { align-items: center; }
.heading-badges { margin-bottom: 10px; display: flex; gap: 8px; }
.action-cluster { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.action-cluster form { margin: 0; }
.compact-actions { font-size: 13px; }
.compact-actions a { padding: 5px 2px; }

.metric-grid { margin-bottom: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { padding: 18px 20px; display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 16px; color: var(--text); background: #fff; text-decoration: none; box-shadow: 0 12px 32px rgba(32,70,51,.06); }
.metric-card span { color: var(--muted); font-size: 13px; }
.metric-card strong { font-size: 30px; }
.status-strip { margin-bottom: 20px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.status-summary { min-height: 54px; padding: 10px 13px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: #fff; text-decoration: none; }
.status-summary strong { font-size: 20px; }

.project-two-column { margin-bottom: 20px; display: grid; grid-template-columns: 1fr 1.25fr; gap: 16px; }
.panel-card { width: 100%; margin: 0 0 20px; padding: clamp(18px, 3vw, 26px); border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 14px 40px rgba(32,70,51,.06); }
.section-heading { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading h2, .section-heading h3, .section-heading p { margin: 0; }
.section-heading h2 { font-size: 22px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading > span { min-width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); font-weight: 850; }
.small-heading { align-items: flex-start; }
.small-heading h3 { font-size: 19px; }
.small-heading p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.mini-metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mini-metric-grid > div { padding: 14px; display: grid; gap: 4px; border-radius: 11px; background: #f4f8f5; }
.mini-metric-grid span { color: var(--muted); font-size: 12px; }
.mini-metric-grid strong { font-size: 24px; }
.mini-metric-grid .danger { background: #fff0ed; color: var(--danger); }

.reminder-list { display: grid; gap: 7px; }
.reminder-item { padding: 10px 11px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
.reminder-item:hover { border-color: #95bba8; }
.reminder-item.overdue { border-color: #f0b4ac; background: #fff5f3; }
.reminder-kind { padding: 4px 7px; border-radius: 7px; color: var(--brand-dark); background: var(--accent); font-size: 11px; font-weight: 800; }
.reminder-item span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.reminder-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.reminder-item small { color: var(--muted); }
.reminder-item em { color: var(--muted); font-size: 12px; font-style: normal; white-space: nowrap; }
.reminder-item.overdue em { color: var(--danger); font-weight: 800; }
.empty-compact { padding: 20px; border: 1px dashed #c9d6ce; border-radius: 12px; color: var(--muted); text-align: center; background: #fafcfb; }

.project-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.project-summary-card { min-width: 0; padding: 16px; display: grid; gap: 7px; border: 1px solid var(--line); border-radius: 13px; color: var(--text); text-decoration: none; }
.project-summary-card:hover { border-color: #95bba8; box-shadow: 0 8px 24px rgba(32,70,51,.08); }
.project-summary-card > strong { overflow-wrap: anywhere; font-size: 17px; }
.project-summary-card > small, .project-summary-card time { color: var(--muted); }
.project-type { width: fit-content; padding: 4px 8px; border-radius: 7px; color: #265d91; background: #eaf3fc; font-size: 12px; font-weight: 800; }
.package-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.status-badge, .result-badge, .task-status, .success-chip { width: fit-content; padding: 4px 8px; display: inline-flex; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status-pending { color: #765500; background: #fff4c2; }
.status-published { color: #1f5d94; background: #e6f2ff; }
.status-opened, .result-won { color: #17633c; background: #e5f5eb; }
.status-paused { color: #76500b; background: #f8ead0; }
.status-terminated, .status-failed, .result-lost, .status-archived { color: #7a2a21; background: #f8e3df; }
.result-pending { color: #596761; background: #edf1ef; }

.filter-panel.project-filter { margin-bottom: 16px; padding: 16px; grid-template-columns: 1fr; gap: 12px; }
.project-keyword-search { min-width: 0; }
.project-filter-row {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(118px, 1fr)) auto;
    gap: 8px;
}
.filter-field { min-width: 0; display: grid; gap: 5px; }
.filter-field label { color: var(--muted); font-size: 12px; font-weight: 750; }
.form-control { width: 100%; min-width: 0; min-height: 44px; padding: 9px 10px; border: 1px solid #bdcbc3; border-radius: 9px; color: var(--text); background: #fff; font: inherit; }
.form-control:focus { outline: 3px solid rgba(20,108,74,.14); border-color: var(--brand); }
.filter-actions { display: flex; align-items: flex-end; gap: 7px; }
.filter-actions .button { margin: 0; }
.wide-panel,
.kanban-board,
.calendar-wrap {
    width: 100%;
    margin-left: 0;
    transform: none;
}
.project-table { width: 100%; min-width: 0; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.project-table .project-col-name { width: 18%; }
.project-table .project-col-purchaser { width: 13%; }
.project-table .project-col-packages { width: 17%; }
.project-table .project-col-owner { width: 10%; }
.project-table .project-col-time { width: 14%; }
.project-table .project-col-follow-up { width: 12%; }
.project-table .project-col-updated { width: 10%; }
.project-table .project-col-action { width: 6%; }
.project-table th { padding: 11px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: left; white-space: nowrap; }
.project-table td { padding: 13px 9px; border-bottom: 1px solid #edf1ef; vertical-align: top; overflow-wrap: anywhere; line-height: 1.5; }
.project-table td > small, .owner-line { display: block; color: var(--muted); font-size: 12px; }
.project-table .status-badge { white-space: nowrap; }
.project-table td:last-child { white-space: nowrap; }
.table-title { display: block; margin-bottom: 4px; color: var(--text); font-weight: 800; text-decoration: none; }
.pagination { margin-top: 16px; display: flex; justify-content: center; gap: 16px; }

.project-editor, .form-section { display: grid; gap: 18px; }
.form-section { margin-bottom: 18px; padding: clamp(18px, 3vw, 28px); border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 14px 40px rgba(32,70,51,.06); }
.form-section.single-form { width: min(900px, 100%); margin-inline: auto; }
.form-section-title { display: flex; align-items: flex-start; gap: 13px; }
.form-section-title > span { min-width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--brand-dark); background: var(--accent); font-size: 17px; font-weight: 850; }
.form-section-title h2, .form-section-title p { margin: 0; }
.form-section-title p { margin-top: 4px; color: var(--muted); }
.responsive-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.responsive-form-grid.one-column { grid-template-columns: 1fr; }
.field-group { min-width: 0; display: grid; align-content: start; gap: 6px; }
.field-group label { font-size: 13px; font-weight: 800; }
.field-group textarea { resize: vertical; }
.field-group:has(textarea) { grid-column: span 2; }
.field-group .errorlist { margin: 0; }
.required-mark { margin-left: 3px; color: var(--danger); }
.checkbox-line { min-height: 44px; display: flex; align-items: center; gap: 8px; }
.checkbox-line input { width: 18px; height: 18px; }
.form-actions, .sticky-form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.form-actions .button, .sticky-form-actions .button { margin: 0; }
.sticky-form-actions { position: sticky; bottom: 12px; z-index: 5; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: 0 12px 34px rgba(32,70,51,.12); }
.upload-guidance { padding: 13px 15px; border-radius: 11px; color: #5a4300; background: #fff7d9; }
.upload-guidance p { margin: 4px 0 0; }

.detail-grid { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-grid > div { min-width: 0; padding: 12px; border-radius: 11px; background: #f7faf8; }
.detail-grid .span-2 { grid-column: span 2; }
.detail-grid dt { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.detail-grid dd { margin: 0; overflow-wrap: anywhere; line-height: 1.6; }
.resource-toolbar { display: flex; gap: 9px; flex-wrap: wrap; }
.resource-toolbar a { font-size: 13px; font-weight: 750; }
.button.small { min-height: 36px; margin: 0; padding: 7px 11px; font-size: 13px; }
.button.danger-button { border-color: var(--danger); background: var(--danger); }
.text-danger { border: 0; color: var(--danger); background: transparent; cursor: pointer; text-decoration: underline; }
.attachment-list { margin-top: 12px; display: grid; gap: 7px; }
.attachment-row { min-width: 0; padding: 9px 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.attachment-row > span { min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.attachment-row strong { color: var(--muted); font-size: 11px; }
.attachment-row a { overflow-wrap: anywhere; }
.attachment-row small { color: var(--muted); }
.compact-list { margin-top: 8px; }

.package-heading { margin-top: 30px; }
.package-panel { margin-bottom: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 18px 48px rgba(32,70,51,.08); }
.package-header { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: linear-gradient(120deg,#f4faf6,#fff); }
.package-header h2 { margin: 9px 0 0; font-size: 24px; }
.package-detail-grid { padding: 22px 24px; }
.share-toolbar { padding: 0 24px 20px; display: flex; gap: 8px; }
.package-section { padding: 22px 24px; border-top: 1px solid var(--line); }
.task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.task-card { min-width: 0; padding: 15px; display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fbfdfc; }
.task-card.overdue { border-color: #e8a99f; background: #fff8f7; }
.task-card header, .task-card footer { display: flex; justify-content: space-between; gap: 8px; }
.task-card footer { justify-content: flex-start; }
.task-card h4, .task-card p { margin: 0; }
.task-card dl { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.task-card dl div { min-width: 0; }
.task-card dt { color: var(--muted); font-size: 11px; }
.task-card dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 13px; }
.task-type { padding: 4px 8px; border-radius: 7px; color: #694500; background: #fff1c2; font-size: 11px; font-weight: 900; }
.task-not_started { color: #596761; background: #edf1ef; }
.task-drafting { color: #765500; background: #fff4c2; }
.task-pending_review { color: #1f5d94; background: #e6f2ff; }
.task-returned { color: #8a3429; background: #fbe7e3; }
.task-completed, .success-chip { color: #17633c; background: #e5f5eb; }

.timeline { display: grid; }
.timeline-item { position: relative; margin-left: 8px; padding: 0 0 20px 24px; border-left: 2px solid #cfe0d7; }
.timeline-dot { position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px #9ec6b1; }
.timeline-item header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.timeline-item header span { color: var(--muted); font-size: 12px; }
.timeline-item p { margin: 9px 0; line-height: 1.65; }
.timeline-item > div:not(.timeline-dot):not(.attachment-list) { margin: 5px 0; line-height: 1.55; }
.timeline-item footer { margin-top: 9px; display: flex; gap: 12px; }
.next-follow { color: #744f00; }

.share-dialog { width: min(680px, 92vw); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 28px 90px rgba(16,41,28,.28); }
.share-dialog::backdrop { background: rgba(12,28,20,.55); }
.dialog-head { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-head h3 { margin: 0; }
.dialog-head button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #edf2ef; cursor: pointer; font-size: 22px; }
.share-dialog textarea { width: calc(100% - 40px); min-height: 330px; margin: 20px; padding: 14px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; font: inherit; line-height: 1.75; }
.share-dialog .form-actions { padding: 0 20px 20px; }
.audit-list { display: grid; }
.audit-list > div { padding: 10px 0; display: grid; grid-template-columns: 130px 100px 1fr; gap: 10px; border-bottom: 1px solid #edf1ef; }
.audit-list time, .audit-list strong { font-size: 12px; }

.kanban-board { display: grid; grid-template-columns: repeat(5, minmax(250px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; }
.kanban-column { min-width: 250px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #edf2ef; }
.kanban-column > header { padding: 13px; display: flex; justify-content: space-between; font-weight: 850; background: #fff; }
.kanban-stack { padding: 10px; display: grid; gap: 9px; }
.kanban-card { padding: 13px; display: grid; gap: 7px; border: 1px solid #d8e2dc; border-radius: 11px; color: var(--text); background: #fff; text-decoration: none; box-shadow: 0 6px 16px rgba(32,70,51,.05); }
.kanban-card > small, .kanban-card > span { color: var(--muted); }
.kanban-card dl { margin: 3px 0 0; display: grid; gap: 4px; }
.kanban-card dl div { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.kanban-card dt { color: var(--muted); }
.kanban-card dd { margin: 0; text-align: right; }
.kanban-empty { padding: 18px 8px; color: var(--muted); text-align: center; }

.month-actions { display: flex; gap: 8px; }
.month-actions .button { margin: 0; }
.calendar-toolbar {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.calendar-toolbar > strong { font-size: 20px; }
.calendar-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); }
.calendar-weekdays { color: var(--muted); background: #f2f6f3; font-size: 12px; font-weight: 800; }
.calendar-weekdays div { padding: 10px; text-align: center; }
.calendar-days { min-width: 910px; }
.calendar-day { min-height: 130px; padding: 8px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside { color: #a0aba5; background: #f8faf9; }
.calendar-day.today > time { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--brand); }
.calendar-events { margin-top: 6px; display: grid; gap: 4px; }
.calendar-event { padding: 5px 6px; display: grid; gap: 1px; border-radius: 6px; color: var(--text); background: #edf6f1; text-decoration: none; font-size: 10px; }
.calendar-event span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-开标 { background: #e6f2ff; }
.event-任务 { background: #fff4c2; }
.event-跟进 { background: #f2eafe; }

.task-section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.compact-task-list { display: grid; gap: 7px; }
.compact-task-list > a { min-width: 0; padding: 10px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
.compact-task-list > a > span { min-width: 0; display: grid; gap: 2px; }
.compact-task-list > a > span:last-child { text-align: right; }
.compact-task-list small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.compact-task-list em { font-size: 12px; font-style: normal; }

.filter-disclosure {
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}
.filter-disclosure summary {
    padding: 13px 16px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    font-weight: 700;
    list-style-position: inside;
}
.filter-disclosure summary small { color: var(--muted); font-weight: 400; }
.filter-disclosure[open] summary { border-bottom: 1px solid var(--line); }
.filter-disclosure .project-filter { margin: 0; border: 0; border-radius: 0; }

.initial-attachment-box {
    margin-top: 18px;
    padding: 16px;
    border: 1px dashed var(--line-strong, var(--line));
    border-radius: 13px;
    background: #f8fbf9;
}
.initial-attachment-box h3,
.initial-attachment-box p { margin: 0 0 8px; }
.initial-attachment-box p { color: var(--muted); }

.primary-product-editor { display: grid; gap: 12px; }
.primary-product-head,
.primary-product-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.2fr) minmax(140px, 1fr) minmax(220px, 1.5fr) minmax(90px, .45fr) auto;
    gap: 10px;
    align-items: start;
}
.primary-product-head {
    padding-inline: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.primary-product-row {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fbfdfc;
}
.primary-product-row > div { min-width: 0; }
.primary-product-row label { display: none; margin-bottom: 6px; font-size: 12px; font-weight: 700; }
.delivery-product-field { display: grid; gap: 7px; }
.delivery-model-search { min-height: 38px; font-size: 13px; }
.product-row-action { padding-top: 4px; }
.primary-product-table { min-width: 720px; width: 100%; border-collapse: collapse; }
.primary-product-table th,
.primary-product-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.primary-product-table th { color: var(--muted); font-size: 12px; }
.primary-product-table th:last-child,
.primary-product-table td:last-child { text-align: center; }

.company-task-form { display: grid; gap: 14px; }
.company-task-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.company-task-card {
    min-width: 0;
    padding: 14px;
    display: grid;
    gap: 11px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fbfdfc;
}
.company-task-card .task-type { justify-self: start; font-size: 14px; }
.company-task-card .field-group { margin: 0; }
.company-task-card dl { margin: 0; display: grid; gap: 9px; }
.company-task-card dt { color: var(--muted); font-size: 11px; }
.company-task-card dd { margin: 2px 0 0; }
.direct-bid-toggle { padding: 9px 10px; border-radius: 9px; background: #eef7f1; }
.direct-bid-note { margin: 0; padding: 8px 10px; border-radius: 9px; color: #8a4b08; background: #fff2d8; font-size: 12px; font-weight: 700; }

@media (max-width: 900px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .status-strip { grid-template-columns: repeat(2, 1fr); }
    .project-two-column, .task-section-grid { grid-template-columns: 1fr; }
    .project-card-grid { grid-template-columns: repeat(2, 1fr); }
    .project-filter-row { grid-template-columns: repeat(3, 1fr); }
    .project-filter-row .filter-actions { grid-column: 1 / -1; }
    .company-task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .primary-product-head { display: none; }
    .primary-product-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .primary-product-row label { display: block; }
    .product-row-action { align-self: end; }
    .wide-panel .table-scroll { overflow: visible; }
    .project-table,
    .project-table tbody,
    .project-table tr,
    .project-table td { display: block; width: 100%; }
    .project-table colgroup,
    .project-table thead { display: none; }
    .project-table tr {
        margin-bottom: 14px;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #fff;
    }
    .project-table td {
        padding: 10px 12px;
        display: grid;
        grid-template-columns: minmax(90px, 28%) minmax(0, 1fr);
        gap: 10px;
        border-bottom: 1px solid #edf1ef;
    }
    .project-table td::before {
        content: attr(data-label);
        grid-row: 1 / span 12;
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
    }
    .project-table td > * { grid-column: 2; }
    .project-table td:last-child { border-bottom: 0; }
}

@media (max-width: 620px) {
    .project-nav { align-items: stretch; }
    .project-nav-actions { width: 100%; }
    .project-nav-actions a { flex: 1 1 auto; justify-content: center; }
    .project-page-head, .project-detail-head, .package-header, .section-heading { align-items: stretch; flex-direction: column; }
    .project-page-head h1 { font-size: 2rem; }
    .action-cluster { justify-content: flex-start; }
    .action-cluster .button, .action-cluster form, .action-cluster form button { width: 100%; }
    .metric-grid, .status-strip, .project-card-grid, .responsive-form-grid, .detail-grid, .task-grid, .task-section-grid { grid-template-columns: 1fr; }
    .detail-grid .span-2, .field-group:has(textarea) { grid-column: auto; }
    .filter-actions, .form-actions, .sticky-form-actions, .month-actions { width: 100%; align-items: stretch; flex-direction: column; }
    .filter-actions .button, .form-actions .button, .sticky-form-actions .button, .month-actions .button { width: 100%; }
    .reminder-item { grid-template-columns: auto 1fr; }
    .reminder-item em { grid-column: 2; }
    .package-header, .package-detail-grid, .package-section { padding: 17px; }
    .share-toolbar { padding: 0 17px 17px; flex-direction: column; }
    .share-toolbar .button { width: 100%; }
    .resource-toolbar { display: grid; grid-template-columns: 1fr 1fr; }
    .attachment-row { align-items: flex-start; }
    .task-card dl { grid-template-columns: 1fr; }
    .audit-list > div { grid-template-columns: 1fr; gap: 3px; }
    .calendar-wrap { overflow-x: auto; }
    .calendar-toolbar { align-items: stretch; flex-direction: column; }
    .compact-task-list > a { grid-template-columns: auto 1fr; }
    .compact-task-list > a > span:last-child { grid-column: 2; text-align: left; }
}

@media (max-width: 620px) {
    .company-task-grid,
    .primary-product-row { grid-template-columns: 1fr; }
    .project-filter-row { grid-template-columns: 1fr; }
    .filter-disclosure summary { align-items: flex-start; flex-direction: column; gap: 3px; }
}

.mandatory-password-notice {
    margin: 18px 0;
    padding: 15px 17px;
    border: 1px solid #f2c66d;
    border-radius: 12px;
    color: #7a4306;
    background: #fff7e6;
}
.mandatory-password-notice strong { display: block; font-size: 16px; }
.mandatory-password-notice p { margin: 6px 0 0; line-height: 1.6; }

/* Final responsive overrides for v0.7.0 quote guidance. */
.hero-version {
    position: absolute;
    top: 12px;
    right: 16px;
    min-width: 0;
    padding: 0;
    display: inline;
    border: 0;
    border-radius: 0;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
    text-align: right;
    opacity: .72;
}

@media (max-width: 760px) {
    .hero-version {
        top: 9px;
        right: 12px;
        min-width: 0;
        padding: 0;
        display: inline;
        text-align: right;
        font-size: 10px;
    }

    .quote-submit-bar {
        padding: 8px;
        display: block;
    }

    .quote-submit-bar > div:first-child {
        display: none;
    }

    .quote-submit-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        flex-wrap: nowrap;
    }

    .quote-submit-actions .button {
        width: 100%;
        min-width: 0;
        min-height: 42px;
        padding: 8px 4px;
        font-size: 12px;
        white-space: nowrap;
    }

    .button-label-full { display: none; }
    .button-label-compact { display: inline; }
}
