/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局图片样式 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 图片加载错误处理 */
img::after {
    content: attr(alt);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #f8f8f8;
    color: #666;
    font-size: 0.9rem;
    position: absolute;
    top: 0;
    left: 0;
}

/* 图片容器辅助类 */
.img-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.img-container img {
    transition: transform 0.5s ease;
}

.img-container:hover img {
    transform: scale(1.05);
}

/* 全局字体设置 */
body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 容器样式 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 28px;
}

nav ul {
    display: flex;
    list-style: none;
    position: relative;
}

nav ul li {
    margin-left: 30px;
    position: relative;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
    padding: 5px 0;
    display: block;
}

nav ul li a:hover {
    color: #e74c3c;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #e74c3c;
    transition: width 0.3s;
}

nav ul li a:hover::after {
    width: 100%;
}

/* 下拉菜单样式 */
.dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1001;
    border-radius: 4px;
    padding-top: 5px;
}

/* 扩大导航项的hover区域，防止下拉菜单消失 */
nav ul li.dropdown-parent {
    position: relative;
}

nav ul li.dropdown-parent::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 10px;
    background: transparent;
}

.dropdown li {
    margin: 0;
    width: 100%;
}

.dropdown li a {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

/* 移除下拉菜单链接的下划线效果 */
.dropdown li a::after {
    display: none;
}

/* 锚点跳转与导航栏对齐 */
#food-culture,
#food-categories,
#local-specialties,
#historical-sites,
#other-attractions {
    scroll-margin-top: 100px;
    padding-top: 100px;
    margin-top: -100px;
}

.dropdown li:last-child a {
    border-bottom: none;
}

.dropdown li a:hover {
    background-color: #f8f8f8;
    color: #e74c3c;
}

/* 导航项悬浮或点击时显示下拉菜单 */
nav ul li:hover .dropdown,
nav ul li.dropdown-open .dropdown {
    display: block;
    animation: fadeDown 0.3s ease-out;
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 英雄区域 */
.hero {
    position: relative;
    min-height: 60vh;
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../images/nanyang_hero.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

/* 详情页面图片样式优化 */
.food-main-image,
.heritage-main-image,
.main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

/* 缩略图样式优化 */
.food-thumbnail,
.heritage-thumbnail,
.thumbnail {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
    border: 3px solid transparent;
}

/* 响应式图片调整 */
@media (max-width: 768px) {
    .food-main-image,
    .heritage-main-image,
    .main-image {
        height: 300px;
    }
    
    .food-thumbnail,
    .heritage-thumbnail,
    .thumbnail {
        height: 80px;
    }
    
    .hero {
        min-height: 40vh;
    }
}

@media (max-width: 480px) {
    .food-main-image,
    .heritage-main-image,
    .main-image {
        height: 200px;
    }
    
    .food-thumbnail,
    .heritage-thumbnail,
    .thumbnail {
        height: 60px;
    }
}

.hero-content {
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    background-color: #e74c3c;
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background-color: #c0392b;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(231, 76, 60, 0.2);
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 10px rgba(231, 76, 60, 0.2);
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(100, 100);
        opacity: 0;
    }
}

.btn:focus:not(:active)::after {
    animation: ripple 0.6s ease-out;
}

/* 内容区块 */
.section {
    padding: 80px 0;
    background-color: white;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.section-title h2 {
	font-size: 2.5rem;
	color: #2c3e50;
	display: inline-block;
	padding-bottom: 15px;
	position: relative;
	text-align: center;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background-color: #e74c3c;
}

.intro-text {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

/* 卡片样式 */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.card-image {
    position: relative;
    height: 300px; /* 固定高度以确保人物全身显示 */
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 使用contain而不是cover，确保人物完整显示 */
    background-color: #f8f8f8;
    transition: transform 0.5s ease;
}

/* 名人卡片特定样式 */
.celebrity-card .card-image {
    height: 350px !important;
    background-color: #f8f8f8;
}

.celebrity-card .card-image img {
    object-fit: contain !important;
    transform: none !important;
    margin: 0 auto;
}

/* 普通卡片hover效果 */
.card:hover:not(.celebrity-card) .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 25px;
    position: relative;
    z-index: 1;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: 600;
}

.card-text {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.7;
}

.card-btn {
    display: inline-flex;
    align-items: center;
    color: #e74c3c;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.card-btn i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.card-btn:hover {
    color: #c0392b;
}

.card-btn:hover i {
    transform: translateX(3px);
}

/* 分享板块 */
.share-section {
    background-color: #f9f9f9;
}

.share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.share-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9rem;
    color: #999;
}

/* 详情页面样式 */
.detail-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.detail-content {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.detail-sidebar {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.detail-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.3;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.9rem;
}

.detail-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 30px;
}

.detail-text {
    margin-bottom: 20px;
    line-height: 1.8;
    color: #444;
}

.detail-text h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 30px 0 15px;
}

.detail-text p {
    margin-bottom: 15px;
}

.detail-text ul, .detail-text ol {
    margin-bottom: 20px;
    padding-left: 20px;
}

.detail-text li {
    margin-bottom: 10px;
}

/* 页脚样式 */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: #e74c3c;
}

.footer-column p {
    margin-bottom: 15px;
    color: #bdc3c7;
    line-height: 1.7;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-block;
    position: relative;
    padding-left: 15px;
}

.footer-links a:hover {
    color: #e74c3c;
    transform: translateX(5px);
}

.footer-links a::before {
    content: '>';
    position: absolute;
    left: 0;
    color: #e74c3c;
    transition: transform 0.3s ease;
}

.footer-links a:hover::before {
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: #e74c3c;
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #bdc3c7;
    font-size: 0.9rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #e74c3c;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* 滚动显示动画 */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

.slide-in-left {
    opacity: 0;
    animation: slideInLeft 1s ease forwards;
}

.slide-in-right {
    opacity: 0;
    animation: slideInRight 1s ease forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

.delay-4 {
    animation-delay: 0.8s;
}

.delay-5 {
    animation-delay: 1s;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .detail-container {
        grid-template-columns: 1fr;
    }
    
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 3rem;
    }
    
    .hero p {
        font-size: 1.2rem;
    }
    
    .header-container {
        flex-direction: column;
        padding: 15px 0;
    }
    
    nav ul {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav ul li {
        margin: 0 10px;
    }
    
    .cards {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .detail-content,
    .detail-sidebar {
        padding: 20px;
    }
    
    .logo {
        font-size: 20px;
    }
}

/* 图标容器位置相对定位 */
.social-links {
    position: relative;
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 焦点样式 - 移除红色边框 */
button:focus, a:focus {
    outline: none;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #e74c3c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 打印样式 */
@media print {
    /* 打印样式 */
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt !important;
        line-height: 1.4;
    }
    
    /* 隐藏不需要打印的元素 */
    header,
    footer,
    nav,
    .btn,
    .social-links,
    .share-section,
    .detail-sidebar {
        display: none !important;
    }
    
    /* 调整容器宽度 */
    .container {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
    }
    
    /* 调整内容区域 */
    .section {
        padding: 20px 0 !important;
    }
    
    /* 调整标题样式 */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        color: black !important;
    }
    
    /* 确保链接可见 */
    a {
        color: #0000EE !important;
        text-decoration: underline !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
    }
    
    a[href^="#"]:after {
        content: "";
    }
    
    /* 调整图片 */
    img {
        max-width: 100% !important;
        height: auto;
        page-break-inside: avoid;
    }
    
    /* 调整列表 */
    ul, ol {
        padding-left: 20px !important;
    }
    
    /* 避免页面中断 */
    .card,
    .detail-content {
        page-break-inside: avoid;
        box-shadow: none !important;
        background: white !important;
    }
    
    /* 确保表格正确打印 */
    table {
        width: 100% !important;
        border-collapse: collapse;
        page-break-inside: avoid;
    }
    
    th, td {
        border: 1px solid #ddd;
        padding: 8px;
    }
}
h2 {
	text-align: center;
	font-size: 18px;
}
