/* 页面头部样式 */
.page-header {
    background: linear-gradient(135deg, #5e35b1, #7e57c2);
    color: white;
    padding: 40px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="1.5" fill="rgba(255,255,255,0.2)"/></svg>');
    background-size: 30px 30px;
    opacity: 0.3;
}

.page-header h1 {
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.page-header p {
    max-width: 700px;
    margin: 0 auto;
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.5;
}

.main-content {
    padding-bottom: 40px;
}

/* 设置面板样式 */
.settings-panel {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin-bottom: 20px;
}

.settings-panel h2 {
    color: #7e57c2;
    border-bottom-color: #e0e0e0;
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 20px;
}

.settings-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.basic-settings, .grid-settings {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.form-group {
    margin-bottom: 10px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

input[type="number"],
input[type="text"],
select,
input[type="color"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: #7e57c2;
    box-shadow: 0 0 0 2px rgba(126, 87, 194, 0.2);
}

input[type="color"] {
    height: 35px;
    padding: 2px;
    cursor: pointer;
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    justify-content: space-between;
}

button {
    background-color: #7e57c2;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

button i {
    margin-right: 6px;
    font-size: 15px;
}

button:hover {
    background-color: #6a46b5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#generateGridBtn, #updatePreviewBtn {
    flex: 1;
    max-width: none;
    letter-spacing: 0.5px;
}

#generateGridBtn {
    background-color: #7e57c2;
}

#updatePreviewBtn {
    background-color: #ff9800;
}

/* 商品参数表头 */
.item-params-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    background-color: #f5f7fa;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    color: #7e57c2;
    text-align: center;
    margin-bottom: 5px;
    font-size: 14px;
}

.item-param-title, .item-param-image, .item-param-product {
    padding: 6px;
}

/* 商品表单样式 */
.item-forms-container {
    margin: 10px 0;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 5px;
}

.item-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.item-form:last-child {
    border-bottom: none;
}

.item-form .form-group {
    margin-bottom: 0;
}

.item-form input {
    padding: 6px 8px;
    font-size: 13px;
}

/* 内容面板样式 */
.content-panel {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.preview-panel {
    flex: 3;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.code-panel {
    flex: 2;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.preview-panel h2, .code-panel h2 {
    color: #7e57c2;
    border-bottom-color: #e0e0e0;
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 20px;
}

.preview-container {
    min-height: 350px;
    border: 1px dashed #ccc;
    border-radius: 6px;
    margin-top: 15px;
    padding: 20px;
    overflow: auto;
}

.code-actions {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

#copyCodeBtn, #downloadCodeBtn {
    padding: 8px 15px;
    font-size: 14px;
    background-color: #f5f7fa;
    color: #333;
    border: 1px solid #ddd;
}

#copyCodeBtn:hover, #downloadCodeBtn:hover {
    background-color: #7e57c2;
    color: white;
    border-color: #7e57c2;
}

#codeOutput {
    background-color: #2d2d2d;
    color: #f8f8f8;
    border: none;
    border-radius: 6px;
    padding: 20px;
    overflow: auto;
    max-height: 350px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* 使用指南样式 */
.usage-guide {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.usage-guide h2 {
    color: #7e57c2;
    text-align: center;
    border-bottom: none;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
}

.guide-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.guide-step {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.step-number {
    width: 30px;
    height: 30px;
    background-color: #7e57c2;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 16px;
}

.step-content p {
    margin: 0;
    color: #666;
    line-height: 1.5;
    font-size: 14px;
}

/* 商品网格样式 */
.taobao-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 10px;
    table-layout: fixed;
    display: table !important;
    margin: 0 auto;
    max-width: 100%;
}

.taobao-grid tr {
    display: table-row !important;
    width: 100%;
}

.taobao-grid td {
    vertical-align: top;
    padding: 0;
    display: table-cell !important;
    float: none !important;
    position: relative !important;
    box-sizing: border-box !important;
}

.grid-item {
    text-align: center;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    transition: all 0.3s;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
}

.grid-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.grid-item a {
    display: block;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.grid-item img {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100% !important;
    object-fit: contain;
}

.grid-item .title {
    padding: 12px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block !important;
    width: 100%;
    box-sizing: border-box;
}

/* 动画效果 */
.button-active {
    transform: scale(0.98);
    opacity: 0.9;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}

/* 提示消息样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background-color: #fff;
    color: #333;
    border-radius: 6px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-20px);
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-left: 4px solid #4caf50;
}

.toast.error {
    border-left: 4px solid #f44336;
}

.toast-content {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
}

.toast-content i {
    margin-right: 10px;
    font-size: 18px;
}

.toast.success i {
    color: #4caf50;
}

.toast.error i {
    color: #f44336;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .content-panel {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: row;
    }
    
    #generateGridBtn, #updatePreviewBtn {
        max-width: none;
    }
}

@media (max-width: 768px) {
    .settings-form {
        grid-template-columns: 1fr;
    }
    
    .item-params-header, .item-form {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .preview-panel, .code-panel {
        padding: 15px;
    }
    
    .page-header {
        padding: 40px 0;
    }
    
    .page-header h1 {
        font-size: 30px;
    }
    
    .page-header p {
        font-size: 16px;
    }
} 