* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部标题 */
.header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid #e1e4e8;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #24292e;
}

/* 主内容区 */
.main-content {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

/* 左侧侧边栏 */
.sidebar {
    width: 300px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 15px;
    height: calc(100vh - 180px);
    overflow-y: auto;
    flex-shrink: 0;
}

.category-list .category-item {
    margin-bottom: 15px;
}

.category-list .category-title {
    font-size: 16px;
    font-weight: 600;
    padding: 10px 12px;
    background-color: #f6f8fa;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.category-list .category-title:hover {
    background-color: #e1e4e8;
}

.category-list .subcategory-list {
    padding-left: 10px;
    display: none;
}

.category-list .subcategory-list.active {
    display: block;
}

.category-list .subcategory-item {
    margin-bottom: 10px;
}

.category-list .subcategory-title {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 10px;
    background-color: #fafbfc;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 6px;
}

.category-list .subcategory-title:hover {
    background-color: #f1f3f4;
}

.category-list .thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding-left: 10px;
}

.category-list .thumbnail {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.category-list .thumbnail:hover {
    border-color: #0366d6;
    transform: scale(1.05);
}

/* 右侧预览区 */
.preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.control-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-secondary {
    background-color: #f6f8fa;
    color: #24292e;
    border: 1px solid #d1d5da;
}

.btn-secondary:hover {
    background-color: #e1e4e8;
}

.btn-danger {
    background-color: #cb2431;
    color: #fff;
}

.btn-danger:hover {
    background-color: #a61c27;
}

/* 颜色选择器样式 */
.color-picker-container {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px 15px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.color-picker-container.active {
    display: flex;
}

#colorPicker {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.color-tip {
    font-size: 12px;
    color: #586069;
}

.preview-container {
    position: relative;
    width: 400px;
    height: 500px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    overflow: hidden;
}

#baseShirt {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.print-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.print-layer.active {
    pointer-events: auto;
}

#printCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 200px;
    max-height: 200px;
    cursor: move;
    user-select: none;
    min-width: 20px;
    min-height: 20px;
}

.tips {
    margin-top: 20px;
    text-align: center;
    color: #586069;
    font-size: 14px;
}

/* 底部联系区 */
.footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid #e1e4e8;
    background-color: #fff;
    margin-top: 40px;
}

.contact-info p {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 500;
}

.wechat-qr {
    width: 150px;
    height: 150px;
    margin: 0 auto 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wechat-qr img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 大图预览弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    margin: 5% auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    position: relative;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}

.close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #ccc;
}

/* 响应式适配 - 手机端 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 300px;
    }

    .preview-container {
        width: 100%;
        max-width: 350px;
        height: 450px;
    }

    .category-list .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .control-buttons {
        gap: 8px;
    }
    
    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .color-picker-container {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}