/* 基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
    line-height: 1.6;
    background-color: #f4f4f4;
    background: linear-gradient(to bottom, #f4f4f4, #ffffff);
    /* 默认渐变背景 */
    transition: background 0.5s ease;
}

/* 深色主题背景 */
body.dark-theme {
    background: linear-gradient(to bottom, #333333, #555);
    /* 深色渐变背景 */
    color: #f4f4f4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
    /* 确保内边距不影响宽度 */
}

/* 修复背景图片显示问题[无效] */
.background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/sushi-bg.jpg') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    /* 分离fixed属性提高兼容性 */
    z-index: -1;
    /* 调整为-1确保在默认内容层下方 */
    opacity: 0.7;
    pointer-events: none;
}

/* 悬浮轮播海报区域 */
.floating-carousel {
    position: relative;
    z-index: 1;
    /* 确保高于背景层 */
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    margin: 50px auto;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* ？启用，轮播区域下方背景图片 */
.floating-carousel::after {
    content: '';
    position: absolute;
    top: 100%;
    /* 在轮播区域下方 */
    left: auto;
    width: 100%;
    height: 300px;
    /* 背景图片高度 */
    background: url('./images/sushi-bg.jpg') no-repeat center center fixed;
    /* 少加一个点，所以没用 */
    background-size: cover;
    /* 背景图片覆盖整个区域 */
    z-index: -2;
    /* 确保背景图片在内容下方 */
    opacity: 0.7;
    /* 半透明效果 */
}

/* 修复轮播图片尺寸 */
.swiper-container {
    width: 100%;
    height: 400px;
    /* 根据需要调整高度 */
    position: relative;
    overflow: hidden;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 确保图片按比例填充容器 */
    opacity: 0.9;
    /* 图片半透明 */
    transition: opacity 0.3s ease-in-out;
}

.swiper-slide img:hover {
    opacity: 1;
    /* 鼠标悬停时恢复不透明 */
}

.swiper-pagination {
    bottom: 10px;
}

/* 头部样式 */
header {
    background-color: #222;
    color: white;
    padding: 10px 0; /* 减少头部上下内边距，从 htdocs 样式引入 */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-container {
    text-align: center;
    margin-top: 10px; /* 减少 Logo 顶部外边距，从 htdocs 样式引入 */
    margin-bottom: 10px; /* 减少 Logo 底部外边距，从 htdocs 样式引入 */
    width: 200px;
    /* 调整 Logo 容器宽度 */
    margin: 0 auto;
    /* 居中对齐 */
    order: 2; /* 调整 Logo 容器顺序，从 htdocs 样式引入 */
}

.logo {
    display: inline-block;
    max-width: 250px; /* 可适当缩小 Logo 最大宽度，从 htdocs 样式引入 */
    height: auto;
    width: 100%;
}

/* 调整小地球图标的位置 */
.language-switcher {
    position: absolute;
    top: 2vh;
    right: 2vh;
    display: inline-block;
    z-index: 1000;
}

#language-button {
    background: none;
    border: none;
    font-size: 4vh;
    cursor: pointer;
    color: white;
    transition: transform 0.2s ease;
}

#language-button:hover {
    transform: scale(1.2);
}

#language-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ccc;
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-width: 20vh;
}

#language-menu li {
    padding: 1em;
    cursor: pointer;
    color: #333;
    font-size: 2.5vh;
}

#language-menu li:hover {
    background: #f0f0f0;
    color: #e74c3c;
}

#language-menu.hidden {
    display: none;
}

/* 小屏幕下的调整 */
@media (max-width: 768px) {
    .language-switcher {
        top: 3vh;
        right: 3vh;
    }

    #language-button {
        font-size: 5vh;
    }

    #language-menu {
        min-width: 25vh;
    }

    #language-menu li {
        font-size: 3vh;
    }
}

/* 导航栏样式 */
nav {
    background-color: #333;
    width: 100%; /* 让导航栏宽度占满 header，从 htdocs 样式引入 */
    order: 1; /* 调整导航栏顺序，从 htdocs 样式引入 */
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    /* 允许导航项换行 */
}

nav ul li {
    padding: 15px 0;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
    white-space: nowrap;
    /* 防止文字换行 */
}

nav ul li a:hover {
    color: #e74c3c;
}

/* 修复 WhatsApp 按钮样式 */
.whatsapp-order {
    background-color: #25d366;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    color: white;
    transition: background-color 0.3s ease;
    /* 修复连字符错误 */
    white-space: nowrap;
    /* 防止文字换行 */
    /*display: inline-block;  确保按钮保持内联块级元素 */
    min-width: auto;
    /* 重置最小宽度 */
    vertical-align: middle;
    /* 添加垂直对齐方式,实测无效 */
}

.whatsapp-order:hover {
    background-color: #1da851;
}

/* 英雄区域样式 */
.hero {
    position: relative;
    background-color: #222; /* 设置与头部相同的背景色实现融合，从 htdocs 样式引入 */
    background: url('./images/sushi-bg.jpg') no-repeat center center fixed;
    /* 确保路径正确 */
    background-size: cover;
    /* 背景图片覆盖整个区域 */
    height: 400px;
    /* 设置高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    z-index: 1;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
    /* 添加内阴影，提升文字可读性 */
    padding: 10px 0; /* 减少 .hero 上下内边距，从 htdocs 样式引入 */
}

/* 黑色区域优化 */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.8));
    /* 渐变遮罩 */
    z-index: -1;
    /* 确保遮罩在文字下方 */
}

/* 优化标题样式 */
.hero h1 {
    font-size: 36px; /* 可适当缩小标题字体大小，从 htdocs 样式引入 */
    margin: 0;
    background: linear-gradient(90deg, #e74c3c, #f39c12);
    /* 渐变背景 */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* 文字渐变效果 */
    text-align: center;
}

.hero p {
    font-size: 18px; /* 可适当缩小副标题字体大小，从 htdocs 样式引入 */
    color: #fff;
    text-align: center;
    margin-top: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    /* 添加文字阴影，提升可读性 */
    margin: 0;
}

/* 菜单区域样式 */
.menu-section {
    padding: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center; /* 从 htdocs 样式引入居中样式 */
}

.menu-section h2 {
    text-align: center;
    margin-bottom: 20px;
}

/* 修复菜单下载按钮样式 */
.menu-download-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 电脑端两列布局 */
    gap: 10px;
    justify-content: center;
    /* 限制最大宽度，使用相对单位 */
    max-width: 90vw; 
    margin: 0 auto;
    /* 添加内边距防止按钮紧贴屏幕边缘 */
    padding: 0 15px; 
    box-sizing: border-box;
}

.menu-download-button {
    padding: 10px 20px;
    background-color: #f0f0f0;
    text-align: center;
    text-decoration: none;
    color: #333;
    border-radius: 5px;
    transition: background-color 0.3s;
    /* 允许按钮内文字换行 */
    white-space: normal; 
    /* 防止按钮过宽 */
    max-width: 100%; 
    box-sizing: border-box;
}

.menu-download-button:hover {
    background-color: #e0e0e0;
}

/* 导航栏样式 */
nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    /* 添加内边距防止导航项紧贴屏幕边缘 */
    padding: 0 15px; 
    box-sizing: border-box;
}

/* 小屏幕设备（手机）适配 */
@media only screen and (max-width: 767px) {
    .menu-download-container {
        grid-template-columns: 1fr; /* 手机端单列布局 */
    }

    nav ul {
        flex-direction: column; /* 导航项垂直排列 */
        align-items: center;
    }

    nav ul li {
        padding: 10px 0;
    }

    .menu-download-button {
        width: 100%; /* 按钮宽度占满容器 */
        margin: 0 auto 15px;
    }
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* 菜单卡片样式 */
.menu-item {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: grab;
    /* 鼠标样式为抓取 */
    position: relative;
}

body.dark-theme .menu-item {
    background-color: #222;
    /* 深色模式下菜单卡片背景色 */
    color: #fff;
    /* 深色模式下菜单卡片文字颜色 */
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.1);
    /* 调整阴影 */
}

.menu-item:active {
    cursor: grabbing;
    /* 鼠标样式为抓取中 */
}

.menu-item:hover {
    transform: translateY(-10px);
    /* 悬停时上移 */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    /* 增强阴影效果 */
}

.menu-item img {
    width: 100%;
    max-height: 200px;
    /* 使用 max-height 代替固定高度 */
    object-fit: cover;
}

.menu-item-content {
    padding: 1em;
    /* 使用 em 作为内边距单位 */
    /*padding: 10px; 减小内边距 */
}

.menu-item-content h3 {
    margin-top: 0;
    margin-bottom: 0.625em;
    /* 使用 em 作为外边距单位 */
    font-size: 1.25em;
    /* 使用 em 作为字体大小单位 */
}

.menu-item-content p {
    margin-bottom: 0.625em;
    /* 使用 em 作为外边距单位 */
    font-size: 1em;
    /* 使用 em 作为字体大小单位 */
}

/* 小屏幕下调整文字内容 */
@media (max-width: 768px) {
    .menu-item-content {
        padding: 0.8em;
        /* 减小内边距 */
    }

    .menu-item-content h3 {
        font-size: 1.1em;
        /* 减小标题字体大小 */
    }

    .menu-item-content p {
        font-size: 0.9em;
        /* 减小段落字体大小 */
    }
}

/* 详细介绍卡片样式 */
.menu-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 90%;
    /* 增大宽度以适应内容 */
    max-width: 95vw;
    /* 最大宽度为视口宽度的 95% */
    max-height: 95vh;
    /* 最大高度为视口高度的 95% */
    overflow-y: auto;
    /* 当内容超出高度时显示垂直滚动条 */
    z-index: 9999;
    /* 确保在最上层 */
    display: none;
    /* 默认隐藏 */
    box-sizing: border-box;
    /* 确保内边距不影响宽度 */
}

body.dark-theme .menu-modal {
    background-color: #222;
    color: #fff;
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.1);
}

/* 关于我们和联系我们区域样式 */
#about,
#contact {
    padding: 20px;
    /* 增加内边距，避免文字靠近边界 */
    margin: 20px auto;
    /* 上下外边距，水平居中 */
    max-width: 1200px;
    /* 最大宽度 */
    text-align: justify;
    /* 使文本均匀分散 */
    text-justify: inter-word;
    /* 兼容旧版浏览器 */
    margin: 1% 3%;
    /* 上下外边距为 5%，左右外边距为 10% */
    max-width: 95%;
    /* 最大宽度为屏幕宽度的 88% */
}

body.dark-theme #about {
    background-color: #222;
    /* 深色模式下关于我们区域背景色 */
    color: #fff;
    /* 深色模式下关于我们区域文字颜色 */
}

#about h2 {
    text-align: center;
    margin-bottom: 10px;
}

#about p,
#contact p {
    line-height: 1.6;
    /* 增加行高，提升可读性 */
    text-align: center;
    margin: 10px 0;
    /* 上下外边距 */
    text-align: justify;
    /* 使文本均匀分散 */
    text-justify: inter-word;
    /* 兼容旧版浏览器 */
    margin: 1% 3%;
    /* 上下外边距为 5%，左右外边距为 10% */
    max-width: 95%;
    /* 最大宽度为屏幕宽度的 88% */
}

/* 联系我们区域样式 */
#contact {
    padding: 40px 0;
    background-color: rgba(255, 255, 255, 0.8);
    /* 添加透明背景 */
}

body.dark-theme #contact {
    background-color: #222;
    /* 深色模式下联系我们区域背景色 */
    color: #fff;
    /* 深色模式下联系我们区域文字颜色 */
}

#contact h2 {
    text-align: center;
    margin-bottom: 20px;
}

/* 页脚样式 */
footer {
    background-color: #222;
    color: white;
    text-align: center;
    padding: 20px 0;
}

/* 媒体查询 - 小屏幕设备（手机） */
@media only screen and (max-width: 767px) {
    .hero h1 {
        font-size: 32px;
    }

    .hero p {
        font-size: 16px;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

    nav ul {
        flex-direction: column;
        /* 改为垂直排列 */
        align-items: center;
        /* 垂直居中对齐 */
    }

    nav ul li {
        padding: 10px 0;
        /* 减少内边距 */
    }

    nav ul li a {
        white-space: nowrap;
        /* 防止文字换行 */
    }

    .menu-section h2 {
        font-size: 24px;
        /* 减小标题字体大小 */
    }

    .menu-item {
        cursor: pointer;
        /* 鼠标样式为指针 */
        margin: 0 auto;
        /* 居中对齐 */
        max-width: 90%;
        /* 限制最大宽度 */
    }

    .menu-download-button {
        width: 100%;
        /* 按钮宽度占满 */
        text-align: center;
        /* 居中对齐文字 */
    }

    .floating-carousel {
        width: 95%;
        margin: 30px auto;
    }

    .swiper-container {
        height: 300px;
    }
}

/* 媒体查询 - 中等屏幕设备（平板） */
@media only screen and (min-width: 768px) and (max-width: 991px) {
    .hero h1 {
        font-size: 40px;
    }

    .hero p {
        font-size: 18px;
    }

    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 全局按钮和链接样式 */
button,
a {
    pointer-events: auto;
    /* 确保按钮可点击 */
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: white;
    text-decoration: none;
    background-color: #e74c3c;
    /* 默认背景色 */
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    position: relative;
    /* 添加相对定位 */
    z-index: 10;
    /* 确保按钮在堆叠顺序上层 */
    white-space: nowrap;
    /* 防止文字换行 */
}

button:hover,
a:hover {
    background-color: #c0392b;
    /* 悬停时背景色 */
    transform: scale(1.05);
    /* 悬停时放大效果 */
}

.hidden {
    display: none;
    /* 隐藏元素 */
}

/* 一键回到顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 20px;
    /* 距底部的距离 */
    right: 20px;
    /* 距右侧的距离 */
    width: 50px;
    height: 50px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.back-to-top:hover {
    opacity: 1;
    transform: scale(1.2);
    /* 悬停时放大效果 */
}

/* 全局主题切换按钮样式 */
.theme-toggle {
    position: fixed;
    top: 20px;
    /* 距顶部的距离 */
    left: 20px;
    /* 距左侧的距离 */
    width: 50px;
    height: 50px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle:hover {
    opacity: 1;
    transform: scale(1.2);
    /* 悬停时放大效果，皆由1.1改来 */
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

body.dark-theme .modal-content {
    background: #222;
    /* 深色模式下模态框背景色 */
    color: #fff;
    /* 深色模式下模态框文字颜色 */
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.1);
    /* 调整阴影 */
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-content img {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    color: #333;
    cursor: pointer;
}

body.dark-theme .close-button {
    color: #fff;
    /* 深色模式下关闭按钮颜色 */
}