* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100vw;
    height: 100vh;
    gap: 0;
}

/* 左侧控制面板 */
.control-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 300px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px 15px;
    box-sizing: border-box;
    gap: 30px;
    overflow-y: auto;
}

/* 中央钟表区域 */
.clock-area {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100vh;
}


/* 钟表容器 */
.clock-container {
    position: relative;
}

.clock {
    width: min(70vw, 70vh);
    height: min(70vw, 70vh);
    border: 8px solid #fff;
    border-radius: 50%;
    background: radial-gradient(circle, #ffffff 0%, #f8f9fa 100%);
    position: relative;
    box-shadow: 
        0 0 30px rgba(0, 0, 0, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.1);
}

/* 小时刻度 */
.hour-marks {
    position: absolute;
    width: 100%;
    height: 100%;
}

.hour-mark {
    position: absolute;
    width: 4px;
    height: 30px;
    background: #333;
    left: 50%;
    top: 10px;
    transform-origin: 2px calc(min(35vw, 35vh) - 10px);
    border-radius: 2px;
}

.hour-mark span {
    position: absolute;
    top: 35px;
    left: 50%;
    transform: translateX(-50%) rotate(calc(var(--rotation) * -1));
    font-weight: bold;
    font-size: 18px;
    color: #333;
}

.hour-mark:nth-child(1) span { transform: translateX(-50%) rotate(0deg); }
.hour-mark:nth-child(2) span { transform: translateX(-50%) rotate(-30deg); }
.hour-mark:nth-child(3) span { transform: translateX(-50%) rotate(-60deg); }
.hour-mark:nth-child(4) span { transform: translateX(-50%) rotate(-90deg); }
.hour-mark:nth-child(5) span { transform: translateX(-50%) rotate(-120deg); }
.hour-mark:nth-child(6) span { transform: translateX(-50%) rotate(-150deg); }
.hour-mark:nth-child(7) span { transform: translateX(-50%) rotate(-180deg); }
.hour-mark:nth-child(8) span { transform: translateX(-50%) rotate(-210deg); }
.hour-mark:nth-child(9) span { transform: translateX(-50%) rotate(-240deg); }
.hour-mark:nth-child(10) span { transform: translateX(-50%) rotate(-270deg); }
.hour-mark:nth-child(11) span { transform: translateX(-50%) rotate(-300deg); }
.hour-mark:nth-child(12) span { transform: translateX(-50%) rotate(-330deg); }

/* 分钟刻度 */
.minute-marks {
    position: absolute;
    width: 100%;
    height: 100%;
}

.minute-mark {
    position: absolute;
    width: 1px;
    height: 15px;
    background: #8f1616;
    left: 50%;
    top: 10px;
    transform-origin: 0.5px calc(min(35vw, 35vh) - 10px);
}

/* 分钟数显示 */
.minute-numbers {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.minute-number {
    position: absolute;
    left:48.5%;
    top: 50%;
    transform-origin: 0 0;
    font-size: 16px;
    font-weight: bold;
    color: #007bff;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid #007bff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    user-select: none;
}

/* 指针 */
.hand {
    position: absolute;
    left: 50.6%;
    bottom: 50%;
    transform-origin: bottom center;
    border-radius: 10px;
    cursor: grab;
    transition: box-shadow 0.2s ease;
}

.hand:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.hand:active {
    cursor: grabbing;
}

.hour-hand {
    width: 10px;
    height: calc(min(35vw, 35vh) - 80px);
    background: linear-gradient(to top, #333 0%, #555 100%);
    margin-left: -5px;
    z-index: 2;
    transform: translateX(-50%) rotate(0deg);
    border-radius: 10px;
    cursor: grab;
}

.hour-hand:active {
    cursor: grabbing;
}

/* 时针头部增强 */
.hour-hand::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #555 0%, #777 100%);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.minute-hand {
    width: 8px;
    height: calc(min(35vw, 35vh) - 15px);
    background: linear-gradient(to top, #666 0%, #888 100%);
    margin-left: -4px;
    z-index: 3;
    transform: translateX(-50%) rotate(0deg);
    border-radius: 10px;
    cursor: grab;
}

.minute-hand:active {
    cursor: grabbing;
}

/* 分针头部增强 */
.minute-hand::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #88888827 0%, #aaa 100%);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

/* 中心点 */
.center-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #333;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

/* 时间显示区域 */
.time-display {
    width: 100%;
    max-width: 250px;
    height: 80px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.time-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.time-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.time-display:hover::before {
    left: 100%;
}

.time-text {
    font-size: 18px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.time-display.showing-time {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.time-display.showing-time .time-text {
    font-size: 24px;
}

/* 模式切换按钮 */
.mode-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 250px;
    justify-content: center;
}

.mode-btn {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #4facfe;
    background: transparent;
    color: #4facfe;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: rgba(79, 172, 254, 0.1);
    transform: translateY(-2px);
}

.mode-btn.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 5px 10px rgba(79, 172, 254, 0.3);
}

/* 挑战模式面板 */
.challenge-panel {
    width: 100%;
    max-width: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 20px 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    color: white;
    text-align: center;
}

.target-time {
    margin-bottom: 20px;
}

.target-label {
    font-size: 14px;
    font-weight: 500;
    display: block;
    margin-bottom: 10px;
}

.target-time-text {
    font-size: 25px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.challenge-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.challenge-btn {
    padding: 10px 20px;
    border: 2px solid #fff;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.challenge-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.challenge-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* 检查答案按钮特殊样式 */
#checkAnswer {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 2px solid #10b981;
    color: white;
}

#checkAnswer:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border: 2px solid #059669;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

/* 设置按钮容器 */
.settings-container {
    width: 100%;
    max-width: 250px;
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

/* 设置按钮 */
.settings-btn {
    width: 50px;
    height: 50px;
    border: none;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.3);
    position: relative;
    overflow: hidden;
}

.settings-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 154, 158, 0.4);
}

.settings-btn:active {
    transform: translateY(0) scale(0.95);
}

.settings-icon {
    font-size: 20px;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.settings-btn:hover .settings-icon {
    animation-duration: 0.5s;
}

/* 设置面板 */
.settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 450px;
    max-width: 90vw;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    z-index: 1000;
    color: white;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: settingsPanelSlideIn 0.3s ease-out;
}

@keyframes settingsPanelSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px 20px 0 0;
}

.settings-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.settings-content {
    padding: 30px;
}

.setting-item {
    margin-bottom: 30px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

/* 语言选择器样式 */
.language-select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.language-select:hover {
    border-color: #667eea;
}

.language-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 设置分隔线 */
.settings-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
    margin: 20px 0;
    width: 100%;
}

.setting-item label {
    display: block;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.setting-item input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    margin-bottom: 12px;
    -webkit-appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.setting-item input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(79, 172, 254, 0.6);
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.volume-value {
    font-size: 15px;
    font-weight: 600;
    color: #4facfe;
    text-shadow: 0 1px 3px rgba(79, 172, 254, 0.3);
}

.test-btn {
    padding: 10px 20px;
    margin: 8px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.test-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 设置面板遮罩 */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    backdrop-filter: blur(8px);
    animation: overlayFadeIn 0.3s ease-out;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 烟花效果样式 */
.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.firework {
    position: absolute;
    width: 8px;
    height: 8px;
}

.firework-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: firework-explode 2.5s ease-out forwards;
    box-shadow: 0 0 6px currentColor;
}

@keyframes firework-explode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(calc(var(--dx) * 0.7), calc(var(--dy) * 0.7)) scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0.3);
        opacity: 0;
    }
}

.challenge-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(255, 255, 255, 0.1);
}

.challenge-btn:active {
    transform: translateY(0);
}

.feedback {
    font-size: 13px;
    font-weight: 500;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback.success {
    color: #4ade80;
    text-shadow: 0 2px 5px rgba(74, 222, 128, 0.3);
}

.feedback.error {
    color: #f87171;
    text-shadow: 0 2px 5px rgba(248, 113, 113, 0.3);
}

.feedback.hint {
    color: #fbbf24;
    text-shadow: 0 2px 5px rgba(251, 191, 36, 0.3);
}

/* 响应式设计 - 针对小屏幕的优化 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 10px;
        gap: 20px;
    }

    .control-panel {
        width: 100%;
        max-width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px;
        gap: 15px;
    }

    .clock-area {
        height: auto;
        flex: 1;
    }

    .clock {
        width: min(80vw, 80vh);
        height: min(80vw, 80vh);
    }

    .time-display,
    .challenge-panel,
    .mode-toggle {
        max-width: 200px;
    }



    .mode-btn,
    .challenge-btn {
        font-size: 12px;
        padding: 8px 12px;
    }

    .target-label {
        font-size: 14px;
    }

    .target-time-text {
        font-size: 18px;
    }

    .feedback {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .control-panel {
        flex-direction: column;
        align-items: center;
    }

    .time-display,
    .challenge-panel,
    .mode-toggle {
        max-width: 280px;
        width: 100%;
    }
}

/* SEO和无障碍访问样式 */

/* 跳转到主内容链接 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    font-size: 14px;
}

.skip-link:focus {
    top: 6px;
}

/* 视觉隐藏但屏幕阅读器可访问 */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 面包屑导航 */
.breadcrumb {
    list-style: none;
    display: flex;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin: 10px;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '>';
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.7);
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #fff;
    text-decoration: underline;
}

.breadcrumb li[aria-current="page"] {
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}

/* 页面头部 */
header[role="banner"] {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

/* 页面底部 */
.site-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.9);
    padding: 15px 0;
    z-index: 100;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    flex-wrap: wrap;
}

.footer-content p {
    margin: 0;
    font-size: 14px;
}

.footer-nav {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: #fff;
    text-decoration: underline;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .footer-nav {
        gap: 15px;
    }
    
    .breadcrumb {
        margin: 5px;
        padding: 8px 15px;
    }
    
    .breadcrumb a,
    .breadcrumb li[aria-current="page"] {
        font-size: 12px;
    }
}

/* 确保主内容区域有足够的边距 */
main.container {
    margin-top: 60px;
    margin-bottom: 80px;
    min-height: calc(100vh - 140px);
}