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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
}

/* 导航栏 */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 20px;
    font-size: 14px;
    color: #666;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-divider {
    color: #ccc;
}

/* 主标题区域 */
.header-section {
    padding: 30px 20px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.main-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.help-icon {
    font-size: 20px;
    opacity: 0.8;
    cursor: pointer;
}

.description {
    font-size: 16px;
    line-height: 1.8;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto 20px auto;
}

/* 作者信息 */
.author-info {
    margin-top: 20px;
}

.author-card {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    color: white;
    transition: all 0.3s ease;
}

.author-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.author-card i {
    font-size: 16px;
}

.author-name {
    font-weight: 600;
}

.author-contact {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.author-contact i {
    color: #07c160;
}

/* 固件选择区域 */
.firmware-section {
    padding: 30px 20px;
}

.section-header h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
    padding: 15px;
    background: #e8f5e8;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
}

.section-description {
    color: #666;
    margin-bottom: 25px;
    padding: 0 15px;
}

/* 固件类型选择标签 */
.firmware-type-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.tab-button {
    padding: 12px 20px;
    border: none;
    background: #f8f9fa;
    color: #666;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tab-button.active {
    background: #007bff;
    color: white;
}

.tab-button:hover:not(.active) {
    background: #e9ecef;
}

/* 固件列表表格 */
.firmware-list {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.firmware-table {
    width: 100%;
    border-collapse: collapse;
}

.firmware-table th {
    background: #f8f9fa;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
}

.firmware-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
}

.firmware-table tbody tr:hover {
    background: #f8f9fa;
}

.firmware-table tbody tr.selected {
    background: #e3f2fd;
}

/* 芯片标签 */
.chip-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.chip-tag.esp32-s3 {
    background: #ff9800;
}

.chip-tag.esp32-c3 {
    background: #f44336;
}

/* 复制按钮 */
.copy-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: #f0f0f0;
}

/* 控制区域 */
.control-section {
    padding: 30px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.control-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #0056b3;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #1e7e34;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #545b62;
}

/* 进度条 */
.progress-container {
    margin-bottom: 25px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #666;
}

/* 日志区域 */
.log-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.log-header {
    background: #f8f9fa;
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #495057;
}

.btn-clear {
    background: none;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: #dc3545;
    color: white;
}

.log-content {
    height: 200px;
    overflow-y: auto;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.log-item {
    margin-bottom: 5px;
    color: #666;
}

.log-item.success {
    color: #28a745;
}

.log-item.error {
    color: #dc3545;
}

.log-item.warning {
    color: #ffc107;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 0;
    }
    
    .control-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .firmware-table {
        font-size: 12px;
    }
    
    .firmware-table th,
    .firmware-table td {
        padding: 8px 6px;
    }
}

/* 滚动条样式 */
.log-content::-webkit-scrollbar {
    width: 6px;
}

.log-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.log-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.log-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 本地固件烧录工具样式 */
.local-firmware-tool {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
}

.local-tool-header {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.local-tool-header h3 {
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.local-description {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.6;
}

.local-tool-content {
    padding: 25px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ff9800;
}

/* 设备选择区域 */
.device-selection {
    margin-bottom: 30px;
}

.chip-categories {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.chip-category {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.category-header {
    background: #f8f9fa;
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    transition: background 0.2s;
}

.category-header:hover {
    background: #e9ecef;
}

.category-header.active {
    background: #007bff;
    color: white;
}

.subcategories {
    padding: 10px;
    display: none;
}

.subcategories.show {
    display: block;
}

.chip-option {
    display: block;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    margin-bottom: 5px;
}

.chip-option:hover {
    background: #f0f0f0;
}

.chip-option input[type="radio"] {
    margin-right: 8px;
}

.chip-selection-status {
    flex: 1;
    background: #e8f5e8;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #c8e6c9;
}

.status-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.selected-chip {
    font-weight: 600;
    color: #2e7d32;
}

/* 文件选择区域 */
.file-selection {
    margin-bottom: 30px;
}

.file-upload-area {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.upload-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.upload-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.upload-tab.active {
    background: #ff9800;
    color: white;
}

.upload-tab:hover:not(.active) {
    background: #e9ecef;
}

.upload-content {
    padding: 20px;
}

.upload-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #856404;
}

.file-input-group {
    display: flex;
    gap: 20px;
    align-items: end;
    margin-bottom: 15px;
}

.address-input,
.file-input {
    flex: 1;
}

.address-input label,
.file-input label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.address-input input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.file-upload-btn {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-upload {
    padding: 10px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-upload:hover {
    background: #0056b3;
}

.file-name {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.file-name.selected {
    color: #28a745;
    font-style: normal;
    font-weight: 500;
}

.btn-add-file {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-add-file:hover {
    background: #1e7e34;
}

/* 多文件上传表格 */
.multiple-files-table {
    margin-bottom: 20px;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.files-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
}

.files-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.files-table .file-row:last-child td {
    border-bottom: none;
}

.files-table .file-row:hover {
    background: #f8f9fa;
}

.address-input-field {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    background: #f9f9f9;
}

.address-input-field:focus {
    outline: none;
    border-color: #007bff;
    background: white;
}

.btn-select-file {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    transition: background 0.2s;
    width: 100%;
    justify-content: center;
}

.btn-select-file:hover {
    background: #545b62;
}

.file-display-name {
    color: #666;
    font-size: 14px;
    font-style: italic;
}

.file-display-name.selected {
    color: #28a745;
    font-style: normal;
    font-weight: 500;
}

.file-display-name.placeholder {
    color: #999;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chip-categories {
        flex-direction: column;
    }
    
    .file-input-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .file-upload-btn {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .multiple-file-item {
        flex-direction: column;
        align-items: stretch;
    }
}