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

html {
    height: 100%;
    overflow: auto;
}

body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
    position: relative;
    transition: background 0.5s ease;
    padding: 20px 0;
}

/* 背景动画 */
.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 {
    text-align: center;
    max-width: 1200px;
    width: 90%;
    padding: 20px;
    z-index: 1;
    animation: fadeIn 1.5s ease-out;
    display: flex;
    flex-direction: column;
    min-height: auto;
    position: relative;
    margin: 0 auto;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
    animation: pulse 3s infinite;
}

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

/* 数据统计样式 */
.statistics {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 20px 0;
    flex-wrap: wrap;
}

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

.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 {
    width: 80%;
    max-width: 600px;
    margin: 20px auto;
}

.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%;
}

/* 倒计时通用样式 */
.countdown {
    margin: 40px 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: 140px;
    height: 160px;
    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: 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: 4rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    min-width: 120px;
    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: 40px 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: 10px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.quote {
    font-size: 1.2rem;
    margin-top: 30px;
    font-style: italic;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    animation: slideIn 1s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.motivation {
    margin-top: 40px;
    font-size: 1.3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    animation: slideIn 1s ease-out 0.2s both;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

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

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

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

.fullscreen-btn, .settings-btn {
    position: fixed;
    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: 10;
}

.fullscreen-btn {
    bottom: 30px;
    right: 30px;
}

.settings-btn {
    bottom: 30px;
    right: 95px;
}

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

.footer {
    position: relative;
    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: 30px;
}

/* 设置面板样式 */
.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);
}

.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);
}

.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;
}

.save-settings {
    width: 100%;
    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;
    margin-top: 20px;
}

.save-settings:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.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: 2.2rem;
}

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

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

body.font-small .digital-number {
    font-size: 3rem;
    min-width: 100px;
    padding: 15px;
}

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

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

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

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

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

/* 动画速度设置 */
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,
.quote.hidden,
.motivation.hidden {
    display: none;
}

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

/* 横屏适配 */
@media (max-height: 600px) and (orientation: landscape) {
    .container {
        padding-top: 10px;
        padding-bottom: 10px;
        justify-content: flex-start;
    }
    
    h1 {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .statistics {
        margin: 10px 0;
    }
    
    .progress-container {
        margin: 10px auto;
    }
    
    .countdown {
        margin: 15px 0;
    }
    
    .flip-card {
        width: 80px;
        height: 100px;
    }
    
    .flip-card-front, .flip-card-back {
        font-size: 2.5rem;
    }
    
    .digital-number {
        font-size: 2.2rem;
        min-width: 70px;
        padding: 10px;
    }
    
    .quote, .motivation {
        margin-top: 15px;
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .footer {
        padding: 10px;
        margin-top: 15px;
    }
}

/* 平板适配 */
@media (max-width: 1024px) and (min-width: 768px) {
    .flip-card {
        width: 120px;
        height: 140px;
    }
    
    .flip-card-front, .flip-card-back {
        font-size: 4rem;
    }
    
    .digital-number {
        font-size: 3.5rem;
        min-width: 100px;
        padding: 15px;
    }
}

/* 手机适配 */
@media (max-width: 767px) {
    body {
        padding: 10px 0;
    }
    
    .container {
        width: 95%;
        padding: 15px 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .statistics {
        gap: 20px;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .flip-card {
        width: 70px;
        height: 90px;
    }
    
    .flip-card-front, .flip-card-back {
        font-size: 2.5rem;
    }
    
    .time-label {
        font-size: 1rem;
    }
    
    .digital-number {
        font-size: 2.5rem;
        min-width: 70px;
        padding: 10px;
    }
    
    .progress-time-unit {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 15px;
    }
    
    .progress-time-label {
        width: auto;
        margin-bottom: 5px;
    }
    
    .progress-time-bar {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .progress-time-value {
        width: auto;
        margin-left: 0;
    }
    
    .quote, .motivation {
        font-size: 1rem;
        padding: 15px;
    }
    
    .footer {
        padding: 12px;
        font-size: 0.8rem;
        margin-top: 20px;
    }
    
    .settings-panel {
        width: 85%;
        right: -85%;
    }
    
    .settings-btn {
        right: 85px;
    }
    
    body.font-small h1 {
        font-size: 1.8rem;
    }
    
    body.font-small .flip-card-front, 
    body.font-small .flip-card-back {
        font-size: 2rem;
    }
    
    body.font-small .stat-value {
        font-size: 1.6rem;
    }
    
    body.font-small .digital-number {
        font-size: 2rem;
        min-width: 60px;
        padding: 8px;
    }
    
    body.font-large h1 {
        font-size: 2.4rem;
    }
    
    body.font-large .flip-card-front, 
    body.font-large .flip-card-back {
        font-size: 3rem;
    }
    
    body.font-large .stat-value {
        font-size: 2.4rem;
    }
    
    body.font-large .digital-number {
        font-size: 3rem;
        min-width: 80px;
        padding: 12px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 360px) {
    .flip-style {
        gap: 10px;
    }
    
    .flip-card {
        width: 60px;
        height: 80px;
    }
    
    .flip-card-front, .flip-card-back {
        font-size: 2rem;
    }
    
    .digital-style {
        gap: 10px;
    }
    
    .digital-number {
        font-size: 2rem;
        min-width: 60px;
        padding: 8px;
    }
    
    .time-label {
        font-size: 0.9rem;
    }
    
    .statistics {
        gap: 15px;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
    
    .progress-container {
        width: 95%;
    }
}