
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    display: flex;
    color: #fff;
    position: relative;
    transition: background 0.5s ease, background-image 0.5s ease;
    padding: 0;
    margin: 0; /* 确保没有外边距 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh; /* 确保最小高度 */
    width: 100%; /* 确保宽度100% */
}

/* 背景动画 - 修复覆盖问题 */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float 15s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0.7;
    }
    25% {
        transform: translateY(-20px) translateX(10px) rotate(90deg);
        opacity: 0.4;
    }
    50% {
        transform: translateY(0) translateX(20px) rotate(180deg);
        opacity: 0.7;
    }
    75% {
        transform: translateY(20px) translateX(10px) rotate(270deg);
        opacity: 0.4;
    }
    100% {
        transform: translateY(0) translateX(0) rotate(360deg);
        opacity: 0.7;
    }
}

/* 左侧主容器 - 修复可能的黑边 */
.container {
    flex: 3;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    z-index: 1;
    position: relative;
    overflow: hidden;
    background: none; /* 确保背景透明 */
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 顶部菜单栏 */
.top-menu {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px; /* 添加间距 */
}

.menu-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    width: 45px;
    height: 45px;
    flex-shrink: 0; /* 防止按钮被压缩 */
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 设置按钮在顶部菜单栏 */
.settings-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    width: 45px;
    height: 45px;
    flex-shrink: 0; /* 防止按钮被压缩 */
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

h1 {
    font-size: 2.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
    animation: pulse 3s infinite;
    flex: 1; /* 让标题占据剩余空间 */
    margin: 0; /* 确保没有外边距 */
    padding: 0; /* 确保没有内边距 */
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* 倒计时主区域 */
.countdown-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

/* 倒计时通用样式 */
.countdown {
    margin: 20px 0;
}

/* 翻页时钟样式 */
.flip-style {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flip-card {
    width: 160px;
    height: 180px;
    perspective: 1000px;
    margin-bottom: 15px;
    position: relative;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.flip-card.flipping .flip-card-inner {
    transform: rotateX(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 5.5rem;
    font-weight: bold;
    overflow: hidden;
}

.flip-card-front {
    background: linear-gradient(145deg, #2c3e50, #4a6491);
    color: white;
    backdrop-filter: blur(10px);
}

.flip-card-front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    z-index: -1;
}

.flip-card-back {
    background: linear-gradient(145deg, #4a6491, #2c3e50);
    color: white;
    transform: rotateX(180deg);
    backdrop-filter: blur(10px);
}

.flip-card-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    z-index: -1;
}

.time-label {
    font-size: 1.5rem;
    margin-top: 10px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* 数字时钟样式 */
.digital-style {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.digital-time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.digital-number {
    font-size: 4.5rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
    min-width: 140px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.digital-number:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.3);
}

/* 进度条时钟样式 */
.progress-style {
    width: 80%;
    max-width: 800px;
    margin: 20px auto;
}

.progress-time-unit {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.progress-time-label {
    width: 40px;
    font-size: 1.2rem;
    text-align: right;
    margin-right: 15px;
}

.progress-time-bar {
    flex: 1;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.progress-time-fill {
    height: 100%;
    border-radius: 15px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-time-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-time-value {
    width: 50px;
    text-align: left;
    margin-left: 15px;
    font-size: 1.2rem;
    font-weight: bold;
}

/* 为不同的时间单位设置不同的颜色 */
#progress-days {
    background: linear-gradient(90deg, #FF6B6B, #FF8E53);
}

#progress-hours {
    background: linear-gradient(90deg, #4ECDC4, #44A08D);
}

#progress-minutes {
    background: linear-gradient(90deg, #FFD93D, #FF9C33);
}

#progress-seconds {
    background: linear-gradient(90deg, #6BCF7F, #4CAF50);
}

.time-status {
    margin-top: 20px;
    font-size: 1.1rem;
    opacity: 0.9;
}

.target-date {
    margin-top: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 25px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

/* 右侧信息栏 - 修复可能的黑边 */
.sidebar {
    flex: 1;
    max-width: 350px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    padding: 25px;
    overflow-y: auto;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 2;
    margin: 0; /* 确保没有外边距 */
    border: none; /* 确保没有边框 */
}

.close-sidebar {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: none;
}

.close-sidebar:hover {
    transform: rotate(90deg);
}

.sidebar h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: white;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* 数据统计样式 */
.statistics-section {
    margin-bottom: 30px;
}

.statistics {
    display: flex;
    justify-content: space-around;
    margin: 15px 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 1rem;
    margin-top: 5px;
    opacity: 0.8;
}

/* 进度条样式 */
.progress-container {
    margin: 20px 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 1rem;
}

.progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 5px;
    transition: width 0.5s ease;
    width: 0%;
}

/* 名言和每日一言区域 */
.quote-section, .motivation-section {
    margin-bottom: 30px;
}

.quote {
    font-size: 1.1rem;
    line-height: 1.6;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.motivation {
    font-size: 1.1rem;
    line-height: 1.6;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.motivation .content {
    margin-bottom: 8px;
}

.motivation .author {
    font-size: 0.9rem;
    opacity: 0.8;
    font-style: italic;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 左侧二级菜单 */
.side-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    padding: 25px 20px;
    transition: left 0.4s ease;
    z-index: 100;
    overflow-y: auto;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
}

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

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.menu-header h3 {
    font-size: 1.5rem;
    color: white;
}

.close-menu {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.close-menu:hover {
    transform: rotate(90deg);
}

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.menu-item i {
    font-size: 1.2rem;
    margin-right: 15px;
    width: 25px;
    text-align: center;
}

.menu-item span {
    font-size: 1rem;
}

.custom-date-section {
    margin-top: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: none;
}

.custom-date-section.active {
    display: block;
}

.custom-date-section h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: white;
}

#custom-date-input {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    margin-bottom: 10px;
}

#custom-date-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
}

#set-custom-date {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#set-custom-date:hover {
    background: rgba(255, 255, 255, 0.3);
}

.footer {
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 5;
    border-radius: 10px;
    margin-top: auto;
}

/* 全屏按钮 - 固定在右下角 */
.fullscreen-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000; /* 确保在最上层 */
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 设置面板样式 */
.settings-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    padding: 30px 25px;
    transition: right 0.4s ease;
    z-index: 100;
    overflow-y: auto;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
}

/* 新增固定保存按钮样式 */
.fixed-save-button {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 310px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 101;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.fixed-save-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-50%) translateY(-2px);
}

.fixed-save-button::after {
    content: "点击保存当前设置";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.fixed-save-button:hover::after {
    opacity: 1;
}

.settings-panel.active {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.settings-header h2 {
    font-size: 1.5rem;
    color: white;
}

.close-settings {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.close-settings:hover {
    transform: rotate(90deg);
}

.setting-group {
    margin-bottom: 25px;
}

.setting-label {
    display: block;
    margin-bottom: 10px;
    font-size: 1rem;
    color: white;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.theme-option {
    height: 60px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.theme-option.active {
    border-color: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* 自定义背景样式 */
.custom-bg-container {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.upload-btn, .remove-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.remove-btn {
    background: rgba(255, 0, 0, 0.3);
    color: white;
}

.upload-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.remove-btn:hover {
    background: rgba(255, 0, 0, 0.5);
}

.bg-preview {
    margin-top: 15px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

/* 新增样式 */
.text-input {
    width: 100%;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    margin-top: 5px;
    resize: vertical;
}

.text-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
}

.api-select {
    width: 100%;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    margin-top: 5px;
}

.api-select option {
    background: #333;
    color: white;
}

.api-custom-container, .api-static-container {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.refresh-input {
    width: 100%;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    margin-top: 5px;
}

.refresh-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
}

/* 单选按钮组样式 */
.radio-group {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-option input {
    margin-right: 5px;
}

.radio-label {
    font-size: 0.9rem;
}

/* 复选框组样式 */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-option input {
    margin-right: 8px;
}

.checkbox-label {
    font-size: 0.9rem;
}

.more-functions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.function-btn {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.function-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.version-info {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: #aaa;
}

.save-success {
    text-align: center;
    color: #4CAF50;
    margin-top: 15px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.save-success.show {
    opacity: 1;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 字体大小设置 */
body.font-small {
    font-size: 14px;
}

body.font-small h1 {
    font-size: 2rem;
}

body.font-small .flip-card-front, 
body.font-small .flip-card-back {
    font-size: 4.5rem;
}

body.font-small .flip-card {
    width: 130px;
    height: 150px;
}

body.font-small .digital-number {
    font-size: 3.5rem;
    min-width: 120px;
    padding: 20px;
}

body.font-small .stat-value {
    font-size: 2rem;
}

body.font-large {
    font-size: 18px;
}

body.font-large h1 {
    font-size: 3rem;
}

body.font-large .flip-card-front, 
body.font-large .flip-card-back {
    font-size: 6rem;
}

body.font-large .flip-card {
    width: 180px;
    height: 200px;
}

body.font-large .digital-number {
    font-size: 5rem;
    min-width: 160px;
    padding: 30px;
}

body.font-large .stat-value {
    font-size: 3rem;
}

/* 动画速度设置 */
body.animation-slow .flip-card-inner {
    transition-duration: 1s;
}

body.animation-slow .particle {
    animation-duration: 25s;
}

body.animation-fast .flip-card-inner {
    transition-duration: 0.3s;
}

body.animation-fast .particle {
    animation-duration: 10s;
}

/* 显示/隐藏元素 */
.statistics.hidden,
.progress-container.hidden,
.motivation.hidden,
.quote.hidden,
.sidebar.hidden,
.api-custom-container.hidden,
.api-static-container.hidden,
.seconds-unit.hidden {
    display: none;
}

/* 隐藏元素通用类 */
.hidden {
    display: none !important;
}

/* 横屏适配增强 - 确保按钮始终可见 */
@media (orientation: landscape) and (max-height: 600px) {
    body {
        overflow: hidden;
    }
    
    .container {
        padding: 10px;
        flex: 1; /* 在横屏时占据全部空间 */
        width: 100%;
    }
    
    .countdown-main {
        padding: 5px 0;
    }
    
    .flip-card {
        width: 100px;
        height: 120px;
    }
    
    .flip-card-front, .flip-card-back {
        font-size: 3.5rem;
    }
    
    .digital-number {
        font-size: 3rem;
        min-width: 80px;
        padding: 10px;
    }
    
    .sidebar {
        padding: 15px;
    }
    
    /* 确保全屏按钮在横屏时可见 */
    .fullscreen-btn {
        position: fixed !important;
        bottom: 15px !important;
        right: 15px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2rem !important;
        z-index: 1000 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* 确保顶部菜单栏的按钮可见 */
    .top-menu {
        margin-bottom: 5px;
    }
    
    .menu-btn, .settings-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}

/* 手机适配 */
@media (max-width: 1024px) {
    .container {
        flex: 2;
    }
    
    .sidebar {
        max-width: 300px;
    }
    
    .flip-card {
        width: 140px;
        height: 160px;
    }
    
    .flip-card-front, .flip-card-back {
        font-size: 4.5rem;
    }
    
    .digital-number {
        font-size: 4rem;
        min-width: 120px;
        padding: 20px;
    }
}

/* 平板适配 - 修复可能的黑边 */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow: hidden;
    }
    
    .container {
        flex: 1;
        height: auto;
        min-height: 100vh;
        padding: 15px;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: none;
        height: 100%;
        transition: right 0.4s ease;
        z-index: 101;
        background: rgba(0, 0, 0, 0.85); /* 确保背景覆盖 */
    }
    
    .sidebar.active {
        right: 0;
    }
    
    .close-sidebar {
        display: block;
    }
    
    .side-menu {
        width: 85%;
        left: -85%;
    }
    
    .settings-panel {
        width: 85%;
        right: -85%;
    }
    
    .flip-card {
        width: 100px;
        height: 120px;
    }
    
    .flip-card-front, .flip-card-back {
        font-size: 3.5rem;
    }
    
    .digital-number {
        font-size: 3rem;
        min-width: 80px;
        padding: 15px;
    }
    
    body.font-small .flip-card {
        width: 80px;
        height: 100px;
    }
    
    body.font-small .flip-card-front, 
    body.font-small .flip-card-back {
        font-size: 2.8rem;
    }
    
    body.font-small .digital-number {
        font-size: 2.5rem;
        min-width: 70px;
        padding: 10px;
    }
    
    body.font-large .flip-card {
        width: 120px;
        height: 140px;
    }
    
    body.font-large .flip-card-front, 
    body.font-large .flip-card-back {
        font-size: 4rem;
    }
    
    body.font-large .digital-number {
        font-size: 3.5rem;
        min-width: 100px;
        padding: 20px;
    }
    
    /* 确保移动端按钮显示 */
    .fullscreen-btn {
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
        width: 45px !important;
        height: 45px !important;
        font-size: 1.3rem !important;
        z-index: 1000 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* 在平板模式下确保背景完全覆盖 */
    .bg-animation {
        width: 100vw;
        height: 100vh;
    }
}

/* 手机适配 */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .flip-card {
        width: 70px;
        height: 90px;
    }
    
    .flip-card-front, .flip-card-back {
        font-size: 2.5rem;
    }
    
    .time-label {
        font-size: 0.9rem;
    }
    
    .digital-number {
        font-size: 2rem;
        min-width: 60px;
        padding: 8px;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
    
    .progress-time-bar {
        height: 20px;
    }
    
    .target-date {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    /* 确保按钮显示 */
    .fullscreen-btn {
        position: fixed !important;
        bottom: 15px !important;
        right: 15px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2rem !important;
        z-index: 1000 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .top-menu {
        gap: 5px;
    }
    
    .menu-btn, .settings-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    body.font-small h1 {
        font-size: 1.4rem;
    }
    
    body.font-small .flip-card-front, 
    body.font-small .flip-card-back {
        font-size: 2.2rem;
    }
    
    body.font-small .flip-card {
        width: 60px;
        height: 80px;
    }
    
    body.font-small .digital-number {
        font-size: 1.8rem;
        min-width: 50px;
        padding: 6px;
    }
    
    body.font-large h1 {
        font-size: 1.8rem;
    }
    
    body.font-large .flip-card-front, 
    body.font-large .flip-card-back {
        font-size: 2.8rem;
    }
    
    body.font-large .flip-card {
        width: 80px;
        height: 100px;
    }
    
    body.font-large .digital-number {
        font-size: 2.5rem;
        min-width: 70px;
        padding: 10px;
    }
}

/* 超宽屏适配 */
@media (min-width: 1600px) {
    body {
        background-size: cover; /* 确保背景完全覆盖 */
    }
    
    .container {
        padding: 40px;
    }
    
    .flip-card {
        width: 180px;
        height: 200px;
    }
    
    .flip-card-front, .flip-card-back {
        font-size: 6rem;
    }
    
    .digital-number {
        font-size: 5rem;
        min-width: 160px;
        padding: 30px;
    }
    
    .sidebar {
        max-width: 400px;
    }
}

/* 打印样式 */
@media print {
    .fullscreen-btn, .menu-btn, .close-sidebar, .settings-btn {
        display: none !important;
    }
    
    .sidebar {
        position: static;
        max-width: 100%;
        box-shadow: none;
        background: white;
        color: black;
    }
    
    body {
        background: white !important;
        color: black;
    }
    
    .bg-animation {
        display: none;
    }
}

/* 通用修复 - 确保没有黑边 */
html {
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: inherit; /* 继承body的背景 */
}
