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

body {
    font-family: 'Arial', sans-serif;
    background: #348CA0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    padding: 1rem;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    color: #333;
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.timer-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: stretch;
}

.timer-container {
    background: #fff;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: grid;
    grid-template-rows: auto 60px auto 100px 60px;
    align-items: center;
    gap: 1rem;
    min-height: 350px;
}

.timer-container h2 {
    color: #555;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 400;
}

.display {
    background: #1a1a1a;
    color: #00ff88;
    font-family: 'Courier New', monospace;
    font-size: 3rem;
    font-weight: bold;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: inset 0 5px 10px rgba(0, 0, 0, 0.3);
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.countdown-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 60px;
}

.input-placeholder {
    height: 60px;
}

.date-display {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    background: rgba(52, 140, 160, 0.1);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.date-display span {
    color: #348CA0;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.countdown-input input {
    width: 60px;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.countdown-input input:focus {
    outline: none;
    border-color: #667eea;
}

.countdown-input span {
    font-size: 1.5rem;
    font-weight: bold;
    color: #666;
}

.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    height: 60px;
}

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 120px;
    height: 44px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-start {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.btn-pause {
    background: linear-gradient(45deg, #ff9800, #f57c00);
    color: white;
}

.btn-pause:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.4);
}

.btn-reset {
    background: linear-gradient(45deg, #f44336, #d32f2f);
    color: white;
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 大平板尺寸 */
@media (max-width: 1400px) {
    .container {
        max-width: 1200px;
        padding: 1.8rem;
    }
    
    .timer-section {
        gap: 1.5rem;
    }
}

/* 平板尺寸 */
@media (max-width: 1024px) {
    .container {
        max-width: 900px;
        padding: 1.8rem;
    }
    
    .timer-section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .display {
        font-size: 2.5rem;
    }
}

/* 手機橫向 */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    .container {
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    .timer-section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .timer-container {
        min-height: 300px;
        grid-template-rows: auto 50px auto 80px 50px;
    }
    
    header h1 {
        font-size: 2rem;
        letter-spacing: 1px;
    }
    
    .display {
        font-size: 2rem;
        height: 80px;
    }
    
    .countdown-input {
        height: 50px;
    }
    
    .countdown-input input {
        width: 50px;
        font-size: 1rem;
    }
    
    .controls {
        height: 50px;
        gap: 0.8rem;
    }
    
    .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
        min-width: 100px;
        height: 40px;
    }
}

/* 手機直向 */
@media (max-width: 480px) {
    body {
        padding: 0.3rem;
    }
    
    .container {
        padding: 1rem;
        border-radius: 10px;
    }
    
    .timer-section {
        gap: 1.5rem;
    }
    
    .timer-container {
        padding: 1rem;
        min-height: 280px;
    }
    
    header h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .timer-container h2 {
        font-size: 1.3rem;
    }
    
    .display {
        font-size: 1.8rem;
        height: 70px;
        padding: 0.5rem;
    }
    
    .countdown-input input {
        width: 45px;
        padding: 0.3rem;
        font-size: 0.9rem;
    }
    
    .controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-width: 80px;
        height: 36px;
        flex: 1;
        min-width: calc(33.33% - 0.4rem);
    }
}

/* 極小螢幕 */
@media (max-width: 320px) {
    .container {
        padding: 0.8rem;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .display {
        font-size: 1.5rem;
        height: 60px;
    }
    
    .btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
        height: 32px;
    }
}