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

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    text-align: center;
}

h1 {
    font-size: 1.8em;
    font-weight: normal;
}

.content {
    padding: 30px;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #3498db;
    margin-bottom: 30px;
}

.tab-btn {
    background-color: #f8f9fa;
    border: none;
    padding: 15px 30px;
    font-size: 1em;
    cursor: pointer;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    margin-right: 5px;
    transition: background-color 0.3s;
    color: #555;
    font-weight: 600;
}

.tab-btn:hover {
    background-color: #e9ecef;
}

.tab-btn.active {
    background-color: #3498db;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section {
    margin-bottom: 40px;
}

.section h2 {
    font-size: 1.3em;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

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

.input-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

input[type="number"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

input[type="number"]:focus {
    outline: none;
    border-color: #3498db;
}

.btn-calculate {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 15px;
}

.btn-calculate:hover {
    background-color: #2980b9;
}

.btn-calculate:active {
    background-color: #21618c;
}

.note {
    background-color: #fffbea;
    border-left: 4px solid #f39c12;
    padding: 12px;
    margin-top: 15px;
    font-size: 0.9em;
}

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

.result-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-left: 4px solid #3498db;
    display: flex;
    flex-direction: column;
}

.result-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.result-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #2c3e50;
}

.diagram-container {
    background-color: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

canvas {
    max-width: 100%;
    height: auto;
}

.formula-list {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
}

.formula-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.formula-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.formula-item strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 8px;
}

.formula-item code {
    display: block;
    background-color: #fff;
    padding: 8px 12px;
    margin: 8px 0;
    border-left: 3px solid #3498db;
    font-family: 'Courier New', monospace;
    color: #c7254e;
}

.formula-item p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9em;
}

footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 0.9em;
}

footer a {
    color: #3498db;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .input-grid,
    .results-grid {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 20px;
    }

    h1 {
        font-size: 1.4em;
    }
}
