/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* 卡片容器样式 */
.action-groups-container,
.options-section,
.result-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

/* 标题样式 */
h2 {
    color: #333;
    border-bottom: 3px solid #667eea;
    padding-bottom: 12px;
    display: inline-block;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 20px;
}

/* 动作组管理 */
.action-groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.action-group-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 2px dashed #dee2e6;
    transition: all 0.3s ease;
}

.action-group-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.group-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.group-name {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    flex: 1;
    min-width: 200px;
    transition: border-color 0.3s ease;
}

.group-name:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.file-item {
    border: 1px solid #dee2e6;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.file-item img {
    height: 50px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
    border: 2px solid #e9ecef;
    background: white;
    padding: 2px;
}

/* 按钮样式 */
.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.upload-btn:active {
    transform: translateY(0);
}

.remove-group-btn {
    background: #dc3545;
    padding: 10px 20px;
}

.remove-group-btn:hover {
    background: #c82333;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.3);
}

.action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 18px 40px;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: rgb(0, 0, 0) 3px solid;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.action-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

/* 选项网格 */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.option-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.option-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.option-card label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 10px;
    cursor: pointer;
}

.option-card input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
}

.option-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-left: 32px;
}

/* 操作按钮区域 */
.action-buttons {
    text-align: center;
    margin: 30px 0;
}

/* 结果展示 */
.result-card {
    text-align: center;
}

.stats-info {
    background: #e8f5e8;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 1.1rem;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.preview-container {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

#resultCanvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.download-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.download-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    border: none;
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.download-btn:active {
    transform: translateY(0);
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #666;
    font-size: 1.1rem;
}

/* 页脚样式 */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 40px 20px;
    backdrop-filter: blur(10px);
    border-radius: 20px 20px 0 0;
}

.footer-content {
    max-width: 100%;
}

.footer-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.footer-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.footer-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 25px 0;
}

.feature-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.footer-bottom {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: white;
    text-decoration: underline;
}

/* 成功提示框样式 */
.success-notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 16px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.4);
    z-index: 10000;
    min-width: 280px;
    max-width: 400px;
    text-align: center;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.success-notification.show {
    top: 20px;
    opacity: 1;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.notification-icon {
    font-size: 1.4rem;
    animation: bounce 0.6s ease-in-out;
}

.notification-text {
    font-weight: 600;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .success-notification {
        min-width: 250px;
        max-width: 90%;
        padding: 14px 20px;
        top: -80px;
    }
    
    .success-notification.show {
        top: 15px;
    }
    
    .notification-text {
        font-size: 1rem;
    }
    
    .notification-icon {
        font-size: 1.2rem;
    }
    .container {
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .action-groups-container,
    .options-section,
    .result-section {
        padding: 20px;
    }
    
    .group-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .group-name {
        min-width: auto;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .download-btn {
        width: 100%;
    }
}

/* 工具提示样式 */
[title] {
    position: relative;
    cursor: help;
}

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* 文件输入样式 */
.file-input {
    display: none;
}

/* 自定义文件名输入框样式 */
.filename-input {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
    max-width: 400px;
    transition: all 0.3s ease;
    background: white;
    text-align: center;
}

.filename-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filename-input::placeholder {
    color: #adb5bd;
    font-style: italic;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}