/*
 * Refactored resources page styles
 * Consistent design style with index.html
 */

/* Base styles inherited from index.html */
:root {
    --primary-color: #4f46e5;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --footer-bg: #1f2937;
    --footer-text: #d1d5db;
    --footer-link: #9ca3af;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --border-radius-sm: 0.25rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --container-max-width: 1200px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Navigation styles - consistent with index.html */
.modern-nav {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.modern-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo {
    height: 30px;
    margin-right: 0.8rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin-left: 1rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Bookmark Function Button */
.bookmark-section {
    display: flex;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    margin-bottom: 2rem;
}

.bookmark-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.bookmark-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
}

.bookmark-btn:active {
    transform: translateY(0);
}

.bookmark-icon {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* Hero Section */
.hero-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    margin-bottom: 3rem;
}

.hero-content {
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

/* Domestic Resources Quick Access Area */
.domestic-resources-bar {
    margin: 2rem 0;
}

.domestic-resources-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.resource-tag-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 2rem;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    margin: 0.25rem;
    position: relative;
}

.resource-tag-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Recommended Tag Styles */
.resource-tag-link.recommended {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: 1px solid #f59e0b;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.resource-tag-link.recommended:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(245, 158, 11, 0.4);
}

/* Recommended Card Styles */
.resource-card.recommended-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #f59e0b;
    position: relative;
    overflow: hidden;
}

.resource-card.recommended-card::before {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

/* Recommended Tag */
.resource-tag.tag-recommended {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-weight: 600;
}

/* Simple tooltip styles for JavaScript-created elements */
[data-tooltip] {
    cursor: help;
}

.resources-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* Resource Category Card Container */
.category-section {
    margin-bottom: 3rem;
    background: white;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.category-header {
    background: linear-gradient(135deg, #6b7280 0%, #374151 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.category-icon {
    margin-right: 0.75rem;
    font-size: 1.8rem;
}

.category-content {
    padding: 1.5rem;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
}

.resource-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}


.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.resource-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, #6366f1 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.resource-card:hover::before {
    transform: scaleX(1);
}

.resource-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 0.75rem 0;
    text-decoration: none;
    display: block;
    transition: color 0.3s;
}

.resource-card:hover .resource-title {
    color: #3730a3;
    text-decoration: underline;
}

.resource-description {
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    flex-grow: 1;
}

.resource-domain {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-style: italic;
    margin: 0;
    display: flex;
    align-items: center;
}

.domain-icon {
    margin-right: 0.25rem;
    font-size: 0.8rem;
}

.resource-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.75rem;
    align-self: flex-start;
}

.tag-domestic {
    background: #dbeafe;
    color: #1d4ed8;
}

.tag-foreign {
    background: #ffedd5;
    color: #c2410c;
}

.tag-research {
    background: #dcfce7;
    color: #166534;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        gap: 1rem;
    }

    .resources-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 2rem;
    }

    .bookmark-btn {
        width: 100%;
        justify-content: center;
    }

    .resources-container {
        padding: 0 1rem 2rem;
    }

    .category-header {
        font-size: 1.25rem;
        padding: 1rem;
    }

    .category-content {
        padding: 1rem;
    }
}

/* Footer styles - consistent with index.html */
.modern-footer {
    background: var(--footer-bg, #1f2937);
    color: var(--footer-text, #d1d5db);
    padding: 3rem 0 1rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

.footer-brand {
    margin-bottom: 1rem;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.footer-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: white;
}

.footer-description {
    font-size: 0.875rem;
    color: var(--text-secondary, #9ca3af);
    line-height: 1.6;
}

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

.footer-links h4 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--footer-link, #9ca3af);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s;
}

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

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding: 1.5rem 1.5rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color, #374151);
    color: var(--text-secondary, #9ca3af);
    font-size: 0.875rem;
}

/* Category Tag Styles */
.category-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.tag-planning {
    background: #e0e7ff;
    color: #3730a3;
}

.tag-search {
    background: #dcfce7;
    color: #166534;
}

.tag-management {
    background: #fef3c7;
    color: #b45309;
}

.tag-analysis {
    background: #ffedd5;
    color: #c2410c;
}

.tag-writing {
    background: #e0e7ff;
    color: #4338ca;
}

.tag-ai {
    background: #ddd6fe;
    color: #7c3aed;
}

.tag-visualization {
    background: #f0fdf4;
    color: #15803d;
}

.tag-domestic {
    background: #dbeafe;
    color: #1d4ed8;
}

.tag-foreign {
    background: #ffedd5;
    color: #c2410c;
}

.tag-research {
    background: #dcfce7;
    color: #166534;
}

/* Resource Card Hover Animation */
.resource-card {
    transition: all 0.3s ease;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* Scroll Animation - 这部分由JavaScript控制 */
.resource-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.resource-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modern-nav {
        padding: 0 1rem;
    }

    .modern-container {
        padding: 0 1rem;
    }

    .nav-menu {
        display: none; /* Hide menu on small screens */
    }

    #mobile-menu-btn {
        display: block; /* Show menu button on small screens */
    }

    .nav-menu.active {
        display: flex; /* Show menu when active */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border: 1px solid var(--border-color);
        border-top: none;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active li {
        margin: 0.5rem 0;
    }

    .hero-section {
        padding: 2rem 0;
    }

    .page-title {
        font-size: 2rem;
    }

    .page-subtitle {
        font-size: 1.1rem;
    }

    .resources-grid {
        grid-template-columns: 1fr;
    }

    .category-header {
        font-size: 1.25rem;
        padding: 1rem;
    }

    .category-content {
        padding: 1rem;
    }

    .bookmark-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .bookmark-section {
        padding: 0.5rem;
    }
}

/* Footer styles - consistent with index.html */
.modern-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

.footer-brand {
    margin-bottom: 1rem;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.footer-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: white;
}

.footer-description {
    font-size: 0.875rem;
    color: var(--footer-link);
    line-height: 1.6;
}

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

.footer-links h4 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--footer-link);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    max-width: var(--container-max-width);
    margin: 2rem auto 0;
    padding: 1.5rem 1.5rem 0;
    text-align: center;
    border-top: 1px solid #374151;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}