/* ========== 变量定义 ========== */
:root {
    --bg-primary: #0f0f1e;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --accent-primary: #f59e0b;
    --accent-secondary: #8b5cf6;
    --bullish: #10b981;
    --bearish: #ef4444;
    --neutral: #6b7280;
    --border: #27272a;
    --shadow: rgba(0, 0, 0, 0.3);
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* ========== 基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ========== 头部样式 ========== */
.header {
    text-align: center;
    padding: 3rem 0;
    position: relative;
    margin-bottom: 2rem;
}

.header-content {
    position: relative;
    z-index: 1;
}

.logo {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.btc-icon {
    display: inline-block;
    margin-right: 0.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 2px;
}

.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: rotate(180deg);
    border-color: var(--accent-primary);
}

/* ========== 统计卡片 ========== */
.stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.live-price-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 2px solid var(--accent-primary);
}

.live-price-card .stat-value {
    animation: pulse 2s ease-in-out infinite;
}

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

.price-update-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* ========== 搜索和筛选 ========== */
.controls {
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.search-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.filters {
    display: flex;
    gap: 1rem;
}

.filter-select {
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:hover,
.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ========== 预测卡片 ========== */
.predictions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.prediction-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

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

.prediction-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--shadow);
    border-color: var(--accent-primary);
}

.prediction-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.prediction-institution {
    flex: 1;
    min-width: 0;
}

.institution-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}

.institution-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.person-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.sentiment-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sentiment-bullish {
    background: rgba(16, 185, 129, 0.15);
    color: var(--bullish);
    border: 1px solid var(--bullish);
}

.sentiment-bearish {
    background: rgba(239, 68, 68, 0.15);
    color: var(--bearish);
    border: 1px solid var(--bearish);
}

.sentiment-neutral {
    background: rgba(107, 114, 128, 0.15);
    color: var(--neutral);
    border: 1px solid var(--neutral);
}

.prediction-price {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(245, 158, 11, 0.05);
    border-left: 4px solid var(--accent-primary);
    border-radius: 8px;
}

.price-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.price-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 0.3rem;
}

.price-date {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.change-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.change-positive {
    background: rgba(16, 185, 129, 0.15);
    color: var(--bullish);
}

.change-negative {
    background: rgba(239, 68, 68, 0.15);
    color: var(--bearish);
}

.long-term-prediction {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.long-term-prediction .price-label {
    font-size: 0.8rem;
}

.long-term-prediction .price-value {
    font-size: 1.8rem;
}

.prediction-content {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.prediction-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.prediction-date {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.7rem;
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-primary);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    transition: background 0.3s ease;
}

.prediction-date:hover {
    background: rgba(245, 158, 11, 0.18);
}

.source-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.source-link:hover {
    color: var(--accent-secondary);
    transform: translateX(5px);
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* ========== 页脚 ========== */
.footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    align-items: center;
}

.footer-links a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-secondary);
}

/* ========== 图片样式 ========== */
.prediction-image {
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.prediction-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px var(--shadow);
}

.prediction-image img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

.prediction-image::after {
    content: '🔍 点击放大';
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.prediction-image:hover::after {
    opacity: 1;
}

/* ========== 图片模态框 ========== */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-modal.show {
    opacity: 1;
    visibility: visible;
}

.image-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background: var(--bg-secondary);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.image-modal-img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}

.image-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
}

.image-modal-close:hover {
    background: rgba(239, 68, 68, 0.9);
    transform: rotate(90deg);
}

.image-modal-caption {
    padding: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-align: center;
    font-weight: 600;
    border-top: 1px solid var(--border);
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
    .stats {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .logo {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .controls {
        flex-direction: column;
    }

    .search-box {
        min-width: 100%;
    }

    .filters {
        flex-direction: column;
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    .header {
        padding: 2rem 0;
        margin-bottom: 1.5rem;
    }

    .theme-toggle {
        position: absolute;
        top: 1rem;
        right: 0;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .prediction-header {
        flex-direction: column;
        gap: 1rem;
    }

    .price-value {
        font-size: 2rem;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 2rem 0;
    }

    .logo {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .theme-toggle {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .stats {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.8rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .price-update-time {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.8rem;
    }

    .header {
        padding: 1.5rem 0;
    }

    .logo {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        top: 0.5rem;
    }

    .stat-card {
        padding: 0.8rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
        margin-bottom: 1.5rem;
    }

    .prediction-card {
        padding: 1.2rem;
    }

    .prediction-date {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .price-update-time {
        font-size: 0.55rem;
    }

    .search-box input,
    .filter-select {
        font-size: 16px;
        padding: 0.8rem 1rem;
    }

    .stat-card::before {
        height: 3px;
    }
}
