/* ==================== 公共样式文件 ====================
   广府旅游指南 - 所有页面共用样式
   版本: 1.0.0
   更新日期: 2024-12
*/

/* ==================== CSS变量定义 ==================== */
:root {
    --primary-red: #8B0000;
    --primary-red-light: #A52A2A;
    --primary-red-dark: #5C0000;
    --accent-gold: #C9A96E;
    --accent-gold-light: #D4B896;
    --accent-gold-dark: #A88B55;
    --bg-cream: #FDF8F0;
    --bg-white: #FFFFFF;
    --bg-light-gray: #F5F5F5;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --text-white: #FFFFFF;
    --border-light: #E8E0D5;
    --border-gold: #D4B896;
}

/* ==================== 全局重置样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
    background-color: var(--bg-cream);
    color: var(--text-primary);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Noto Serif SC", "SimSun", serif;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

ul, ol {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

input, textarea, select {
    font-family: inherit;
}

/* ==================== 容器布局 ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== 顶部工具栏 ==================== */
.top-bar {
    background-color: var(--bg-light-gray);
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
    height: 40px;
    line-height: 40px;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.top-bar-left, .top-bar-right {
    display: flex;
    gap: 20px;
}

.top-bar a {
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.top-bar a:hover {
    color: var(--primary-red);
}

/* ==================== 头部区域 ==================== */
.header {
    background: linear-gradient(to bottom, var(--bg-white), var(--bg-cream));
    padding: 20px 0;
    border-bottom: 3px solid var(--accent-gold);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-red), var(--accent-gold));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 32px;
}

.logo-text h1 {
    font-size: 28px;
    color: var(--primary-red);
    font-weight: 700;
    letter-spacing: 2px;
}

.logo-text .slogan {
    font-size: 14px;
    color: var(--accent-gold-dark);
    font-family: "Noto Serif SC", serif;
    margin-top: 4px;
}

/* ==================== 搜索框 ==================== */
.search-box {
    display: flex;
    align-items: center;
    position: relative;
    width: 400px;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: 2px solid var(--accent-gold);
    border-radius: 4px;
    font-size: 14px;
    background-color: var(--bg-white);
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.search-box button {
    position: absolute;
    right: 5px;
    background: var(--primary-red);
    border: none;
    color: var(--text-white);
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover {
    background: var(--primary-red-light);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-gold);
    border-radius: 4px;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
}

.search-suggestions.active {
    display: block;
}

.search-suggestions .suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s ease;
}

.search-suggestions .suggestion-item:hover {
    background: var(--bg-light-gray);
}

.search-suggestions .suggestion-item i {
    color: var(--accent-gold);
    width: 20px;
}

.search-suggestions .suggestion-category {
    font-size: 10px;
    color: var(--text-light);
    background: var(--bg-light-gray);
    padding: 2px 6px;
    border-radius: 2px;
    margin-left: auto;
}

/* ==================== 主导航栏 ==================== */
.main-nav {
    background: linear-gradient(to right, var(--primary-red-dark), var(--primary-red), var(--primary-red-dark));
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.nav-list {
    display: flex;
    list-style: none;
    position: relative;
}

.nav-item {
    position: relative;
}

.nav-item > a {
    display: block;
    padding: 14px 24px;
    color: var(--text-white);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--accent-gold);
    transition: width 0.3s ease;
}

.nav-item:hover > a {
    background: rgba(201, 169, 110, 0.2);
}

.nav-item:hover > a::after {
    width: 80%;
}

.nav-item.active > a {
    background: var(--accent-gold);
    color: var(--primary-red-dark);
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-top: 3px solid var(--accent-gold);
    display: none;
    z-index: 1001;
}

.nav-item:hover .nav-dropdown {
    display: block;
    animation: dropdownFadeIn 0.3s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-dropdown a {
    display: block;
    padding: 12px 20px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    transition: all 0.15s ease;
}

.nav-dropdown a:last-child {
    border-bottom: none;
}

.nav-dropdown a:hover {
    background: linear-gradient(to right, rgba(139,0,0,0.1), transparent);
    color: var(--primary-red);
    padding-left: 28px;
}

/* ==================== 移动端菜单按钮 ==================== */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
}

/* ==================== 底部区域 ==================== */
.footer {
    background: linear-gradient(to bottom, var(--primary-red), var(--primary-red-dark));
    color: var(--text-white);
    margin-top: 40px;
}

.footer-main {
    padding: 40px 0 30px;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
}

.footer-about {
    flex: 0 0 auto;
    max-width: 60%;
}

.footer-links {
    flex: 0 0 auto;
    text-align: right;
}

.footer-about h4, .footer-links h4 {
    font-size: 16px;
    margin-bottom: 20px;
    color: var(--accent-gold);
}

.footer-about p {
    font-size: 13px;
    line-height: 1.8;
    opacity: 0.9;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 20px 30px;
    align-items: center;
}

.footer-links li {
    margin-bottom: 0;
}

.footer-links a {
    font-size: 13px;
    opacity: 0.8;
    transition: all 0.2s ease;
    display: inline-block;
    padding: 4px 0;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--accent-gold);
    transform: translateX(3px);
}

.footer-divider {
    height: 1px;
    background: rgba(255,255,255,0.2);
    margin: 0 20px;
}

.footer-bottom {
    padding: 20px 0;
    font-size: 12px;
}

.footer-bottom .container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.footer-info {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.footer-info a {
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.footer-info a:hover {
    opacity: 1;
    color: var(--accent-gold);
}

.footer-host {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-host img {
    height: 40px;
    filter: brightness(0) invert(1);
}

.footer-host p {
    opacity: 0.8;
}

/* ==================== 返回顶部按钮 ==================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-red);
    color: var(--text-white);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(139,0,0,0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-red-light);
    transform: translateY(-5px);
}

/* ==================== 通用内容区域样式 ==================== */
.main-content {
    padding: 24px 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

.content-left {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.content-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ==================== 通用区块标题样式 ==================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(to right, var(--primary-red), var(--primary-red-light));
    color: var(--text-white);
}

.section-header h3 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h3 i {
    color: var(--accent-gold);
}

.section-header a {
    font-size: 12px;
    color: var(--accent-gold-light);
    transition: color 0.15s ease;
}

.section-header a:hover {
    color: var(--text-white);
}

/* ==================== 通用卡片样式 ==================== */
.card {
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .content-right {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-about {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .top-bar {
        display: none;
    }

    .header .container {
        flex-direction: column;
        gap: 20px;
    }

    .logo-section {
        flex-direction: column;
        text-align: center;
    }

    .logo-text h1 {
        font-size: 22px;
    }

    .search-box {
        width: 100%;
    }

    .main-nav {
        position: relative;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-red-dark);
    }

    .nav-list.active {
        display: flex;
    }

    .nav-item > a {
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .nav-dropdown {
        position: static;
        box-shadow: none;
        background: rgba(0,0,0,0.2);
    }

    .nav-dropdown a {
        padding-left: 40px;
        color: var(--text-white);
        border-bottom-color: rgba(255,255,255,0.1);
    }

    .content-right {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        flex-direction: column;
        gap: 30px;
    }

    .footer-about {
        max-width: 100%;
        text-align: center;
    }

    .footer-links {
        text-align: center;
    }

    .footer-links ul {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .footer-bottom .container {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .footer-info {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
}
