:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db; /* 主题强调色，可以换成更自然的颜色 */
    --background-color: #f5f6fa; /* 页面整体背景色，可能会被视频覆盖 */
    --text-color: #e0e0e0; /* 文本颜色，在深色/模糊背景上需要更亮 */
    --border-radius: 12px; /* 更圆润的边角 */
    --transition: all 0.3s ease;
    --secondary-color-rgb: 52, 152, 219; /* 为rgba背景色准备的RGB值 */

}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    position: relative;
}

.video-background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.background-video.active {
    opacity: 1; 
}

.navbar {
    background-color: transparent; 
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999; 
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    transition: var(--transition);
}

.logo:hover {
    color: var(--secondary-color);
}

.nav-controls {
    display: flex;
    align-items: center;
}

.icon-btn {
    background-color: rgba(36, 35, 35, 0.3); /* 半透明深色背景 */
    border: 1px solid rgba(255, 255, 255, 0.3); /* 浅色细边框 */
    color: var(--text-color); /* 保持现有的文字颜色，假设它是浅色的 */
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0; /* 移除内边距，尺寸和弹性布局会处理居中 */
    margin-left: 0.8rem;
    transition: var(--transition);
    border-radius: 50%; /* 设置为圆形 */
    width: 40px; /* 为圆形指定明确的宽度 */
    height: 40px; /* 为圆形指定明确的高度 */
    display: inline-flex; /* 用于内部图标对齐 */
    align-items: center; /* 垂直居中图标 */
    justify-content: center; /* 水平居中图标 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* 轻微阴影 */
}

.icon-btn:hover, .icon-btn:focus { /* 合并悬停和焦点状态以保持一致 */
    color: var(--secondary-color);
    background-color: rgba(0, 0, 0, 0.5); /* 悬停/焦点时加深背景色 */
    border-color: rgba(255, 255, 255, 0.5); /* 使边框更不透明一些 */
    outline: none; /* 移除默认的焦点轮廓（如果有的话） */
}

.background-music-toggle-btn {
    /* 使用 .icon-btn 的通用样式 */
} 

.menu-toggle-btn {
    /* 使用 .icon-btn 的通用样式 */
}

/* Side Menu Styles */
.side-menu {
    position: fixed;
    top: 0;
    right: -300px; 
    width: 280px; 
    height: 100%;
    background-color: rgba(30, 30, 30, 0.25); 
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    box-shadow: -5px 0 15px rgba(0,0,0,0.2); 
    padding: 2rem 1.5rem;
    z-index: 1001; 
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); 
    display: flex;
    flex-direction: column;
}

.side-menu.active {
    right: 0; 
}

.close-menu-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem; 
}

.menu-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 2rem;
    text-align: center;
}

.side-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-menu ul li {
    margin-bottom: 1.2rem;
}

.side-menu ul li a.menu-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 0.5rem 0;
    display: block;
    transition: var(--transition);
    border-left: 3px solid transparent; 
    padding-left: 10px;
}

.side-menu ul li a.menu-link:hover,
.side-menu ul li a.menu-link.active {
    color: var(--secondary-color);
    border-left-color: var(--secondary-color);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4); 
    z-index: 1000; 
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0s 0.4s;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease;
}

/* New: Central Controls Module */
.central-controls-module {
    position: fixed;
    top: 90px; /* Distance from the top, below the navbar */
    left: 50%;
    transform: translateX(-50%);
    width: auto; /* Fit content */
    min-width: 280px; /* Minimum width */
    max-width: 350px; /* Maximum width */
    padding: 1rem 1.5rem;
    background-color: rgba(30, 30, 30, 0.35); /* Similar to side-menu */
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border-radius: var(--border-radius);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 990; /* Below side menu (1001) and navbar (999) but above player */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center content horizontally */
    gap: 1rem; /* Space between time display and timer controls */
}

.central-controls-module .time-display {
    text-align: center; /* Center time text */
    width: 100%;
}

.central-controls-module .current-time {
    font-size: 2.8rem; /* Larger time display */
    font-weight: 500;
    color: var(--text-color);
}

.central-controls-module .work-phase {
    color: var(--secondary-color);
    font-size: 1rem;
    margin-top: 0.2rem;
}

.central-controls-module .timer-controls {
    display: flex;
    gap: 1rem; /* Space between timer buttons */
    width: 100%;
    justify-content: center;
}

.central-controls-module .timer-btn {
    background-color: rgba(255, 255, 255, 0.15); /* Slightly more opaque buttons */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.8rem 1.2rem; 
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center; 
    gap: 0.5rem;
    flex-grow: 1; /* Make buttons fill available space if needed */
}

.central-controls-module .timer-btn:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white; 
}

.player-section.left-player {
    position: fixed;
    left: 10px; /* 给左侧播放器一些边距 */
    top: 50%; /* 垂直居中 */
    transform: translateY(-50%); /* 精确垂直居中 */
    width: auto; /* 宽度由内容决定，或者设置一个最大宽度 */
    max-width: 260px; /* 限制最大宽度 */
    max-height: calc(100vh - 40px); /* 调整最大高度，留出上下边距 */
    padding: 1rem; /* Simplified padding */
    background-color: transparent; 
    backdrop-filter: none; 
    -webkit-backdrop-filter: none;
    box-shadow: none; /* 移除整体的 box-shadow */
    border-right: none; /* 移除整体的 border */
    color: var(--text-color); 
    z-index: 998; 
    display: flex;
    flex-direction: column;
    overflow-y: auto; 
    border-radius: 0; 
    align-items: flex-start; /* 左对齐子元素 */
    /* Custom scrollbar for WebKit */
    &::-webkit-scrollbar {
        width: 8px;
    }
    &::-webkit-scrollbar-track {
        background: transparent; /* Or a very subtle color like rgba(0,0,0,0.1) */
        border-radius: 10px;
    }
    &::-webkit-scrollbar-thumb {
        background-color: rgba(255, 255, 255, 0.3); /* Semi-transparent white */
        border-radius: 10px;
        border: 2px solid transparent; /* Creates padding around thumb */
        background-clip: content-box;
    }
    &::-webkit-scrollbar-thumb:hover {
        background-color: rgba(255, 255, 255, 0.5);
    }
    /* Custom scrollbar for Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.player-section.left-player .time-display {
    text-align: left; 
    margin-bottom: 1.5rem; 
    width: 100%;
}

.player-section.left-player .current-time {
    font-size: 2rem; 
}

.player-section.left-player .work-phase {
    font-size: 0.9rem; 
}

.player-section.left-player .audio-controls {
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    margin-bottom: 0; /* Adjusted, timer controls are gone */
    width: 100%; 
    padding-top: 0; /* Reset padding, no sticky header here now */
}

.player-section.left-player .sound-item {
    background-color: rgba(60, 60, 60, 0.4); /* 半透明背景 */
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    padding: 10px 15px;
    display: flex; 
    flex-direction: row; 
    align-items: center; 
    gap: 10px; 
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 50px; /* 给每个item一个最小高度 */
    width: auto; /* 宽度自适应内容，但可以设置最大宽度 */
    max-width: 230px; /* 确保不会太宽 */
    /* 尝试有机形状 */
    /* border-radius: 50% 20% / 10% 40%;  这是一个示例，您可以尝试不同的值 */
    /* border-radius: 60px 20px 70px 15px / 30px 50px 25px 45px; */ /* 更复杂的示例 */
    border-radius: 25px 10px; /* 简化为两角不同的圆角，像一个被压扁的豆荚 */
    transform: rotate(-2deg); /* 轻微旋转增加动态感 */
    margin-bottom: 5px; /* 增加一点底部外边距，防止旋转后重叠 */
}

.player-section.left-player .sound-item:nth-child(even) {
    transform: rotate(2deg); /* 交替旋转方向 */
    /* border-radius: 10px 25px; */ /* 交替形状 */
    align-self: flex-end; /* 尝试让偶数个元素靠右一点，形成错落感 */
    margin-left: 10px; /* 配合align-self */
}


.player-section.left-player .sound-item i {
    font-size: 1.3rem; 
    color: var(--text-color); /* 图标颜色改为文本色，用背景区分 */
    opacity: 0.8;
    margin-bottom: 0; 
}
.player-section.left-player .sound-item span {
    font-size: 0.9rem; 
    flex-grow: 1; 
    color: var(--text-color);
}
.player-section.left-player .sound-item .volume-slider {
    width: 70px; /* 缩小音量条 */
    height: 3px;
}


.player-section.left-player .sound-item:hover {
    background-color: rgba(80, 80, 80, 0.5);
    border-color: var(--secondary-color);
    transform: rotate(0deg) scale(1.05); /* 悬停时回正并放大 */
}
.player-section.left-player .sound-item.playing { 
    background-color: rgba(var(--secondary-color-rgb), 0.4); 
    border-color: var(--secondary-color);
    transform: rotate(0deg) scale(1.08); /* 播放时更突出 */
    box-shadow: 0 0 10px rgba(var(--secondary-color-rgb), 0.5);
}
.player-section.left-player .sound-item.playing i {
    color: white; /* 播放时图标变亮 */
    opacity: 1;
}


.player-section.left-player .timer-controls {
    display: flex;
    flex-direction: column; 
    gap: 0.8rem;
    margin-top: auto; 
    padding-bottom: 0; 
    width: 100%;
}

.player-section.left-player .timer-btn {
    background-color: rgba(255, 255, 255, 0.1); /* 计时器按钮背景 */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.7rem 1rem; 
    border-radius: 10px; /* 按钮也用圆角 */
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center; 
    gap: 0.5rem;
}

.player-section.left-player .timer-btn:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white; 
}


footer { 
    position: fixed;
    bottom: 10px;
    left: 50%; /* 尝试居中页脚 */
    transform: translateX(-50%);
    text-align: center;
    padding: 0.5rem;
    color: rgba(224, 224, 224, 0.7); 
    font-size: 0.8rem;
    z-index: 1; 
    background-color: rgba(0,0,0,0.2); /* 给页脚一点背景使其在某些视频下更可读 */
    border-radius: 5px;
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
}
footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }
    .logo {
        font-size: 1.3rem;
    }
    .icon-btn {
        font-size: 1.2rem;
        margin-left: 0.5rem;
    }

    .side-menu {
        width: 250px; 
        right: -270px; 
    }

    .player-section.left-player {
        width: 200px; /* 移动设备上左侧播放器更窄 */
        padding: 5rem 1rem 1rem 1rem;
        left: 5px; /* 调整边距 */
        max-height: calc(100vh - 60px);
    }
    .player-section.left-player .current-time {
        font-size: 1.8rem;
    }
     .player-section.left-player .sound-item span {
        font-size: 0.8rem;
    }
    .player-section.left-player .sound-item i {
        font-size: 1.2rem;
    }
    .player-section.left-player .sound-item .volume-slider {
        width: 60px;
    }
    .player-section.left-player .sound-item {
        padding: 8px 12px;
        gap: 8px;
    }


    footer { 
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
        bottom: 5px;
    }
}

@media (max-width: 480px) {
    .player-section.left-player {
        /* 在超小屏幕，也许隐藏左侧播放器，通过点击一个浮动按钮来显示一个模态窗口播放器 */
        /* display: none; */ 
        /* 或者，让它更窄，并简化 */
        width: calc(100% - 20px); /* 几乎占满，但留点边距 */
        left: 10px;
        top: auto; /* 不再垂直居中 */
        bottom: 10px; /* 放到屏幕底部 */
        transform: none; /* 移除垂直居中transform */
        height: auto; /* 高度自适应 */
        max-height: 40vh; /* 限制最大高度为屏幕的40% */
        padding: 0.8rem;
        flex-direction: row; /* 尝试水平排列时间显示和音效控制（如果空间允许） */
        flex-wrap: wrap; /* 允许换行 */
        align-items: center;
        background-color: rgba(20,20,20,0.7); /*底部栏背景更深一点*/
    }
     .player-section.left-player .time-display {
        width: auto; /* 不占满宽度 */
        margin-right: 1rem; /* 和音效控制有些间距 */
        margin-bottom: 0.5rem;
    }
    .player-section.left-player .current-time {
        font-size: 1.5rem;
    }
     .player-section.left-player .work-phase {
        font-size: 0.7rem;
    }
    .player-section.left-player .audio-controls {
       flex-direction: row; /* 音效项也尝试水平排列 */
       flex-wrap: wrap; /* 允许换行 */
       gap: 8px;
       margin-bottom: 0.5rem;
       justify-content: center; /*居中*/
       flex-grow: 0;
    }
    .player-section.left-player .sound-item {
        padding: 6px 10px;
        gap: 5px;
        transform: rotate(0deg); /* 移除旋转 */
        max-width: none; /* 移除最大宽度限制，让其自适应 */
        flex-basis: calc(50% - 4px); /* 尝试每行两个，减去gap */
    }
     .player-section.left-player .sound-item:nth-child(even) {
        transform: rotate(0deg);
        align-self: auto;
        margin-left: 0;
    }

    .player-section.left-player .timer-controls {
        flex-direction: row; /* 计时器按钮也水平 */
        gap: 0.5rem;
        width: 100%; /* 占满剩余宽度 */
        justify-content: center;
        margin-top: 0.5rem;
    }
    .player-section.left-player .timer-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .logo {
        display: none; 
    }
    .navbar {
        justify-content: flex-end; 
    }
    footer {
        display: none; /* 小屏幕隐藏页脚 */
    }
}

/* Utility class for hiding sound items based on mode */
.sound-item.hidden-by-mode {
    display: none !important; /* Use important to override existing display flex if needed */
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65); /* Overlay */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    background-color: #ffffff; /* White background for content */
    color: #333333; /* Default dark text color for modal content */
    margin: 5% auto;
    padding: 25px 30px;
    border: none;
    width: 90%;
    max-width: 700px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    position: relative; /* For absolute positioning of close button if needed */
}

.close {
    color: #777; /* Darker grey for close button */
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    text-shadow: none;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out;
}

.close:hover,
.close:focus {
    color: #000000; /* Black on hover/focus */
    text-decoration: none;
    cursor: pointer;
    opacity: 1;
}

/* Main Modal Title (direct child of modal-content) */
.modal-content > h2 {
    color: #222222; /* Very dark title */
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #eeeeee; /* Subtle separator */
}

.about-text {
    margin-top: 15px;
    line-height: 1.75; /* Improved line height */
    color: #444444; /* Main text color */
    font-size: 16px;
}

.about-text p {
    margin-bottom: 1em;
}

.about-text ul {
    margin-left: 20px;
    margin-bottom: 1em;
    padding-left: 5px;
}

.about-text li {
    margin-bottom: 0.5em;
}

/* Language specific styles for title spans within H2 */
.modal-content > h2 span.en,
.modal-content > h2 span.zh {
    display: none; /* Hide both by default, JS will show one */
}

/* Language specific styles */
.about-text .en {
    margin-bottom: 30px;
    display: none;
}

.about-text .zh {
    font-family: 'Noto Sans SC', sans-serif;
    display: none;
}

/* Language switch related styles */
html[lang="en"] .about-text .en {
    display: block;
}

html[lang="zh"] .about-text .zh {
    display: block;
}

.modal h2 .en,
.modal h2 .zh {
    display: none;
}

html[lang="en"] .modal h2 .en,
html[lang="zh"] .modal h2 .zh {
    display: block;
}
