/* 保持原有的通用样式、header、banner、container等 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", Arial, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

header {
    background-color: #2d2d2d;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    max-width: 40px;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* 悬停效果 */
.nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.nav-links a:hover::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 3px;
    background-color: #a62a1a;
    transition: width 0.3s ease-out;
}

.nav-links a:hover::after {
    width: 100%;
}


.dark-mode-toggle {
    background-color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.dark-mode-toggle.dark {
    background-color: #333;
    color: #fff;
}

.dark-mode-toggle i {
    margin-right: 8px;
}

.banner {
    background-image: url('../img/shiqubanner.png');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 50px 20px;
    margin-bottom: 15px;
    border-radius: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.banner h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.banner p {
    font-size: 16px;
    opacity: 0.9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.section-title {
    font-size: 24px;
    margin: 50px 0 20px;
    color: #333;
    display: flex;
    align-items: center;
}

body.dark-mode .section-title {
    color: #e0e0e0;
}

.section-title::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 1em;
    background-color: #a62a1a;
    margin-right: 10px;
    border-radius: 2px;
    margin-top: 3px;
}

.map-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.map-content {
    position: relative; /* 新增: 用于定位子元素 map-loading */
    width: 860px;
    height: 550px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

body.dark-mode .map-content {
    background-color: #222;
}

/* 新增: 地图加载提示样式 */
.map-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8); /* 半透明白色背景 */
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    z-index: 10; /* 确保在地图SVG之上 */
    transition: opacity 0.3s ease-in-out; /* 平滑过渡 */
    pointer-events: none; /* 加载中允许点击穿透，避免阻挡事件 */
}

/* 暗夜模式下的加载提示背景和文字颜色 */
body.dark-mode .map-loading {
     background-color: rgba(0, 0, 0, 0.8); /* 半透明黑色背景 */
     color: #e0e0e0;
}

/* 隐藏状态 */
.map-loading.hidden {
    opacity: 0;
    pointer-events: none; /* 完全隐藏后禁止事件 */
}


.lunar-calendar {
    width: 280px;
    height: 550px;
}

.calendar-container {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 280px;
    padding: 20px;
    position: relative;
    min-height: 550px;
    overflow-y: auto;
}

body.dark-mode .calendar-container {
    background-color: #222;
    color: white;
}

.calendar-header {
    text-align: center;
    margin-bottom: 15px;
}

.calendar-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

body.dark-mode .calendar-title {
    color: white;
}

.date-info {
    text-align: center;
    margin-bottom: 10px;
}

.date-info .gregorian {
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
    font-weight: bold;
}

body.dark-mode .date-info .gregorian {
    color: white;
}

.date-number {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
}

.date-number .number {
    font-size: 64px;
    font-weight: bold;
    color: #c41e3a;
    margin: 0 15px;
     /* 添加动画平滑过渡 */
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.date-number .arrow {
    font-size: 24px;
    color: #c41e3a;
    cursor: pointer;
    transition: transform 0.2s;
}

body.dark-mode .date-number .arrow {
     color: #ff6b6b; /* 暗黑模式下箭头颜色 */
}


.date-number .arrow:hover {
    transform: scale(1.2);
}

.lunar-info {
    text-align: center;
    margin: 10px 0;
    font-size: 14px;
    color: #666;
}

body.dark-mode .lunar-info {
    color: #aaa;
}

.festival-info {
    text-align: center;
    margin: 15px 0;
    font-size: 14px;
    color: #2e7d32;
    padding: 8px;
    background-color: #e8f5e9;
    border-radius: 6px;
}

body.dark-mode .festival-info {
    background-color: #333;
    color: #ddd;
}

.section {
    margin-bottom: 20px;
}

.items-container {
    display: flex;
    flex-wrap: wrap;
    margin-left: 5px;
    max-width: 260px;
}

.item-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    width: 100%;
}

.section-title {
    flex-shrink: 0;
    margin-right: 20px;
    display: flex;
    align-items: center;
    height: 36px;
}

.section-title1 {
            flex-shrink: 0;
            margin-right: 20px;
            display: flex;
            align-items: center;
            height: 36px;
        }

.section-title1 .icon {
    margin: 20px auto;
    position: relative;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    border-radius: 50%;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
}

.section-title1 .icon.yi {
    background-color: #5CB85C;
    box-shadow: 0 0 0 3px rgba(92, 184, 92, 0.3);
}

.section-title1 .icon.ji {
    background-color: #D9534F;
    box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.3);
}

.items {
    display: flex;
    flex-wrap: wrap;
    font-size: 14px;
    color: #666;
}

body.dark-mode .items {
    color: #aaa;
}

.items span {
    margin-right: 10px;
    margin-bottom: 5px;
}

.caishen {
    text-align: center;
    font-size: 14px;
    color: #f44336;
    padding: 8px;
    background-color: #ffebee;
    border-radius: 6px;
}

body.dark-mode .caishen {
    background-color: #333;
    color: #ddd;
}

.caishen-direction {
    color: #d32f2f;
    font-weight: bold;
    margin-left: 5px;
}

/* 热门城市时间样式 - 保持不变 */
.time-display {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

@keyframes digitScroll {
    0% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(-10px); opacity: 0; }
    51% { transform: translateY(10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.time-digit {
    background-color: #a62a1a;
    color: white;
    font-size: 24px;
    font-weight: bold;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    margin: 0 5px;
    transition: all 0.5s ease;
}

body.dark-mode .time-digit {
    background-color: #ff6b6b;
}

.time-digit.gray {
    background-color: #e0e0e0;
    color: #333;
    animation: digitScroll 1s ease-in-out;
}

body.dark-mode .time-digit.gray {
    background-color: #444;
    color: #e0e0e0;
}

.time-colon {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

body.dark-mode .time-colon {
    color: #e0e0e0;
}

.country-times {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.country-time {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.country-time:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

body.dark-mode .country-time {
    background-color: #222;
}

.country-time h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

body.dark-mode .country-time h3 {
    color: #e0e0e0;
}

.country-time h3 img {
    width: 24px;
    margin-right: 10px;
    vertical-align: middle;
}

.country-time p {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

body.dark-mode .country-time p {
    color: #aaa;
}

.country-time a {
    text-decoration: none;
    color: #333;
}

body.dark-mode .country-time a {
    color: #e0e0e0;
}

.other-countries {
    margin-top: 40px;
}

.country-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.country-button {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    text-align: left;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.country-button:hover {
    background-color: #a62a1a;
    color: white;
    border-color: #a62a1a;
}

.country-button img {
    width: 20px;
    margin-right: 12px;
    margin-left: 18px;
}

.country-button span {
    font-size: 13px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.info-card {
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

body.dark-mode .info-card {
    background-color: #222;
}

.info-card-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    display: flex;
    align-items: center;
}

body.dark-mode .info-card-title {
    color: #e0e0e0;
}

.info-card-title i {
    margin-right: 8px;
    color: #a62a1a;
}

body.dark-mode .info-card-title i {
    color: #ff6b6b;
}

.info-card-content {
    font-size: 14px;
    color: #666;
}

body.dark-mode .info-card-content {
    color: #aaa;
}

body.dark-mode .country-time h3 {
    color: #ffffff !important; /* 覆盖原有颜色 */
}

body.dark-mode .country-time a {
    color: #ffffff !important; /* 覆盖链接颜色 */
}


.footer {
    text-align: center;
    margin-top: 50px;
    margin-bottom: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 13px;
}

.footer a{
    text-decoration: none;
    color: #666;
}

body.dark-mode .footer {
    border-top: 1px solid #444;
    color: #aaa;
}

/* 时间信息框样式 */
.time-info-box {
    fill: #ffffff; /* 默认填充色 */
    stroke: #aC1717; /* 红色边框 */
    stroke-width: 1.5px;
    rx: 8px;
    ry: 8px;
    /* height和width通过JS根据文本bbox计算 */
    /* x和y通过JS计算，使其中心与group原点(0,0)对齐 */
}

/* 暗夜模式下的信息框填充色 */
body.dark-mode .time-info-box {
    fill: #333; /* 暗色填充 */
}

/* 移除或覆盖原有的 text/tspan 样式，这些由JS直接设置 */
/*
.time-info-box text {
    font-family: Arial, sans-serif;
    font-size: 12px;
    dominant-baseline: middle;
}

.time-info-box text:first-of-type {
    font-weight: bold;
    fill: #69696;
    font-size: 13px;
}

.time-info-box text:last-of-type {
    font-size: 12px;
    fill: #636e72;
}
*/


        @media (max-width: 768px) {
    .country-buttons {
        grid-template-columns: repeat(3, 1fr); /* 小屏幕分3列 */
    }
    .nav-links {
        flex-wrap: wrap;
    }
    .map-container {
        flex-direction: column; /* 在小屏幕上垂直堆叠地图和日历 */
        align-items: center;
    }
    .map-content {
         width: 100%; /* 地图宽度适应容器 */
         height: 400px; /* 调整地图高度 */
         margin-bottom: 20px; /* 在地图和日历之间添加间距 */
    }
    .lunar-calendar {
         width: 100%; /* 日历宽度适应容器 */
    }
    .calendar-container {
         width: 100%; /* 日历内容宽度适应容器 */
         min-height: auto; /* 移除最小高度限制 */
    }
    .items-container {
        max-width: none; /* 允许 items 容器使用全部宽度 */
        justify-content: center; /* 让宜忌项居中 */
    }
}

@media (max-width: 480px) {
    .country-buttons {
        grid-template-columns: repeat(2, 1fr); /* 超小屏幕分2列 */
    }
    .banner h1 {
        font-size: 24px;
    }
    .banner p {
        font-size: 14px;
    }
    .section-title {
        font-size: 20px;
    }
    .time-digit {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    .time-colon {
        font-size: 20px;
    }
    .country-time h3 {
        font-size: 16px;
    }
    .country-button span {
        font-size: 12px;
    }
     .date-number .number {
        font-size: 50px; /* 减小日期数字大小 */
    }
}

/* 更多工具下拉框样式 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-menu {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 130px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1000;
    top: 100%; /* 从父元素底部开始定位 */
    left: 0;
    margin-top: 10px; /* 向下移动15px */
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.dropdown-menu.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-menu a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    font-size: 14px;
}

.dropdown-menu a:hover {
    background-color: #f5f5f5;
    color: #a62a1a;
}

body.dark-mode .dropdown-menu {
    background-color: #222;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

body.dark-mode .dropdown-menu a {
    color: #e0e0e0;
}

body.dark-mode .dropdown-menu a:hover {
    background-color: #333;
    color: #ffcc00;
}
