/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #0F172A;
    color: #F8FAFC;
    min-height: 100vh;
    line-height: 1.6;
}

/* 网格背景 */
.grid-bg {
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: -1px -1px;
}

/* 卡片样式 */
.card {
    background-color: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 1rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3B82F6, #8B5CF6, #10B981);
    opacity: 0.8;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.3), 0 10px 15px -5px rgba(0, 0, 0, 0.2);
}

.card:hover::before {
    opacity: 1;
    animation: gradient-shift 3s ease infinite;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(90deg, #3B82F6, #8B5CF6);
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, #8B5CF6, #3B82F6);
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
}

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

/* 输入框样式 */
input[type="text"] {
    transition: all 0.3s ease;
    background-color: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(96, 165, 250, 0.3);
}

input[type="text"]:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

input[type="text"]::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    background: linear-gradient(90deg, #F8FAFC, #94A3B8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3B82F6, transparent);
    opacity: 0.6;
}

.highlight {
    background: linear-gradient(90deg, #3B82F6, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
}

.table-header {
    background-color: rgba(30, 41, 59, 0.5);
    color: #E2E8F0;
}

.table-header th {
    padding: 10px 5px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.table-row {
    transition: background-color 0.2s ease;
}

.table-row:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.table-row td {
    padding: 8px 5px;
    font-size: 0.875rem;
}

/* 股票图表容器 */
.stock-chart-container {
    width: 100%;
    height: 300px;
    position: relative;
    margin: 20px 0;
    border-radius: 1rem;
    overflow: hidden;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 粒子容器 */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* 粒子样式 */
.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.7;
    filter: blur(1px);
    z-index: 0;
}

/* 趋势线样式 */
.trend-line {
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 辉光效果 */
.glow-effect {
    filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.7));
    animation: pulse 2s infinite alternate;
}

/* 数据点样式 */
.data-point {
    filter: drop-shadow(0 0 3px rgba(59, 130, 246, 0.8));
}

/* 价格闪烁指示器 */
.price-flash {
    font-family: 'Roboto Mono', monospace;
    font-size: 10px;
    pointer-events: none;
    z-index: 2;
    animation: price-flash 1s ease-out forwards;
}

/* 分析模态框样式 */
#analysisModal {
    backdrop-filter: blur(8px);
}

#modalContent {
    border: 1px solid rgba(59, 130, 246, 0.3);
    background-color: rgba(15, 23, 42, 0.95);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(59, 130, 246, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6, #8B5CF6, #10B981);
    border-radius: 2px;
    width: 0;
    animation: progress-animation 1.2s ease-out forwards;
}

/* 分析内容样式 */
.analysis-content {
    background-color: rgba(30, 41, 59, 0.5);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

/* 动画效果 */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes progress-animation {
    0% { width: 0%; }
    20% { width: 15%; }
    40% { width: 35%; }
    60% { width: 60%; }
    80% { width: 85%; }
    100% { width: 100%; }
}

@keyframes pulse {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

@keyframes price-flash {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0; transform: scale(1); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .card {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .stock-chart-container {
        height: 250px;
    }
    
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .stock-chart-container {
        height: 200px;
    }
    
    .btn-primary {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    input[type="text"] {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.8);
}

/* 链接样式 */
a {
    color: #3B82F6;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #60A5FA;
    text-decoration: underline;
}

/* 工具提示样式 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(15, 23, 42, 0.95);
    color: #F8FAFC;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 50;
}

.tooltip:hover::after {
    opacity: 1;
}

/* 动画延迟类 */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

/* 加载动画 */
.loading-spinner {
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top: 3px solid #3B82F6;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

/* 图表容器样式增强 */
#priceFlash {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
}

/* 蜡烛图样式增强 */
.candlestick {
    transition: opacity 0.3s ease;
}

/* 渐变背景增强 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.15), transparent 40%),
                radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.15), transparent 40%);
    z-index: -1;
}

/* 辉光文本效果 */
.glow-text {
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* 卡片内容增强 */
.card-content {
    position: relative;
    z-index: 1;
}

/* Cookie Consent Popup Styles */
.cookie-popup {
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(59, 130, 246, 0.3);
}

.cookie-btn-accept {
    background: linear-gradient(90deg, #3B82F6, #8B5CF6);
    transition: all 0.3s ease;
    font-weight: 600;
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

.cookie-btn-decline {
    transition: all 0.3s ease;
    font-weight: 600;
}

.cookie-btn-decline:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Fade animations for cookie popup */
.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

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

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

/* Responsive adjustments for cookie popup */
@media (max-width: 768px) {
    .cookie-popup {
        padding: 1rem;
    }
    
    .cookie-popup .flex {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cookie-popup button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cookie-popup p {
        font-size: 0.875rem;
    }
    
    .cookie-popup button {
        padding: 0.75rem 2rem;
        font-size: 0.875rem;
    }
}