/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--background-color);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 70px; /* 为导航栏预留空间 */
    transition: padding-top var(--transition-fast) ease;
}

/* 导航栏折叠时调整页面内边距 */
.navbar-collapsed + * {
    padding-top: 50px !important;
}

/* 导航栏隐藏动画 */
.navbar-hidden {
    transform: translateY(-100%);
}

/* 悬浮导航按钮样式 */
.floating-nav-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    background: linear-gradient(135deg, var(--primary-color), #4285f4);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

.floating-nav-button.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.floating-nav-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(26, 115, 232, 0.5);
}

/* 移动端触摸反馈 */
.floating-nav-button:active {
    transform: scale(0.95);
    box-shadow: 0 3px 8px rgba(26, 115, 232, 0.6);
}

.floating-nav-button.active {
    background: linear-gradient(135deg, #4285f4, #1a73e8);
}

/* 移动端触摸反馈 */
.floating-nav-button.active:active {
    transform: scale(0.9);
}

.floating-icon {
    width: 24px;
    height: 2px;
    background-color: var(--white);
    position: relative;
    transition: all 0.3s ease;
}

.floating-icon::before,
.floating-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--white);
    transition: all 0.3s ease;
}

.floating-icon::before {
    top: -8px;
}

.floating-icon::after {
    bottom: -8px;
}

.floating-nav-button.active .floating-icon {
    background-color: transparent;
}

.floating-nav-button.active .floating-icon::before {
    transform: rotate(45deg) translate(5px, 6px);
}

.floating-nav-button.active .floating-icon::after {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* 悬浮导航菜单样式 */
.floating-nav-menu {
    position: fixed;
    right: 90px;
    bottom: 20px;
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 16px;
    min-width: 200px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.floating-nav-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-menu-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.floating-menu-link {
    display: block;
    color: var(--text-primary);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
    min-height: 44px; /* 移动端最小触摸高度 */
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

.floating-menu-link:hover {
    background-color: rgba(26, 115, 232, 0.1);
    color: var(--primary-color);
    transform: translateX(-4px);
}

/* 移动端触摸反馈 */
.floating-menu-link:active {
    transform: translateX(-2px);
    background-color: rgba(26, 115, 232, 0.2);
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--white);
    box-shadow: var(--shadow-light);
    z-index: 1000;
    transition: all var(--transition-fast) ease;
    height: 70px;
    overflow: visible;
}

.navbar:hover {
    box-shadow: var(--shadow-medium);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
    position: relative;
}

.navbar-brand {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.brand-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: all var(--transition-fast) ease;
    display: inline-block;
}

.brand-link:hover {
    color: var(--primary-hover);
    transform: scale(1.05);
}

.navbar-menu {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    transition: all var(--transition-medium) ease;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast) ease;
    position: relative;
    display: inline-block;
    min-width: 70px;
    text-align: center;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(26, 115, 232, 0.1);
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: all var(--transition-fast) ease;
}

.nav-link:hover::after {
    width: 80%;
}

/* 导航栏折叠样式 */
.navbar-collapsed {
    height: 50px;
    box-shadow: var(--shadow-medium);
}

.navbar-collapsed .navbar-brand {
    font-size: 1.2rem;
}

.navbar-collapsed .container {
    height: 50px;
}

/* 导航栏隐藏/显示动画 */
.navbar-hidden {
    transform: translateY(-100%);
}

/* 移动导航切换按钮 */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    border-radius: 50%;
    transition: all var(--transition-fast) ease;
    width: 44px; /* 增大触摸区域至44px，符合移动端标准 */
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    position: relative;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

.mobile-nav-toggle:hover {
    background-color: var(--light-gray);
}

/* 移动端触摸反馈 */
.mobile-nav-toggle:active {
    transform: scale(0.9);
    background-color: rgba(26, 115, 232, 0.2);
}

.mobile-nav-toggle.active {
    background-color: var(--primary-color);
}

/* 移动端触摸反馈 */
.mobile-nav-toggle.active:active {
    background-color: var(--primary-hover);
}

/* 汉堡菜单图标 */
.hamburger-icon {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    position: relative;
    transition: all var(--transition-fast) ease;
}

.mobile-nav-toggle.active .hamburger-icon {
    background-color: var(--white);
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: all var(--transition-fast) ease;
}

.mobile-nav-toggle.active .hamburger-icon::before,
.mobile-nav-toggle.active .hamburger-icon::after {
    background-color: var(--white);
}

.hamburger-icon::before {
    top: -8px;
    left: 0;
}

.hamburger-icon::after {
    bottom: -8px;
    left: 0;
}

.mobile-nav-toggle.active .hamburger-icon::before {
    transform: rotate(45deg) translate(5px, 6px);
}

.mobile-nav-toggle.active .hamburger-icon::after {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* 移动端导航菜单样式 */
@media (max-width: 768px) {
    .navbar-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        padding: 20px 0;
        box-shadow: var(--shadow-medium);
        transition: all var(--transition-medium) ease;
        gap: 10px;
        z-index: 999;
    }
    
    .navbar-collapsed .navbar-menu {
        top: 50px;
    }
    
    .nav-menu-open {
        left: 0 !important;
    }
    
    .nav-link {
        padding: 15px 20px;
        width: 100%;
        text-align: left;
        min-width: auto;
    }
    
    .mobile-nav-toggle {
        display: flex;
    }
    
    .navbar-menu {
        left: -100%;
    }
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 章节标题 */
.section-title {
    font-family: var(--font-title);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* 欢迎区域 */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #4285f4);
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,128L48,144C96,160,192,192,288,186.7C384,181,480,139,576,144C672,149,768,203,864,224C960,245,1056,235,1152,213.3C1248,192,1344,160,1392,144L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom center;
    background-size: cover;
}

.hero-content {
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

.welcome-title {
    font-family: var(--font-title);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.welcome-subtitle {
    font-size: 1.5rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* 打字机效果 */
.dynamic-text {
    border-right: 3px solid var(--white);
    animation: typing 3s steps(30, end), blink-caret 0.75s step-end infinite;
    white-space: nowrap;
    overflow: hidden;
}

/* 倒计时区域 */
.countdown-section {
    padding: 80px 0;
    background-color: var(--white);
}

.holiday-section {
    padding: 80px 0;
    background-color: var(--section-background);
}

/* 倒计时显示 */
.countdown-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.countdown-label {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ========== 翻页卡片核心样式 (默认蓝白配色) ========== */
.countdown-flip-card {
    position: relative;
    width: var(--flip-card-width);
    height: var(--flip-card-height);
    background: var(--flip-card-bg);
    border-radius: 12px;
    box-shadow: var(--flip-card-shadow), inset 0 2px 2px var(--flip-card-border);
    font-size: var(--flip-card-font-size);
    font-weight: 700;
    font-family: var(--font-title);
    perspective: 1200px;
}

#days, #holidayDays {
    width: 180px;
}

/* 机械时钟中间分割线 */
.countdown-flip-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -2%;
    width: 104%;
    height: 1px;
    background: var(--flip-card-divider);
    z-index: 10;
    transform: translateY(-50%);
}

/* 上下半区公共样式 */
.half {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    background: var(--flip-card-bg);
    color: var(--flip-card-text);
    overflow: hidden;
}

.half span {
    position: absolute;
    left: 0;
    width: 100%;
    height: var(--flip-card-height);
    line-height: var(--flip-card-height);
    text-align: center;
}

/* 上半区 */
.top-static, .top-flap {
    top: 0;
    border-radius: 12px 12px 0 0;
}

.top-static span, .top-flap span {
    top: 0;
}

/* 下半区 */
.bottom-static, .bottom-flap {
    bottom: 0;
    border-radius: 0 0 12px 12px;
}

.bottom-static span, .bottom-flap span {
    bottom: 0;
}

/* 翻页动画轴心与初始状态 */
.top-flap {
    transform-origin: bottom center;
    z-index: 2;
    backface-visibility: hidden;
}

.bottom-flap {
    transform-origin: top center;
    transform: rotateX(90deg);
    z-index: 2;
    backface-visibility: hidden;
}

/* 主题色区分上半页 */
.top-static, .top-flap {
    background: var(--flip-card-bg-top);
}

.bottom-static, .bottom-flap {
    background: var(--flip-card-bg-bottom);
}

/* 动画触发 */
.flipping .top-flap {
    animation: flipTop 0.25s ease-in forwards;
}

.flipping .bottom-flap {
    animation: flipBottom 0.25s ease-out 0.25s forwards;
}

@keyframes flipTop {
    0%   { transform: rotateX(0deg);   filter: brightness(1); }
    100% { transform: rotateX(-90deg); filter: brightness(0.4); }
}

@keyframes flipBottom {
    0%   { transform: rotateX(90deg);  filter: brightness(0.4); }
    100% { transform: rotateX(0deg);   filter: brightness(1); }
}

.countdown-separator {
    font-family: var(--font-title);
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 10px;
    animation: pulse 1s infinite;
}

/* 节假日标签 */
.holiday-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.holiday-tab {
    padding: 10px 20px;
    background-color: var(--white);
    color: var(--text-secondary);
    border: 2px solid var(--medium-gray);
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition-fast) ease;
    box-shadow: var(--shadow-light);
}

.holiday-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.holiday-tab.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.holiday-name {
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    font-weight: 500;
}

/* 个人信息区域 */
.profile-section {
    padding: 80px 0;
    background-color: var(--white);
}

/* 修改为更具体的选择器，避免与 3D 卡片样式冲突 */
.profile-section .profile-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    transition: all var(--transition-fast) ease;
    max-width: 800px;
    margin: 0 auto;
    gap: 2rem;
    flex-wrap: wrap;
}

.profile-section .profile-card:hover {
    box-shadow: var(--shadow-medium);
}

.profile-avatar {
    flex-shrink: 0;
}

.profile-avatar img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--primary-color);
    transition: all var(--transition-fast) ease;
    animation: fadeIn 1s ease-out;
}

.profile-avatar img:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

.profile-info {
    flex: 1;
    min-width: 300px;
}

.profile-name {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.profile-bio {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-label {
    font-weight: 600;
    color: var(--text-primary);
}

.detail-value {
    color: var(--text-secondary);
}

/* 个人信息链接样式 */
.profile-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.profile-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all var(--transition-fast) ease;
    box-shadow: var(--shadow-light);
}

.profile-link:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.profile-link:active {
    transform: translateY(0);
}

/* 每日激励区域 */
.motivation-section {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-color), #4285f4);
    color: var(--white);
    text-align: center;
}

.motivation-section .section-title {
    color: var(--white);
}

.motivation-section .section-title::after {
    background-color: var(--white);
}

.quote-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-light);
    transition: all var(--transition-fast) ease;
}

.quote-container:hover {
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-medium);
}

.quote-text {
    font-size: 1.5rem;
    font-style: italic;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.quote-author {
    font-size: 1.2rem;
    opacity: 0.9;
}

.refresh-quote {
    padding: 12px 24px;
    background-color: var(--white);
    color: var(--primary-color);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-fast) ease;
    box-shadow: var(--shadow-light);
}

.refresh-quote:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background-color: var(--light-gray);
}

.refresh-quote:active {
    transform: translateY(0);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--white);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes fadeOutIn {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* 平滑过渡类 */
.fade-transition {
    animation: fadeOutIn 0.5s ease;
}

/* 雪花样式 */
.snowflake {
    position: fixed;
    background-color: var(--white);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    user-select: none;
    /* 使用CSS transform优化性能 */
    will-change: transform;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* 响应式设计基础 */
@media (max-width: 768px) {
    .welcome-title {
        font-size: 2.5rem;
    }
    
    .welcome-subtitle {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .countdown-number {
        font-size: 2rem;
    }
    
    .countdown-separator {
        font-size: 2rem;
    }
    
    .countdown-item {
        padding: 1rem;
        min-width: 80px;
    }
    
    .profile-card {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar img {
        width: 150px;
        height: 150px;
    }
    
    .quote-text {
        font-size: 1.2rem;
    }
}

/* ========== 新春主题样式覆盖 ========== */
/* 确保新春主题下原有样式正确应用 */

/* Hero区域 */
[data-theme="newyear"] .hero-section {
    background: linear-gradient(135deg, #cb2d3e, #ef473a);
    color: #ffffff;
}

/* 节假日标签 */
[data-theme="newyear"] .holiday-tab {
    border-color: #c0392b;
    color: #5d4037;
}

[data-theme="newyear"] .holiday-tab:hover,
[data-theme="newyear"] .holiday-tab.active {
    background: #c0392b;
    color: #ffffff;
    border-color: #c0392b;
}

/* 每日激励区域 */
[data-theme="newyear"] .motivation-section {
    background: linear-gradient(135deg, #c0392b, #8e44ad);
    color: #ffffff;
}

[data-theme="newyear"] .motivation-section .section-title {
    color: #ffffff;
}

/* 章节标题 */
[data-theme="newyear"] .section-title {
    font-family: 'Ma Shan Zheng', cursive;
    color: #c0392b;
}

[data-theme="newyear"] .section-title::after {
    background-color: #f1c40f;
}