/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* 顶部倒计时 */
#timer-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10;
}

#timer-label {
    font-size: 14px;
    color: #aaa;
}

#timer {
    font-size: 36px;
    font-weight: bold;
    color: #00d4ff;
    min-width: 50px;
    text-align: center;
}

#timer-unit {
    font-size: 14px;
    color: #aaa;
}

/* 视频容器 */
#video-container {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: #000;
}

#video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 开始按钮覆盖层 */
#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 20;
}

#overlay.hidden {
    display: none;
}

#start-btn {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 4px solid #00d4ff;
    background: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
}

#start-btn:active {
    transform: scale(0.95);
    background: rgba(0, 212, 255, 0.3);
}

#hint {
    margin-top: 20px;
    font-size: 14px;
    color: #888;
    text-align: center;
    padding: 0 20px;
}

/* 结束面板 */
#result-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 30;
}

#result-panel.hidden {
    display: none;
}

#result-panel h2 {
    font-size: 28px;
    color: #ff4d4f;
    margin-bottom: 20px;
}

.result-count {
    font-size: 22px;
    margin-bottom: 10px;
}

.result-speed {
    font-size: 18px;
    color: #aaa;
    margin-bottom: 30px;
}

#result-count {
    color: #00d4ff;
    font-weight: bold;
    font-size: 28px;
}

#result-speed {
    color: #00d4ff;
    font-weight: bold;
}

#restart-btn {
    padding: 14px 40px;
    border-radius: 30px;
    border: 2px solid #00d4ff;
    background: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
    font-size: 18px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

#restart-btn:active {
    background: rgba(0, 212, 255, 0.3);
}

/* 速度曲线图容器 */
#chart-container {
    height: 120px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.6);
}

#chart-container.hidden {
    display: none;
}

#speedChart {
    width: 100%;
    height: 100%;
}

/* 底部计数 */
#count-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10;
}

#count-label {
    font-size: 14px;
    color: #aaa;
}

#count {
    font-size: 48px;
    font-weight: bold;
    color: #ff4d4f;
}

/* FPS 显示 */
#fps-display {
    position: fixed;
    top: 4px;
    right: 8px;
    font-size: 11px;
    color: #666;
    z-index: 100;
}
