@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #f8f4ec;
    --bg-secondary: #fdfaf5;
    --text-primary: #43352b;
    --text-secondary: #6d5a48;
    --accent: #c98943;
    --accent-dark: #9d6a32;
    --accent-soft: rgba(201, 137, 67, 0.12);
    --card-bg: rgba(255, 255, 255, 0.97);
    --border-soft: rgba(186, 164, 134, 0.4);
    --shadow-soft: 0 18px 40px rgba(103, 78, 49, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Source Sans 3', 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: 1.7;
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: radial-gradient(circle at 20% 20%, rgba(201, 137, 67, 0.08), transparent 55%),
                      radial-gradient(circle at 80% 15%, rgba(150, 112, 62, 0.06), transparent 55%),
                      radial-gradient(circle at 50% 80%, rgba(173, 140, 102, 0.08), transparent 60%);
    z-index: -1;
    opacity: 0.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
    letter-spacing: 0.01em;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
}

a {
    color: var(--accent-dark);
    transition: color 0.2s ease;
}

a:hover {
    color: #b77436;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 252, 247, 0.95);
    backdrop-filter: blur(18px);
    z-index: 1000;
    box-shadow: 0 12px 30px rgba(96, 74, 46, 0.08);
    border-bottom: 1px solid var(--border-soft);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-icon {
    font-size: 2rem;
}

.nav-title {
    background: linear-gradient(120deg, #d7a05a, #b37a36);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-item {
    position: relative;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-dark);
    background: var(--accent-soft);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(120deg, #c98943, #b37a36);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 汉堡菜单动画 */
.hamburger.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

header {
    background: rgba(255, 255, 255, 0.9);
    background-image: url('world.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    backdrop-filter: blur(12px);
    color: var(--text-primary);
    padding: 6rem 0 2.5rem 0;
    text-align: center;
    box-shadow: 0 25px 60px rgba(83, 60, 40, 0.12);
    position: relative;
    overflow: hidden;
    margin-top: 70px;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 248, 236, 0.95), rgba(245, 234, 216, 0.85));
    z-index: -1;
}

.hero-content {
    max-width: 840px;
    margin: 0 auto 3rem auto;
    padding: 2.5rem 2.75rem;
    background: rgba(255, 255, 255, 0.78);
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(94, 73, 45, 0.18);
    border: 1px solid rgba(201, 137, 67, 0.12);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
    min-width: 140px;
    box-shadow: 0 18px 35px rgba(120, 88, 52, 0.12);
    backdrop-filter: blur(6px);
    line-height: 1.4;
}

.stat-number {
    display: block;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--accent-dark);
    text-shadow: none;
    font-family: 'Noto Serif SC', 'Songti SC', serif;
}

.stat-label {
    display: block;
    font-size: 1rem;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

h1 {
    margin: 0 0 0.75rem 0;
    font-size: clamp(2.1rem, 4.5vw, 3.2rem);
    font-weight: 700;
    color: #3a2a1d;
    text-shadow: none;
    line-height: 1.3;
    letter-spacing: 0.03em;
}

header p {
    font-size: 1.15rem;
    margin: 0 auto 2.2rem auto;
    font-weight: 400;
    color: var(--text-secondary);
    max-width: 640px;
}

#city-list {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 1.75rem;
    box-shadow: var(--shadow-soft);
    margin-bottom: 3rem;
    border: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1rem 4rem 1rem;
    min-height: calc(100vh - 400px);
}

#city-list h2 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.city-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

#library-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
    align-content: start;
}

.pagination {
    margin: 2rem 0 0;
    display: none;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pagination-btn {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(201, 137, 67, 0.25);
    border-radius: 999px;
    color: var(--accent-dark);
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    min-width: 2.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 6px 18px rgba(159, 122, 69, 0.15);
}

.pagination-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px rgba(159, 122, 69, 0.25);
}

.pagination-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
    background: rgba(247, 233, 215, 0.7);
    border-color: rgba(201, 137, 67, 0.2);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #d7a05a, #c98943);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 16px 32px rgba(154, 112, 52, 0.35);
    opacity: 1;
}

.pagination-btn.prev-next {
    font-weight: 600;
    padding: 0.5rem 1.25rem;
}

.city-btn {
    display: inline-block;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(247, 238, 225, 0.95));
    color: var(--text-secondary);
    border: 1px solid rgba(201, 137, 67, 0.15);
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-align: center;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.city-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(201, 137, 67, 0.25), transparent);
    transition: left 0.5s;
}

.city-btn:hover::before {
    left: 100%;
}

.city-btn:hover, .city-btn.active {
    background: linear-gradient(135deg, #f3d8b5, #e9c69d);
    color: #3d2a1a;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(179, 133, 74, 0.25);
}

.city-btn:focus-visible,
.pagination-btn:focus-visible,
.close-btn:focus-visible,
.nav-link:focus-visible {
    outline: 3px solid rgba(201, 137, 67, 0.35);
    outline-offset: 3px;
}

.library-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-soft);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.library-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #d7a05a, #c98943);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

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

.library-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 26px 50px rgba(103, 78, 49, 0.18);
}

.library-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.library-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: saturate(0.9) brightness(1.05);
}

.library-card:hover .library-image img {
    transform: scale(1.05);
    filter: saturate(1.05) brightness(1.08);
}

.library-info {
    padding: 1.75rem;
}

.library-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.4rem;
    color: #3a2d20;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.library-card p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.library-card p:first-of-type {
    color: #5a4634;
    font-weight: 600;
    font-size: 1rem;
}

.library-icon {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(255, 255, 252, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 22px;
    padding: 2.5rem;
    min-width: 320px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 55px rgba(92, 67, 38, 0.22);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1px solid var(--border-soft);
}

.modal.show .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(243, 225, 203, 0.65);
    border: none;
    font-size: 1.5rem;
    color: #7a5830;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(226, 193, 154, 0.85);
    color: #3f2a19;
    transform: rotate(90deg);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-soft);
}

.modal-header img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(91, 68, 45, 0.18);
    border: 1px solid var(--border-soft);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: #3a2d20;
    font-weight: 600;
    flex: 1;
}

.modal-body {
    line-height: 1.7;
}

.modal-content h2 {
    margin: 0 0 1.5rem 0;
    font-size: 1.8rem;
    color: #3a2d20;
    font-weight: 600;
}

.modal-content p {
    margin: 1rem 0;
    line-height: 1.7;
    color: var(--text-secondary);
}

.modal-content a {
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.modal-content a:hover {
    color: #b77436;
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(255, 252, 247, 0.98);
        backdrop-filter: blur(18px);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 16px 32px rgba(94, 72, 43, 0.12);
        padding: 2rem 0;
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hero-content {
        padding: 1.85rem 1.5rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .stat-item {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    header {
        padding: 1.5rem 0 1rem 0;
    }
    
    header p {
        margin: 0 0 1.5rem 0;
    }
    
    #city-list {
        margin: 0 0.75rem 1.5rem 0.75rem;
        padding: 1rem;
    }
    
    #city-list h2 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }
    
    .city-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.4rem;
    }
    
    .city-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        margin: 0;
        min-height: 2.2rem;
    }
    
    main {
        padding: 0 0.75rem;
    }
    
    #library-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .pagination {
        margin-top: 1.5rem;
        gap: 0.5rem;
    }

    .pagination-btn {
        padding: 0.45rem 0.9rem;
        font-size: 0.9rem;
    }

    .library-card {
        padding: 0;
    }
    
    .library-image {
        height: 150px;
    }
    
    .library-info {
        padding: 1.25rem;
    }
    
    .library-card h3 {
        font-size: 1.2rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .modal-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .modal-header img {
        width: 60px;
        height: 60px;
    }
    
    .close-btn {
        top: 1rem;
        right: 1rem;
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }

    .city-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 0.3rem;
    }
    
    .city-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
        margin: 0;
        min-height: 2rem;
    }

    .hero-content {
        padding: 1.5rem 1.2rem;
    }

    .pagination {
        gap: 0.4rem;
    }

    .pagination-btn {
        padding: 0.45rem 0.8rem;
        font-size: 0.85rem;
    }

    .library-card {
        padding: 0;
    }
    
    .library-image {
        height: 120px;
    }
    
    .library-info {
        padding: 1rem;
    }
    
    .modal-content {
        padding: 1.25rem;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(201, 137, 67, 0.25);
    border-radius: 50%;
    border-top-color: var(--accent-dark);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(210, 189, 160, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(201, 137, 67, 0.55);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(189, 124, 54, 0.75);
}

/* Footer Styles */

.footer {
    background: linear-gradient(135deg, #3d3028 0%, #2b241f 100%);
    color: #f1e8dc;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 137, 67, 0.7), transparent);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1rem 2rem 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: #fdf7ed;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    position: relative;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 32px;
    height: 2px;
    background: linear-gradient(90deg, #d7a05a, #c98943);
    border-radius: 1px;
}

.footer-section p {
    color: rgba(244, 236, 223, 0.85);
    line-height: 1.7;
    margin: 0 0 1rem 0;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: #f1e8dc;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.social-link:hover {
    background: rgba(201, 137, 67, 0.28);
    transform: translateY(-2px);
    color: #fff;
}

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

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

.footer-links a {
    color: rgba(244, 236, 223, 0.8);
    text-decoration: none;
    transition: color 0.3s ease, padding 0.3s ease;
    position: relative;
    padding-left: 0;
}

.footer-links a::before {
    content: '→';
    position: absolute;
    left: -1rem;
    opacity: 0;
    transition: all 0.3s ease;
    color: rgba(201, 137, 67, 0.9);
}

.footer-links a:hover {
    color: #fff;
    padding-left: 1rem;
}

.footer-links a:hover::before {
    opacity: 1;
}

.contact-info p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: rgba(244, 236, 223, 0.8);
}


.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5rem 0;
}

.footer-bottom-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    color: rgba(244, 236, 223, 0.65);
    margin: 0;
    font-size: 0.9rem;
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
}

.footer-bottom-links a {
    color: rgba(244, 236, 223, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

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

/* Footer Responsive */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 1rem 1.5rem 1rem;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .footer-bottom-links {
        justify-content: center;
        gap: 1rem;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .footer {
        margin-top: 2rem;
    }
    
    .footer-content {
        padding: 1.5rem 1rem 1rem 1rem;
    }
    
    .footer-bottom {
        padding: 1rem 0;
    }
    
    .footer-bottom-links {
        flex-direction: column;
        gap: 0.5rem;
    }
} 