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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: rgb(253, 255, 253);
    min-height: 100vh;
    padding: 20px;
}

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

header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.upload-section {
    padding: 40px;
    background: #f8f9fa;
}

.file-upload {
    margin-bottom: 30px;
}

.file-upload input[type="file"] {
    display: none;
}

.upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 3px dashed #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.upload-label:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-label.dragover {
    border-color: #667eea;
    background: #e8f0ff;
}

.upload-icon {
    font-size: 2rem;
    margin-right: 15px;
}

.upload-text {
    font-size: 1.2rem;
    color: #666;
}

.compiler-selection {
    margin-bottom: 20px;
}

.compiler-selection label {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: block;
}

.radio-group {
    display: flex;
    gap: 20px;
}

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

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.options {
    margin-bottom: 30px;
}

.options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #666;
}

.options input[type="checkbox"] {
    margin-right: 10px;
}

.analyze-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.analyze-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.analyze-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.loading {
    padding: 60px;
    text-align: center;
    background: white;
}

.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); }
}

.results {
    padding: 40px;
    background: white;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.results-header h2 {
    color: #333;
    font-size: 2rem;
    font-weight: 300;
}

.export-buttons {
    display: flex;
    gap: 10px;
}

.export-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.export-btn:hover {
    background: #218838;
}

.summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.summary-item {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
}

.summary-item .label {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.summary-item .value {
    display: block;
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
}

.chart-container {
    margin-bottom: 40px;
    height: 400px;
    background: white;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table-container {
    overflow-x: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
}

tr:hover {
    background: #f8f9fa;
}

.details-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 0.8rem;
}

.details-btn:hover {
    background: #138496;
}

.error {
    padding: 40px;
    background: #f8d7da;
    color: #721c24;
    text-align: center;
}

.error h3 {
    margin-bottom: 15px;
}

.hidden {
    display: none;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.section-details {
    margin-top: 20px;
}

.section-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.section-item:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
    }
    
    header {
        padding: 30px 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .upload-section, .results {
        padding: 20px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .results-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    
    .summary {
        grid-template-columns: 1fr;
    }
}
/* 内存配置总览样式 */
.memory-configuration {
    margin-bottom: 40px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.memory-config-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 20px 30px;
}

.memory-config-header h3 {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 5px;
}

.memory-config-header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.memory-config-header .no-config {
    color: #ffc107;
    font-style: italic;
}

.memory-config-table {
    padding: 0;
}

.memory-config-table table {
    margin: 0;
    box-shadow: none;
}

.memory-config-table th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.memory-config-table td {
    vertical-align: middle;
}

.memory-config-table code {
    background: #f8f9fa;
    padding: 4px 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #495057;
}

.memory-config-table strong {
    color: #28a745;
    font-weight: 600;
}

/* 模块详情部分样式 */
.modules-section {
    margin-bottom: 30px;
    padding: 20px 0;
    border-top: 2px solid #eee;
}

.modules-section h3 {
    color: #333;
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 5px;
}

.modules-section p {
    color: #666;
    font-size: 0.95rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .memory-config-header {
        padding: 15px 20px;
    }
    
    .memory-config-header h3 {
        font-size: 1.3rem;
    }
    
    .memory-config-table {
        overflow-x: auto;
    }
    
    .modules-section {
        padding: 15px 0;
    }
}
/* 段分配明细样式 */
.memory-regions, .section-summary {
    margin-bottom: 20px;
}

.memory-regions h4, .section-summary h4 {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding: 10px 20px;
    background: #f8f9fa;
    border-left: 4px solid #28a745;
}

.section-summary h4 {
    border-left-color: #17a2b8;
}

.section-summary p {
    margin: 0 20px 15px;
    color: #666;
    font-size: 0.9rem;
}

.section-summary-table {
    padding: 0 20px 20px;
}

.section-summary-table table {
    margin: 0;
    box-shadow: none;
}

.section-summary-table th {
    background: #f1f8ff;
    color: #495057;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.section-summary-table code {
    background: #f8f9fa;
    padding: 4px 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #e83e8c;
    font-weight: 600;
}

.no-config {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.memory-config-table {
    padding: 0 20px 20px;
}