/* ========================================
   H-Shares Theme - H股资讯
   ======================================== */

/* CSS Variables */
:root {
    --primary: #1e3a8a;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --accent-red: #dc2626;
    --accent-green: #16a34a;
    --bg: #f8fafc;
    --bg-white: #ffffff;
    --bg-light: #f1f5f9;
    --text: #0f172a;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.3s ease;
    --transition-fast: all 0.2s ease;
    --max-width: 1280px;
    --header-height: 80px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 15px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Top Bar
   ======================================== */
.top-bar {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

/* ========================================
   Main Header & Navigation
   ======================================== */
.main-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .navbar {
    padding: 0;
    height: var(--header-height);
}

/* Logo */
.navbar-brand {
    padding: 0;
    margin-right: 2rem;
}

.logo-icon {
    color: #fff;
    background: rgba(255,255,255,0.15);
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
}
.logo-icon img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
}
.logo.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.logo-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 0.75rem;
    font-weight: 400;
}

/* Navigation Links */
.navbar-nav {
    gap: 0.5rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: rgba(255,255,255,0.85) !important;
    padding: 0.75rem 1.25rem !important;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.1);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--accent);
    border-radius: 3px 3px 0 0;
    transition: var(--transition-fast);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
}

.nav-icon {
    display: flex;
    align-items: center;
}

/* Dropdown */
.dropdown-toggle::after {
    border: none;
    width: auto;
    height: auto;
    margin-left: 0.25rem;
    font-family: 'Material Design Icons';
    content: '';
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E") no-repeat center;
    width: 16px;
    height: 16px;
    opacity: 0.7;
    transition: var(--transition-fast);
}

.dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
    opacity: 1;
}

.dropdown-menu {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-width: 200px;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    color: var(--text);
    font-weight: 500;
    transition: var(--transition-fast);
}

.dropdown-item:hover,
.dropdown-item.active {
    background: var(--bg-light);
    color: var(--primary);
}

/* Mega Menu */
.mega-dropdown {
    position: static;
}

.mega-menu {
    width: 100%;
    left: 0;
    right: 0;
    padding: 2rem 0;
    border: none;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    box-shadow: var(--shadow-xl);
    margin-top: 0;
}

.mega-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--bg-white);
    border: 1px solid var(--border);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.mega-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.mega-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mega-content h6 {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text);
}

/* Search Button */
.btn-search {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    border: 1px solid rgba(255,255,255,0.15);
}

.btn-search:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

/* Mobile Toggle */
.navbar-toggler {
    padding: 0.5rem;
    color: #fff;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' fill='white' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    min-height: calc(100vh - var(--header-height) - 400px);
    padding: 0;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
}

.footer-title {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-light);
    border-radius: 3px;
}
.footer-links {
    list-style: none;
    padding: 0;
}
.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.footer-links a::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--primary-light);
    border-radius: 50%;
    opacity: 0;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: #fff;
    padding-left: 0.5rem;
}

.footer-links a:hover::before {
    opacity: 1;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    border: 1px solid rgba(255,255,255,0.1);
}

.social-link:hover {
    background: var(--primary-light);
    transform: translateY(-3px);
    border-color: var(--primary-light);
}

/* Footer Form */
.footer-form .form-control {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 0.75rem 1rem;
}

.footer-form .form-control::placeholder {
    color: rgba(255,255,255,0.5);
}

.footer-form .form-control:focus {
    background: rgba(255,255,255,0.15);
    border-color: var(--primary-light);
    box-shadow: none;
    color: #fff;
}

.footer-form .btn {
    padding: 0.75rem 1.25rem;
}

/* ========================================
   Cards
   ======================================== */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    transition: var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   Badges
   ======================================== */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
    border-radius: var(--radius-sm);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 991.98px) {
    :root {
        --header-height: 70px;
    }
    
    .navbar-collapse {
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        padding: 1rem;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        margin-top: 0.5rem;
        box-shadow: var(--shadow-lg);
    }
    
    .navbar-nav {
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.625rem 1rem !important;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .mega-menu {
        position: static;
        width: 100%;
        padding: 1rem;
        box-shadow: none;
        background: rgba(0,0,0,0.2);
    }
    
    .mega-item {
        margin-bottom: 0.75rem;
    }
    
    .navbar-actions {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
}

@media (max-width: 767.98px) {
    .top-bar .row > div:first-child {
        display: none;
    }
    
    .logo-subtitle {
        display: none !important;
    }
    
    .footer-top .row > div {
        margin-bottom: 2rem;
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

/* ========================================
   Utility Classes
   ======================================== */
.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 60%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-title span {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.hero-desc {
    font-size: 1.125rem;
    opacity: 0.8;
    margin-bottom: 2rem;
    max-width: 500px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.hero-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius);
    transition: var(--transition-fast);
}

.hero-actions .btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: #fff;
}

.hero-actions .btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

.hero-actions .btn-outline-light {
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.05);
}

.hero-actions .btn-outline-light:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

.hero-stats {
    display: flex;
    justify-content: flex-end;
    gap: 2.5rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.1);
    min-width: 100px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.7;
    color: #fff;
}

@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-title span {
        font-size: 1.25rem;
    }
    
    .hero-stats {
        justify-content: flex-start;
        margin-top: 2rem;
        gap: 1rem;
    }
    
    .stat-item {
        flex: 1;
        min-width: auto;
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero-stats {
        flex-direction: column;
    }
}
