@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ==================== 现代设计系统 CSS变量 ==================== */
:root {
    /* 色彩系统 - 极夜蓝/科技深靛色系 */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary-color: #f1f5f9;
    --accent-color: #f59e0b;

    /* 背景体系 */
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f8fafc;

    /* 文本色体系 */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-inverse: #ffffff;

    /* 边框与分割线 */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* 投影体系 (Soft Shadows) */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 25px rgba(37, 99, 235, 0.1);

    /* 圆角体系 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-pill: 9999px;

    /* 过渡动画 */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== 仪表盘专用组件 (Dashboard Components) ==================== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.premium-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.premium-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-card-inner {
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.stat-card-icon {
    font-size: 2.5rem;
    position: absolute;
    right: 20px;
    top: 20px;
    opacity: 0.1;
    transition: all var(--transition-base);
}

.premium-card:hover .stat-card-icon {
    opacity: 0.2;
    transform: scale(1.1) rotate(-5deg);
}

.stat-card-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-top: 8px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.stat-card-subtext {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
    font-weight: 400;
}

/* 渐变配色 */
.accent-blue { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.accent-green { background: linear-gradient(90deg, #10b981, #34d399); }
.accent-cyan { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.accent-orange { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.text-blue { color: #2563eb !important; }
.text-green { color: #10b981 !important; }
.text-cyan { color: #06b6d4 !important; }
.text-orange { color: #f59e0b !important; }

/* 趋势图与表格卡片 */
.chart-container-card {
    padding: 24px;
    height: 100%;
}

.card-title-modern {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title-modern i {
    font-size: 1.3rem;
}

/* 极简表格 */
.minimalistic-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.minimalistic-table th {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    padding: 0 15px 10px;
    border: none;
}

.minimalistic-table td {
    background: #fdfdfd;
    padding: 15px;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.minimalistic-table td:first-child {
    border-left: 1px solid var(--border-light);
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.minimalistic-table td:last-child {
    border-right: 1px solid var(--border-light);
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.minimalistic-table tr:hover td {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.badge-new-data {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ==================== 全局重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* ==================== 顶部极简信息栏 ==================== */
.top-navbar {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-muted);
}

.top-navbar .top-links a {
    color: var(--text-muted);
    margin-right: 15px;
}

.top-navbar .top-links a:hover {
    color: var(--primary-color);
}

/* ==================== 主导航栏 (Glassmorphism 悬浮感) ==================== */
.main-navbar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-navbar .site-title h1 {
    font-size: 26px;
    color: var(--primary-color);
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-navbar .site-title .subtitle {
    font-size: 13px;
    color: var(--text-light);
    margin: 3px 0 0 0;
    font-weight: 500;
}

.main-navbar .nav-menu {
    display: flex;
    gap: 8px;
}

.main-navbar .nav-link {
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.main-navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px 3px 0 0;
    transition: width 0.3s ease;
    opacity: 0;
}

.main-navbar .nav-link:hover {
    color: var(--primary-color);
    background-color: var(--primary-light);
}

.main-navbar .nav-link.active {
    background-color: var(--primary-color);
    color: var(--text-inverse);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

/* ==================== 导航下拉菜单 (Navbar Dropdown) ==================== */
.nav-item-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu-custom {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    padding: 8px 0;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.nav-item-dropdown:hover .dropdown-menu-custom {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item-custom {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: var(--text-muted);
    font-size: 13px; /* 字体小一号 */
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.dropdown-item-custom:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

/* ==================== 三级嵌套菜单 (Tertiary Dropdown) ==================== */
.dropdown-submenu {
    position: relative;
}

.dropdown-menu-tertiary {
    position: absolute;
    top: -8px; /* 与父级项对齐 */
    left: 100%;
    margin-left: 0;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    padding: 8px 0;
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all var(--transition-base);
}

.dropdown-submenu:hover > .dropdown-menu-tertiary {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* 即使在三级菜单显示时，二级项右侧也保留间隙，防止鼠标滑出 */
.dropdown-submenu::after {
    content: '';
    position: absolute;
    top: 0;
    right: -15px;
    width: 15px;
    height: 100%;
    background: transparent;
}

/* 即使在下拉菜单显示时，主链接下方也保留一点间隙，防止鼠标滑出 */
.nav-item-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

/* ==================== 主要内容区域 ==================== */
.main-content {
    background-color: transparent;
    min-height: calc(100vh - 200px);
    padding: 30px 0 50px;
}

/* ==================== 搜索与筛选区域 (Glass & Pills) ==================== */
.search-section {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition-base);
}

.search-section:hover {
    box-shadow: var(--shadow-md);
}

.search-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}

.search-header h2 {
    font-size: 20px;
    color: var(--text-main);
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
}

.search-header h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 4px;
    margin-right: 12px;
}

/* 输入框与基础表单 */
.form-control,
.form-select,
.region-select,
.range-input {
    background-color: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: 15px;
    color: var(--text-main);
    transition: all var(--transition-base);
}

.form-control:focus,
.form-select:focus,
.region-select:focus,
.range-input:focus {
    background-color: var(--bg-surface);
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* 下拉箭头定制 */
.form-select,
.region-select {
    padding-right: 36px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

/* 按钮组 */
.btn-primary,
.btn-search-primary {
    background: linear-gradient(to right, var(--primary-color), #3b82f6);
    color: var(--text-inverse);
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    transition: all var(--transition-fast);
}

.btn-primary:hover,
.btn-search-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    color: #fff;
    text-decoration: none;
}

.btn-primary:active,
.btn-search-primary:active {
    transform: translateY(1px);
    box-shadow: none;
}

.btn-secondary,
.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-outline-primary:hover {
    background: var(--primary-light);
}

.btn-reset {
    background: var(--bg-page);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-reset:hover {
    background: var(--border-color);
    color: var(--text-main);
}

/* 高级搜索过滤药丸 (Pills) */
.btn-group-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 7px 18px;
    background-color: var(--bg-page);
    border: 1px solid transparent;
    color: var(--text-muted);
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    background-color: var(--border-color);
    color: var(--text-main);
}

.filter-btn.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: rgba(37, 99, 235, 0.3);
    font-weight: 600;
}

.search-item-full label {
    display: block;
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 15px;
}

.search-row {
    flex-wrap: wrap;
}

/* ==================== 数据列表与仪表盘卡片 (Cards) ==================== */
.dashboard-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    overflow: hidden;
    margin-bottom: 25px;
    transition: all var(--transition-base);
}

.dashboard-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.dashboard-header {
    background: linear-gradient(to right, #ffffff, #f8fafc);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 24px;
}

.dashboard-title {
    font-size: 18px;
    border-left: 4px solid var(--primary-color);
    border-radius: 2px;
}

/* 列表渲染 */
.list-items {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.list-item {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.list-item:hover {
    background-color: var(--bg-surface);
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.item-title {
    margin-bottom: 10px;
}

.item-title .title-link {
    color: var(--text-main);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.5;
    transition: color var(--transition-fast);
}

.item-title .title-link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.item-meta span {
    display: inline-flex;
    align-items: center;
    background: var(--bg-page);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-light);
}

.item-meta .item-date {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--text-light);
    font-weight: 500;
}

.item-meta .item-separator {
    display: none;
    /* 卡片模式下不需要竖线分割 */
}

.item-meta .item-type {
    color: var(--primary-color);
    background: var(--primary-light);
    border-color: rgba(37, 99, 235, 0.1);
    font-weight: 600;
}

.result-info {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding: 10px 20px;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.result-info strong {
    color: var(--primary-color);
    font-size: 18px;
    margin: 0 5px;
}

/* ==================== 分页控件 ==================== */
.pagination-wrapper {
    margin-top: 40px;
}

.pagination {
    display: flex;
    gap: 8px;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-weight: 500;
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.pagination .page-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.1);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    color: var(--text-inverse);
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.pagination .page-item.disabled .page-link {
    color: var(--text-light);
    background: var(--bg-page);
    box-shadow: none;
    cursor: not-allowed;
}

/* ==================== 页脚与悬浮件 ==================== */
.main-footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
    padding: 40px 0;
}

.main-footer .footer-content {
    color: var(--text-muted);
}

/* QQ Box 升级 */
.qq-contact-box {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.qq-number {
    text-shadow: none;
    color: #38bdf8;
}

/* ==================== 响应式适配 (App与手机端) ==================== */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    .main-navbar .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        padding-top: 15px !important;
        padding-bottom: 10px !important;
    }

    .main-navbar .site-title {
        margin-bottom: 12px;
        width: 100%;
        text-align: center;
    }

    .main-navbar .site-title h1 {
        font-size: 22px;
    }

    .main-navbar .site-title .subtitle {
        font-size: 12px;
    }

    .main-navbar .nav-menu {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        gap: 5px;
        justify-content: flex-start;
    }

    /* Hide scrollbar for nav-menu */
    .main-navbar .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .main-navbar .nav-menu {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .main-navbar .nav-link {
        white-space: nowrap;
        padding: 6px 14px;
        font-size: 14px;
        flex-shrink: 0;
    }

    .search-section {
        padding: 15px;
        border-radius: var(--radius-md);
        margin-bottom: 20px;
    }

    .search-row>div {
        flex-direction: column;
        align-items: stretch !important;
        width: 100%;
        gap: 10px;
    }

    .search-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .search-item>div {
        width: 100% !important;
    }

    .list-item {
        padding: 15px;
    }

    .item-title .title-link {
        font-size: 15px;
    }

    .item-meta {
        gap: 6px;
    }

    .item-meta span {
        font-size: 11px;
        padding: 2px 6px;
    }

    .btn-group-filter {
        gap: 6px;
    }

    .filter-btn {
        flex: 1 1 calc(33.333% - 6px);
        text-align: center;
        padding: 6px 8px;
        font-size: 13px;
    }

    .dashboard-header {
        padding: 12px 15px;
    }

    .dashboard-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .filter-btn {
        flex: 1 1 calc(50% - 6px);
    }

    .top-navbar {
        display: none;
        /* 手机端隐藏顶部的欢迎和QQ栏，节省空间 */
    }
}

/* ==================== 共享仪表盘卡片样式 ==================== */
.dashboard-card {
    margin-bottom: 2rem;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dashboard-header {
    background-color: #fff;
    border-bottom: 2px solid #f0f2f5;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0;
    color: #333;
    border-left: 4px solid #0d6efd;
    padding-left: 10px;
}

.btn-more {
    font-size: 0.9rem;
    color: #666;
    text-decoration: none;
}

.btn-more:hover {
    color: #0d6efd;
}