/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 6px;
    padding: 25px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8em;
    font-weight: normal;
}

h2 {
    color: #555;
    margin-bottom: 12px;
    font-size: 1.1em;
    font-weight: normal;
}

/* 小猫奔跑动画 */
.cat-run {
    width: 120px;
    height: 99px;
    margin: 0 auto 20px;
    background: url('./assets/hand-drawn-animation-frames-element-collection/output/spritesheet.png') 0 0 no-repeat;
    background-size: 720px 99px;
    border-radius: 8px;
    border: 1px solid #eee;
    animation: none; /* 默认不播放 */
}

.cat-run.running {
    animation: catRun 1s steps(6) infinite;
}

.cat-run.paused {
    animation-play-state: paused;
}

@keyframes catRun {
    from { background-position: 0 0; }
    to { background-position: -720px 0; }
}

/* 秒表显示 */
.stopwatch {
    text-align: center;
    margin-bottom: 25px;
}

.display {
    font-size: 3em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 25px;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 20px 30px;
    border-radius: 12px;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: 3px;
    min-width: 280px;
    display: inline-block;
}

/* 按钮 */
.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    color: #333;
    transition: background 0.2s;
}

.btn:hover {
    background: #f0f0f0;
}

.btn.start {
    border-color: #4CAF50;
    color: #4CAF50;
}

.btn.start:hover {
    background: #4CAF50;
    color: white;
}

.btn.stop {
    border-color: #f44336;
    color: #f44336;
}

.btn.stop:hover {
    background: #f44336;
    color: white;
}

.btn.reset {
    border-color: #666;
    color: #666;
}

.btn.reset:hover {
    background: #666;
    color: white;
}

.btn.lap {
    border-color: #2196F3;
    color: #2196F3;
}

.btn.lap:hover {
    background: #2196F3;
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:disabled:hover {
    background: white;
    color: #333;
    transform: none;
}


/* 记圈记录 */
.laps-section {
    margin-top: 25px;
}

/* Grid 布局 */
.laps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.grid-header {
    display: contents;
}

.grid-body {
    display: contents;
}

.grid-cell {
    padding: 8px;
    text-align: center;
    background: white;
    border-bottom: 1px solid #f0f0f0;
}

.grid-row {
    display: contents;
}

.grid-row:nth-child(even) .grid-cell {
    background-color: white;
}

.grid-row:hover .grid-cell {
    background-color: white;
}

.grid-header .grid-cell {
    background: white;
    font-weight: normal;
    border-bottom: 1px solid #f0f0f0;
}

.grid-row {
    display: contents;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 20px;
    }
    
    .display {
        font-size: 2.2em;
        padding: 15px 20px;
        min-width: 240px;
        letter-spacing: 2px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 150px;
        margin: 2px 0;
    }
    
    .laps-grid {
        font-size: 14px;
    }
    
    .grid-cell {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .display {
        font-size: 1.8em;
        padding: 12px 15px;
        min-width: 200px;
        letter-spacing: 1px;
    }
}