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

:root {
    --primary-color: #1a2b3c;       /* 更深的蓝黑色 */
    --secondary-color: #2c3e50;     /* 深蓝灰色 */
    --accent-color: #2980b9;        /* 稍深的蓝色 */
    --background-color: #f0f4f8;    /* 更白一些的灰蓝色 */
    --text-color: #0d1b2a;          /* 更深的蓝黑色 */
    --muted-color: #4a5568;         /* 更深的灰色 */
    --card-background: #ffffff;     /* 纯白卡片背景 */
    
    /* 导航栏颜色调整 */
    --nav-background: #0d1b2a;      /* 深蓝黑色 */
    --nav-text: #f0f4f8;            /* 更亮的灰蓝色 */
    --nav-hover: #2c3e50;           /* 深蓝灰色悬停 */
    --nav-active: #2980b9;          /* 深蓝色激活 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: white;
    padding: 8px;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

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

header {
    background-color: var(--nav-background);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

nav {
    background-color: var(--nav-background);
}

nav ul {
    display: flex;
    list-style-type: none;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

nav ul li {
    margin: 10px 10px;
}

nav ul li a {
    color: var(--nav-text);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: block;
    position: relative;
    overflow: hidden;
}

nav ul li a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--nav-active);
    transition: width 0.3s ease;
}

nav ul li a:hover::before {
    width: 100%;
}

nav ul li a:hover {
    background-color: var(--nav-hover);
    color: var(--nav-active);
    transform: translateY(-3px);
}

header h1 {
    text-align: center;
    color: var(--nav-text);
    margin-bottom: 1rem;
    font-size: 1.8rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.mobile-nav-toggle {
    display: none;
    background-color: transparent;
    border: 2px solid var(--nav-text);
    color: var(--nav-text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mobile-nav-toggle:hover {
    background-color: rgba(255,255,255,0.1);
    transform: scale(1.05);
}

.city-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    gap: 10px;
}

.city-nav li a {
    text-decoration: none;
    color: var(--nav-text);  
    background-color: rgba(13, 27, 42, 0.1);  
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid transparent;
}

.city-nav li a:hover {
    color: var(--nav-background);  
    background-color: var(--nav-text);  
    border: 1px solid var(--nav-background);
    box-shadow: 0 2px 4px rgba(13, 27, 42, 0.2);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.city-section {
    margin-bottom: 2rem;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(44, 62, 80, 0.1);
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    transition: box-shadow 0.3s ease;
}

.city-section:hover {
    box-shadow: 0 6px 8px rgba(44, 62, 80, 0.15);
}

.city-section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}

.city-section-header h2 {
    margin-right: 1rem;
    color: var(--primary-color);
    white-space: nowrap;
    border-bottom: 2px solid var(--accent-color);
    position: relative;
}

.city-section-header h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
}

.city-description {
    color: var(--secondary-color);
    font-style: italic;
    font-weight: 400;
    flex-grow: 1;
}

.attractions {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.attraction {
    background-color: var(--background-color);
    border-radius: 8px;
    padding: 1rem;
    border-left: 3px solid var(--accent-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.attraction::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(52, 152, 219, 0.1), transparent);
    transition: all 0.6s ease;
}

.attraction:hover::before {
    left: 100%;
}

.attraction:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.1);
}

.attraction h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.attraction h3 a {
    color: var(--primary-color);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.attraction h3 a:hover {
    color: var(--accent-color);
}

.attraction h3 a::after {
    content: '➜';
    margin-left: 5px;
    font-size: 0.8em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.attraction h3 a:hover::after {
    opacity: 1;
}

.attraction p {
    color: var(--secondary-color);
    font-size: 0.95rem;
    line-height: 1.7;
}

footer {
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 1.5rem;
}

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

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 50%;
    font-size: 18px;
    transition: all 0.3s ease;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.back-to-top i {
    position: static;  /* 确保图标不会脱离文档流 */
    margin: 0;  /* 移除可能的边距 */
}

.back-to-top:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

@media screen and (max-width: 768px) {
    .mobile-nav-toggle {
        display: block;
        position: absolute;
        top: 15px;
        right: 15px;
        z-index: 1000;
    }

    .mobile-nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(13, 27, 42, 0.95);
        z-index: 999;
        overflow-y: auto;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-nav-overlay.show {
        display: block;
        opacity: 1;
    }

    .mobile-nav-content {
        position: relative;
        padding: 60px 20px 20px;
        max-width: 600px;
        margin: 0 auto;
    }

    .mobile-nav-close {
        position: absolute;
        top: 15px;
        right: 15px;
        background: none;
        border: none;
        color: var(--nav-text);
        font-size: 2rem;
        cursor: pointer;
        z-index: 1001;
    }

    .city-nav {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .city-nav li {
        width: 100%;
        text-align: center;
        margin: 10px 0;
    }

    .city-nav li a {
        display: block;
        padding: 15px;
        font-size: 1.2rem;
        background-color: rgba(255,255,255,0.1);
        border: 1px solid rgba(255,255,255,0.2);
    }

    .city-nav li a:hover {
        background-color: rgba(255,255,255,0.2);
    }
}

@media (min-width: 769px) {
    .city-nav {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media screen and (max-width: 1024px) {
    .attractions {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 480px) {
    .attractions {
        grid-template-columns: 1fr;
    }
}

/* 移动端优化 */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .city-section {
        padding: 1rem;
    }

    .city-section-header {
        text-align: center;
    }

    .city-section-header h2 {
        font-size: 1.5rem;
    }

    .city-section-header p {
        font-size: 0.9rem;
    }

    .city-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .city-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .city-card-image {
        width: 100%;
        max-width: 250px;
        margin-bottom: 1rem;
    }

    .city-card-content {
        padding: 0;
        text-align: center;
    }

    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 16px;
        right: 10px;
        bottom: 10px;
    }

    header {
        padding: 0.5rem;
    }

    .header-container h1 {
        font-size: 1.5rem;
    }

    main {
        padding: 0.5rem;
    }
}

@media screen and (max-width: 480px) {
    body {
        font-size: 12px;
    }

    .city-section-header h2 {
        font-size: 1.2rem;
    }

    .city-section-header p {
        font-size: 0.8rem;
    }
}

/* 移动端城市导航 */
.mobile-city-nav {
    display: none;
}

@media screen and (max-width: 768px) {
    .mobile-city-nav {
        display: block;
        background-color: var(--nav-background);
        padding: 10px 0;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .mobile-city-nav-container {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-city-nav-scroll {
        display: flex;
        gap: 15px;
        padding: 0 15px;
        white-space: nowrap;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none;  /* IE 10+ */
    }

    .mobile-city-nav-scroll::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

    .mobile-city-nav-item {
        color: var(--nav-text);
        text-decoration: none;
        padding: 8px 12px;
        border-radius: 20px;
        background-color: rgba(255,255,255,0.1);
        transition: all 0.3s ease;
        font-size: 14px;
    }

    .mobile-city-nav-item:hover {
        background-color: rgba(255,255,255,0.2);
        transform: scale(1.05);
    }

    .mobile-city-nav-item.active {
        background-color: var(--nav-active);
        color: white;
    }
}
