/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
}

:root {
    --body-bg: #eef3fc;
    --container-bg: #ffffff;
    --grad-start: #bdd4f5;
    --grad-mid: #a0bedf;
    --grad-end: #85a8cc;
    --primary-dark: #3a5a7a;
    --primary-medium: #5c7d9e;
    --primary-light: #7c9cbd;
    --accent-color: #5c7d9e;
    --accent-hover: #486683;
    --accent-light-bg: #f2f6fc;
    --border-light: #dbe6f2;
    --border-table: #cbdaea;
    --td-border: #eff3f6;
    --input-border: #e2edf2;
    --btn-primary-bg: #5c7d9e;
    --btn-success-bg: #6c8e6a;
    --btn-warning-bg: #c48156;
    --btn-load-bg: #768aa0;
    --btn-default-bg: #f1f5f9;
    --btn-default-color: #3a5a7a;
    --th-bg: #f9fcff;
    --th-text: #2f5270;
    --row-total-border: #5c7d9e;
    --total-section-bg: linear-gradient(135deg, #f0f6fe, #e8f0fa);
    --manual-bg: #fff9ed;
    --manual-border: #e2cfb0;
    --merchant-bg: #4c6a86;
    --merchant-text: #f0f7f5;
    --final-total-color: #c56e42;
    --toast-bg: #3e6b64e6;
    --tooltip-bg: #2c3e2f;
    --tooltip-text: #f9f7f3;
    --drag-handle-color: #7b9e8c;
    --focus-shadow: #7fada340;
    --area-bg: #f8fafc;
    --disabled-input-bg: #eef2f5;
    --disabled-border: #ced4da;
    --modal-overlay: rgba(0,0,0,0.5);
    --modal-bg: #ffffff;
    --tag-high-intent: #d4edda;
    --tag-high-text: #155724;
    --tag-mid-intent: #fff3cd;
    --tag-mid-text: #856404;
    --tag-low-intent: #f8d7da;
    --tag-low-text: #721c24;
    --tag-deal: #d1ecf1;
    --tag-deal-text: #0c5460;
}

body {
    padding: 20px;
    background: var(--body-bg);
    min-height: 100vh;
}

.container {
    max-width: 1480px;
    margin: 0 auto;
    background: var(--container-bg);
    box-shadow: 0 20px 35px -12px rgba(0,0,0,0.1);
    border-radius: 28px;
    position: relative;
    overflow-x: auto;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, var(--grad-start), var(--grad-mid), var(--grad-end));
    border-radius: 28px 28px 0 0;
}

.header {
    padding: 20px 24px 12px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.logo-area { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}
.logo-icon svg { width: 26px; height: 26px; stroke: white; stroke-width: 1.7; fill: none; }
.header h1 { font-size: 1.6rem; font-weight: 700; color: var(--primary-dark); letter-spacing: -0.3px; }
.slogan {
    font-size: 1.05rem; font-weight: 500; color: var(--primary-medium);
    margin-left: 6px; padding-left: 12px; border-left: 2px solid var(--border-table);
    line-height: 1.2; white-space: nowrap;
}
.header-right { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.color-palette { display: flex; align-items: center; gap: 8px; }
.theme-label { font-size: 12px; font-weight: 500; color: var(--primary-dark); }
.color-swatch {
    width: 22px; height: 22px; border-radius: 22px;
    cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    border: 2px solid rgba(255,255,255,0.6);
}
.quote-time-text { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--primary-dark); font-weight: 500; }
.flaticon {
    width: 18px; height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-right: 6px;
    vertical-align: middle;
}

.customer-info {
    margin: 20px 24px;
    background: var(--accent-light-bg);
    padding: 18px 20px;
    border-radius: 24px;
    border: 1px solid var(--border-light);
}
.info-group { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.info-item { flex: 1 1 180px; }
.info-item.address-item { flex: 3 1 280px; }
.info-item label { font-size: 0.8rem; font-weight: 600; color: var(--primary-dark); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.info-item input {
    width: 100%; padding: 12px 14px;
    border: 1.5px solid var(--input-border); border-radius: 16px;
    font-size: 0.9rem; background: var(--container-bg); color: var(--primary-dark);
}

.batch-bar {
    margin: 8px 24px 12px 24px;
    display: flex; flex-wrap: wrap; gap: 12px;
    align-items: center; justify-content: space-between;
}
.batch-group { display: flex; gap: 10px; background: transparent; padding: 6px 16px; border-radius: 48px; align-items: center; flex-wrap: wrap; }
.batch-select { padding: 6px 12px; border-radius: 40px; border: 1px solid var(--border-table); background: var(--container-bg); font-size: 0.8rem; }
.btn-batch {
    background: var(--btn-default-bg); border: none; padding: 6px 20px; border-radius: 40px;
    font-weight: 500; font-size: 0.75rem; cursor: pointer; color: var(--primary-dark);
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-batch.primary { background: var(--btn-primary-bg); color: white; }

.table-container {
    margin: 0 24px 20px 24px;
    border: 1px solid var(--border-light);
    border-radius: 24px;
    overflow-x: auto;
    background: var(--container-bg);
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 1350px;
}

th:nth-child(1), td:nth-child(1) { width: 6%; text-align: center; }
th:nth-child(2), td:nth-child(2) { width: 5%; }
th:nth-child(3), td:nth-child(3) { width: 9%; }
th:nth-child(4), td:nth-child(4) { width: 6%; }
th:nth-child(5), td:nth-child(5) { width: 6%; }
th:nth-child(6), td:nth-child(6) { width: 8%; }
th:nth-child(7), td:nth-child(7) { width: 6%; }
th:nth-child(8), td:nth-child(8) { width: 5%; }
th:nth-child(9), td:nth-child(9) { width: 6%; }
th:nth-child(10), td:nth-child(10) { width: 8%; }
th:nth-child(11), td:nth-child(11) { width: 15%; }
th:nth-child(12), td:nth-child(12) { width: 6%; }
th:nth-child(13), td:nth-child(13) { width: 10%; text-align: center; }

th, td {
    white-space: nowrap;
    padding: 8px 6px;
    vertical-align: middle;
}
th {
    background: var(--th-bg);
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--th-text);
    border-bottom: 2px solid var(--border-table);
}
td {
    border-bottom: 1px solid var(--td-border);
}

td select, td input {
    width: 100%;
    padding: 6px 4px;
    border-radius: 12px;
    border: 1px solid var(--input-border);
    background: var(--container-bg);
    font-size: 0.8rem;
    color: var(--primary-dark);
    box-sizing: border-box;
}
input:disabled, select:disabled {
    background: var(--disabled-input-bg);
    border-color: var(--disabled-border);
    opacity: 0.7;
    cursor: not-allowed;
}

.drag-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}
.serial-number { font-weight: 600; font-size: 0.85rem; color: var(--primary-dark); min-width: 24px; text-align: center; }
.drag-handle { cursor: grab; user-select: none; display: inline-flex; padding: 4px; font-size: 22px; color: var(--drag-handle-color); }
.row-total {
    font-weight: 700; text-align: right; cursor: pointer;
    border: 2px solid var(--row-total-border); border-radius: 16px;
    padding: 4px 6px; background: var(--container-bg);
}
.row-total.manual-mode { background: var(--manual-bg); border-color: var(--manual-border); }

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    flex-wrap: nowrap;
}
.icon-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #5c6f87;
    flex-shrink: 0;
}
.icon-btn:hover { background: rgba(92, 111, 135, 0.1); transform: scale(1.02); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.icon-btn.btn-copy svg { stroke: #3b82f6; }
.icon-btn.btn-delete svg { stroke: #ef4444; }
.icon-btn.btn-copy:hover svg { stroke: #2563eb; }
.icon-btn.btn-delete:hover svg { stroke: #dc2626; }

.total-section {
    margin: 16px 24px 24px;
    background: var(--total-section-bg);
    padding: 14px 20px;
    border-radius: 28px;
    border: 1px solid var(--border-light);
}
.category-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-table);
}
.cat-item {
    background: var(--container-bg);
    padding: 4px 14px;
    border-radius: 32px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    color: var(--primary-dark);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cat-item strong { color: var(--final-total-color); margin-right: 4px; }
.full-total-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
.total-item { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--primary-dark); }
.final-total-item span:last-child { color: var(--final-total-color); font-size: 1.2rem; font-weight: 700; }
#invoice-type, #discount { padding: 4px 8px; border-radius: 40px; border: 1px solid var(--border-table); background: var(--container-bg); }
.discount-input { width: 65px; padding: 4px; text-align: center; border-radius: 30px; }

.btn-group {
    margin: 10px 24px 20px;
    display: flex; flex-wrap: wrap; gap: 12px;
    justify-content: center;
}
.btn {
    border: none; padding: 8px 16px; font-weight: 600; font-size: 0.8rem;
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    background: var(--btn-default-bg); color: var(--btn-default-color);
    border-radius: 40px;
}
.btn-primary { background: var(--btn-primary-bg); color: white; }
.btn-success { background: var(--btn-success-bg); color: white; }
.btn-warning { background: var(--btn-warning-bg); color: white; }
.btn-load { background: var(--btn-load-bg); color: white; }
#saved-data-list {
    min-width: 220px; border-radius: 40px; padding: 8px 16px;
    border: 1px solid var(--border-table); background: var(--container-bg);
    font-size: 0.8rem; color: var(--primary-dark); outline: none; cursor: pointer;
}

.merchant-info {
    margin: 20px 24px 24px; text-align: center;
    background: var(--merchant-bg); padding: 10px 16px; border-radius: 60px;
    color: var(--merchant-text); font-size: 0.7rem;
}
.version { text-align: center; font-size: 11px; color: var(--primary-light); padding-bottom: 18px; }

.toast-notify {
    position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
    background: var(--toast-bg); backdrop-filter: blur(12px); color: white;
    padding: 10px 24px; font-size: 0.8rem; font-weight: 500; z-index: 2000;
    opacity: 0; transition: 0.25s; pointer-events: none; border-radius: 40px;
}
.toast-notify.show { opacity: 1; transform: translateX(-50%) translateY(-10px); }

.custom-tooltip {
    position: fixed; background: var(--tooltip-bg); color: var(--tooltip-text);
    padding: 6px 12px; border-radius: 12px; font-size: 0.75rem;
    z-index: 2100; pointer-events: none; white-space: nowrap;
}

.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: var(--modal-bg);
    width: 95%;
    max-width: 1300px;
    max-height: 90vh;
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 40px rgba(0,0,0,0.2);
}
.modal-header {
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    background: var(--th-bg);
}
.modal-header h2 { font-size: 1.4rem; color: var(--primary-dark); }
.close-modal { font-size: 32px; font-weight: bold; cursor: pointer; color: var(--primary-medium); line-height: 1; transition: 0.2s; }
.close-modal:hover { color: var(--final-total-color); transform: scale(1.1); }
.modal-body { padding: 24px 28px; overflow-y: auto; flex: 1; background: var(--container-bg); }

.client-stats-bar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    align-items: center;
    justify-content: space-between;
}
.action-buttons-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.search-filter-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    background: var(--accent-light-bg);
    padding: 5px 16px;
    border-radius: 48px;
}
.search-filter-group input {
    padding: 8px 16px;
    border-radius: 40px;
    border: 1px solid var(--border-table);
    background: var(--container-bg);
    font-size: 0.85rem;
    width: 200px;
}
.search-filter-group select {
    padding: 6px 12px;
    border-radius: 40px;
    border: 1px solid var(--border-table);
    background: var(--container-bg);
    font-size: 0.85rem;
}
.reset-btn {
    background: var(--btn-default-bg);
    border: none;
    padding: 6px 14px;
    border-radius: 40px;
    cursor: pointer;
}

.client-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-height: 58vh;
    overflow-y: auto;
    padding-right: 6px;
}
.client-card {
    border: 1px solid var(--border-light);
    border-radius: 28px;
    padding: 20px 24px;
    background: var(--container-bg);
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.client-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    border-color: var(--primary-light);
}
.client-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}
.client-info-main {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.client-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    cursor: pointer;
}
.client-name:hover { text-decoration: underline; }
.client-contact-detail {
    font-size: 0.8rem;
    color: var(--primary-medium);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.client-contact-detail span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.right-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.intent-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--area-bg);
    padding: 4px 12px;
    border-radius: 40px;
}
.intent-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 700;
    border-left: 4px solid;
}
.intent-badge.high { background: var(--tag-high-intent); color: var(--tag-high-text); border-left-color: #28a745; }
.intent-badge.mid { background: var(--tag-mid-intent); color: var(--tag-mid-text); border-left-color: #ffc107; }
.intent-badge.low { background: var(--tag-low-intent); color: var(--tag-low-text); border-left-color: #dc3545; }
.intent-badge.deal { background: var(--tag-deal); color: var(--tag-deal-text); border-left-color: #17a2b8; }
.intent-badge.default { background: #e9ecef; color: #495057; border-left-color: #6c757d; }
.category-select {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 30px;
    border: 1px solid var(--border-table);
    background: var(--container-bg);
}
.client-action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
}
.icon-svg-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: #5c6f87;
}
.icon-svg-btn:hover { background: rgba(92, 111, 135, 0.1); }
.icon-svg-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.delete-client-svg:hover svg { stroke: #ef4444; }
.edit-client-svg:hover svg { stroke: #3b82f6; }

.stats-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: var(--accent-light-bg);
    padding: 8px 18px;
    border-radius: 32px;
    margin: 12px 0;
}
.stats-group {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    font-weight: 500;
    align-items: center;
}
.stats-group span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.stats-group span strong { color: var(--final-total-color); }
.btn-sm-add {
    background: var(--btn-primary-bg);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.btn-sm-add:hover { filter: brightness(0.95); }

.remark-row {
    margin: 12px 0;
    padding: 8px 12px;
    background: #fffdf7;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border: 1px dashed var(--border-table);
}
.remark-row input {
    flex: 2;
    min-width: 180px;
    padding: 8px 14px;
    border-radius: 40px;
    border: 1px solid var(--border-table);
    background: white;
}
.purchase-list {
    margin-top: 16px;
    border-top: 2px solid var(--border-light);
    padding-top: 14px;
}
.purchase-list > strong {
    font-size: 0.85rem;
    display: block;
    margin-bottom: 12px;
    color: var(--primary-dark);
}
.purchase-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--area-bg);
    margin: 8px 0;
    padding: 12px 18px;
    border-radius: 22px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.1s;
    border: 1px solid transparent;
}
.purchase-item:hover {
    background: var(--td-border);
    transform: translateX(3px);
    border-color: var(--border-table);
}
.purchase-actions { display: flex; gap: 12px; }
.delete-purchase-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #e74c3c;
}
.delete-purchase-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.delete-purchase-btn:hover svg { stroke: #c0392b; }

.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.7rem;
}
.detail-table th, .detail-table td {
    border: 1px solid var(--border-table);
    padding: 8px 10px;
    text-align: left;
}
.detail-table th { background: var(--th-bg); color: var(--th-text); }
.client-stats-inline {
    display: inline-flex;
    gap: 16px;
    margin-left: 16px;
    flex-wrap: wrap;
}
/* ========== 手机端专用适配 ========== */
@media (max-width: 768px) {
    input, select, button {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    body {
        padding: 8px;
    }
    .container {
        border-radius: 16px;
    }
    .header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
    }
    .logo-area {
        flex-wrap: wrap;
    }
    .header h1 {
        font-size: 1.2rem;
    }
    .slogan {
        font-size: 0.75rem;
        white-space: normal;
        border-left: none;
        padding-left: 0;
        margin-left: 0;
    }
    .customer-info {
        margin: 12px 16px;
        padding: 12px;
    }
    .info-group {
        flex-direction: column;
        gap: 12px;
    }
    .info-item {
        width: 100%;
    }
    .batch-bar {
        margin: 8px 16px;
        flex-direction: column;
        align-items: stretch;
    }
    .batch-group {
        justify-content: space-between;
        padding: 6px 0;
    }
    .table-container {
        margin: 0 16px 16px;
        border-radius: 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table {
        min-width: 900px; /* 保持表格可水平滚动 */
    }
    th, td {
        padding: 6px 4px;
        font-size: 0.7rem;
    }
    .row-total {
        font-size: 0.7rem;
    }
    .action-buttons {
        gap: 4px;
    }
    .icon-btn {
        width: 24px;
        height: 24px;
    }
    .icon-btn svg {
        width: 14px;
        height: 14px;
    }
    .total-section {
        margin: 12px 16px;
        padding: 10px 12px;
    }
    .category-summary {
        gap: 8px;
        justify-content: flex-start;
    }
    .cat-item {
        font-size: 0.7rem;
        padding: 2px 10px;
    }
    .full-total-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .total-item {
        font-size: 0.75rem;
    }
    .btn-group {
        margin: 8px 16px;
        gap: 8px;
        justify-content: center;
    }
    .btn {
        padding: 6px 12px;
        font-size: 0.7rem;
    }
    #saved-data-list {
        min-width: 180px;
        font-size: 0.7rem;
    }
    .merchant-info {
        margin: 12px 16px;
        font-size: 0.6rem;
    }
    .version {
        font-size: 9px;
    }
    /* 客户管理模态框手机适配 */
    .modal-content {
        width: 98%;
        max-height: 95vh;
        border-radius: 20px;
    }
    .modal-header {
        padding: 12px 16px;
    }
    .modal-header h2 {
        font-size: 1.2rem;
    }
    .modal-body {
        padding: 16px;
    }
    .client-stats-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-filter-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    .search-filter-group input {
        width: 100%;
    }
    .client-card {
        padding: 16px;
    }
    .client-name {
        font-size: 1.1rem;
    }
    .client-contact-detail {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .right-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }
    .intent-controls {
        width: 100%;
        justify-content: space-between;
    }
    .stats-row {
        flex-direction: column;
        align-items: stretch;
    }
    .stats-group {
        gap: 12px;
    }
    .remark-row {
        flex-direction: column;
        align-items: stretch;
    }
    .purchase-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    .detail-table {
        font-size: 0.65rem;
    }
}

/* 针对更小屏幕的额外优化 */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1rem;
    }
    .slogan {
        font-size: 0.65rem;
    }
    .cat-item {
        font-size: 0.65rem;
    }
    .btn {
        padding: 5px 10px;
    }
}
/* 确保详情表格宽度自适应 */
.detail-table {
    width: 100%;
    table-layout: auto;
    word-break: break-word;
    border-collapse: collapse;
}

/* 手机端优化：允许单元格内容换行，减小内边距 */
@media (max-width: 768px) {
    .detail-table th,
    .detail-table td {
        white-space: normal;      /* 允许换行，防止撑开宽度 */
        padding: 6px 4px;         /* 减小内边距 */
        font-size: 0.7rem;        /* 字体稍小，适配小屏 */
    }
    .detail-table {
        display: block;
        overflow-x: auto;         /* 如果内容实在太多，可水平滚动 */
        -webkit-overflow-scrolling: touch;
    }
}

/* 同时确保模态框主体内容区域滚动条合适 */
.modal-body {
    overflow-x: auto;
}