:root {
    --primary-color: #3861fb;
    --secondary-color: #627eea;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --success-color: #16c784;
    --danger-color: #ea3943;
    --hover-color: #f0f0f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 10px 20px;
    margin: 0 10px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.calculator-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    background-color: var(--card-background);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.coin-selector-container {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    border-right: 1px solid var(--border-color);
    padding-right: 20px;
}

.search-container {
    position: relative;
    margin-bottom: 15px;
}

#coin-search {
    width: 100%;
    padding: 10px 35px 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
}

.search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.coin-list {
    max-height: 400px;
    overflow-y: auto;
}

.coin-item {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.coin-item:hover {
    background-color: var(--hover-color);
}

.coin-item.active {
    background-color: rgba(56, 97, 251, 0.1);
    font-weight: 500;
}

.coin-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    border-radius: 50%;
}

.coin-name {
    flex: 1;
}

.coin-symbol {
    color: #666;
    font-size: 0.9em;
}

.calculator-form {
    flex: 2;
    min-width: 300px;
    padding: 0 20px;
}

.direction-selector {
    display: flex;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.direction-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.direction-btn[data-direction="long"] {
    color: var(--success-color);
}

.direction-btn[data-direction="short"] {
    color: var(--danger-color);
}

.direction-btn.active[data-direction="long"] {
    background-color: var(--success-color);
    color: white;
}

.direction-btn.active[data-direction="short"] {
    background-color: var(--danger-color);
    color: white;
}

.leverage-container {
    margin-bottom: 20px;
}

.leverage-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.leverage-slider {
    flex: 1;
    height: 8px;
    appearance: none;
    background: #ddd;
    border-radius: 4px;
    outline: none;
}

.leverage-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

#leverage-value {
    min-width: 40px;
    text-align: center;
    font-weight: 500;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-unit input {
    width: 100%;
    padding: 10px 60px 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
}

.unit {
    position: absolute;
    right: 15px;
    color: #666;
}

.calculate-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.calculate-btn:hover {
    background-color: var(--secondary-color);
}

.results-container {
    flex: 1;
    min-width: 250px;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
}

.results-container h2 {
    margin-bottom: 15px;
    font-size: 18px;
    color: var(--primary-color);
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.result-label {
    color: #666;
}

.result-value {
    font-weight: 500;
}

.price-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px;
    background-color: var(--card-background);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px 0;
    color: #666;
    font-size: 14px;
}

.coming-soon {
    width: 100%;
    text-align: center;
    padding: 50px 0;
}

.coming-soon h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

@media (max-width: 992px) {
    .calculator-container {
        flex-direction: column;
    }
    
    .coin-selector-container {
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
    
    .coin-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        max-height: 200px;
    }
    
    .coin-item {
        width: calc(33.33% - 10px);
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .coin-item {
        width: calc(50% - 10px);
    }
    
    .price-info {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .coin-item {
        width: 100%;
    }
}
/* 底部样式 */
footer {
    background-color: #f9f9f9;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e9ecef;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* 语言切换样式 */
.language-switcher-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.language-link {
    color: #3861fb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.language-link:hover {
    color: #2d4fd7;
    text-decoration: underline;
}

.language-separator {
    color: #6c757d;
    font-weight: 400;
}

/* 手机端适配 */
@media (max-width: 768px) {
    footer {
        padding: 15px;
    }

    .footer-content {
        gap: 8px;
    }

    .language-switcher-footer {
        flex-direction: column;
        gap: 5px;
    }

    .language-separator {
        display: none;
    }
}
