@import url("https://cdn.staticfile.org/font-awesome/6.7.2/css/all.min.css");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", Arial, sans-serif;
    font-size: 15px;
}

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

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

body.dark-mode .banner {
    background-color: #000;
}

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

body.dark-mode .country-button {
    background-color: #333;
    color: #e0e0e0;
}

body.dark-mode .country-button:hover {
    background-color: #444;
}

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

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

body.dark-mode .clock {
    border-color: #555;
    background-color: #222;
}

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

body.dark-mode .hour-hand,
body.dark-mode .minute-hand {
    background-color: #e0e0e0;
}

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

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

.logo {
max-height: 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 {
    width: 100%;
}


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

.main-content {
    display: flex;
    margin-bottom: 30px;
}

.clock-section {
    flex: 1;
    padding-right: 20px;
}

.info-section {
    flex: 1;
    padding-left: 20px;
}

.clock-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 50px;
}

.clock {
    position: relative;
    width: 300px;
    height: 300px;
    border: 10px solid #333;
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.clock-face {
    position: relative;
    width: 100%;
    height: 100%;
}

.number {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: #222;
    transform-origin: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.number:hover {
    color: #ff0000;
    transform: translate(-50%, -50%) scale(1.2);
}

.hand {
    position: absolute;
    transform-origin: 50% 100%;
    z-index: 10;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
    bottom: 49%;
    left: 49%;
    transform: translateX(-50%);
}

.hour-hand {
    width: 8px;
    height: 80px;
    background-color: #222;
    border-radius: 4px;
}

.minute-hand {
    width: 6px;
    height: 110px;
    background-color: #222;
    border-radius: 3px;
}

.second-hand {
    width: 2px;
    height: 120px;
    background-color: #ff0000;
    border-radius: 1px;
}

.center-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: black;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.clock-title {
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
    margin-top: 30px;
}

.time-display {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.time-digit {
    background-color: #333;
    color: white;
    font-size: 36px;
    font-weight: bold;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 5px;
    border-radius: 10px;
}

.time-digit.gray {
    background-color: #ddd;
    color: #333;
}

.time-colon {
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
}

.date-display {
    font-size: 14px;
    color: #666;
    text-align: center;
}

.info-title {
    font-size: 24px;
    margin-bottom: 35px;
    text-align: center;
    margin-top: 50px;
}

.info-item {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.info-label {
    font-weight: bold;
    width: 100px;
}

.info-value {
    flex: 1;
    text-align: right;
}

.info-text {
    line-height: 1.6;
    margin-top: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background-color: #f0f0f0;
    padding: 15px;
    border-radius: 10px;
}

    /* 为 12 个热门国家实时时间里每个单独的时间样式设置宽度和时间数字大小 */
       .country-time {
            width: 23%;
            margin-bottom: 20px;
        }

       .country-time .time-digit {
            font-size: 22px;
            width: 39px;
            height: 39px;
            line-height: 39px;
            text-align: center;
        }

       .country-time .time-colon {
            font-size: 22px;
            line-height: 39px;
            margin: 1px 5px 3px 1px;
        }

       .twelve-country-time-container {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
        }

        /* 更多国家时区与实时时间按钮样式 */
.country-button {
    background-color: white; /* 默认背景框底色为白色 */
    border: 1px solid #ccc; /* 边框线为灰色 */
    border-radius: 5px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    text-decoration: none; /* 去掉链接下划线 */
    color: black; /* 默认字体颜色为黑色 */
    transition: all 0.3s ease;
}

.country-button:hover {
    background-color: #a62a1a; /* 选中状态显示的红色改成#a62a1a */
    color: white !important; /* 确保字体颜色为白色，使用!important提高优先级 */
}

.country-button:hover span {
    color: white !important; /* 确保按钮内的<span>文本颜色也为白色 */
    
}
.country-button img {
    width: 20px;
    margin-right: 12px;
}

.country-button span {
    color: black; /* 确保文字颜色为黑色 */
    font-size: 12px;
}


        
        .country-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 分成5列显示 */
    gap: 10px; /* 列间距 */
    margin-top: 20px;
}

       .country-time a {
            text-decoration: none;
            color: black;
            font-size: 13px;
            display: block;
            text-align: center;
        }

       .country-time a:hover {
            color: black;
        }

        /* 顶部横幅样式 */
       .banner {
            background-image: url('../img/shiqubanner.png'); /* 修改背景图路径 */
            color: white;
            text-align: center;
            padding: 15px 0;
            font-size: 24px;
            height: 100px;
            line-height: 100px;
            padding: 25px;
            line-height: 1.1;
        }
        /* 设置链接样式 */
a.home-link:link, 
a.home-link:visited {
  color: #fdcccc;
  text-decoration: none; /* 去掉下划线 */
  font-size: 13px;       /* 字体大小13px */
}

        /* 中国北京（beijing）时区信息栏目里面图标和标题对齐 */
       .timezone-item {
            display: flex;
            align-items: center;
            margin-top: 20px;
        }

       .timezone-icon {
            margin-right: 10px;
        }

        /* 现在星期几？ 今天是第几周？ 夏令时开始时间？ 夏令时结束时间？这几个栏目字体加粗。下边距8px */
       .info-card-title {
            font-weight: bold;
            margin-bottom: 8px;
        }

        /* 更多国家时区与实时时间栏目名称下边距30px */
       .more-countries-title {
            margin-bottom: 30px;
        }

        /* 版权信息居中，上边距30px，下边距30px */
       .footer {
            text-align: center;
            margin-top: 30px;
            margin-bottom: 30px;
        }

        /* 中国北京（beijing）时区信息文字下边距20px */
       .timezone-title {
            margin-bottom: 20px;
        }

        /* 时区标识符文字上边距20px */
       .timezone-item:nth-child(2) .timezone-content {
            margin-top: 20px;
        }
        
        /* 新增专业时尚栏目标题样式 */
       .fancy-title {
            font-size: 20px;
            font-weight: 600;
            color: black;
            padding-bottom: 5px;
            margin-bottom: 20px;
            text-transform: uppercase;
            letter-spacing: 1px;
            display: flex;
            align-items: center;
            margin-top: 60px;
        }

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

       .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: auto; /* 将按钮推到右侧 */
}

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

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

        body.dark-mode h3.fancy-title {
    color: white !important; /* 暗夜模式下栏目名称字体颜色为白色 */
}

body.dark-mode .country-button {
    color: white !important; /* 暗夜模式下按钮字体颜色为白色 */
}

body.dark-mode .country-button:hover {
        background-color: #a62a1a; /* 暗夜模式下悬停时按钮背景色 */
    color: white !important; /* 暗夜模式下悬停时按钮字体颜色为白色 */
}

body.dark-mode .country-button span {
    color: white; /* 确保文字颜色为黑色 */
}
        
        
        @media (max-width: 768px) {
    .country-buttons {
        grid-template-columns: repeat(3, 1fr); /* 小屏幕分3列 */
    }
    .nav-links {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .country-buttons {
        grid-template-columns: repeat(2, 1fr); /* 超小屏幕分2列 */
    }
}


/* 更多工具下拉框样式 */
.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;
}