/* 分区域彩色/渐变二维码生成器样式 */
/* 版本: 2024-01-15 v1.1 - 修复导航栏样式冲突 */

/* 避免全局重置，只重置特定容器 */
.main-container,
.main-container * {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 确保导航栏不受影响 - 强制保护 */
nav,
.navbar,
.navbar *,
.nav-item,
.nav-link,
.dropdown,
.dropdown-menu,
.dropdown-item,
.dropdown-toggle {
    box-sizing: content-box !important;
    font-family: inherit !important;
}

/* 重置可能影响导航栏的样式 */
.navbar .nav-item,
.navbar .nav-link,
.navbar .dropdown-toggle,
.navbar .dropdown-menu,
.navbar .dropdown-item {
    margin: initial !important;
    padding: initial !important;
    border: initial !important;
    background: initial !important;
    color: initial !important;
    text-decoration: initial !important;
    font-size: initial !important;
    font-weight: initial !important;
    line-height: initial !important;
}

/* 导航栏应该在最上层 */
.navbar {
    position: relative !important;
    z-index: 1000 !important;
}

/* 主容器样式 */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.header-section {
    text-align: center;
    margin-bottom: 30px;
    color: white !important;
}

.header-section h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header-section h1 i {
    color: white !important;
}

.header-section .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    color: white !important;
}

.generator-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    align-items: start;
}

/* 控制面板样式 */
.control-panel {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.panel-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.panel-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.panel-section h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-section h3 i {
    color: #667eea;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.file-input {
    display: none;
}

.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.file-upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.file-upload-area i {
    font-size: 24px;
    color: #9ca3af;
    margin-bottom: 8px;
    display: block;
}

.file-upload-area span {
    color: #6b7280;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.file-upload-area small {
    color: #9ca3af;
    font-size: 12px;
    display: block;
    margin-top: 8px;
    line-height: 1.4;
}

.feature-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 模式选择器 */
.mode-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
}

.mode-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-option input[type="radio"]:checked + .mode-preview {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.mode-option input[type="radio"]:checked ~ span {
    color: #667eea;
    font-weight: 600;
}

.mode-preview {
    width: 40px;
    height: 40px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.block-preview {
    background: linear-gradient(to right, 
        #ef4444 0%, #ef4444 50%, 
        #10b981 50%, #10b981 100%),
        linear-gradient(to bottom,
        transparent 0%, transparent 50%,
        #3b82f6 50%, #3b82f6 100%);
}

.row-preview {
    background: linear-gradient(to bottom,
        #ef4444 0%, #ef4444 25%,
        #f59e0b 25%, #f59e0b 50%,
        #10b981 50%, #10b981 75%,
        #3b82f6 75%, #3b82f6 100%);
}

.column-preview {
    background: linear-gradient(to right,
        #ef4444 0%, #ef4444 25%,
        #f59e0b 25%, #f59e0b 50%,
        #10b981 50%, #10b981 75%,
        #3b82f6 75%, #3b82f6 100%);
}

.diagonal-preview {
    background: linear-gradient(45deg,
        #ef4444 0%,
        #f59e0b 33%,
        #10b981 66%,
        #3b82f6 100%);
}

.gradient-preview {
    background: linear-gradient(135deg,
        #ff6b6b 0%,
        #4ecdc4 50%,
        #45b7d1 100%);
}

.mode-option span {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* 颜色设置区域 */
#color-settings .color-input-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: end;
    margin-bottom: 12px;
}

#color-settings .color-picker {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#color-settings .gradient-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

#color-settings .gradient-steps {
    flex: 1;
}

/* 按钮样式 */
.generate-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.generate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.generate-button:active {
    transform: translateY(0);
}

.generate-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 预览面板样式 */
.preview-panel {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.preview-header h3 {
    font-size: 1.1rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-header h3 i {
    color: #667eea;
}

.preview-actions {
    display: flex;
    gap: 12px;
}

.action-button {
    padding: 10px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-button:hover:not(:disabled) {
    background: #5a67d8;
    transform: translateY(-1px);
}

.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.preview-area {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    margin-bottom: 20px;
}

.preview-placeholder {
    text-align: center;
    color: #9ca3af;
}

.preview-placeholder i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.preview-placeholder p {
    font-size: 16px;
}

#preview-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.preview-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #f0f4ff;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4f46e5;
    font-size: 14px;
}

.info-item i {
    color: #667eea;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    background: white;
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.loading-spinner i {
    font-size: 32px;
    color: #667eea;
    margin-bottom: 16px;
}

.loading-spinner p {
    color: #6b7280;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .generator-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .control-panel {
        order: 2;
    }
    
    .preview-panel {
        order: 1;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 15px;
    }
    
    .header-section h1 {
        font-size: 2rem;
    }
    
    .control-panel,
    .preview-panel {
        padding: 20px;
    }
    
    .mode-selector {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .preview-area {
        min-height: 300px;
    }
}

/* 会员保护样式 */
.premium-required {
    position: relative;
    overflow: hidden;
}

.premium-required::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(2px);
    z-index: 10;
}

.premium-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 11;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.premium-overlay h4 {
    color: #f59e0b;
    margin-bottom: 8px;
    font-size: 18px;
}

.premium-overlay p {
    color: #6b7280;
    margin-bottom: 16px;
}

.upgrade-button {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.upgrade-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
