:root {
    --primary-bg: #0a0a1f;
    --secondary-bg: #1a1a2e;
    --card-bg: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --text-primary: #ffffff;
    --text-secondary: #e5e5e5;
    --text-muted: #9ca3af;
    --border-color: #2a2a4a;
    --glass-bg: rgba(255, 255, 255, 0.02);
}

* {
    box-sizing: border-box;
}

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; 
    background: linear-gradient(135deg, var(--primary-bg) 0%, #0f0f23 50%, var(--secondary-bg) 100%);
    color: var(--text-secondary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 粒子画布样式 */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    pointer-events: none;
}

/* 确保内容在背景之上 */
.container {
    position: relative;
    z-index: 10;
}

/* Glass Card System */
.glass-card {
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.8) 0%, rgba(22, 33, 62, 0.8) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #065f46 0%, #0f766e 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 1.2rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    50% { transform: translate(-50%, -50%) rotate(180deg); }
}

.hero-title {
    font-size: clamp(1.25rem, 3vw, 1.8rem);
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center; 
    gap: 0.75rem;
    white-space: nowrap; /* MODIFIED: Prevents the title from wrapping to the next line */
}

.hero-title img {
    height: 2.5rem;
    width: auto;
    flex-shrink: 0;
}

/* Control Panel */
.control-panel {
    padding: 1.2rem;
    display: grid;
    grid-template-columns: 1fr; /* Mobile: single column */
    gap: 1rem;
}

@media (min-width: 768px) {
    .control-panel {
        grid-template-columns: 1fr auto 1fr; /* Desktop: 3 columns */
        align-items: center;
    }
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.kpi-card {
    background: linear-gradient(145deg, rgba(31, 41, 55, 0.8) 0%, rgba(55, 65, 81, 0.8) 100%);
    border: 1px solid #4b5563;
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.kpi-card:hover::before {
    left: 100%;
}

.kpi-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
}

.kpi-title { 
    color: var(--text-primary) !important;
    font-size: 0.9rem !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.kpi-value { 
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 400; /* Regular font weight */
    line-height: 1.2;
}

.kpi-value.kpi-value-bold {
    font-weight: 800; /* Bold font weight */
}
.kpi-value.kpi-value-green {
    color: var(--accent-green);
}
.kpi-value.kpi-value-red {
    color: var(--accent-red);
}
.kpi-value.kpi-value-neutral {
    color: var(--text-primary);
}

/* Chart Container */
.chart-container {
    padding: 1.5rem;
    height: 420px;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-title::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: var(--accent-blue);
    border-radius: 2px;
}

/* Signals Table */
.signals-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
}

.signals-header {
    background: linear-gradient(90deg, rgba(51, 65, 85, 0.8) 0%, rgba(71, 85, 105, 0.8) 100%);
    padding: 1.2rem;
    border-bottom: 1px solid #475569;
    flex-shrink: 0;
}

.signals-content {
    flex: 1;
    overflow: auto;
    padding: 0;
}

.signals-table {
    width: 100%;
    border-collapse: collapse;
}

.signals-table th {
    background: rgba(75, 85, 99, 0.5);
    color: var(--text-secondary);
    text-align: left;
    padding: 1rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

.signals-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: background-color: 0.2s;
}

.signals-table tr:hover td {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
}

/* Marquee Section */
.marquee-container {
    background: linear-gradient(145deg, rgba(31, 41, 55, 0.8) 0%, rgba(55, 65, 81, 0.8) 100%);
    border: 1px solid #4b5563;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
}

.marquee-content {
    display: flex;
    animation: marquee 12s linear infinite;
    white-space: nowrap;
}

.marquee-content:hover {
    animation-play-state: paused;
}

.marquee-item {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    margin-right: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ROI Calculator */
.roi-calculator {
    background: linear-gradient(145deg, rgba(19, 78, 74, 0.8) 0%, rgba(15, 118, 110, 0.8) 100%);
    border: 1px solid #14b8a6;
    padding: 1.5rem;
    position: relative;
}

.roi-calculator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(20, 184, 166, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Form Controls */
.form-select, .form-input {
    background: linear-gradient(145deg, rgba(55, 65, 81, 0.8) 0%, rgba(75, 85, 99, 0.8) 100%);
    border: 1px solid #6b7280;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-select:focus, .form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 
        0 0 0 3px rgba(59, 130, 246, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-select option {
    background-color: #374151;
    color: var(--text-secondary);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #1d4ed8 100%);
    border: 1px solid #2563eb;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

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

/* Animations */
.highlight-latest { 
    animation: pulse-glow 2s ease-in-out infinite; 
}

@keyframes pulse-glow { 
    0%, 100% { 
        background: linear-gradient(90deg, rgba(59, 130, 246, 0.2) 0%, rgba(16, 185, 129, 0.2) 100%);
    } 
    50% { 
        background: linear-gradient(90deg, rgba(16, 185, 129, 0.3) 0%, rgba(59, 130, 246, 0.3) 100%);
    }
}

.status-updating {
    color: var(--accent-red);
    animation: blink-animation 1.2s infinite;
}

@keyframes blink-animation {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.action-buy {
    color: var(--accent-green) !important;
    font-weight: 700 !important;
}

.action-sell {
    color: var(--accent-red) !important;
    font-weight: 700 !important;
}

/* Responsive Design */
@media (max-width: 767px) { /* Changed from 640px to 767px for better control panel stacking */
    .container {
        padding: 0.8rem;
    }

    .glass-card {
        border-radius: 12px;
        margin-bottom: 0.8rem;
    }
    
    .hero-section {
        padding: 1rem; 
        margin-bottom: 1rem;
    }

    .hero-title {
        flex-direction: row;
        gap: 0.5rem;
        font-size: clamp(1rem, 2.5vw, 1.5rem);
    }

    .hero-title img {
        height: 32px;
    }

    .chart-container {
        padding: 1rem;
        height: 280px;
    }

    .kpi-card {
        padding: 1rem;
    }

    .signals-table th,
    .signals-table td {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .form-select, .form-input {
        font-size: 0.875rem;
        padding: 0.625rem;
    }

    .roi-calculator {
        padding: 1rem;
    }

    .marquee-container {
        padding: 0.8rem;
    }

    .marquee-item {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
        margin-right: 1rem;
    }

    .marquee-content {
        animation: marquee 8s linear infinite;
    }
}

.language-switcher a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.language-switcher a:hover {
    color: white;
}

.language-switcher a.active {
    color: white;
    font-weight: 700;
}

.login-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.login-links a:hover {
    color: white;
}

.loading-spinner {
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top: 2px solid var(--accent-blue);
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

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

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container::-webkit-scrollbar {
    height: 6px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 3px;
}

.footer-card {
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.8) 0%, rgba(22, 33, 62, 0.8) 100%);
    border: 1px solid rgba(42, 42, 74, 0.5);
    backdrop-filter: blur(20px);
}

/* Star Rating */
.star-rating { 
    flex-direction: row-reverse; 
    justify-content: flex-end; 
}
.star-rating input[type="radio"]:checked ~ label,
.star-rating:not(:checked) > label:hover,
.star-rating:not(:checked) > label:hover ~ label { 
    color: #facc15; 
}

/* Clickable Reviews */
.clickable-reviews {
    cursor: pointer;
    transition: color 0.3s ease;
}

.clickable-reviews:hover {
    color: var(--accent-blue);
}

/* === Override for top header (hero-section) === */
.hero-section {
    padding: 0.6rem !important;   /* 蓋掉 Tailwind padding */
    margin-bottom: 1rem !important;
    gap: 0.3rem !important;       /* 減少間距 */
}

.hero-title {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem) !important; /* 更小字體 */
}

.hero-title img {
    height: 2rem !important;    /* 蓋掉 Tailwind h-10 */
    width: auto !important;
}
