/* 条形码生成器专用样式 */

/* 标签页容器 */
.tab-container {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #333;
    background-color: #f5f5f5;
}

.tab-btn.active {
    color: #4a90e2;
    border-bottom-color: #4a90e2;
    font-weight: 600;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 生成器容器（左右双列布局） */
.generator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

/* 表单容器 */
.form-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 表单组 */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-select,
.form-input,
.form-textarea {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-select:focus,
.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
}

.form-help.error {
    color: #e74c3c;
}

.form-help.success {
    color: #27ae60;
}

/* 尺寸设置（横向两列） */
.size-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* 颜色设置（横向两列） */
.color-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.color-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-input-wrapper input[type="color"] {
    width: 50px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
}

.color-input-wrapper .color-text {
    flex: 1;
}

/* 滑块样式 */
.slider-with-value {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    transition: background 0.3s ease;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4a90e2;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4a90e2;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.slider-value {
    font-weight: 600;
    color: #4a90e2;
    min-width: 50px;
    text-align: right;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: #4a90e2;
    border: 2px solid #4a90e2;
}

.btn-secondary:hover {
    background: #4a90e2;
    color: white;
}

/* 预览区域 */
.preview-wrapper {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 100px);
}

.preview-container {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.preview-container h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.preview-area {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
}

.preview-placeholder {
    text-align: center;
    color: #999;
}

.preview-placeholder i {
    font-size: 64px;
    margin-bottom: 15px;
    color: #ccc;
}

.preview-placeholder p {
    margin: 0;
    font-size: 14px;
}

.preview-area img {
    max-width: 100%;
    height: auto;
    display: block;
}

.preview-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.preview-actions .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* 批量生成容器 */
.batch-container {
    margin-top: 20px;
}

.batch-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.batch-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.batch-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.batch-item img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.batch-item .item-content {
    font-size: 12px;
    color: #666;
    word-break: break-all;
    margin-bottom: 10px;
}

.batch-item .item-actions {
    display: flex;
    gap: 5px;
}

.batch-item .item-actions .btn {
    flex: 1;
    font-size: 12px;
    padding: 6px 12px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .generator-container {
        grid-template-columns: 1fr;
    }

    .preview-wrapper {
        position: static;
        max-height: none;
    }

    .size-settings,
    .color-settings {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tab-buttons {
        flex-direction: column;
        border-bottom: none;
    }

    .tab-btn {
        border-bottom: 1px solid #e0e0e0;
        border-left: 3px solid transparent;
    }

    .tab-btn.active {
        border-bottom: 1px solid #e0e0e0;
        border-left-color: #4a90e2;
    }

    .batch-actions {
        flex-direction: column;
    }

    .batch-results-grid {
        grid-template-columns: 1fr;
    }
}

/* 打印样式 */
@media print {
    body * {
        visibility: hidden;
    }

    #preview-area,
    #preview-area *,
    .batch-results-grid,
    .batch-results-grid * {
        visibility: visible;
    }

    #preview-area {
        position: absolute;
        left: 0;
        top: 0;
    }

    .batch-results-grid {
        position: absolute;
        left: 0;
        top: 0;
        grid-template-columns: repeat(3, 1fr);
    }

    .batch-item {
        page-break-inside: avoid;
        border: none;
    }

    .batch-item .item-actions {
        display: none;
    }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(74, 144, 226, 0.3);
    border-radius: 50%;
    border-top-color: #4a90e2;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 通知提示 */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    border-left: 4px solid #27ae60;
}

.notification.error {
    border-left: 4px solid #e74c3c;
}

.notification.info {
    border-left: 4px solid #4a90e2;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
