/* 文件路径: assets/css/style.css */

/* --- CSS Variables for easy theming --- */
:root {
    --primary-color: #007bff;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-color: #333;
    --label-color: #555;
    --border-color: #dee2e6;
    --input-focus-border: #80bdff;
    --disclaimer-color: #6c757d;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- General Styles & Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
}

/* --- Main Container --- */
.converter-container {
    width: 100%;
    max-width: 700px;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 2rem;
}

header h1 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* --- Tab Navigation --- */
.category-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto; /* For mobile */
    -webkit-overflow-scrolling: touch; /* Smoother scrolling on iOS */
}

.tab-link {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 1rem;
    color: var(--label-color);
    border-bottom: 3px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-link:hover {
    color: var(--primary-color);
}

.tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* --- Tab Content --- */
.converter-tab-content {
    display: none; /* Hide by default */
}

.converter-tab-content.active {
    display: block; /* Show active tab content */
}

/* --- Form & Input Rows --- */
.unit-row {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap; /* For mobile */
}

.unit-label {
    flex: 1;
    min-width: 150px;
    font-size: 1rem;
    color: var(--label-color);
    padding-right: 1rem;
}

.input-wrapper {
    flex: 2;
}

.unit-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.unit-input:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Remove arrows from number input */
.unit-input::-webkit-outer-spin-button,
.unit-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.unit-input[type=number] {
    -moz-appearance: textfield;
}

/* --- Footer --- */
footer {
    margin-top: 2rem;
    text-align: center;
}

.disclaimer {
    font-size: 0.875rem;
    color: var(--disclaimer-color);
    line-height: 1.5;
}

/* --- Responsive Design for Mobile --- */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    .converter-container {
        padding: 1.5rem 1rem;
    }
    header h1 {
        font-size: 1.5rem;
    }
    .unit-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .unit-label {
        margin-bottom: 0.5rem;
        font-weight: 500;
    }
    .input-wrapper {
        width: 100%;
    }
}
