* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    /* 更改为更柔和的背景色 */
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header-title {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 10px;
}

.header-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 导航栏 */
nav {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.nav-btn:hover,
.nav-btn.active {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    font-size: 12px;
}

/* 主要内容区域 */
.page {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    /* 降低白色背景的亮度 */
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    /* 增加模糊效果使界面更柔和 */
    backdrop-filter: blur(15px);
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

/* 睡眠计算器样式 */
.sleep-calculator {
    text-align: center;
}

.time-input {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.time-input input {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 18px;
    text-align: center;
    width: 120px;
}

.calculate-btn {
    background: linear-gradient(45deg, #34495e, #2c3e50);
    /* 降低按钮亮度 */
    opacity: 0.9;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.calculate-btn:hover {
    transform: translateY(-2px);
}

.sleep-times {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.sleep-time-item {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    opacity: 0.9;
    color: white;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
}

.sleep-time {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.sleep-cycles {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 数绵羊计数器 */
.sheep-counter {
    text-align: center;
}

.sheep-display {
    font-size: 4rem;
    font-weight: bold;
    color: #667eea;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sheep-emoji {
    font-size: 2rem;
    margin: 0 10px;
    display: inline-block;
    transition: transform 0.3s ease;
}
.sheep-emoji.jump {
    animation: sheepJump 0.5s ease;
}

@keyframes sheepJump {
    0% { transform: translateY(0); }
    50% { transform: translateY(-20px) rotate(10deg); }
    100% { transform: translateY(0); }
}
#sheepCount {
    transition: transform 0.2s ease;
}

#sheepCount.pulse {
    animation: countPulse 0.3s ease;
}

@keyframes countPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.counter-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.counter-btn {
    background: linear-gradient(45deg, #2980b9, #3498db);
    opacity: 0.9;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.counter-btn:hover {
    transform: scale(1.1);
}

.save-record-btn {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    opacity: 0.9;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.save-record-btn:hover {
    transform: translateY(-2px);
}

/* 历史记录样式 */
.history-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.clear-btn {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
}

.record-list {
    max-height: 400px;
    overflow-y: auto;
}

.record-item {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #667eea;
}

.record-info {
    flex: 1;
}

.record-sheep {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

.record-date {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.delete-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
}

/* 关于页面 */
.about-content {
    line-height: 1.6;
}

.about-content h3 {
    color: #667eea;
    margin: 20px 0 10px 0;
}

.about-content p {
    margin-bottom: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header-title {
        font-size: 2rem;
    }

    .nav-buttons {
        flex-wrap: wrap;
        gap: 5px;
    }

    .nav-btn {
        padding: 8px 15px;
        font-size: 12px;
    }

    .card {
        padding: 20px;
    }

    .sleep-times {
        grid-template-columns: 1fr;
    }

    .sheep-display {
        font-size: 3rem;
    }

    .counter-buttons {
        flex-wrap: wrap;
    }

    .history-controls {
        flex-direction: column;
        gap: 10px;
    }
}
/* 添加深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a1a 0%, #2c3e50 100%);
    }

    .card {
        background: rgba(40, 44, 52, 0.95);
        color: #e0e0e0;
    }

    .card-title {
        color: #e0e0e0;
    }

    .time-input input {
        background: rgba(40, 44, 52, 0.95);
        color: #e0e0e0;
        border-color: #4a4a4a;
    }

    .record-item {
        background: rgba(40, 44, 52, 0.8);
        border-left-color: #3498db;
    }

    .record-sheep {
        color: #3498db;
    }

    .record-date {
        color: #888;
    }
}

/* 添加护眼模式过渡效果 */
@media (prefers-color-scheme: dark) {
    * {
        transition: background-color 0.3s ease, color 0.3s ease;
    }
}