/* 基础样式 */
:root {
    --glow-color: rgba(52, 152, 219, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #2c3e50;
    color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(45deg, #2c3e50, #3498db);
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

/* 语言选择器样式 */
.language-switcher {
    margin-bottom: 20px;
    text-align: right;
}

.language-switcher select {
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    width: auto;
    max-width: 100%;
}

/* 地区选择器样式 */
.region-selector {
    margin-bottom: 30px;
    text-align: center;
}

.region-selector label {
    display: block;
    margin-bottom: 10px;
    font-size: 18px;
}

.select2-container {
    width: 100% !important;
    max-width: 400px !important;
}

/* Select2 样式优化 */
.select2-container--default .select2-selection--single {
    background-color: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 5px;
    height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: white !important;
    line-height: 36px !important;
    padding-left: 12px !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: white transparent transparent transparent !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent white transparent !important;
}

.select2-dropdown {
    background-color: rgba(0, 0, 0, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.select2-container--default .select2-results__option {
    color: white !important;
    padding: 8px 12px !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: rgba(52, 152, 219, 0.3) !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: rgba(52, 152, 219, 0.5) !important;
}

.select2-search--dropdown {
    padding: 8px !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    padding: 6px 10px !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

/* 信息容器样式 */
.info-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

.language-info {
    text-align: center;
    margin-bottom: 20px;
}

.language-info h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

/* 时间显示样式 */
.time-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.digital-clock {
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    width: 100%;
    max-width: 400px;
}

.digital-clock h2 {
    font-size: 20px;
    margin-bottom: 10px;
}

.digital-clock .time {
    font-size: 36px;
    font-weight: bold;
    text-shadow: 0 0 10px var(--glow-color);
}

/* 时钟容器样式 */
.clock-container {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1;
    margin: 0 auto;
}

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

.clock {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 5px solid rgba(52, 152, 219, 0.5);
    box-shadow: 0 0 30px var(--glow-color),
                inset 0 0 30px var(--glow-color);
    position: relative;
    overflow: hidden;
}

/* 时钟指针样式 */
.hour-hand, .minute-hand, .second-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom;
    border-radius: 2px;
}

.hour-hand {
    width: 4px;
    height: 50px;
    background: white;
    box-shadow: 0 0 10px white;
    margin-left: -2px;
}

.minute-hand {
    width: 3px;
    height: 70px;
    background: #3498db;
    box-shadow: 0 0 10px #3498db;
    margin-left: -1.5px;
}

.second-hand {
    width: 2px;
    height: 80px;
    background: #e74c3c;
    box-shadow: 0 0 10px #e74c3c;
    margin-left: -1px;
}

.center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px white;
}

/* 时钟数字样式 */
.numbers {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.numbers span {
    position: absolute;
    font-size: 16px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 5px white;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
}

/* 快速时区切换样式 */
.quick-zones {
    margin: 20px auto;
    width: 100%;
    max-width: 800px;
    overflow: hidden;
    text-align: center;
}

.scroll-container {
    display: inline-flex;
    gap: 10px;
    padding: 10px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    justify-content: center;
    flex-wrap: wrap;
}

.scroll-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.quick-zones button {
    flex: 0 0 auto;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 100px;
}

.quick-zones button:hover,
.quick-zones button:focus {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.quick-zones button:active {
    transform: translateY(0);
}

.quick-zones button.active {
    background: rgba(52, 152, 219, 0.5);
}

/* 加载指示器样式 */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-indicator.show {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 触摸设备优化 */
@media (hover: none) {
    .quick-zones button:hover {
        transform: none;
    }

    .quick-zones button:active {
        background: rgba(52, 152, 219, 0.7);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .quick-zones button {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .scroll-container {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }
    
    .quick-zones button {
        min-width: auto;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .quick-zones button {
        background: black;
        border: 2px solid white;
    }

    .quick-zones button.active {
        background: white;
        color: black;
    }
}

/* 页脚导航样式 */
footer nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

footer nav li {
    margin: 0;
    padding: 0;
}

/* 主要时区按钮容器 */
.main-timezones {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 30px auto;
    max-width: 800px;
    padding: 0 20px;
}

.main-timezones a {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    min-width: 120px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.main-timezones a:hover,
.main-timezones a:focus {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.main-timezones a.active {
    background: rgba(52, 152, 219, 0.6);
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .language-switcher {
        text-align: center;
        margin-bottom: 15px;
    }

    .region-selector label {
        font-size: 16px;
    }

    .digital-clock {
        padding: 15px;
    }

    .digital-clock .time {
        font-size: 32px;
    }

    .clock-container {
        max-width: 250px;
    }

    footer nav ul {
        padding: 0 15px;
    }

    footer nav a {
        font-size: 13px;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .digital-clock .time {
        font-size: 28px;
    }

    .clock-container {
        max-width: 200px;
    }

    .numbers span {
        font-size: 14px;
        width: 20px;
        height: 20px;
        line-height: 20px;
    }

    footer nav ul {
        flex-direction: column;
        gap: 8px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
    }
    
    .background-animation {
        background: linear-gradient(45deg, #1a1a1a, #2c3e50);
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .clock {
        border-color: white;
        box-shadow: none;
    }
    
    .numbers span {
        background: black;
        color: white;
        text-shadow: none;
    }
    
    footer nav a {
        background: black;
        color: white;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .background-animation {
        animation: none;
    }
    
    .clock-hands {
        transition: none;
    }
    
    footer nav a {
        transition: none;
    }
}

/* RTL 语言支持 */
[dir="rtl"] {
    .language-switcher {
        text-align: left;
    }
    
    .numbers span {
        transform: translate(50%, -50%);
    }
}

/* 页脚样式 */
footer {
    margin-top: auto;
    padding: 20px 0;
    background: rgba(0, 0, 0, 0.3);
    text-align: center;
}

footer nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

footer nav a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.8;
    padding: 5px 10px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

footer nav a:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.4);
}

footer nav a.active {
    background: rgba(52, 152, 219, 0.5);
    opacity: 1;
}

/* 移动端优化 */
@media (max-width: 768px) {
    footer nav ul {
        flex-direction: column;
        gap: 10px;
        padding: 0 20px;
    }

    footer nav a {
        display: block;
        padding: 8px 15px;
    }
}
