/* 基础重置与全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: #f1f5f9;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 容器样式 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* 头部样式 */
.header {
    padding: 30px 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo i {
    font-size: 2.5rem;
    color: #fbbf24;
}

.time-display {
    text-align: right;
}

.date {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 4px;
}

.time {
    font-size: 1.8rem;
    font-weight: 600;
    color: #f1f5f9;
    letter-spacing: 1px;
}

/* 概览卡片 */
.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.card {
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header i {
    font-size: 1.5rem;
    color: #fbbf24;
}

.card-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

.price-display {
    font-size: 3rem;
    font-weight: 700;
    color: #fbbf24;
    line-height: 1;
    margin-bottom: 10px;
}

.price-info {
    font-size: 0.95rem;
    color: #94a3b8;
}

.update-display {
    font-size: 2.2rem;
    font-weight: 600;
    color: #60a5fa;
    line-height: 1;
    margin-bottom: 20px;
}

.refresh-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: scale(1.05);
}

.refresh-btn:active {
    transform: scale(0.98);
}

/* 图表导航区域 */
.chart-nav {
    margin-bottom: 40px;
}

.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab {
    flex: 1;
    background: transparent;
    border: 1px solid transparent;
    color: #cbd5e1;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 120px;
}

.tab:hover {
    background: rgba(30, 41, 59, 0.4);
    color: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tab.active {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.9), rgba(245, 158, 11, 0.9));
    color: #0f172a;
    border-color: rgba(251, 191, 36, 0.3);
    box-shadow:
        0 4px 15px rgba(251, 191, 36, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* 平滑过渡的金色渐变效果 */
.tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(251, 191, 36, 0.1),
        transparent
    );
    transition: left 0.6s ease;
}

.tab:hover::before {
    left: 100%;
}

.tab.active::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    left: 100%;
}

/* 激活状态的图标颜色 */
.tab.active i {
    color: #0f172a;
}

/* 按钮激活动画效果 */
.tab-activating {
    animation: tabActivate 0.3s ease forwards;
}

@keyframes tabActivate {
    0% {
        transform: translateY(-2px) scale(0.98);
        box-shadow:
            0 0 0 0 rgba(251, 191, 36, 0),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: translateY(-2px) scale(1.02);
        box-shadow:
            0 0 20px 5px rgba(251, 191, 36, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    100% {
        transform: translateY(-2px) scale(1);
        box-shadow:
            0 4px 15px rgba(251, 191, 36, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}

/* 按钮图标动画 */
.tab i {
    transition: transform 0.3s ease, color 0.3s ease;
}

.tab.active i {
    transform: scale(1.1);
    color: #0f172a;
}

.tab:hover i {
    transform: translateY(-1px);
}

/* 图表容器样式 */
.chart-container {
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 25px;
    height: 400px;
    position: relative;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.chart-container:hover {
    border-color: rgba(251, 191, 36, 0.3);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 数据表格区域 */
.data-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
}

.section-header i {
    color: #fbbf24;
}

/* 表格选择器样式 */
.table-selector {
    display: flex;
    align-items: center;
    gap: 20px;
}

.custom-select {
    position: relative;
    min-width: 180px;
}

.custom-select select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    padding: 12px 20px;
    padding-right: 50px;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #f1f5f9;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.custom-select select:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(251, 191, 36, 0.3);
}

.custom-select select:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

.select-arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #fbbf24;
    transition: transform 0.3s ease;
}

.custom-select:hover .select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* 数据计数样式更新 */
.data-count {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.1));
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.95rem;
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.data-count::before {
    content: '📊';
    font-size: 1.1rem;
}

/* 表格容器样式 */
.tab-tables {
    position: relative;
    min-height: 400px;
}

.tab-table {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-table.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.table-container {
    overflow-x: auto;
    border-radius: 15px;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

thead {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(10px);
}

th {
    padding: 20px 24px;
    text-align: left;
    font-weight: 600;
    color: #f1f5f9;
    border-bottom: 2px solid rgba(251, 191, 36, 0.3);
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #fbbf24, transparent);
    transition: width 0.3s ease;
}

th:hover::after {
    width: 100%;
}

td {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: rgba(30, 41, 59, 0.4);
    /* 移除 transform: translateX(5px); 以防止横向移动条 */
}

/* 价格单元格特殊样式 */
td:nth-child(2),
td:nth-child(3) {
    font-weight: 600;
    color: #fbbf24;
}

/* 波动指示器样式 */
.price-change {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 8px;
}

.price-up {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.price-down {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* 加载状态样式 */
.loading-row td {
    text-align: center;
    padding: 50px;
    color: #94a3b8;
}

.loading-row td .loading-spinner {
    margin-bottom: 15px;
}

.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(251, 191, 36, 0.3);
    border-radius: 50%;
    border-top-color: #fbbf24;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空数据提示 */
.no-data {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-style: italic;
}

.no-data i {
    font-size: 2rem;
    color: #64748b;
    margin-bottom: 15px;
    display: block;
}

/* 页脚样式 */
.footer {
    padding: 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 30px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.api-info {
    color: #94a3b8;
    font-size: 0.9rem;
}

.api-info a {
    color: #60a5fa;
    text-decoration: none;
}

.api-info a:hover {
    text-decoration: underline;
}

.copyright {
    color: #64748b;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .time-display {
        text-align: center;
    }

    .overview-cards {
        grid-template-columns: 1fr;
    }

    .price-display {
        font-size: 2.5rem;
    }

    .nav-tabs {
        flex-direction: column;
    }

    .tab {
        min-width: 100%;
        padding: 14px 20px;
    }

    .chart-container {
        height: 300px;
        padding: 15px;
    }

    .table-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .custom-select {
        width: 100%;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .table-container {
        border-radius: 12px;
        margin: 0 -15px;
        width: calc(100% + 30px);
    }

    th, td {
        padding: 16px 12px;
        font-size: 0.9rem;
    }

    table {
        min-width: 1000px; /* 在移动端启用横向滚动 */
    }
}

@media (max-width: 480px) {
    .tab {
        font-size: 0.9rem;
        padding: 12px 16px;
    }

    .tab i {
        font-size: 0.9rem;
    }
}

/* 加载状态样式 */
.loading {
    color: #94a3b8;
    font-style: italic;
}