/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* 防止微信等浏览器自动调整字体大小 */
    -webkit-text-size-adjust: none !important;
    -moz-text-size-adjust: none !important;
    -ms-text-size-adjust: none !important;
    text-size-adjust: none !important;
}

:root {
    --primary-color: #1a73e8;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --border-color: #dadce0;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-hover: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 防止微信等浏览器自动调整字体大小 */
    -webkit-text-size-adjust: none !important;
    -moz-text-size-adjust: none !important;
    -ms-text-size-adjust: none !important;
    text-size-adjust: none !important;
}

/* ==================== 密码验证界面 ==================== */

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.auth-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.24);
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-header p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-input {
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

.auth-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.auth-input::placeholder {
    color: #aaa;
}

.auth-button {
    padding: 14px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-button:hover {
    background: #1557b0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

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

.auth-error {
    color: #d32f2f;
    font-size: 14px;
    padding: 12px;
    background: #ffebee;
    border-radius: 6px;
    margin-top: 8px;
}

/* 密码输入错误动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.auth-input.shake {
    animation: shake 0.5s;
    border-color: #d32f2f;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .auth-container {
        padding: 32px 24px;
    }

    .auth-header h1 {
        font-size: 24px;
    }

    .auth-header p {
        font-size: 14px;
        margin-bottom: 24px;
    }
}

/* ==================== 应用主界面 ==================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.order-detail-layout {
    max-width: 1100px;
    width: 100%;
    padding: 0 16px 24px 16px;
}

/* 头部 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 16px 12px 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 6px;
}

.stats {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 4px;
}

/* 搜索容器 */
.search-container {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-switch {
    display: inline-flex;
    gap: 8px;
    margin-top: 8px;
}

.tab-btn {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    text-decoration: none;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.18);
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    border-color: white;
}

.search-input {
    flex: 1;
    max-width: 400px;
    padding: 10px 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: white;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.search-input::placeholder {
    color: #aaa;
}

.search-btn, .clear-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn {
    background: white;
    color: var(--primary-color);
}

.search-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.clear-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* 主内容区 */
.main {
    flex: 1;
    padding: 16px;
}

/* 订单统计区 */
.orders-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--card-bg);
    padding: 14px 16px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.section-header h2 {
    font-size: 20px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.date-filter input[type="date"] {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.pill-btn {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.pill-btn.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pill-btn.ghost {
    background: #f5f5f5;
}

.pill-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
}

.order-summary {
    padding-bottom: 10px;
}

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

.summary-item {
    background: linear-gradient(135deg, #f6f8ff 0%, #eef2ff 100%);
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid #e6e9f5;
}

.summary-item.order-no {
    min-width: 260px;
}

.summary-item .label {
    color: var(--text-secondary);
    font-size: 13px;
}

.summary-item .value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    margin-top: 6px;
    color: #1f2937;
    word-break: break-word;
}

.summary-item.order-no .value {
    font-size: 20px;
    word-break: break-all;
}

@media (min-width: 901px) {
    .summary-item.order-no {
        grid-column: span 2;
    }
}

.order-card {
    padding-top: 8px;
}

.card-header {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 16px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 320px;
    table-layout: auto;
}

.order-table th, .order-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    font-size: 14px;
}

/* 按品类统计表格字体放大（仅第一张统计卡片） */
.orders-section .order-card:first-of-type .order-table th,
.orders-section .order-card:first-of-type .order-table td {
    font-size: 21px;
}

/* 品类表：名称列放大 20% 加粗；数量/单价/金额与名称同字重同字号 */
.orders-section .order-card:first-of-type .order-table th:nth-child(2),
.orders-section .order-card:first-of-type .order-table td:nth-child(2) {
    font-size: 25.2px; /* 21px * 1.2 */
    font-weight: 700;
}
.orders-section .order-card:first-of-type .order-table td:nth-child(3),
.orders-section .order-card:first-of-type .order-table td:nth-child(4),
.orders-section .order-card:first-of-type .order-table td:nth-child(5) {
    font-size: 25.2px;
    font-weight: 700;
}

/* 移动端：按品类统计列宽重分配，优先给名称列 */
@media (max-width: 640px) {
    .orders-section .order-card:first-of-type .order-table {
        table-layout: fixed;
    }
    .orders-section .order-card:first-of-type .order-table th:nth-child(1),
    .orders-section .order-card:first-of-type .order-table td:nth-child(1) {
        width: 18%;
    }
    .orders-section .order-card:first-of-type .order-table th:nth-child(2),
    .orders-section .order-card:first-of-type .order-table td:nth-child(2) {
        width: 42%;
        word-break: break-all;
        font-size: 25.2px;
        font-weight: 700;
    }
    .orders-section .order-card:first-of-type .order-table th:nth-child(3),
    .orders-section .order-card:first-of-type .order-table td:nth-child(3) {
        width: 12%;
        white-space: nowrap;
        text-align: center;
        font-size: 25.2px;
        font-weight: 700;
    }
    .orders-section .order-card:first-of-type .order-table th:nth-child(4),
    .orders-section .order-card:first-of-type .order-table td:nth-child(4) {
        width: 14%;
        white-space: nowrap;
        text-align: center;
        font-size: 25.2px;
        font-weight: 700;
    }
    .orders-section .order-card:first-of-type .order-table th:nth-child(5),
    .orders-section .order-card:first-of-type .order-table td:nth-child(5) {
        width: 14%;
        white-space: nowrap;
        text-align: center;
        font-size: 25.2px;
        font-weight: 700;
    }
}

/* 移动端订单明细列宽优化：让“订单号”占主宽，数量/金额贴合内容 */
@media (max-width: 640px) {
    .orders-section .order-card:last-of-type .order-table {
        table-layout: fixed;
    }
    .orders-section .order-card:last-of-type .order-table th:nth-child(1),
    .orders-section .order-card:last-of-type .order-table td:nth-child(1) {
        width: 32%;
    }
    .orders-section .order-card:last-of-type .order-table th:nth-child(2),
    .orders-section .order-card:last-of-type .order-table td:nth-child(2) {
        width: 36%;
        word-break: break-all;
    }
    .orders-section .order-card:last-of-type .order-table th:nth-child(3),
    .orders-section .order-card:last-of-type .order-table td:nth-child(3) {
        width: 12%;
        white-space: nowrap;
    }
    .orders-section .order-card:last-of-type .order-table th:nth-child(4),
    .orders-section .order-card:last-of-type .order-table td:nth-child(4) {
        width: 20%;
        white-space: nowrap;
    }
}

/* 订单详情页：数量 / 批发价 / 总金额 居中对齐（表头与内容） */
.order-detail-layout .order-table th:nth-child(3),
.order-detail-layout .order-table th:nth-child(4),
.order-detail-layout .order-table th:nth-child(5),
.order-detail-layout .order-table td:nth-child(3),
.order-detail-layout .order-table td:nth-child(4),
.order-detail-layout .order-table td:nth-child(5) {
    text-align: center;
}

.order-table th {
    background: #f8f9fb;
    color: #555;
    font-weight: 600;
}

.order-table tbody tr:hover {
    background: #f9fbff;
}

.cell-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.cell-money {
    text-align: right;
    color: #d32f2f;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cell-money:nth-child(4) {
    color: var(--text-primary);
    font-weight: 600;
}

.cell-name {
    max-width: 300px;
}

.cell-thumb {
    width: 64px;
}

.stat-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 8px;
    background: #f5f5f5;
    border: 1px solid #f0f0f0;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-img:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.stat-img.placeholder {
    cursor: default;
    background: linear-gradient(135deg, #f7f7f7 0%, #ededed 100%);
    border-style: dashed;
}

/* 空白占位：纯色方块，无图片时使用 */
.stat-img--blank {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: #f5f5f5;
    border: 1px solid #f0f0f0;
    cursor: default;
}

.order-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.order-link:hover {
    text-decoration: underline;
}

.orders-loading, .orders-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    color: var(--text-secondary);
}

.orders-empty {
    text-align: center;
    justify-content: center;
}

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

/* 产品卡片 */
.product-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.product-name {
    font-size: 22.5px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 16px 16px 8px 16px;
    line-height: 1.4;
    border-bottom: 1px solid #f0f0f0;
}

.product-content {
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding: 12px;
}

.product-image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    object-fit: contain;
    background: #f5f5f5;
    padding: 8px;
    border-radius: 8px;
    margin-top: 8px;  /* 图片向下移动，与文字对齐 */
}

.product-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.product-manufacturer {
    font-size: 21px;
    color: #2563eb;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.detail-label {
    color: var(--text-primary);
    font-size: 21px;
    font-weight: 700;
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary);
}

.price {
    color: #d32f2f;
    font-size: 20px;
}

.date {
    color: #ea580c;
    font-size: 19px;
}

.date-label {
    color: #ea580c;
}

/* 底部分页 */
.footer {
    background: var(--card-bg);
    padding: 20px 16px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

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

.page-info {
    font-size: 24px;
    color: var(--text-primary);
    min-width: 120px;
    text-align: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 21px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--primary-color);
    color: white;
}

.btn:hover:not(:disabled) {
    background: #1557b0;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    background: #e0e0e0;
    color: #9e9e9e;
    cursor: not-allowed;
    transform: none;
}

/* 页码按钮 */
.page-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.btn-page {
    min-width: 59px;
    height: 59px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 27px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    color: var(--text-primary);
}

.btn-page:hover {
    background: #f5f5f5;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-page.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
    cursor: default;
    transform: none;
}

.jump-page {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.jump-page label {
    font-size: 21px;
    color: var(--text-secondary);
}

#page-input {
    width: 100px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 21px;
    text-align: center;
}

#page-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-jump {
    padding: 8px 16px;
}

/* 加载和空状态 */
.loading, .no-data {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 移动端适配 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 20px;
    }

    .stats {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .search-container {
        margin-top: 8px;
        gap: 6px;
    }

    .search-input {
        max-width: none;
        font-size: 16px;
        padding: 9px 12px;
    }

    .search-btn, .clear-btn {
        padding: 9px 18px;
        font-size: 16px;
    }

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

    .section-header {
        align-items: flex-start;
    }

    .date-filter {
        width: 100%;
        justify-content: flex-start;
    }

    .summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .product-card {
        border-radius: 8px;
    }

    .product-name {
        font-size: 27px;  /* 调大50%: 18px → 27px */
        padding: 12px 12px 8px 12px;
        text-align: center;  /* 居中显示 */
    }

    .product-content {
        gap: 24px;  /* 增加图片边框和文字的间距 */
        padding: 8px;
    }

    .product-image {
        width: 100px;
        height: 100px;
        padding: 6px;
        margin-top: 8px;  /* 图片向下移动，与文字对齐 */
    }

    .product-manufacturer {
        font-size: 20px;  /* 调大25%: 16px → 20px */
        margin-bottom: 6px;
    }

    .detail-row {
        font-size: 14px;
    }

    .detail-label {
        font-size: 20px;  /* 调大25%: 16px → 20px */
        font-weight: 700;
    }

    .price {
        font-size: 21.25px;  /* 调大25%: 17px → 21.25px */
    }

    .date {
        font-size: 18.75px;  /* 调大25%: 15px → 18.75px */
    }

    .pagination {
        gap: 12px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 19.5px;
    }

    .page-info {
        font-size: 21px;
        min-width: 90px;
    }

    .jump-page {
        font-size: 19.5px;
    }

    #page-input {
        width: 90px;
        padding: 8px 12px;
        font-size: 19.5px;
    }

    .btn-page {
        min-width: 54px;
        height: 54px;
        font-size: 24px;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 12px;
    }

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

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

    .date-filter input[type="date"], .pill-btn {
        width: 100%;
    }

    .summary-item .value {
        font-size: 20px;
    }

    .product-name {
        font-size: 24px;  /* 调大50%: 16px → 24px */
        padding: 10px;
        text-align: center;  /* 居中显示 */
    }

    .product-content {
        gap: 24px;  /* 进一步增加图片容器边框和文字的间距 */
        padding: 10px;
    }

    .product-image {
        width: 110px;
        height: 110px;
        margin-top: 8px;  /* 图片向下移动，与文字对齐 */
    }

    .product-manufacturer {
        font-size: 17.5px;  /* 调大25%: 14px → 17.5px */
    }

    .detail-label {
        font-size: 17.5px;  /* 调大25%: 14px → 17.5px */
    }

    .price {
        font-size: 18.75px;  /* 调大25%: 15px → 18.75px */
    }

    .date {
        font-size: 16.25px;  /* 调大25%: 13px → 16.25px */
    }

    .footer {
        padding: 16px 12px;
    }

    .pagination {
        gap: 8px;
    }

    .page-numbers {
        gap: 6px;
        margin: 12px 0;
    }

    .btn-page {
        min-width: 49px;
        height: 49px;
        font-size: 22px;
        padding: 4px 8px;
    }

    .btn-prev::before {
        content: "‹";
        font-size: 27px;
    }

    .btn-next::after {
        content: "›";
        font-size: 27px;
    }

    .btn-prev, .btn-next {
        padding: 10px 16px;
    }

    .btn-prev span, .btn-next span {
        display: none;
    }
}

@media (max-width: 600px) {
    .order-detail-layout {
        max-width: 100%;
        padding: 0 10px 20px 10px;
    }

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

    .summary-item.order-no {
        grid-column: 1 / -1;
    }

    .summary-item .value {
        font-size: 18px;
    }

    .order-card {
        padding: 12px;
    }

    .order-table {
        table-layout: fixed;
    }

    .order-table th,
    .order-table td {
        font-size: 13px;
        padding: 8px 8px;
        word-break: break-word;
    }

    .cell-name {
        max-width: none;
        word-break: break-word;
    }
}

/* 灯箱样式 */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: background 0.3s ease;
    overflow: auto;
}

.lightbox.active {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.3s ease;
}

.lightbox.active .lightbox-content {
    opacity: 1;
    transform: scale(1.5);
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 36px;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s ease;
}

.lightbox-close:hover {
    transform: scale(1.2);
}

.lightbox-caption {
    color: white;
    text-align: center;
    margin-top: 16px;
    font-size: 18px;
    font-weight: 500;
}

/* 移动端灯箱优化 */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
    }

    .lightbox-close {
        top: -50px;
        font-size: 42px;
    }

    .lightbox-caption {
        font-size: 16px;
    }
}
