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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f97316 0%, #dc2626 100%);
    min-height: 100vh;
    padding: 20px;
}

.expansion-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #ea580c 0%, #b91c1c 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

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

main {
    padding: 30px;
}

.simulation-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .simulation-layout {
        grid-template-columns: 1fr;
    }
}

.material-panel {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

#expansionCanvas {
    width: 100%;
    height: auto;
    background: linear-gradient(to bottom, #fff7ed 0%, #ffedd5 100%);
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.material-info {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.info-item {
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.info-item span:first-child {
    font-weight: 600;
    color: #4b5563;
}

.info-item span:last-child {
    color: #ea580c;
    font-weight: 700;
}

.charts-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.chart-container h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
}

.chart-container canvas {
    width: 100%;
    height: 150px;
    background: white;
    border-radius: 6px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.controls-panel {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.controls-panel h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #7c2d12;
    margin-bottom: 20px;
}

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

.control-group {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.control-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.control-group label span:last-child {
    color: #ea580c;
    font-weight: 700;
}

.control-group select {
    width: 100%;
    padding: 8px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
}

.control-group select:focus {
    outline: none;
    border-color: #ea580c;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ea580c;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ea580c;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.control-button {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.control-button.heat {
    background: #ef4444;
    color: white;
}

.control-button.heat:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(220, 38, 38, 0.3);
}

.control-button.cool {
    background: #3b82f6;
    color: white;
}

.control-button.cool:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(37, 99, 235, 0.3);
}

.control-button.reset {
    background: #6b7280;
    color: white;
}

.control-button.reset:hover {
    background: #4b5563;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.presets-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.presets-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #7c2d12;
    margin-bottom: 15px;
}

.preset-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.preset-button {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.preset-button.metal {
    background: #78716c;
    color: white;
}

.preset-button.metal:hover {
    background: #57534e;
}

.preset-button.nonmetal {
    background: #0ea5e9;
    color: white;
}

.preset-button.nonmetal:hover {
    background: #0284c7;
}

.preset-button.liquid {
    background: #06b6d4;
    color: white;
}

.preset-button.liquid:hover {
    background: #0891b2;
}

.formulas-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.formulas-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #7c2d12;
    margin-bottom: 15px;
}

.formula-list {
    display: grid;
    gap: 12px;
    margin-bottom: 15px;
}

.formula-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
}

.formula-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    min-width: 140px;
}

.formula {
    font-family: 'Times New Roman', serif;
    font-size: 1.1rem;
    color: #b91c1c;
    font-style: italic;
}

.parameter-display {
    padding-top: 15px;
    border-top: 2px solid #e5e7eb;
    font-size: 1rem;
    font-weight: 600;
    color: #7c2d12;
}

.parameter-display span:last-child {
    color: #ea580c;
    font-weight: 700;
}

.explanation {
    padding: 30px;
    background: #fafafa;
    border-top: 1px solid #e5e7eb;
}

.explanation h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #7c2d12;
    margin-bottom: 15px;
}

.explanation h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ea580c;
    margin: 20px 0 10px;
}

.explanation p {
    line-height: 1.8;
    color: #374151;
    margin-bottom: 12px;
}

.explanation strong {
    color: #b91c1c;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.6rem;
    }

    header .subtitle {
        font-size: 0.95rem;
    }

    main {
        padding: 15px;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .material-info {
        flex-direction: column;
    }

    .button-group {
        flex-direction: column;
    }

    .control-button,
    .preset-button {
        width: 100%;
    }

    .formula-label {
        min-width: auto;
    }

    .formula-item {
        flex-direction: column;
        align-items: flex-start;
    }
}
