/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    padding: 30px;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

/* 标题样式 */
h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-weight: 700;
    position: relative;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: #4285f4;
    border-radius: 3px;
}

/* 选项卡样式 */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    position: relative;
    transition: all 0.3s ease;
}

.tab:hover {
    color: #4285f4;
}

.tab.active {
    color: #4285f4;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #4285f4;
}

/* 内容区域样式 */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content.active {
    display: block;
}

/* 显示时间样式 */
.display {
    font-size: 48px;
    text-align: center;
    margin: 20px 0;
    font-weight: bold;
    color: #333;
    font-family: 'Courier New', monospace;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.display.completed {
    animation: pulse 0.5s ease-in-out 3;
    color: #4285f4;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 控制按钮样式 */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}

.btn-primary {
    background-color: #4285f4;
    color: white;
}

.btn-secondary {
    background-color: #fbbc05;
    color: white;
}

.btn-danger {
    background-color: #ea4335;
    color: white;
}

.btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

/* 圈数记录样式 */
.laps {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 10px;
    scrollbar-width: thin;
    scrollbar-color: #ddd #f5f5f5;
}

.laps::-webkit-scrollbar {
    width: 6px;
}

.laps::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.laps::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 3px;
}

.lap-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.lap-item:hover {
    background-color: #f9f9f9;
}

/* 倒计时输入样式 */
.countdown-input {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.time-input {
    width: 60px;
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.time-input:focus {
    border-color: #4285f4;
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.time-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-label {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* 提示音选项样式 */
.alarm-sound {
    margin-top: 20px;
    text-align: center;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.alarm-sound label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.alarm-sound input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 键盘快捷键提示样式 */
.keyboard-shortcuts {
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    color: #666;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.keyboard-shortcuts span {
    display: inline-block;
    padding: 2px 6px;
    background-color: #eee;
    border-radius: 3px;
    margin: 0 2px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 时钟信息样式 */
.clock-info {
    text-align: center;
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 10px;
    color: #666;
    font-size: 12px;
    width: 100%;
    max-width: 500px;
}

/* 离线消息样式 */
.offline-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 1000;
    text-align: center;
    max-width: 90%;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* 应用加载动画 */
.app-loaded {
    animation: fadeIn 0.5s ease;
}

/* 响应式设计 */
@media (max-width: 500px) {
    .container {
        padding: 20px;
    }
    
    .display {
        font-size: 36px;
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .time-input {
        width: 50px;
        padding: 6px;
        font-size: 14px;
    }
    
    .tab {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .keyboard-shortcuts {
        font-size: 12px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #222;
        color: #eee;
    }
    
    .container {
        background-color: #333;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    
    h1 {
        color: #eee;
    }
    
    .tab {
        color: #bbb;
    }
    
    .tab.active {
        color: #4285f4;
    }
    
    .display {
        color: #eee;
    }
    
    .lap-item {
        border-bottom: 1px solid #444;
    }
    
    .lap-item:hover {
        background-color: #3a3a3a;
    }
    
    .time-input {
        background-color: #444;
        border-color: #555;
        color: #eee;
    }
    
    .time-input:focus {
        border-color: #4285f4;
    }
    
    .time-input:disabled {
        background-color: #333;
    }
    
    .alarm-sound, .keyboard-shortcuts {
        background-color: #3a3a3a;
    }
    
    .keyboard-shortcuts span {
        background-color: #444;
        color: #eee;
    }
    
    .input-label {
        color: #bbb;
    }
    
    footer {
        color: #999;
    }
    
    .offline-message {
        background-color: rgba(66, 133, 244, 0.8);
    }
}