* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #000000; /* 改为全黑背景 */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 100px 40px 50px 40px; /* 增加顶部内边距50px，将内容下移 */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 600px;
    width: 90%;
    min-height: 700px; /* 增加最小高度以适应下移的内容 */
    backdrop-filter: blur(10px);
    position: relative;
}

/* 设置图标保持原位置 */
.settings-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #667eea;
}

.settings-icon:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: rotate(90deg);
}

h1 {
    color: #4a5568;
    margin-bottom: 30px;
    font-size: 2.5em;
    font-weight: 300;
}

h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 400;
}

h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 500;
}

.input-section {
    margin-bottom: 30px;
}

/* 模式切换开关样式 */
.mode-switch-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.mode-switch {
    position: relative;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 25px;
    padding: 4px;
    display: flex;
    width: 100%;
    max-width: 400px;
    height: 50px;
}

.mode-switch input[type="radio"] {
    display: none;
}

.mode-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s ease;
    padding: 0 20px;
    font-size: 14px;
}

.mode-label.left {
    border-radius: 21px 0 0 21px;
}

.mode-label.right {
    border-radius: 0 21px 21px 0;
}

.switch-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 21px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

#target-mode:checked ~ .switch-slider {
    transform: translateX(0);
}

#duration-mode:checked ~ .switch-slider {
    transform: translateX(100%);
}

#target-mode:checked ~ .mode-label.left {
    color: white;
}

#duration-mode:checked ~ .mode-label.right {
    color: white;
}

/* 设置容器 - 固定高度防止跳跃 */
.settings-container {
    min-height: 140px; /* 增加高度 */
    position: relative;
    margin-bottom: 30px; /* 增加底部边距 */
}

.target-mode-settings,
.duration-mode-settings {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    transition: opacity 0.3s ease;
}

/* 目标时间模式 - 一行布局 */
.target-datetime-row {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.input-group.half-width {
    flex: 1;
    max-width: 200px;
    text-align: left;
}

/* 时长输入样式 */
.duration-inputs {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    margin-bottom: 15px;
}

.duration-input {
    flex: 1;
    text-align: center;
}

.duration-input label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #4a5568;
    font-size: 14px;
}

.duration-input input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 18px;
    text-align: center;
    font-weight: bold;
    transition: border-color 0.3s ease;
}

.duration-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #4a5568;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 按钮组样式 */
.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 40px; /* 增加顶部边距，将按钮下移 */
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 35px; /* 增加按钮高度和宽度 */
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin: 5px;
    min-height: 50px; /* 设置最小高度 */
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

button:active {
    transform: translateY(0);
}

.countdown-section {
    display: none;
}

.countdown-display {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    flex-wrap: wrap;
}

.time-unit {
    text-align: center;
    margin: 10px;
    min-width: 100px;
}

.time-unit .number {
    display: block;
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.time-unit .label {
    display: block;
    font-size: 1em;
    color: #718096;
    margin-top: 5px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.finished-section {
    display: none;
}

.finished-section h2 {
    font-size: 2.5em;
    color: #48bb78;
    margin-bottom: 20px;
}

.finished-section p {
    font-size: 1.2em;
    color: #4a5568;
    margin-bottom: 20px;
}

/* 设置页面样式 */
.settings-page {
    text-align: left;
}

.settings-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: #4a5568;
}

.setting-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
}

.setting-item select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: border-color 0.3s ease;
}

.setting-item select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.settings-buttons {
    text-align: center;
    margin-top: 30px;
}

@media (max-width: 600px) {
    .container {
        padding: 30px 20px; /* 移动端也增加内边距 */
        margin: 20px;
        min-height: 600px; /* 移动端最小高度 */
    }
    
    h1 {
        font-size: 2em;
    }
    
    .mode-switch {
        height: 45px;
    }
    
    .mode-label {
        font-size: 13px;
        padding: 0 15px;
    }
    
    .duration-inputs {
        flex-direction: column;
        gap: 10px;
    }
    
    .target-datetime-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .input-group.half-width {
        max-width: none;
    }
    
    .settings-container {
        min-height: 220px; /* 移动端增加高度 */
        margin-bottom: 35px;
    }
    
    .button-group {
        flex-direction: column;
        margin-top: 35px; /* 移动端按钮下移 */
    }
    
    button {
        padding: 20px 35px; /* 移动端按钮更大 */
        min-height: 55px;
    }
}

/* 滚轮输入控件样式 */
.wheel-input {
    cursor: ns-resize;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.wheel-input:focus {
    cursor: text;
}

/* 移动设备优化 */
@media (max-width: 768px) {
    .wheel-input {
        font-size: 18px;
        padding: 12px;
        touch-action: none;
    }
}

/* 为移动设备添加触摸反馈 */
.wheel-input:active {
    background-color: #f0f0f0;
}