:root {
    --primary-color: #00c3ff;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --muted-text: #6c757d;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --card-bg: #1e1e1e;
        --text-color: #e9ecef;
        --muted-text: #adb5bd;
        --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    transition: background-color 0.3s ease;
}

.container {
    width: 95%;
    max-width: 450px;
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, background-color 0.3s ease;
}

h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-container {
    display: flex;
    gap: 8px;
}

input[type="number"] {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--card-bg);
    color: var(--text-color);
    inputmode: decimal;
}

.clear-button {
    padding: 0 1rem;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    height: 1rem;
}

h5 {
    margin: 1.5rem 0 0.5rem;
    font-weight: 600;
    color: var(--muted-text);
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 1.5rem;
}

.preset-button {
    padding: 0.5rem;
    background-color: #e9ecef;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #495057;
    transition: background-color 0.2s;
}

.preset-button:hover {
    background-color: #dee2e6;
}

@media (prefers-color-scheme: dark) {
    .preset-button {
        background-color: #2c2c2c;
        color: #e9ecef;
    }
    .preset-button:hover {
        background-color: #3d3d3d;
    }
}

.output-container {
    background-color: rgba(0, 123, 255, 0.05);
    padding: 1.2rem;
    border-radius: 10px;
    margin-top: 1rem;
}

.output-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.output-item:last-child {
    margin-bottom: 0;
    border-top: 1px dashed #dee2e6;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.info-section {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--muted-text);
    text-align: center;
}

#loading {
    text-align: center;
    font-size: 0.85rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: none;
}

footer {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted-text);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}
