* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #f59e0b;
    --secondary-color: #d97706;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --dark-bg: #1f2937;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    padding: 20px;
    color: #ffffff;
    position: relative;
    overflow-x: hidden;
}

/* 动态背景层 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 165, 0, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
    animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 动态粒子容器 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(255, 215, 0, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 215, 0, 0.3), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 215, 0, 0.2), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(255, 215, 0, 0.3), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(255, 215, 0, 0.2), transparent),
        radial-gradient(1px 1px at 33% 80%, rgba(255, 215, 0, 0.3), transparent),
        radial-gradient(2px 2px at 15% 90%, rgba(255, 215, 0, 0.2), transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: particleMove 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes particleMove {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

.container {
    position: relative;
    z-index: 1;
}


/* 头部样式 */
.header {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.2), 0 0 60px rgba(255, 215, 0, 0.1);
    text-align: center;
    border: 1px solid rgba(255, 215, 0, 0.3);
    animation: headerGlow 3s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% { box-shadow: 0 8px 32px rgba(255, 215, 0, 0.2), 0 0 60px rgba(255, 215, 0, 0.1); }
    50% { box-shadow: 0 8px 32px rgba(255, 215, 0, 0.3), 0 0 80px rgba(255, 215, 0, 0.15); }
}

.header-content h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    animation: titleShine 3s linear infinite;
    background-size: 200% auto;
}

@keyframes titleShine {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.header-content h1 i {
    margin-right: 10px;
    -webkit-text-fill-color: #ffd700;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.subtitle {
    color: #aaaaaa;
    font-size: 1.1rem;
}

/* 今日价格卡片 */
.today-price-section {
    margin-bottom: 30px;
}

.price-card {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.main-price {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    color: white;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.3), 0 0 60px rgba(255, 215, 0, 0.2);
    border: 2px solid rgba(255, 215, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.main-price::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: priceShine 3s linear infinite;
}

@keyframes priceShine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.update-time {
    font-size: 0.9rem;
    opacity: 0.9;
}

.price-display {
    text-align: center;
    padding: 30px 0;
}

.price-value {
    font-size: 4rem;
    font-weight: bold;
    display: inline-block;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.3);
    animation: priceGlow 2s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes priceGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.3); }
    50% { text-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.5); }
}

.price-unit {
    font-size: 1.5rem;
    margin-left: 10px;
    opacity: 0.9;
    color: #ffd700;
    position: relative;
    z-index: 1;
}

.refresh-btn {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    border: 2px solid rgba(255, 215, 0, 0.5);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    position: relative;
    z-index: 1;
}

.refresh-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
    border-color: rgba(255, 215, 0, 0.8);
}

.refresh-btn i {
    transition: transform 0.3s ease;
}

.refresh-btn:hover i {
    transform: rotate(180deg);
}

/* 搜索区域 */
.search-section {
    margin-bottom: 30px;
}

.search-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(255, 138, 101, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.search-card h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.date-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.date-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    background: linear-gradient(135deg, #ff8a65 0%, #ffb74d 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255, 138, 101, 0.3);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 138, 101, 0.4);
}

/* 价格列表 */
.price-list-section {
    margin-bottom: 30px;
}

.price-list-section h2 {
    color: #ffd700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.price-item {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.price-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.3), 0 0 40px rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.6);
}

.price-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
}

.price-item-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffd700;
}

.change-percent {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.change-percent.positive {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.2) 0%, rgba(0, 200, 0, 0.2) 100%);
    color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.change-percent.negative {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.2) 0%, rgba(200, 0, 0, 0.2) 100%);
    color: #ff4444;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.change-percent.neutral {
    background: rgba(100, 100, 100, 0.2);
    color: #888888;
}

.price-details {
    display: grid;
    gap: 10px;
}

.price-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}

.price-detail-label {
    color: #888888;
}

.price-detail-value {
    font-weight: 600;
    color: #ffffff;
}

/* 图表区域 */
.chart-section {
    margin-bottom: 30px;
}

.chart-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(255, 138, 101, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.chart-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.period-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.period-tab {
    background: #f3f4f6;
    color: var(--text-primary);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.period-tab:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.period-tab.active {
    background: linear-gradient(135deg, #ff8a65 0%, #ffb74d 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 138, 101, 0.3);
}

.chart-container {
    position: relative;
    height: 400px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #ffd700;
    font-size: 1.1rem;
}

.loading i.fa-spinner {
    margin-right: 8px;
    animation: spin 1s linear infinite;
    color: #ffd700;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 页脚 */
.footer {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.15);
    margin-top: 30px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.footer p {
    margin: 5px 0;
    color: #888888;
}

.footer a {
    color: #ffd700;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.footer a:hover {
    color: #ffed4e;
    text-decoration: underline;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header-content h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .price-value {
        font-size: 3rem;
    }

    .price-unit {
        font-size: 1.2rem;
    }

    .price-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 300px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .period-tabs {
        width: 100%;
    }

    .period-tab {
        flex: 1;
        min-width: 70px;
    }

    .search-form {
        flex-direction: column;
    }

    .date-input {
        width: 100%;
    }

    .search-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 25px 20px;
    }

    .price-card {
        padding: 20px;
    }

    .price-value {
        font-size: 2.5rem;
    }
}
