/* ============================================
   AI安全动态追踪系统 - 主样式表
   Color: #1B2A4A (深海军蓝), #008CD4 (科技蓝)
   ============================================ */

:root {
    --primary-dark: #1B2A4A;
    --primary-blue: #008CD4;
    --primary-light: #E8F4FD;
    --bg-main: #F5F7FA;
    --bg-white: #FFFFFF;
    --text-primary: #1B2A4A;
    --text-secondary: #5A6B87;
    --text-muted: #8899B4;
    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(27, 42, 74, 0.08);
    --shadow-md: 0 4px 12px rgba(27, 42, 74, 0.1);
    --shadow-lg: 0 8px 24px rgba(27, 42, 74, 0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --tag-product: #E8F4FD;
    --tag-tech: #EDE9FE;
    --tag-solution: #FEF3C7;
    --tag-opinion: #FCE7F3;
    --tag-product-text: #008CD4;
    --tag-tech-text: #7C3AED;
    --tag-solution-text: #D97706;
    --tag-opinion-text: #DB2777;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== Header ===== */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    flex-shrink: 0;
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 0.5px;
}

.logo-text span {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-main);
    padding: 4px;
    border-radius: var(--radius-md);
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-tab:hover {
    color: var(--primary-dark);
    background: rgba(0, 140, 212, 0.05);
}

.nav-tab.active {
    background: var(--bg-white);
    color: var(--primary-blue);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* ===== Main Content ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 60px;
}

.panel {
    display: none;
}

.panel.active {
    display: block;
}

/* ===== Panel Header ===== */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.panel-info h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.panel-info .subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.panel-stats {
    display: flex;
    gap: 12px;
}

.stat-badge {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    text-align: center;
    min-width: 100px;
    box-shadow: var(--shadow-sm);
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Filter Bar ===== */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 10px;
}

.filter-select {
    padding: 8px 32px 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A6B87' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 140, 212, 0.1);
}

.filter-date-input {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 13px;
}

.filter-date-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 140, 212, 0.1);
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 13px;
    min-width: 200px;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 140, 212, 0.1);
}

.search-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-btn:hover {
    background: #0078B8;
}

.search-btn:active {
    transform: scale(0.98);
}

/* ===== Tracking List ===== */
.tracking-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 15px;
}

/* ===== Tracking Table ===== */
.tracking-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    background: var(--bg-white);
}

.tracking-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
    background: var(--bg-white);
}

/* 列宽分配（8 列，合计 100%）——固定布局，避免内容撑破版面 */
.tracking-table th:nth-child(1) { width: 5%; }   /* 序号 */
.tracking-table th:nth-child(2) { width: 16%; }  /* 名称 */
.tracking-table th:nth-child(3) { width: 7%; }   /* 类别 */
.tracking-table th:nth-child(4) { width: 27%; }  /* 主要功能及特点 */
.tracking-table th:nth-child(5) { width: 9%; }   /* 推出时间 */
.tracking-table th:nth-child(6) { width: 14%; }  /* 机构 */
.tracking-table th:nth-child(7) { width: 13%; }  /* 机构类别 */
.tracking-table th:nth-child(8) { width: 9%; }   /* 原文链接 */

.tracking-table th {
    background: var(--primary-blue);
    color: #fff;
    padding: 12px 10px;
    text-align: left;
    font-weight: 500;
    font-size: 12px;
    white-space: nowrap;
}

.tracking-table td {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.tracking-table tr:hover {
    background: #f8f9ff;
}

.tracking-table .seq {
    width: 40px;
    text-align: center;
    color: var(--text-secondary);
}

.tracking-table .name {
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.tracking-table .summary {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.tracking-table .date {
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 12px;
}

.tracking-table .org {
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-primary);
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.tracking-table .cat-badge,
.tracking-table .org-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
}

.tracking-table .link {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 12px;
    white-space: nowrap;
}

.tracking-table .link:hover {
    text-decoration: underline;
}

/* ===== Load More ===== */
.load-more-container {
    text-align: center;
    margin-top: 28px;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 36px;
    background: var(--bg-white);
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-load-more:hover:not(:disabled) {
    background: var(--primary-blue);
    color: white;
}

.btn-load-more:hover:not(:disabled) .remaining-hint {
    color: rgba(255, 255, 255, 0.7);
}

.btn-load-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-load-more .remaining-hint {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

/* ===== Reports Panel ===== */
.report-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.report-tab {
    padding: 10px 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.report-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-blue);
    transform: scaleX(0);
    transition: transform 0.2s;
}

.report-tab.active {
    color: var(--primary-blue);
    font-weight: 600;
}

.report-tab.active::after {
    transform: scaleX(1);
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.report-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.report-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.report-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

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

.report-icon.weekly {
    background: #E8F4FD;
    color: var(--primary-blue);
}

.report-icon.monthly {
    background: #EDE9FE;
    color: #7C3AED;
}

.report-details h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.report-details p {
    font-size: 13px;
    color: var(--text-muted);
}

.report-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.btn-view, .btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-view {
    background: var(--primary-blue);
    color: white;
    border: none;
}

.btn-view:hover {
    background: #0078B8;
}

.btn-download {
    background: var(--bg-white);
    color: var(--primary-blue);
    border: 1.5px solid var(--primary-blue);
}

.btn-download:hover {
    background: var(--primary-light);
}

/* ===== Hot Topics / Trends ===== */
.hot-section {
    margin-top: 24px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
}

.hot-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hot-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hot-item {
    padding: 14px 16px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-blue);
}

.hot-item .hot-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hot-item .hot-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(27, 42, 74, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    max-width: 900px;
    max-height: 85vh;
    margin: 40px auto;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-main);
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #FEE2E2;
    color: #DC2626;
}

#modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

#modal-body iframe {
    width: 100%;
    height: 70vh;
    border: none;
    border-radius: var(--radius-sm);
}

/* ===== TOP 10 Section ===== */
.top10-section {
    margin-top: 24px;
}

.top10-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top10-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.top10-item:hover {
    background: var(--primary-light);
}

.top10-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.top10-rank.gold {
    background: #F59E0B;
}

.top10-rank.silver {
    background: #94A3B8;
}

.top10-rank.bronze {
    background: #D97706;
}

.top10-info {
    flex: 1;
}

.top10-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 2px;
}

.top10-info p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 15px;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-white);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 14px;
        padding: 14px 16px;
    }

    .logo-text h1 {
        font-size: 17px;
    }

    .nav-tabs {
        width: 100%;
    }

    .nav-tab {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
    }

    .main-content {
        padding: 16px 16px 60px;
    }

    .panel-header {
        flex-direction: column;
        gap: 12px;
    }

    .panel-stats {
        width: 100%;
    }

    .stat-badge {
        flex: 1;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select {
        flex: 1;
    }

    .search-box {
        width: 100%;
    }

    .search-input {
        flex: 1;
    }

    .search-btn {
        flex-shrink: 0;
    }

    .report-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .report-actions {
        width: 100%;
    }

    .btn-view, .btn-download {
        flex: 1;
        justify-content: center;
    }
}
