:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --background: #f5f6fa;
    --card: #ffffff;
    --text: #2c3e50;
    --success: #2ecc71;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.calculator-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin: 20px 0;
}

h1 {
    color: var(--primary);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    position: relative;
}

h1::after {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background: var(--secondary);
    margin: 10px auto;
    border-radius: 2px;
}

.input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-weight: 500;
}

input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.main-content {
    position: relative;
}

.result-group {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
    display: none;
}

.result-group.show {
    display: block;
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

.result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.result-label {
    color: var(--primary);
    font-weight: 500;
}

.result-value {
    font-weight: bold;
    color: var(--secondary);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.result-value.highlight {
    animation: highlight 0.5s ease;
}

@keyframes highlight {
    0% {
        transform: scale(1);
        color: var(--secondary);
    }
    50% {
        transform: scale(1.1);
        color: var(--accent);
    }
    100% {
        transform: scale(1);
        color: var(--secondary);
    }
}

.result-value:hover::after {
    content: '点击复制';
    position: absolute;
    right: -70px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--text);
    opacity: 0.7;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #e1e1e1;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn.active {
    background: var(--secondary);
    color: white;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.rate-presets {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.rate-preset-btn {
    padding: 5px 10px;
    border: 1px solid var(--secondary);
    border-radius: 4px;
    background: transparent;
    color: var(--secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.rate-preset-btn:hover {
    background: var(--secondary);
    color: white;
}

.options-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}

.action-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.reset-btn {
    background: var(--accent);
    color: white;
}

.copy-btn {
    background: var(--success);
    color: white;
}

.tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.info-sections {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.info-section {
    background: var(--card);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid rgba(52, 152, 219, 0.1);
    transition: all 0.3s ease;
}

.info-section:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.info-section h2 {
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-section h2::before {
    content: '';
    display: block;
    width: 3px;
    height: 20px;
    background: var(--secondary);
    border-radius: 2px;
}

.formula-item {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid var(--secondary);
    transition: all 0.3s ease;
}

.formula-item:hover {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.formula-item:last-child {
    margin-bottom: 0;
}

.formula-item strong {
    color: var(--accent);
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.formula-item p {
    margin: 0.25rem 0;
    color: var(--text);
    font-family: "Consolas", monospace;
    font-size: 0.95rem;
}

.instruction-list {
    list-style: none;
    padding: 0;
}

.instruction-list li {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    position: relative;
    padding-left: 1.75rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.instruction-list li:hover {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.instruction-list li::before {
    content: '→';
    color: var(--secondary);
    font-weight: bold;
    position: absolute;
    left: 0.75rem;
}

.instruction-list ul {
    list-style: none;
    padding-left: 1.25rem;
    margin-top: 0.5rem;
}

.instruction-list ul li {
    margin-bottom: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: rgba(52, 152, 219, 0.05);
    border-radius: 4px;
    font-size: 0.9rem;
}

.instruction-list ul li::before {
    content: '•';
    color: var(--secondary);
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
        margin-top: 0;
    }

    .calculator-card {
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .button-group {
        flex-direction: column;
    }

    body {
        padding: 0;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .container {
        margin: 0;
        margin-bottom: 0px;
        padding: 1rem;
        border-radius: 0;
        box-shadow: none;
    }

    .result {
        margin-top: 1rem;
        padding: 0.3rem;
        background: transparent;
    }

    .info-sections {
        gap: 1rem;
    }

    .info-section {
        padding: 1rem;
    }

    .formula-item, 
    .instruction-list li {
        padding: 0.6rem;
    }

    .instruction-list li {
        padding-left: 1.5rem;
    }
}

/* Navigation - PC */
.lang-nav {
    background-color: #333;
    color: white;
    padding: 10px 0;
    width: 100%;
}

.lang-nav .container {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
}

.lang-nav a {
    color: #fff;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.lang-nav a:hover {
    background-color: #555;
}

.lang-nav a.active {
    background-color: #4CAF50;
}

/* Media Queries for Mobile */
@media screen and (max-width: 768px) {
    /* Mobile Navigation */
    .lang-nav .container {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 3列 */
        grid-template-rows: repeat(2, auto);    /* 2行 */
        gap: 10px;
        padding: 10px;
    }

    .lang-nav a {
        text-align: center;
        padding: 10px;
        background-color: #444;
    }

    .lang-nav a.active {
        background-color: #4CAF50;
    }

    /* Mobile Container */
    .container {
        width: 100%;
        padding: 0 15px;
    }

    /* Mobile Calculator Card */
    .calculator-card {
        margin: 10px 0;
        padding: 15px;
    }
}

/* RTL Support */
[dir="rtl"] .lang-nav .container {
    justify-content: flex-start;
}

[dir="rtl"] .result-label {
    text-align: right;
} 