body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

/* Make sizing predictable so padding/borders don't cause overflow */
*, *::before, *::after {
    box-sizing: border-box;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

/* 页面标题区域 */
.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f3f4;
}

.error-icon, .success-icon {
    font-size: 4em;
    margin-bottom: 15px;
    display: block;
}

.page-subtitle {
    color: #6c757d;
    font-size: 1.1em;
    margin-top: 10px;
    font-weight: 400;
}

/* 内容区域 */
.content-section {
    margin-bottom: 30px;
}

/* 错误详情样式 */
.error-details {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.error-details-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.error-details-header h3 {
    margin: 0;
    color: #c53030;
    font-size: 1.2em;
}

.error-details-icon {
    font-size: 1.2em;
}

.error-message-content {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #c53030;
}

.error-message-content code {
    color: #c53030;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    word-break: break-word;
}

/* 解决方案样式 */
.solutions-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2d3748;
    margin-bottom: 20px;
}

.solutions-icon {
    font-size: 1.3em;
}

.solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.solution-item {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    transition: all 0.3s ease;
}

.solution-item:hover {
    background: #edf2f7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.solution-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.solution-content h4 {
    margin: 0 0 8px 0;
    color: #2d3748;
    font-size: 1.1em;
}

.solution-content p {
    margin: 0;
    color: #4a5568;
    font-size: 0.9em;
    line-height: 1.4;
}

/* 下载页面样式 */
.download-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    border: 2px solid #e9ecef;
}

.download-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 10px;
}

.download-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #495057;
}

.download-icon {
    font-size: 1.4em;
}

.file-count {
    background: #28a745;
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.download-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.download-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.download-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.file-icon {
    font-size: 2.5em;
    color: #28a745;
}

.file-details h4 {
    margin: 0 0 5px 0;
    color: #2d3748;
    font-size: 1.1em;
}

.file-details p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9em;
}

.download-button {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    text-decoration: none;
    color: white;
}

.download-button-icon {
    font-size: 1.1em;
}

/* 下载提示样式 */
.download-tips {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 12px;
    padding: 20px;
}

.tips-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.tips-header h4 {
    margin: 0;
    color: #0056b3;
}

.tips-icon {
    font-size: 1.2em;
    color: #007bff;
}

.tips-list {
    margin: 0;
    padding-left: 20px;
    color: #495057;
}

.tips-list li {
    margin-bottom: 8px;
    line-height: 1.4;
}

/* 操作按钮区域 */
.actions-section {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #f1f3f4;
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.2em;
    font-weight: 600;
}

/* 主要操作区域 */
.main-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid #e9ecef;
}

.upload-section h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.file-input-wrapper {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 2px dashed #007bff;
    text-align: center;
    transition: border-color 0.3s ease;
}

.file-input-wrapper:hover {
    border-color: #0056b3;
}

form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

input[type="file"] {
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #ced4da;
    background: #f8f9fa;
    max-width: 100%;
    font-size: 14px;
}

/* Ensure the file input stays visually centered but doesn't overflow
   the dashed wrapper on narrow layouts */
.file-input-wrapper input[type="file"] {
    display: block;
    margin: 18px auto;
    width: 85%;
    max-width: 760px;
    min-width: 320px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    padding: 18px 14px;
    font-size: 16px;
    line-height: 1.2;
    background: #ffffff;
}

@media (max-width: 480px) {
    .file-input-wrapper input[type="file"] {
        width: 96%;
        min-width: auto;
        padding: 12px 10px;
        font-size: 15px;
    }
}

/* 主要按钮样式 */
.primary-button {
    padding: 18px 30px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    text-decoration: none;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    text-decoration: none;
    color: white;
}

.primary-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-icon {
    font-size: 20px;
}

/* 产品信息区域 */
.product-info-section {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    margin-bottom: 25px;
    overflow: hidden;
}

.collapsible-header {
    background: #f1f3f4;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.collapsible-header:hover {
    background: #e9ecef;
}

.collapsible-header h3 {
    margin: 0;
    color: #495057;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-icon {
    font-size: 14px;
    color: #007bff;
    transition: transform 0.3s ease;
}

.product-count {
    background: #007bff;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* 产品网格布局 */
.product-list-container {
    padding: 20px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.product-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.product-item:hover {
    background: #e7f3ff;
    border-color: #007bff;
    transform: translateY(-1px);
}

.product-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.product-name {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.loading {
    display: none;
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #007bff;
}

.loading img {
    width: 60px;
}

.loading p {
    margin-top: 15px;
    color: #495057;
    font-size: 16px;
}

.file-list {
    margin-top: 15px;
    list-style-type: none;
    padding: 0;
}

.file-list li {
    background: #e7f3ff;
    margin: 8px 0;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #007bff;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 20px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 8px;
    }
    
    .solutions-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .download-item {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .download-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .primary-button {
        padding: 15px 20px;
        font-size: 16px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .error-icon, .success-icon {
        font-size: 3em;
    }
}
