/* Base Reset & Typography */
body {
    background-color: #f9fafb;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: #333;
}

/* Header & Navigation */
.site-header {
    background-color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 50;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    height: 4rem;
    align-items: center;
}

.logo-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.desktop-nav {
    display: none;
}
@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
        gap: 2rem;
    }
}

.nav-link {
    color: #111827;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}
.nav-link:hover {
    color: #2563eb;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 0.5rem;
}
@media (min-width: 768px) { .mobile-menu-btn { display: none; } }

.mobile-menu {
    display: none;
    position: absolute;
    top: 4rem;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #f3f4f6;
}
.mobile-menu.active { display: block; }

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: #111827;
    text-decoration: none;
    border-bottom: 1px solid #f9fafb;
}
.mobile-nav-link:hover {
    color: #2563eb;
    background-color: #f9fafb;
}

/* Search Box */
.top-search {
    display: none;
    width: 24rem;
    margin-left: 2rem;
}
@media (min-width: 768px) { .top-search { display: block; } }

.search-wrapper { position: relative; }
.search-input {
    display: block;
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    color: #111827;
    font-size: 0.875rem;
    box-sizing: border-box;
}
.search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.search-btn {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    padding: 0 0.75rem;
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.search-btn:hover { color: #2563eb; }

/* Main Content */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
}

/* Components */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1f2937;
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
}

/* Grid System */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
}
@media (min-width: 768px) { .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .resource-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Cards */
.resource-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s;
    overflow: hidden;
    border: 1px solid #f3f4f6;
}
.resource-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-body { padding: 1.5rem; }

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0;
}
.card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}
.card-title a:hover { color: #2563eb; }

.card-desc {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    height: 2.5rem; /* Approx 2 lines */
    overflow: hidden;
    line-height: 1.25rem;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #9ca3af;
}
.card-meta span { display: flex; align-items: center; }
.card-meta span i { margin-right: 0.25rem; }

/* Pagination */
.pagination-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}
.pagination {
    display: flex;
    gap: 0.5rem;
}
.page-item {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    text-decoration: none;
    color: #374151;
    background-color: white;
    font-size: 0.875rem;
}
.page-item:hover { background-color: #f3f4f6; }
.page-item.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Detail Page */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 0;
}
@media (min-width: 1024px) {
    .detail-layout {
        grid-template-columns: 2fr 1fr;
    }
}

.detail-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}
.detail-body { padding: 2rem; }

.detail-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    margin-top: 0;
}
.detail-meta {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}
.detail-meta span { display: flex; align-items: center; }
.detail-meta span i { margin-right: 0.25rem; }

.detail-section { margin-bottom: 2rem; }
.detail-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
    border-left: 4px solid #3b82f6;
    padding-left: 0.75rem;
}
.detail-section-title.green { border-color: #10b981; }

.detail-content {
    color: #4b5563;
    line-height: 1.625;
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 0.25rem;
}

/* Sidebar */
.sidebar-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.sidebar-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 0.5rem;
    margin-top: 0;
}
.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-item {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
}
.sidebar-item i {
    color: #9ca3af;
    margin-right: 0.5rem;
    margin-top: 0.25rem;
}
.sidebar-link {
    color: #4b5563;
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.4;
    transition: color 0.2s;
}
.sidebar-link:hover { color: #2563eb; }

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tag-link {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #f3f4f6;
    color: #4b5563;
    border-radius: 9999px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.2s;
}
.tag-link:hover {
    background-color: #dbeafe;
    color: #2563eb;
}

/* Tag Cloud Colors */
.tag-cloud .tag-link:nth-child(5n+1) { background-color: #fee2e2; color: #dc2626; }
.tag-cloud .tag-link:nth-child(5n+2) { background-color: #fef3c7; color: #d97706; }
.tag-cloud .tag-link:nth-child(5n+3) { background-color: #d1fae5; color: #059669; }
.tag-cloud .tag-link:nth-child(5n+4) { background-color: #dbeafe; color: #2563eb; }
.tag-cloud .tag-link:nth-child(5n+5) { background-color: #e0e7ff; color: #4f46e5; }
.tag-cloud .tag-link:hover { opacity: 0.9; transform: translateY(-1px); }


/* Download List */
.download-list { display: flex; flex-direction: column; gap: 1rem; }
.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #eff6ff;
    padding: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #dbeafe;
}
.download-info { display: flex; align-items: center; }
.download-icon { color: #3b82f6; font-size: 1.5rem; margin-right: 1rem; }
.download-name { font-weight: 600; color: #1f2937; margin-bottom: 0.25rem; }
.download-extra { font-size: 0.875rem; color: #6b7280; }
.pwd-code { color: #ef4444; font-family: monospace; font-weight: 700; margin: 0 0.25rem; }
.copy-btn { color: #3b82f6; cursor: pointer; border: none; background: none; font-size: 0.75rem; margin-left: 0.5rem; }
.copy-btn:hover { text-decoration: underline; }

.download-btn {
    background-color: #2563eb;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
}
.download-btn:hover { background-color: #1d4ed8; }

/* Tags */
.tags-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #e5e7eb; }
.tag-label { color: #6b7280; margin-right: 0.5rem; }
.tag-item {
    display: inline-block;
    background-color: #f3f4f6;
    color: #4b5563;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    text-decoration: none;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}
.tag-item:hover { background-color: #dbeafe; color: #2563eb; }

/* QR Modal */
.qr-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.qr-modal.hidden { display: none; }
.qr-modal-content {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 20rem;
    text-align: center;
    position: relative;
}
.qr-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: #9ca3af;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}
.qr-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 1rem; color: #1f2937; }
.qr-container { display: flex; justify-content: center; margin-bottom: 1rem; }
.qr-tip { font-size: 0.875rem; color: #6b7280; }
.qr-link-area { display: none; } /* Hidden as per request */
.qr-link { color: #3b82f6; font-size: 0.875rem; text-decoration: none; }
.qr-link:hover { text-decoration: underline; }

/* Search Page */
.search-header { margin-bottom: 1.5rem; }
.search-title { font-size: 1.5rem; font-weight: 700; color: #1f2937; margin-bottom: 0.5rem; }
.search-meta { color: #6b7280; }
.highlight { color: #2563eb; font-weight: 600; }
.no-results { text-align: center; padding: 4rem 0; background-color: #f9fafb; border-radius: 0.5rem; }
.no-results p { color: #6b7280; font-size: 1.125rem; margin-bottom: 1rem; }
.back-link { color: #3b82f6; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* Footer */
.site-footer {
    background-color: #1f2937;
    color: white;
    padding: 2rem 0;
    margin-top: auto;
}
.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.footer-links {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #9ca3af;
}

.footer-link {
    color: #9ca3af;
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: white;
}

.footer-separator {
    color: #4b5563;
}

/* 404 Page */
.error-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 0;
}
.error-code {
    font-size: 3.75rem;
    font-weight: 700;
    color: #e5e7eb;
}
.error-message {
    font-size: 1.5rem;
    font-weight: 500;
    color: #4b5563;
    margin-top: 1rem;
}
.error-desc {
    color: #6b7280;
    margin-top: 0.5rem;
}
.error-btn {
    margin-top: 2rem;
    padding: 0.75rem 1.5rem;
    background-color: #2563eb;
    color: white;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: background-color 0.2s;
}
.error-btn:hover {
    background-color: #1d4ed8;
}

/* Utilities */
.hidden { display: none !important; }

/* --- New Homepage Styles --- */
/* Hero Section */
.hero-section {
    background-color: #2563eb;
    padding: 5rem 0;
    color: white;
    text-align: center;
}
.hero-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}
.hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: white;
}
.hero-search-box {
    background-color: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 700px;
    margin: 0 auto;
}
.hero-search-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    position: relative;
}
.hero-search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1.125rem;
    transition: all 0.2s;
}
.hero-search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.hero-search-btn {
    background-color: #2563eb;
    color: white;
    padding: 0 2.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1.125rem;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}
.hero-search-btn:hover {
    background-color: #1d4ed8;
}
.hero-hot-keywords {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
    text-align: left;
}
.keyword-link {
    color: #6b7280;
    text-decoration: none;
    margin-left: 0.5rem;
}
.keyword-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Stats Section */
.stats-section {
    padding: 2rem 0;
    background-color: transparent;
    border-bottom: none;
    margin-top: -3rem; /* Pull up to overlap hero slightly or just sit closer */
    position: relative;
    z-index: 10;
}
.stats-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
}
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: none;
    transition: transform 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
}
.stat-label {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0 0 0.5rem 0;
}
.stat-value-wrapper {
    display: flex;
    align-items: baseline;
}
.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0;
}
.text-blue { color: #2563eb; }
.text-green { color: #10b981; }
.stat-unit {
    margin-left: 0.5rem;
    color: #6b7280;
}
.stat-icon-wrapper {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bg-blue-light { background-color: #dbeafe; }
.bg-green-light { background-color: #d1fae5; }
.stat-icon { font-size: 1.5rem; }

/* Hot Section */
.hot-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1rem;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.more-link {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.875rem;
}
.more-link:hover { text-decoration: underline; }

.hot-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
}
@media (min-width: 768px) { .hot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .hot-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.hot-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    border: 1px solid #f3f4f6;
    height: 100%;
}
.hot-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.hot-card-body { padding: 1.5rem; }
.hot-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.file-type-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}
.type-word { background-color: #dbeafe; color: #1e40af; }
.file-size { color: #9ca3af; font-size: 0.75rem; }
.hot-card-link { text-decoration: none; color: inherit; }
.hot-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    line-height: 1.5;
    height: 3rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.hot-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #9ca3af;
    border-top: 1px solid #f3f4f6;
    padding-top: 1rem;
}
.download-count { color: #f59e0b; }

/* Latest Section */
.latest-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 3rem 1rem;
}
.latest-list-wrapper {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.latest-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.latest-item {
    border-bottom: 1px solid #f3f4f6;
}
.latest-item:last-child { border-bottom: none; }
.latest-link {
    display: block;
    padding: 1.5rem;
    text-decoration: none;
    transition: background-color 0.2s;
}
.latest-link:hover { background-color: #f9fafb; }
.latest-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
@media (min-width: 640px) {
    .latest-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}
.latest-main {
    flex: 1;
    min-width: 0;
}
.latest-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}
.latest-title {
    font-size: 1rem;
    font-weight: 500;
    color: #1f2937;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.free-badge {
    background-color: #d1fae5;
    color: #065f46;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    flex-shrink: 0;
}
.latest-size {
    font-size: 0.875rem;
    color: #6b7280;
    display: none;
}
@media (min-width: 640px) { .latest-size { display: block; } }

.latest-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}
.latest-keywords {
    display: flex;
    gap: 0.5rem;
}
.keyword-tag {
    background-color: #f3f4f6;
    color: #6b7280;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}
.latest-time {
    font-size: 0.875rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Copyright Notice */
.copyright-alert {
    background-color: #fff8f8;
    border: 1px solid #fee2e2;
    border-left: 4px solid #ef4444;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-top: 2rem;
}
.copyright-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #b91c1c;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.copyright-content {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.625;
}
.copyright-content p {
    margin-bottom: 0.5rem;
}
.copyright-content p:last-child {
    margin-bottom: 0;
}
