/* 基本样式 */
body {
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    overflow-y: auto; /* 当内容超出屏幕时允许滚动 */
}

/* 头部样式 */
header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    position: relative; /* 如果需要头部定位，可以加上 */
    z-index: 10; /* 确保头部在大部分内容上方 */
}

/* 右侧图标样式 */
.header-right img {
    width: 24px; /* 图标大小 */
    margin-left: 15px;
    cursor: pointer;
    vertical-align: middle; /* 垂直对齐 */
    /* 如果使用字体图标，这里需要不同的样式 */
}

/* 主内容区域样式 */
main {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 50px; /* 调整顶部外边距 */
    flex-grow: 1; /* 使 main 区域填充剩余空间 */
}

/* 状态文本样式 */
#status-text {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 30px;
    min-height: 1.2em; /* 预留空间防止文本切换时布局跳动 */
    text-align: center;
}

/* 计时器容器样式 */
.timer-progress-container {
    width: 200px; /* 容器大小，决定了圆环的整体尺寸 */
    height: 200px;
    position: relative;
    margin-bottom: 40px;
}

/* SVG 样式 */
.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg); /* 从顶部开始绘制圆环 */
    overflow: visible; /* 确保描边不会被剪裁 */
}

/* 圆环背景样式 */
.timer-circle-bg {
    fill: none; /* 无填充 */
    stroke: #eee; /* 灰色描边 */
    stroke-width: 10; /* 描边宽度，可以根据需要调整 */
    stroke-linecap: round; /* 圆角描边 */
}

/* 进度条圆环样式 */
.timer-circle-progress {
    fill: none;
    stroke: #007bff; /* 正常状态蓝色 */
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s linear; /* 添加过渡动画 */
}

/* 微休息状态下的进度条颜色 */
.timer-progress-container.microbreak .timer-circle-progress {
    stroke: #ffc107; /* 微休息时黄色 */
}


/* 时间显示样式 */
#timer-display {
    font-size: 3em;
    font-weight: bold;
    color: #333;
    position: absolute; /* 绝对定位 */
    top: 50%; /* 定位到容器中心 */
    left: 50%;
    transform: translate(-50%, -50%); /* 精确居中 */
    z-index: 1; /* 确保在 SVG 上层显示 */
}

/* 控制按钮样式 */
#control-button {
    padding: 12px 40px;
    font-size: 1.2em;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#control-button:hover:not(:disabled) {
    background-color: #0056b3;
}

#control-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* 暂停/继续按钮颜色 */
#control-button.pause-state {
    background-color: #ffc107; /* 黄色或橙色 */
}
#control-button.pause-state:hover:not(:disabled) {
     background-color: #ffa000;
}
#control-button.continue-state {
     background-color: #28a745; /* 绿色 */
}
#control-button.continue-state:hover:not(:disabled) {
     background-color: #218838;
}


/* --- 弹框样式 --- */

.modal-background {
    display: none; /* <<<<<<<< 关键：默认隐藏弹框 */
    position: fixed; /* 固定定位覆盖整个屏幕 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */
    /* 注意：这里的 flex 属性在 display: none; 时是不起作用的 */
    /* 它将在 display: flex; 生效时用于居中内容 */
    justify-content: center; /* 居中内容 */
    align-items: center; /* 居中内容 */
    z-index: 100; /* 确保在最上层 */
}

/* 弹框显示时应用的样式 */
.modal-background.show {
    display: flex; /* <<<<<<<< 关键：加上 show 类时显示为 flex */
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    position: relative;
    text-align: center;
    margin: auto; /* flexbox 居中辅助 */
    box-sizing: border-box; /* 盒模型计算 */
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.modal-content .config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-content .config-item label {
    flex-basis: 50%;
    text-align: left;
    margin-right: 10px;
    color: #555;
    /* 防止文本过长换行影响布局 */
    word-break: break-word;
}

.modal-content .config-item input[type="number"] {
    flex-basis: 30%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    box-sizing: border-box;
}

.modal-content .modal-buttons {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.modal-content .modal-buttons button {
    padding: 10px 20px;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#cancel-config {
    background-color: #ccc;
    color: #333;
}
#cancel-config:hover {
    background-color: #bbb;
}

#confirm-config {
    background-color: #007bff;
    color: #fff;
}
#confirm-config:hover {
    background-color: #0056b3;
}

/* 确保 footer 不会遮挡内容或被弹框覆盖，如果需要的话 */
/* footer { margin-top: auto; } */
