/* ========== 基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.image-preview.uploading {
    position: relative;
}

.image-preview .upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 54, 93, 0.8);
    color: #fff;
    font-size: 12px;
    padding: 5px;
    text-align: center;
}

:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --accent: #3182ce;
    --gold: #c9a227;
    --bg-light: #f7fafc;
    --text: #2d3748;
    --text-light: #718096;
    --border: #e2e8f0;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: #fff;
}

/* ========== 导航栏 ========== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(26, 54, 93, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 70px;
}

.logo {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gold);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
}

    .nav-links a {
        color: rgba(255,255,255,0.85);
        text-decoration: none;
        font-size: 16px;
        transition: all 0.3s;
        padding: 8px 0;
        position: relative;
    }

        .nav-links a:hover, .nav-links a.active {
            color: var(--gold);
        }

        .nav-links a::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 0;
            height: 2px;
            background: var(--gold);
            transition: width 0.3s;
        }

        .nav-links a:hover::after, .nav-links a.active::after {
            width: 100%;
        }

/* ========== 首页 ========== */
.hero {
    height: calc(100vh - 70px);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-top: 70px;
}

    .hero::before {
        content: '';
        position: absolute;
        width: 200%;
        height: 200%;
        background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
        animation: slide 1s linear infinite; /* 加快一点，4秒一个周期 */
    }

@keyframes slide {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-60px, -60px);
    }
    /* SVG图案是60x60，移动一个周期 */
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 820px;
    padding: 0 20px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: 2px;
}

.hero p {
    font-size: 20px;
    margin-bottom: 40px;
    opacity: 0.9;
    line-height: 1.8;
}

.btn-primary {
    display: inline-block;
    padding: 14px 40px;
    background: var(--gold);
    color: var(--primary);
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(201, 162, 39, 0.3);
    }

.features {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3列 */
    gap: 30px;
}

/* 响应式 */
@media (max-width: 992px) {
    .features {
        grid-template-columns: repeat(2, 1fr); /* 平板2列 */
    }
}

@media (max-width: 768px) {
    .features {
        grid-template-columns: 1fr; /* 手机1列 */
    }
}

.feature-card {
    background: #fff;
    padding: 40px 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: all 0.3s;
    border: 1px solid var(--border);
}

    .feature-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    }

.feature-icon {
    width: 70px;
    height: 70px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 30px;
    color: var(--accent);
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--primary);
}

.feature-card p {
    color: var(--text-light);
    font-size: 15px;
}

/* ========== 产品中心 ========== */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    padding: 100px 20px 60px;
    text-align: center;
    margin-top: 70px;
}

    .page-header h1 {
        font-size: 36px;
        margin-bottom: 15px;
    }

    .page-header p {
        font-size: 18px;
        opacity: 0.9;
        max-width: 600px;
        margin: 0 auto;
    }

.products-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

.category-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 25px;
    border: 2px solid var(--border);
    background: #fff;
    border-radius: 25px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s;
    color: var(--text);
}

    .filter-btn:hover, .filter-btn.active {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: var(--text-light);
    font-size: 16px;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border: 1px solid var(--border);
    cursor: pointer;
}

    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    }

.product-image {
    width: 100%;
    height: 240px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

    .product-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.product-image-placeholder {
    font-size: 60px;
    color: var(--border);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--gold);
    color: var(--primary);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.product-info {
    padding: 25px;
}

    .product-info h3 {
        font-size: 20px;
        margin-bottom: 10px;
        color: var(--primary);
    }

    .product-info p {
        color: var(--text-light);
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 15px;
        /* 只显示1行 */
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        height: calc(14px * 1.6); /* 1行高度 */
    }

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.product-price {
    color: var(--gold);
    font-size: 18px;
    font-weight: bold;
}

.product-tag {
    background: var(--bg-light);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    color: var(--text-light);
}

/* ========== 产品详情弹窗 ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

    .modal-overlay.active {
        display: flex;
    }

.modal {
    background: #fff;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

    .modal-close:hover {
        background: rgba(0,0,0,0.2);
        transform: rotate(90deg);
    }

.modal-body {
    padding: 0;
}

/* 弹窗图片布局 - 改为垂直排列 */
.modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}

/* 主图 - 固定高度，宽度自适应，图片居中完整显示 */
.modal-main-img {
    width: 100%;
    height: 500px; /* 固定高度 */
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .modal-main-img img {
        max-width: 100%;
        max-height: 100%; /* 不超过容器 */
        width: auto; /* 宽度自动 */
        height: auto; /* 高度自动 */
        object-fit: contain; /* 完整显示，不裁剪 */
        display: block;
    }

.modal-main-img-placeholder {
    font-size: 80px;
    color: var(--border);
}

/* 缩略图横向排列 */
.modal-thumbs {
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 0 10px 10px;
    overflow-x: auto;
    justify-content: center; /* 居中 */
}

.modal-thumb {
    width: 100px;
    height: 75px;
    flex-shrink: 0;
    background: var(--bg-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
    border: 2px solid transparent;
}

    .modal-thumb:hover,
    .modal-thumb.active {
        border-color: var(--gold);
    }

    .modal-thumb img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
    }

.modal-thumb-placeholder {
    font-size: 30px;
    color: var(--border);
}

.modal-content {
    padding: 40px;
}

    .modal-content h2 {
        font-size: 28px;
        color: var(--primary);
        margin-bottom: 20px;
    }

    .modal-content .specs {
        background: var(--bg-light);
        padding: 25px;
        border-radius: 10px;
        margin: 25px 0;
    }

.specs h4 {
    margin-bottom: 15px;
    color: var(--primary);
    font-size: 18px;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

    .spec-item span:first-child {
        color: var(--text-light);
    }

    .spec-item span:last-child {
        color: var(--text);
        font-weight: 500;
    }

/* ========== 联系方式 ========== */
.contact-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.contact-info h2 {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
    transition: all 0.3s;
}

    .contact-item:hover {
        transform: translateX(5px);
        box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    }

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    flex-shrink: 0;
}

.contact-item div h4 {
    color: var(--primary);
    margin-bottom: 5px;
}

.contact-item div p {
    color: var(--text-light);
    font-size: 15px;
}

.contact-form {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    margin-top: 80px;
}

    .contact-form h3 {
        font-size: 24px;
        color: var(--primary);
        margin-bottom: 25px;
    }

.form-group {
    margin-bottom: 20px;
}

    .form-group label {
        display: block;
        margin-bottom: 8px;
        color: var(--text);
        font-weight: 500;
        font-size: 14px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        width: 100%;
        padding: 12px 16px;
        border: 2px solid var(--border);
        border-radius: 8px;
        font-size: 15px;
        transition: all 0.3s;
        font-family: inherit;
    }

        .form-group input:focus,
        .form-group textarea:focus,
        .form-group select:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
        }

    .form-group textarea {
        resize: vertical;
        min-height: 120px;
    }

/* ========== 产品管理后台 ========== */
.admin-page {
    background: var(--bg-light);
    min-height: 100vh;
}

.admin-header {
    background: var(--primary);
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .admin-header h2 {
        font-size: 20px;
    }

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-search {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 400px;
}

    .admin-search input {
        flex: 1;
        padding: 10px 16px;
        border: 2px solid var(--border);
        border-radius: 8px;
        font-size: 14px;
    }

.admin-table {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

    .admin-table table {
        width: 100%;
        border-collapse: collapse;
    }

    .admin-table th {
        background: var(--primary);
        color: #fff;
        padding: 15px;
        text-align: left;
        font-weight: 500;
        font-size: 14px;
    }

    .admin-table td {
        padding: 15px;
        border-bottom: 1px solid var(--border);
        font-size: 14px;
    }

    .admin-table tr:hover {
        background: var(--bg-light);
    }

    .admin-table img {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 8px;
        background: var(--bg-light);
    }

.admin-actions {
    /*display: flex;*/
    gap: 8px;
}

.btn-sm {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.btn-edit {
    background: var(--accent);
    color: #fff;
}

.btn-delete {
    background: #e53e3e;
    color: #fff;
}

.btn-add {
    background: var(--gold);
    color: var(--primary);
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

    .btn-add:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(201, 162, 39, 0.3);
    }

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-online {
    background: #c6f6d5;
    color: #22543d;
}

.status-offline {
    background: #fed7d7;
    color: #742a2a;
}

/* 编辑弹窗 */
.edit-modal .modal {
    max-width: 700px;
}

.edit-form {
    padding: 30px;
}

    .edit-form h3 {
        margin-bottom: 25px;
        color: var(--primary);
        font-size: 22px;
    }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.image-upload {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

    .image-upload:hover {
        border-color: var(--accent);
        background: var(--bg-light);
    }

.image-upload-icon {
    font-size: 40px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.image-preview {
    aspect-ratio: 1;
    background: var(--bg-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--border);
    position: relative;
    overflow: hidden;
}

    .image-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .image-preview .remove-img {
        position: absolute;
        top: 5px;
        right: 5px;
        width: 24px;
        height: 24px;
        background: #e53e3e;
        color: #fff;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        font-size: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.btn-cancel {
    padding: 10px 24px;
    border: 2px solid var(--border);
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s;
}

    .btn-cancel:hover {
        border-color: var(--text-light);
    }

.btn-save {
    padding: 10px 30px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
}

    .btn-save:hover {
        background: var(--primary-light);
    }

.back-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

    .back-link:hover {
        color: #fff;
    }

/* ========== 页脚 ========== */
.footer {
    background: var(--primary);
    color: rgba(255,255,255,0.7);
    padding: 40px 20px;
    text-align: center;
}

    .footer p {
        font-size: 14px;
    }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .nav-links {
        gap: 20px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .contact-section {
        grid-template-columns: 1fr;
    }

    .modal-gallery {
        grid-template-columns: 1fr;
    }

    .modal-main-img {
        height: 250px;
    }

    .modal-thumbs {
        flex-direction: row;
        height: 100px;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}
/* ========== 二维码区域 ========== */
.qrcode-box {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    border: 1px solid var(--border);
    margin-top: 10px;
}

    .qrcode-box img {
        width: 180px;
        height: 180px;
        object-fit: contain;
        border-radius: 8px;
    }

.qrcode-placeholder {
    width: 180px;
    height: 180px;
    background: var(--bg-light);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: var(--text-light);
}

    .qrcode-placeholder span {
        font-size: 60px;
        margin-bottom: 10px;
    }

    .qrcode-placeholder p {
        font-size: 14px;
    }

.qrcode-tip {
    color: var(--text-light);
    font-size: 13px;
    margin-top: 12px;
}

.submit-success {
    display: none;
    background: #c6f6d5;
    color: #22543d;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.submit-error {
    display: none;
    background: #fed7d7;
    color: #742a2a;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.input-error {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1) !important;
}

.error-tip {
    color: #e53e3e;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.message-content {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .message-content:hover {
        white-space: normal;
        overflow: visible;
    }

.status-unread {
    background: #fed7d7;
    color: #742a2a;
}

.status-read {
    background: #feebc8;
    color: #744210;
}

.status-replied {
    background: #c6f6d5;
    color: #22543d;
}



/* ========== 语言切换器 ========== */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 30px;
}

.lang-btn {
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.3);
    background: transparent;
    color: rgba(255,255,255,0.7);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
    font-family: inherit;
}

    .lang-btn:hover {
        border-color: var(--gold);
        color: var(--gold);
    }

    .lang-btn.active {
        background: var(--gold);
        color: var(--primary);
        border-color: var(--gold);
    }

@media (max-width: 768px) {
    .lang-switcher {
        margin-left: 10px;
        gap: 5px;
    }

    .lang-btn {
        padding: 4px 10px;
        font-size: 12px;
    }
}
