* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

header p {
    font-size: 16px;
    opacity: 0.9;
}

/* 步骤导航 */
.steps {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.5;
    transition: all 0.3s;
}

.step.active {
    opacity: 1;
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #666;
}

.step.active .step-num {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.step-line {
    width: 80px;
    height: 2px;
    background: #ddd;
    margin: 0 15px;
}

/* 主内容区 */
main {
    padding: 30px;
}

.card {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}

.card h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 表单 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

input, textarea, select {
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
}

/* 按钮 */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102,126,234,0.4);
}

.btn-vip {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    margin-left: 10px;
}

.btn-vip:hover {
    box-shadow: 0 8px 25px rgba(245,87,108,0.4);
}

.btn-profit {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.btn-profit:hover {
    box-shadow: 0 8px 25px rgba(56,239,125,0.4);
}

.profit-positive {
    color: #67c23a;
    font-weight: bold;
}
.profit-negative {
    color: #f56c6c;
    font-weight: bold;
}
.summary-row {
    background: #f5f7fa;
    font-weight: bold;
}
.btn-save-price {
    background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%);
    color: white;
}
.btn-save-price:hover {
    box-shadow: 0 8px 25px rgba(64,158,255,0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102,126,234,0.4);
}

.btn-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 24px;
}

.hidden {
    display: none !important;
}

/* 模板选择 */
.template-bar {
    display: flex;
    gap: 15px;
    align-items: center;
}

.template-bar select {
    flex: 1;
    max-width: 400px;
}

/* 输入选项卡 */
.input-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.tab-btn.active {
    border-color: #667eea;
    background: rgba(102,126,234,0.1);
    color: #667eea;
}

.tab-content {
    margin-top: 20px;
}

textarea {
    width: 100%;
    min-height: 150px;
    resize: vertical;
    font-family: 'Consolas', monospace;
}

/* 图片上传 */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #667eea;
    background: rgba(102,126,234,0.05);
}

.upload-hint p {
    color: #666;
    margin: 5px 0;
}

.upload-hint .hint {
    font-size: 13px;
    color: #999;
}

.image-preview {
    max-width: 100%;
    max-height: 300px;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

/* 表格 */
.table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th, td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

tbody tr:hover {
    background: #f8f9ff;
}

tbody tr:nth-child(even) {
    background: #fafafa;
}

/* 汇总 */
.summary {
    display: flex;
    justify-content: flex-end;
    gap: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 20px;
}

.summary-item {
    font-size: 16px;
}

.summary-item span:last-child {
    font-weight: bold;
    font-size: 20px;
    color: #667eea;
    margin-left: 10px;
}

/* 导出 */
.export-card {
    text-align: center;
}

.export-hint {
    color: #888;
    margin-bottom: 30px;
}

.export-options {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 40px;
}

.export-option {
    flex: 1;
    max-width: 300px;
    padding: 40px 30px;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.export-option:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102,126,234,0.2);
}

.export-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.export-option h3 {
    margin-bottom: 10px;
    color: #333;
}

.export-option p {
    color: #888;
    font-size: 14px;
}

.preview-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    text-align: left;
}

.preview-section h3 {
    margin-bottom: 15px;
}

.preview-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.preview-info p {
    color: #666;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 35px;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-content h3 {
    margin-bottom: 25px;
}

.modal-content .form-group {
    margin-bottom: 20px;
}

.modal-content .btn-row {
    justify-content: flex-end;
    margin-top: 0;
}

footer {
    text-align: center;
    padding: 25px;
    color: #999;
    font-size: 14px;
    border-top: 1px solid #eee;
}

/* 响应式 */
@media (max-width: 768px) {
    .steps {
        flex-wrap: wrap;
    }
    
    .step-line {
        width: 30px;
    }
    
    .export-options {
        flex-direction: column;
    }
    
    .export-option {
        max-width: 100%;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* 产品操作按钮 */
.btn-mini {
    padding: 2px 6px;
    font-size: 12px;
    margin: 0 2px;
    cursor: pointer;
    border: 1px solid #ddd;
    background: #f5f5f5;
    border-radius: 3px;
}
.btn-mini:hover:not(:disabled) {
    background: #e0e0e0;
}
.btn-mini:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.btn-danger {
    color: #ff4d4f;
    border-color: #ff4d4f;
}
.btn-danger:hover {
    background: #ff4d4f;
    color: white;
}
#editTable .actions {
    white-space: nowrap;
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 10000;
    transition: transform 0.3s ease;
    font-size: 14px;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
}
.toast-error {
    background: #e74c3c;
}
.toast-success {
    background: #27ae60;
}
