/* 谷歌字体导入 - Noto Sans SC 用于常规文本, ZCOOL KuaiLe 用于趣味标题 */
/* 此处注释：实际字体已通过 HTML 中的 <link> 标签引入，无需在CSS中再次 @import */

/* === 基本重置和页面主体样式 === */
body {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f8ff; /* AliceBlue - 淡雅的背景色 */
    color: #333; /* 主要文字颜色 */
    line-height: 1.7; /* 行高 */
    display: flex;
    flex-direction: column;
    align-items: center; /* 水平居中容器 */
    padding-top: 20px; /* 顶部留白 */
    padding-bottom: 20px; /* 底部留白 */
    min-height: 100vh; /* 最小高度为视口高度 */
    box-sizing: border-box; /*盒模型*/
}

/* === 应用主容器 === */
.app-container {
    width: 95%;
    max-width: 1000px; /* 最大宽度 */
    background-color: #fff; /* 白色背景 */
    padding: 20px;
    border-radius: 20px; /* 圆角 */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); /* 阴影效果 */
    transition: all 0.3s ease-in-out;
}

/* === 顶部控制区域 === */
.top-controls {
    display: flex;
    justify-content: flex-end; /* 按钮组靠右对齐 */
    align-items: center; /* 垂直居中对齐按钮 */
    margin-bottom: 15px;
    gap: 10px; /* 按钮之间的间隙 */
}

/* 顶部栏按钮的通用样式 */
.top-bar-button {
    padding: 8px 10px; /* 上下8px，左右10px内边距 */
    color: white;
    border: none;
    border-radius: 10px; /* 圆角 */
    cursor: pointer;
    font-size: 0.9em; /* 字体大小 */
    font-weight: 500; /* 字体粗细 */
    text-decoration: none; /* 移除链接下划线 */
    display: inline-flex; /* 使内部元素（如图标和文字）可以更好地对齐 */
    align-items: center; /* 垂直居中对齐内部元素 */
    justify-content: center; /* 水平居中对齐内部元素 */
    gap: 5px; /* 内部元素（如图标和文字）之间的间隙 */
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s; /* 过渡效果 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* 轻微阴影 */
    
    width: 130px; /* 设置一个固定宽度以确保按钮大小一致 */
    box-sizing: border-box; /* 确保padding和border包含在设定的width内 */
}
.top-bar-button:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15); /* 悬停时阴影加深 */
    transform: translateY(-1px); /* 悬停时轻微上移 */
}

/* 特定顶部按钮的背景色 */
#home-link-btn {
    background-color: #28a745; /* 首页按钮用绿色 */
}
#home-link-btn:hover {
    background-color: #218838; /* 悬停时深一点的绿色 */
}

#fullscreen-btn {
    background-color: #87CEEB; /* 全屏按钮用天蓝色 */
}
#fullscreen-btn:hover {
    background-color: #76b6d2; /* 悬停时深一点的天蓝色 */
}

/* === 主要内容区域布局 === */
.main-content {
    display: flex;
    flex-wrap: wrap; /* 允许内容换行，适应不同屏幕尺寸 */
    gap: 25px; /* 计时器区域和任务列表区域之间的间隙 */
}

/* === 计时器和任务列表区域通用样式 === */
.timer-section, .todo-section {
    flex: 1; /* 允许这两个区域弹性增长以填充可用空间 */
    min-width: 300px; /* 每个区域的最小宽度，防止在小屏幕上过度压缩 */
    padding: 25px; /* 内边距 */
    border: 2px dashed #add8e6; /* 淡蓝色虚线边框 */
    border-radius: 15px; /* 圆角 */
    background-color: #f0ffff; /* Azure - 非常浅的青色背景 */
    box-sizing: border-box;
}

/* === 计时器部分特有样式 === */
.timer-section {
    text-align: center; /* 内容（如时间显示、按钮组）居中 */
}

#state-label {
    font-family: 'ZCOOL KuaiLe', cursive; /* 趣味字体 */
    font-size: 2.8em; /* 状态标签字号 */
    margin-bottom: 10px;
    color: #ff69b4; /* 亮粉色 */
}

#time-display {
    font-family: 'ZCOOL KuaiLe', cursive; /* 趣味字体 */
    font-size: 5em; /* 时间显示字号 */
    font-weight: 700; /* 加粗 */
    margin-bottom: 20px;
    color: #4682b4; /* 钢蓝色 */
}

/* 计时器设置区域 (学习时长、短休息时长输入框) */
.timer-settings {
    margin-bottom: 20px;
    font-size: 1.1em;
    display: flex;
    flex-direction: column; /* 设置项垂直排列 */
    align-items: center; /* 设置项在其容器内水平居中 */
    gap: 12px; /* 设置项之间的垂直间隙 */
}
.timer-settings div { /* 每个设置项 (label + input) 的容器 */
    display: flex;
    align-items: center; /* 标签和输入框在同一行内垂直居中对齐 */
    gap: 8px; /* 标签和输入框之间的水平间隙 */
}
.timer-settings label {
    color: #555;
    font-weight: 500; /* 标签文字稍加粗 */
}
.timer-settings input[type="number"] {
    width: 60px; /* 输入框宽度 */
    padding: 8px; /* 内边距 */
    border: 1px solid #b0e0e6; /* 粉蓝色边框 */
    border-radius: 8px; /* 圆角 */
    font-size: 1em;
    text-align: center; /* 输入内容居中 */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05); /* 细微内阴影 */
}

/* 计时器控制按钮组 */
.timer-buttons {
    display: flex;
    flex-wrap: wrap; /* 允许按钮换行 */
    justify-content: center; /* 按钮在其容器内水平居中 */
    gap: 8px; /* 按钮之间的间隙 */
}
.timer-buttons .control-btn {
    padding: 12px 15px; /* 按钮内边距 */
    margin: 5px; /* 按钮外边距，用于换行时的间距 */
    font-size: 1.1em;
    font-weight: 500;
    border: none; /* 无边框 */
    border-radius: 25px; /* 大圆角，形成胶囊状或圆形按钮 */
    cursor: pointer;
    transition: all 0.2s ease; /* 平滑过渡效果 */
    min-width: 90px; /* 按钮最小宽度 */
    box-shadow: 0 3px 5px rgba(0,0,0,0.1); /* 按钮阴影 */
    flex-grow: 1; /* 允许按钮在 flex 容器中分配额外空间 */
    flex-basis: 100px; /* 按钮在分配额外空间前的基本宽度 */
}

/* 不同功能按钮的特定颜色 */
.control-btn.start { background-color: #90ee90; color: #333; } /* 开始按钮 - 淡绿色 */
.control-btn.start:hover { background-color: #76c876; transform: translateY(-2px); }
.control-btn.pause { background-color: #ffd700; color: #333; } /* 暂停按钮 - 金色 */
.control-btn.pause:hover { background-color: #e6c300; transform: translateY(-2px); }
.control-btn.reset, .control-btn.skip { background-color: #dda0dd; color: #fff; } /* 重置和跳过按钮 - 紫红色 */
.control-btn.reset:hover, .control-btn.skip:hover { background-color: #c98cc9; transform: translateY(-2px); }

.control-btn.complete-early { background-color: #FFD700; color: #333; } /* 提前完成按钮 - 金色 */
.control-btn.complete-early:hover { background-color: #ffc400; transform: translateY(-2px); }

/* 禁用状态的按钮 */
.control-btn:disabled {
    background-color: #d3d3d3; /* 浅灰色 */
    color: #777;
    cursor: not-allowed; /* 不可点击光标 */
    box-shadow: none; /* 无阴影 */
    transform: none; /* 无位移 */
}

/* 已完成番茄计数器 */
#pomodoro-counter {
    margin-top: 20px;
    font-size: 1.2em;
    color: #6a5acd; /* 暗淡蓝紫色 */
    font-weight: 500;
}

/* === 任务列表部分特有样式 === */
.todo-section h2 {
    font-family: 'ZCOOL KuaiLe', cursive; /* 趣味字体 */
    text-align: center;
    margin-bottom: 20px;
    font-size: 2em;
    color: #ff7f50; /* 珊瑚色 */
}

/* 任务输入区域 */
.task-input-area {
    display: flex; /* 使用flex布局使输入框和按钮在同一行 */
    margin-bottom: 20px;
}
.task-input-area input[type="text"] {
    flex-grow: 1; /* 输入框占据剩余空间 */
    padding: 12px 15px;
    font-size: 1em;
    border: 1px solid #b0e0e6; /* 粉蓝色边框 */
    border-radius: 10px 0 0 10px; /* 左侧圆角，与按钮组合 */
}
.task-input-area input[type="text"]::placeholder {
    color: #aaa; /* 占位符文字颜色 */
}
.task-input-area .add-btn { /* 添加按钮 */
    padding: 12px 18px;
    background-color: #32cd32; /* 酸橙绿 */
    color: white;
    border: none;
    border-radius: 0 10px 10px 0; /* 右侧圆角 */
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.2s;
}
.task-input-area .add-btn:hover {
    background-color: #28a428; /* 悬停时深一点的酸橙绿 */
}

/* 任务列表 */
#task-list {
    list-style: none; /* 去掉默认列表符号 */
    padding: 0;
    margin: 0;
    max-height: 280px; /* 限制最大高度，超出则滚动 */
    overflow-y: auto; /* 内容超出时显示垂直滚动条 */
}
#task-list li { /* 每个任务项 */
    display: flex;
    justify-content: space-between; /* 任务文本和操作按钮两端对齐 */
    align-items: center; /* 垂直居中对齐 */
    padding: 12px 15px;
    background-color: #fffacd; /* 柠檬绸色 */
    border-bottom: 1px dashed #eee8aa; /* 苍金麒麟色虚线底部边框 */
    border-radius: 8px; /* 圆角 */
    margin-bottom: 10px; /* 任务项之间的间距 */
    font-size: 1.05em;
    transition: transform 0.2s ease; /* 平滑过渡效果 */
}
#task-list li:hover {
    transform: scale(1.02); /* 悬停时轻微放大 */
}
#task-list li.completed span { /* 已完成任务的文本样式 */
    text-decoration: line-through wavy #ff6347; /* 番茄色波浪删除线 */
    color: #888; /* 文字颜色变灰 */
}
/* 任务操作按钮区域 */
#task-list li .task-actions button {
    background: none; /* 透明背景 */
    border: none; /* 无边框 */
    cursor: pointer;
    padding: 5px;
    font-size: 1.2em; /* 操作按钮图标/文字大小 */
    margin-left: 10px; /* 与前一个按钮或文本的左边距 */
}
#task-list li .task-actions .complete-btn { color: #20b2aa; } /* 完成按钮 - 浅海洋绿 */
#task-list li .task-actions .delete-btn { color: #ff6347; } /* 删除按钮 - 番茄色 */
#task-list li .task-actions button:hover { opacity: 0.7; } /* 悬停时透明度变化 */

/* === 全屏模式下的特定调整 === */
body:fullscreen .app-container { /* 当 body 进入全屏状态时 */
    height: 100vh; /* 高度占满视口 */
    width: 100vw; /* 宽度占满视口 */
    max-width: none; /* 取消最大宽度限制 */
    max-height: none; /* 取消最大高度限制 */
    border-radius: 0; /* 全屏时去掉圆角 */
    padding: 10px; /* 调整内边距 */
    overflow-y: auto; /* 如果内容依然超出，允许滚动 */
}
body:fullscreen .top-controls {
    margin-bottom: 5px; /* 调整顶部控件的下边距 */
}
/* 在全屏模式下使用视口单位 (vw, vh) 调整字体大小，使其具有响应式特性 */
body:fullscreen #time-display { font-size: 7vw; }
body:fullscreen #state-label { font-size: 4vw; }
body:fullscreen .timer-buttons .control-btn { padding: 2vh 3vw; font-size: 2vw;}
body:fullscreen .todo-section h2 {font-size: 3vw;}

/* === 状态相关的视觉提示 (通过给 body 添加类来改变样式) === */
body.study-state #state-label { color: #ff69b4; } /* 学习状态下的标题颜色 */
body.study-state #time-display { color: #4682b4; } /* 学习状态下的时间颜色 */

body.break-state #state-label { color: #32cd32; } /* 休息状态下的标题颜色 */
body.break-state #time-display { color: #20b2aa; } /* 休息状态下的时间颜色 */

/* 辅助类：供屏幕阅读器读取，视觉上隐藏 (用于按钮中的emoji等) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}