/* 基础重置和字体 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* 容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部区域 */
.header {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: 600;
}

/* 搜索框 */
.search-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
}

.search-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.search-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-item label {
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.search-item select,
.search-item input {
    padding: 12px 16px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 15px;
    min-width: 200px;
    transition: all 0.3s ease;
    background: white;
}

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

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e1e5eb;
    color: #555;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-small {
    padding: 8px 16px;
    border: 2px solid #e1e5eb;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.btn-small:hover:not(.active) {
    border-color: #667eea;
    color: #667eea;
}

/* 主内容区域 */
.main-content {
    position: relative;
}

/* 加载提示 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: white;
    margin-top: 20px;
    font-size: 18px;
}

/* 错误提示 */
.error-msg {
    background: #fee;
    border: 2px solid #f87171;
    color: #dc2626;
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 15px;
}

/* 藏品指标卡片 */
.collection-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.metric-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.metric-card.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.metric-card.highlight .metric-label {
    color: rgba(255, 255, 255, 0.9);
}

.metric-card.highlight .metric-value {
    color: white;
}

.metric-card.highlight.up {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.metric-card.highlight.down {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

.metric-label {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.metric-value {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

/* K线容器 */
.kline-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.kline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.kline-header h3 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.kline-tip {
    color: #999;
    font-size: 13px;
}

.kline-chart {
    width: 100%;
    height: 400px;
}

/* 模块标题 */
.modules-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.modules-tabs {
    display: flex;
    gap: 8px;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #e0e0e0;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #d0d0d0;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modules-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
}

/* 数据区域 */
.data-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.section-title {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title .icon {
    font-size: 28px;
}

.section-title .subtitle {
    font-size: 14px;
    color: #888;
    font-weight: normal;
    margin-left: 15px;
}

/* 模块网格布局 - 每个模块独占一行 */
.modules-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px;
    width: 100%;
}

.modules-grid .module-card {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
}

/* 模块卡片 */
.module-card {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px 24px;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

/* 风险账号样式 */
.risk-section {
    margin-bottom: 24px;
}

.risk-section:last-child {
    margin-bottom: 0;
}

.risk-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: help;
    position: relative;
}

/* 即时显示tooltip */
.risk-title[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 4px;
    padding: 6px 10px;
    background: #333;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
    animation: none;
    transition: none;
}

.risk-yellow {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    color: #856404;
    border-left: 4px solid #ffc107;
}

.risk-red {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* 风险账号表格行颜色 */
.risk-row-yellow {
    background-color: #fff8e1 !important;
}

.risk-row-yellow:hover {
    background-color: #ffecb3 !important;
}

.risk-row-red {
    background-color: #ffebee !important;
}

.risk-row-red:hover {
    background-color: #ffcdd2 !important;
}

/* 日期数据统计网格 */
.date-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
}

.date-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.date-stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}

.date-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

/* 图表容器 */
.chart-container {
    height: 280px;
    margin-bottom: 20px;
    display: none; /* 暂时隐藏空的图表区域 */
}

/* 数据表格 */
.data-table-container {
    max-height: 300px;
    overflow: auto;
    border-radius: 8px;
    border: 1px solid #e1e5eb;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: #f1f3f5;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e1e5eb;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f5;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

/* 数据汇总 */
.data-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.summary-item {
    background: white;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e1e5eb;
}

.summary-item .label {
    display: block;
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.summary-item .value {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #667eea;
}

/* K线容器 */
.kline-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.kline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.kline-header h3 {
    font-size: 18px;
    color: #2c3e50;
}

.kline-controls {
    display: flex;
    gap: 10px;
}

.kline-chart {
    height: 400px;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px;
    color: white;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-item select,
    .search-item input {
        min-width: 100%;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 22px;
    }

    .section-title {
        font-size: 18px;
    }
}

/* 滚动条美化 */
.data-table-container::-webkit-scrollbar {
    width: 8px;
}

.data-table-container::-webkit-scrollbar-track {
    background: #f1f3f5;
}

.data-table-container::-webkit-scrollbar-thumb {
    background: #c1c8d0;
    border-radius: 4px;
}

.data-table-container::-webkit-scrollbar-thumb:hover {
    background: #a0a7b0;
}

/* 隐藏类 - 必须放在最后以覆盖其他display规则 */
.hidden {
    display: none !important;
}
