/* --- 全局样式和变量 --- */
:root {
    /* 主要颜色 */
    --primary-color: #4a90e2; /* 蓝色：代表专业、可靠 */
    --primary-light: #7cb1ff;
    --primary-dark: #1a62b3;
    
    /* 次要颜色 */
    --secondary-color: #ffd400; /* 黄色：代表活力、警示 */
    --secondary-light: #ffe14d;
    --secondary-dark: #e6be00;
    
    /* 基础颜色 */
    --background-color: #f5f7fa;
    --text-color: #333333;
    --light-gray: #e0e0e0;
    --medium-gray: #9e9e9e;
    --dark-gray: #616161;
    
    /* 功能颜色 */
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --info-color: #2196f3;
    
    /* 通用尺寸 */
    --border-radius: 6px;
    --button-radius: 50px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* 字体 */
    --font-family: 'Roboto', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    --font-size-xxl: 32px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08);
    
    /* 动画 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* --- 基本重置和全局设置 --- */
*, *::before, *::after {
    box-sizing: border-box; /* 让 padding 和 border 不增加元素总宽高 */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* 更现代的字体栈 */
    margin: 0; /* 移除默认外边距 */
    padding: 0; /* 移除默认内边距 */
    background-color: var(--light-bg); /* 设置页面背景色 */
    color: var(--dark-text); /* 设置默认文字颜色 */
    display: flex; /* 使用 Flexbox 布局，用于页脚固定 */
    flex-direction: column; /* 主轴方向为垂直 */
    min-height: 100vh; /* 最小高度为视口高度 */
    line-height: 1.6; /* 默认行高 */
}

/* --- 链接样式 --- */
a {
    color: var(--primary-color); /* 链接颜色为蓝色 */
    text-decoration: none; /* 默认无下划线 */
    transition: color 0.2s ease-in-out; /* 颜色过渡效果 */
}

a:hover {
    color: #0a58ca; /* 悬停时深一点的蓝色 */
    text-decoration: underline; /* 悬停时显示下划线 */
}

/* --- 头部样式 --- */
header {
    /* background: linear-gradient(to right, var(--primary-color), #0a58ca); */
     /* 蓝色渐变背景 */
    color: var(--white-color); /* 文字白色 */
    /* padding: 1rem 2rem;  */
    /* 内边距 */
    text-align: center; /* 文字居中 */
    box-shadow: 0 2px 5px var(--shadow-color); /* 添加底部阴影 */
    position: relative; /* 添加相对定位 */
    overflow: hidden; /* 确保装饰内容不会溢出 */
}

/* 添加头部装饰元素 */
header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: 0;
}

.logo {
    display: flex;
    align-items: center;
    padding-left: 100px;
    justify-content: left;
    font-size: 2.2rem;
    font-weight :700px;
    font-style: oblique;
    /* color: var(--primary-color); */
    color: var(--primary-dark);
    cursor: pointer;
    transition: all var(--transition-normal);
    /* padding: var(--spacing-md) 0; */
    text-align: center;
    position: relative;
    z-index: 1;
}

.logo:hover {
    transform: scale(1.05);
    text-shadow: var(--primary-dark);
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--spacing-xs);
    color: var(--primary-color);
    animation: pulse 1.5s infinite alternate ease-in-out;
    position: relative;
}

.timer-svg-icon {
    color: #ffd400;
    transition: all var(--transition-normal);
    filter: drop-shadow(0 0 1px rgb(82, 169, 228));
}

.timer-circle-bg {
    stroke-dasharray: 63;
    stroke-dashoffset: 0;
    transform-origin: center;
    animation: circle-animation 8s linear infinite;
}

.timer-mark {
    transform-origin: center;
    opacity: 0.8;
}

.timer-hand {
    transform-origin: center;
    animation: hand-animation 8s linear infinite;
}

.timer-center {
    animation: pulse 1.5s infinite alternate ease-in-out;
}

.logo-text {
    display: inline-flex;
    transition: all var(--transition-normal);
    position: relative;
}

.logo-highlight {
    color: var(--secondary-color);
    position: relative;
    transition: all var(--transition-normal);
}

.logo-highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--secondary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.logo:hover .logo-highlight::after {
    transform: scaleX(1);
    transform-origin: left;
}

@keyframes circle-animation {
    from {
        stroke-dashoffset: 0;
    }
    to {
        stroke-dashoffset: 63;
    }
}

@keyframes hand-animation {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    from {
        opacity: 0.8;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1.02);
    }
}

.logo::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.1) 0%, rgba(74, 144, 226, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.logo:hover::before {
    opacity: 1;
}

/* --- 主内容区域 --- */
main {
    flex-grow: 1; /* 占据所有可用垂直空间 */
    /* padding: 2rem 1rem;  */
    /* 内边距 (左右稍小) */
    max-width: 960px; /* 稍宽的最大宽度 */
    margin: 0 auto; /* 水平居中 */
    width: 100%; /* 默认占满父容器 */
}
/* --- 计时器容器通用样式 --- */
.timer-container{
    background-color: var(--light-blue); 
    /* 使用浅蓝色背景 */
    padding: 1rem 1.5rem; /* 内边距调整 */
    border-radius: 12px; /* 更大的圆角 */
    box-shadow: 0 4px 15px var(--shadow-color); /* 更明显的阴影 */
    text-align: center; /* 内容居中 */
    margin-bottom: 2.5rem; /* 和下方内容区的间距增大 */
}

.timer-container h2 {
    margin-top: 0;
    margin-bottom: 1.5rem; /* 标题和下方内容间距 */
    color: var(--primary-color); /* 标题颜色为蓝色 */
    font-size: 1.8rem; /* 标题字体大小 */
}

/* --- Page 1: 计时器设置 --- */
.display {
    font-family: 'Courier New', Courier, monospace; /* 使用等宽字体显示时间 */
    font-size: 3rem; /* 时间显示字体更大 */
    font-weight: bold;
    margin: 1.5rem 0;
    background-color: var(--white-color); /* 白色背景 */
    color: var(--primary-color);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: 2px solid var(--primary-color); /* 蓝色边框 */
    min-height: 60px;
    display: inline-block; /* 使其根据内容调整宽度，但仍可设置 padding */
    letter-spacing: 3px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); /* 内阴影增加立体感 */
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px; /* 按钮间距增大 */
    max-width: 300px; /* 限制数字键盘最大宽度 */
    margin: 2rem auto; /* 上下边距增大并居中 */
}

/* --- 按钮通用样式 --- */
.num-btn, .controls button {
    padding: 1rem; /* 统一内边距 */
    font-size: 1.1rem; /* 字体大小 */
    border: none; /* 移除默认边框 */
    border-radius: 8px; /* 圆角 */
    cursor: pointer;
    background-color: var(--white-color); /* 默认白色背景 */
    color: var(--primary-color); /* 默认蓝色文字 */
    font-weight: 600;
    box-shadow: 0 2px 5px var(--shadow-color); /* 添加按钮阴影 */
    transition: transform 0.1s ease, background-color 0.2s ease, box-shadow 0.2s ease; /* 过渡效果 */
}

.num-btn:hover, .controls button:hover {
    background-color: var(--secondary-color); /* 悬停时背景变黄 */
    color: var(--dark-text); /* 悬停时文字变深 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); /* 悬停时阴影加深 */
}

.num-btn:active, .controls button:active {
    transform: translateY(2px); /* 点击时轻微下沉 */
    box-shadow: 0 1px 3px var(--shadow-color); /* 点击时阴影变浅 */
}

.zero-btn {
    grid-column: span 3; /* 0 按钮占据三列 */
}

.controls {
    display: flex;
    justify-content: center; /* 居中排列 */
    gap: 1rem; /* 按钮间距 */
    margin-top: 1.5rem;
}

.controls button {
    min-width: 120px; /* 设置最小宽度 */
}

/* Set 按钮特定样式 */
#set-btn {
    background-color: var(--primary-color); /* 蓝色背景 */
    color: var(--white-color);
}

#set-btn:hover {
    background-color: #0a58ca; /* 深蓝色悬停 */
    color: var(--white-color);
}

/* Clear/Back 按钮特定样式 */
#clear-btn, #clear-btn-page2, #back-btn {
    background-color: var(--secondary-color); /* 黄色背景 */
    color: var(--dark-text);
}

#clear-btn:hover, #clear-btn-page2:hover, #back-btn:hover {
    background-color: #ffca2c; /* 稍亮的黄色悬停 */
    color: var(--dark-text);
}

/* --- Page 2: 计时器显示 --- */
.timer-container.page2 {
    background-color: var(--primary-color); /* Page 2 容器用主蓝色 */
    color: var(--white-color);
}

.timer-container.page2 h2 {
    color: var(--white-color); /* Page 2 标题白色 */
}

.visual-timer {
    margin: 2rem 0; /* 上下边距 */
    position: relative; /* 用于内部元素定位 */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-circle {
    width: 220px; /* 圆环容器增大 */
    height: 220px;
    position: relative;
}

.timer-circle svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.bg-circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.3); /* 背景圆环用半透明白色 */
    stroke-width: 20; /* 圆环加粗 */
}

.progress-circle {
    fill: none;
    stroke: var(--secondary-color); /* 进度圆环用黄色 */
    stroke-width: 20; /* 圆环加粗 */
    stroke-linecap: round; /* 线条末端为圆形 */
    stroke-dasharray: 628.3; /* 初始值 (2 * PI * 100)，JS会更新 */
    stroke-dashoffset: 628.3; /* 初始值，JS会更新 */
    transition: stroke-dashoffset 1s linear; /* 平滑过渡 (设为1s，与JS一致) */
}

.time-left {
    font-family: 'Courier New', Courier, monospace;
    font-size: 3.5rem; /* 剩余时间字体更大 */
    font-weight: bold;
    color: var(--white-color); /* 文字白色 */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    letter-spacing: 2px;
}

.controls.page2-controls {
    justify-content: center;
    gap: 1.5rem; /* Page 2 按钮间距更大 */
}

/* Start 按钮特定样式 */
#start-btn {
    background-color: var(--secondary-color); /* Start 按钮用黄色 */
    color: var(--dark-text);
    padding: 1rem 2.5rem; /* 更大的内边距 */
    font-size: 1.3rem;
}

#start-btn:hover {
    background-color: #ffca2c;
    color: var(--dark-text);
}

#start-btn:disabled {
    background-color: #aaa; /* 禁用时灰色 */
    color: #eee;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.back-button-container {
    text-align: center;
    margin-top: 2rem; /* 与上方内容间距增大 */
}

#back-btn {
     padding: 0.8rem 1.5rem; /* 返回按钮小一点 */
     font-size: 1rem;
}

/* --- 内容区域样式 (About, Features etc.) --- */
.content-section {
    background-color: var(--white-color); /* 白色背景 */
    padding: 2rem; /* 内边距 */
    margin-bottom: 2rem; /* 底部外边距 */
    border-radius: 8px; /* 圆角 */
    box-shadow: 0 2px 8px var(--shadow-color); /* 轻微阴影 */
    border-left: 5px solid var(--secondary-color); /* 左侧黄色边框 */
}

.content-section h2 {
    color: var(--primary-color); /* 标题蓝色 */
    border-bottom: 2px solid var(--primary-color); /* 底部蓝色边框 */
    padding-bottom: 0.6rem;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
}

.content-section p, .content-section li {
    color: #495057; /* 稍深的文本颜色 */
    margin-bottom: 1rem; /* 段落下边距 */
}

.content-section ul, .content-section ol {
    padding-left: 25px;
    margin-bottom: 1rem;
}

.content-section li {
     margin-bottom: 0.5rem; /* 列表项间距 */
}

/* --- 页脚样式 --- */
footer {
    background-color: var(--dark-text); /* 页脚背景深灰色 */
    color: rgba(255, 255, 255, 0.7); /* 文字用半透明白色 */
    text-align: center;
    padding: 2rem 1rem;
    margin-top: auto; /* 确保固定在底部 */
    font-size: 0.9rem;
}

footer p {
    margin: 0.5rem 0;
}

footer a {
    color: var(--secondary-color); /* 链接黄色 */
}

footer a:hover {
    color: var(--white-color);
}

/* --- 响应式设计 --- */
@media (max-width: 992px) {
    .logo {
        font-size: var(--font-size-lg);
        padding: var(--spacing-sm) 0;
    }
    
    .timer-svg-icon {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 768px) {
    .logo {
        font-size: var(--font-size-md);
    }
    
    .timer-svg-icon {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 576px) {
    .logo {
        font-size: var(--font-size-md);
    }
    
    .timer-svg-icon {
        width: 20px;
        height: 20px;
    }
}

/* --- Page View Toggling --- */
.page-view {
    display: none; /* Hide all page views by default */
    margin-bottom: 2.5rem; /* Add space below the active view before info content */
}

.page-view.active-view {
    display: block; /* Show the active page view */
}

/* Ensure back button container is only visible with page 2 */
.page1-view .back-button-container {
    display: none;
}
.page2-view .back-button-container {
    display: block; /* Or flex, or whatever its default is */
}

/* Wrapper for the always-visible info content */
/* .info-content-wrapper { */
    /* No specific styles needed currently, */
    /* inherits spacing via margin-bottom on .page-view */
/* } */

/* --- Page 2 Extra Content Styling --- */
/* (Removed - no longer needed as content is always visible) */
/* .page2-extra-content { ... } */

/* --- 页脚样式 --- */
footer {
    background-color: var(--dark-text); /* 页脚背景深灰色 */
    color: rgba(255, 255, 255, 0.7); /* 文字用半透明白色 */
    text-align: center;
    padding: 2rem 1rem;
    margin-top: auto; /* 确保固定在底部 */
    font-size: 0.9rem;
}

footer p {
    color: var(--primary-color);
    margin: 0.5rem 0;
}

footer a {
    color: var(--secondary-color); /* 链接黄色 */
}

footer a:hover {
    color: var(--white-color);
} 