/* AI资讯网站样式文件 */

:root {
    --ai-font-ui: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --ai-font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, "Courier New", monospace;

    --ai-bg-page: #ffffff;
    --ai-bg-muted: #f3f4f6;
    --ai-bg-surface: #ffffff;
    --ai-bg-soft: #f9fafb;

    --ai-text-primary: #111827;
    --ai-text-secondary: #374151;
    --ai-text-muted: #6b7280;

    --ai-border: #e5e7eb;
    --ai-border-strong: #cbd5e1;

    --ai-brand-500: #667eea;
    --ai-brand-600: #5b6fd9;
    --ai-brand-700: #4c63cf;
    --ai-accent-500: #764ba2;
    --ai-success-500: #10b981;
    --ai-success-600: #059669;
    --ai-danger-500: #ef4444;

    --ai-radius-sm: 8px;
    --ai-radius-md: 12px;
    --ai-radius-lg: 16px;
    --ai-radius-pill: 999px;

    --ai-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --ai-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --ai-shadow-brand: 0 8px 24px rgba(102, 126, 234, 0.22);

    --ai-gradient-brand: linear-gradient(135deg, var(--ai-brand-500) 0%, var(--ai-accent-500) 100%);
}

html,
body {
    font-family: var(--ai-font-ui);
    color: var(--ai-text-primary);
}

/* Tailwind CDN 不可用时的最小兜底样式（仅作用于 news.html） */
.tw-fallback .hidden { display: none !important; }
.tw-fallback .block { display: block !important; }
.tw-fallback .flex { display: flex !important; }
.tw-fallback .flex-1 { flex: 1 1 0% !important; }
.tw-fallback .flex-shrink-0 { flex-shrink: 0 !important; }
.tw-fallback .items-center { align-items: center !important; }
.tw-fallback .justify-between { justify-content: space-between !important; }
.tw-fallback .justify-center { justify-content: center !important; }
.tw-fallback .min-w-0 { min-width: 0 !important; }
.tw-fallback .w-full { width: 100% !important; }
.tw-fallback .w-auto { width: auto !important; }
.tw-fallback .w-48 { width: 12rem !important; }
.tw-fallback .w-56 { width: 14rem !important; }
.tw-fallback .h-12 { height: 3rem !important; }
.tw-fallback .h-16 { height: 4rem !important; }
.tw-fallback .mx-auto { margin-left: auto !important; margin-right: auto !important; }
.tw-fallback .ml-8 { margin-left: 2rem !important; }
.tw-fallback .ml-16 { margin-left: 4rem !important; }
.tw-fallback .mr-2 { margin-right: 0.5rem !important; }
.tw-fallback .mb-2 { margin-bottom: 0.5rem !important; }
.tw-fallback .mb-3 { margin-bottom: 0.75rem !important; }
.tw-fallback .mb-4 { margin-bottom: 1rem !important; }
.tw-fallback .mb-6 { margin-bottom: 1.5rem !important; }
.tw-fallback .mt-2 { margin-top: 0.5rem !important; }
.tw-fallback .mt-6 { margin-top: 1.5rem !important; }
.tw-fallback .p-1 { padding: 0.25rem !important; }
.tw-fallback .p-4 { padding: 1rem !important; }
.tw-fallback .px-3 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
.tw-fallback .px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.tw-fallback .py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.tw-fallback .py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.tw-fallback .py-8 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
.tw-fallback .py-12 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.tw-fallback .pt-2 { padding-top: 0.5rem !important; }
.tw-fallback .pb-3 { padding-bottom: 0.75rem !important; }
.tw-fallback .pr-2 { padding-right: 0.5rem !important; }
.tw-fallback .top-8 { top: 2rem !important; }
.tw-fallback .sticky { position: sticky !important; }
.tw-fallback .gap-8 { gap: 2rem !important; }
.tw-fallback .space-x-1 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.25rem !important; }
.tw-fallback .space-x-2 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.5rem !important; }
.tw-fallback .space-x-4 > :not([hidden]) ~ :not([hidden]) { margin-left: 1rem !important; }
.tw-fallback .space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem !important; }
.tw-fallback .space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem !important; }
.tw-fallback .max-w-7xl { max-width: 80rem !important; }
.tw-fallback .max-h-\[600px\] { max-height: 600px !important; }
.tw-fallback .overflow-y-auto { overflow-y: auto !important; }
.tw-fallback .rounded-md { border-radius: 0.375rem !important; }
.tw-fallback .rounded-lg { border-radius: 0.5rem !important; }
.tw-fallback .border { border-width: 1px !important; border-style: solid !important; }
.tw-fallback .border-t { border-top-width: 1px !important; border-top-style: solid !important; }
.tw-fallback .border-gray-300 { border-color: #d1d5db !important; }
.tw-fallback .bg-white { background-color: #ffffff !important; }
.tw-fallback .bg-gray-50 { background-color: #f9fafb !important; }
.tw-fallback .bg-gray-100 { background-color: #f3f4f6 !important; }
.tw-fallback .bg-gray-200 { background-color: #e5e7eb !important; }
.tw-fallback .bg-blue-600 { background-color: #2563eb !important; }
.tw-fallback .text-center { text-align: center !important; }
.tw-fallback .text-white { color: #ffffff !important; }
.tw-fallback .text-gray-500 { color: #6b7280 !important; }
.tw-fallback .text-gray-600 { color: #4b5563 !important; }
.tw-fallback .text-gray-700 { color: #374151 !important; }
.tw-fallback .text-gray-900 { color: #111827 !important; }
.tw-fallback .text-blue-600 { color: #2563eb !important; }
.tw-fallback .font-sans { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif !important; }
.tw-fallback .font-medium { font-weight: 500 !important; }
.tw-fallback .font-bold { font-weight: 700 !important; }
.tw-fallback .text-sm { font-size: 0.875rem !important; line-height: 1.25rem !important; }
.tw-fallback .text-lg { font-size: 1.125rem !important; line-height: 1.75rem !important; }
.tw-fallback .text-xl { font-size: 1.25rem !important; line-height: 1.75rem !important; }
.tw-fallback .text-2xl { font-size: 1.5rem !important; line-height: 2rem !important; }
.tw-fallback .text-4xl { font-size: 2.25rem !important; line-height: 2.5rem !important; }
.tw-fallback .shadow-md { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important; }
.tw-fallback .shadow-lg { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important; }
.tw-fallback .transition-colors { transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease !important; }
.tw-fallback .hover\:bg-white:hover { background-color: #ffffff !important; }
.tw-fallback .hover\:bg-blue-600:hover { background-color: #2563eb !important; }
.tw-fallback .hover\:text-white:hover { color: #ffffff !important; }
.tw-fallback .hover\:text-gray-600:hover { color: #4b5563 !important; }
.tw-fallback .hover\:text-gray-900:hover { color: #111827 !important; }

@media (min-width: 640px) {
    .tw-fallback .sm\:px-6 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
}
@media (min-width: 768px) {
    .tw-fallback .md\:hidden { display: none !important; }
    .tw-fallback .md\:block { display: block !important; }
}
@media (min-width: 1024px) {
    .tw-fallback .lg\:hidden { display: none !important; }
    .tw-fallback .lg\:block { display: block !important; }
    .tw-fallback .lg\:px-8 { padding-left: 2rem !important; padding-right: 2rem !important; }
}
@media (min-width: 1280px) {
    .tw-fallback .xl\:block { display: block !important; }
}

.gradient-bg {
    background: var(--ai-gradient-brand);
}

/* 词云样式 */
.keyword-wall {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: transparent;
    padding: 5px;
}

.hot-title {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 20px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 15;
    pointer-events: none;
    white-space: nowrap;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.keyword-tag {
    position: absolute;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    user-select: none;
    white-space: nowrap;
    opacity: 0;
    animation: fadeInScale 0.8s ease-out forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.keyword-tag:hover {
    color: #fbbf24;
    transform: scale(1.1);
    text-shadow: 0 4px 12px rgba(251, 191, 36, 0.6);
}

/* 词云字体大小现在通过JavaScript动态设置，不再使用CSS类 */

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.fade-in {
    animation: fadeIn 0.6s ease-in;
}

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

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 滚动交互样式 */
.nav-container {
    transition: all 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-simplified {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ai-border);
    box-shadow: var(--ai-shadow-sm);
}

.nav-simplified .nav-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    padding: 0 20px;
}

.nav-tabs {
    display: flex;
    gap: 0;
    background: var(--ai-bg-soft);
    border-radius: var(--ai-radius-sm);
    padding: 4px;
}

.nav-tab {
    padding: 8px 24px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: var(--ai-text-muted);
}

.nav-tab.active {
    background: var(--ai-bg-surface);
    color: var(--ai-text-primary);
    box-shadow: var(--ai-shadow-sm);
}

.nav-tab:hover {
    color: var(--ai-text-primary);
}

/* 现代化导航样式 */
.modern-nav {
    position: relative;
    overflow: hidden;
}

.nav-link {
    position: relative;
    display: inline-block;
    padding: 12px 20px;
    color: var(--ai-text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: var(--ai-radius-sm);
    margin: 0 4px;
}

.nav-link:hover {
    color: var(--ai-text-primary);
    background: rgba(102, 126, 234, 0.12);
    transform: translateY(-2px);
}

.nav-link.active {
    color: var(--ai-text-primary);
    background: rgba(102, 126, 234, 0.18);
    box-shadow: var(--ai-shadow-brand);
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--ai-gradient-brand);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 80%;
}

.mobile-nav-link {
    display: block;
    padding: 12px 16px;
    color: var(--ai-text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: var(--ai-radius-sm);
    margin: 4px 0;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--ai-text-primary);
    background: rgba(102, 126, 234, 0.12);
}

.back-button {
    background: var(--ai-brand-600);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--ai-radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.back-button:hover {
    background: var(--ai-brand-700);
}

.content-section {
    margin-top: 64px;
}

.hot-keywords {
    background: var(--ai-gradient-brand);
    color: #ff6b9d;
    padding: 10px 0 10px 0;
    margin-top: 30px;
    margin-bottom: 0px;
    position: relative;
    overflow: hidden;
}

.hot-keywords::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

@media (max-width: 768px) {
    .keyword-wall {
        height: 250px;
        min-height: 200px;
        padding: 3px;
    }
}

.keyword-item {
    position: absolute;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    border-radius: 4px;
    padding: 2px 6px;
    margin: 2px;
}

.keyword-item:hover {
    transform: scale(1.1);
    z-index: 10;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.keyword-large {
    font-size: 26px;
    color: #ff6b9d;
}

.keyword-medium {
    font-size: 20px;
    color: #ff8fab;
}

.keyword-small {
    font-size: 16px;
    color: #ffa8c5;
}

.keyword-tiny {
    font-size: 14px;
    color: #ffc1d9;
}

.corner-title {
    position: absolute;
    top: 10px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.news-section {
    background: var(--ai-bg-surface);
    border-radius: var(--ai-radius-md);
    box-shadow: var(--ai-shadow-md);
    overflow: hidden;
    margin-bottom: 30px;
}

.news-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 20px 30px;
    border-bottom: 1px solid var(--ai-border);
}

.news-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.news-subtitle {
    color: #64748b;
    font-size: 14px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.filter-tab {
    padding: 8px 16px;
    border-radius: var(--ai-radius-pill);
    background: var(--ai-bg-surface);
    border: 1px solid var(--ai-border);
    color: var(--ai-text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tab.active {
    background: var(--ai-brand-600);
    color: white;
    border-color: var(--ai-brand-600);
}

.filter-tab:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.filter-tab.active:hover {
    background: var(--ai-brand-700);
}

.history-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.history-button {
    padding: 6px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--ai-radius-sm);
    color: var(--ai-text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-button:hover {
    background: #e2e8f0;
    color: #475569;
}

.history-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.date-links {
    display: flex;
    gap: 4px;
    margin: 0 8px;
}

.date-link {
    padding: 4px 8px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #64748b;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.date-link:hover:not(.disabled) {
    background: #f1f5f9;
    color: #475569;
}

.date-link.active {
    background: var(--ai-brand-600);
    color: white;
    border-color: var(--ai-brand-600);
}

.date-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 每周资讯筛选样式 */
.filter-button {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.filter-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-button.active {
    border-color: var(--ai-brand-600);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.22);
}

.weekly-filter-section {
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 1.5rem;
}

.weekly-filter-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    padding: 30px;
}

@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }
}

.article-card {
    background: var(--ai-bg-surface);
    border-radius: var(--ai-radius-md);
    box-shadow: var(--ai-shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--ai-border);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ai-shadow-md);
}

.article-header {
    padding: 20px 20px 0 20px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.article-category {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.category-tech { background: #dbeafe; color: #1e40af; }
.category-business { background: #dcfce7; color: #166534; }
.category-research { background: #fef3c7; color: #92400e; }
.category-ai { background: #fce7f3; color: #be185d; }
.category-other { background: #f3f4f6; color: #374151; }

.article-country {
    padding: 2px 6px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 11px;
    color: #64748b;
}

.article-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 12px;
}

.article-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-title a:hover {
    color: var(--ai-brand-600);
}

.article-keyinfo {
    background: #fef2f2;
    border-left: 4px solid #f87171;
    padding: 12px;
    margin: 12px 0;
    border-radius: 0 6px 6px 0;
}

.article-keyinfo-text {
    color: #dc2626;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
}

.article-summary {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.article-footer {
    padding: 0 20px 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-stats {
    color: #94a3b8;
    font-size: 12px;
}

.article-read-more {
    color: var(--ai-brand-600);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-read-more:hover {
    color: var(--ai-brand-700);
}

.footer {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 60px 0 30px 0;
    margin-top: 80px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #f8fafc;
}

.footer-section p {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #f8fafc;
}

.footer-bottom {
    border-top: 1px solid #475569;
    padding-top: 20px;
    text-align: center;
    color: #94a3b8;
}

.social-links {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
}

/* 底部栏层级设置 - 确保在所有固定元素之上 */
footer {
    z-index: 1000 !important;
    position: relative;
}

/* 通用底部容器层级设置 */
#footer-container {
    z-index: 1000 !important;
    position: relative;
}
