/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header h1 i {
    margin-right: 15px;
    color: #ffd700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* 价格显示区域 */
.price-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.price-section h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5rem;
    font-weight: 600;
}

.price-section h2 i {
    margin-right: 10px;
    color: #667eea;
}

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

.price-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f0ff 100%);
    border-radius: 15px;
    padding: 25px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.price-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.price-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.btc-card {
    border-color: #f7931a;
}

.kas-card {
    border-color: #70d0e4;
}

.crypto-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.crypto-header i {
    font-size: 1.5rem;
    margin-right: 12px;
}

.btc-card .crypto-header i {
    color: #f7931a;
}

.kas-card .crypto-header i {
    color: #70d0e4;
}

.crypto-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.price-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.price-item:hover {
    background: rgba(255, 255, 255, 0.9);
}

.currency {
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
}

.price {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

.last-update {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.last-update i {
    margin-right: 5px;
}

/* 转换器区域 */
.converter-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.converter-section h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5rem;
    font-weight: 600;
}

.converter-section h2 i {
    margin-right: 10px;
    color: #667eea;
}

.converter-card {
    max-width: 600px;
    margin: 0 auto;
}

.converter-description {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
    font-size: 1rem;
}

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

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

.input-item label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
    display: flex;
    align-items: center;
}

.input-item label i {
    margin-right: 8px;
    color: #667eea;
}

.input-item input {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.input-item input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.calculate-btn {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* 结果显示区域 */
.result-section {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border-radius: 15px;
    border: 2px solid #667eea;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.result-header i {
    margin-right: 10px;
    color: #70d0e4;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.total-value,
.kas-amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
}

.result-content .label {
    font-weight: 500;
    color: #666;
}

.result-content .value {
    font-weight: 700;
    font-size: 1.2rem;
    color: #333;
}

/* 状态指示器 */
.status-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #666;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.status-indicator.connected {
    color: #28a745;
}

.status-indicator.error {
    color: #dc3545;
}

.status-indicator i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .price-section,
    .converter-section {
        padding: 20px;
    }
    
    .price-grid {
        grid-template-columns: 1fr;
    }
    
    .input-group {
        grid-template-columns: 1fr;
    }
    
    .status-indicator {
        bottom: 15px;
        right: 15px;
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .price-section,
    .converter-section {
        padding: 15px;
    }
    
    .price-card {
        padding: 20px;
    }
    
    .result-content {
        gap: 10px;
    }
    
    .total-value,
    .kas-amount {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误状态 */
.error {
    color: #dc3545 !important;
}

.success {
    color: #28a745 !important;
}