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

:root {
    --primary-color: #4facfe;
    --secondary-color: #00f2fe;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e9ecef;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #404040;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

/* 自动主题检测 */
@media (prefers-color-scheme: dark) {
    body:not([data-theme="light"]) {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --border-color: #404040;
        --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

/* 导航栏样式 */
.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow);
    z-index: 100;
    position: relative;
}

.nav-brand-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.nav-brand-center h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.nav-links {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.2);
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
    text-decoration: none;
    color: white;
}

.nav-link:active {
    transform: translateY(0);
}

.link-icon {
    font-size: 1rem;
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}

.tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    padding: 20px;
    overflow: auto;
}

.tab-content.active {
    display: flex;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.content-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    width: 100%;
}

/* 日历容器 */
.calendar-container {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 90%;
    margin: 0 auto;
    max-width: 1200px;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 10px;
}

.weekday {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 0.9rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    flex: 1;
    grid-template-rows: repeat(5, 1fr);
}

.day-cell {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    position: relative;
    min-height: 0;
}

.day-cell.clickable {
    cursor: pointer;
}

.day-cell.clickable:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.2);
}

.day-cell.non-clickable {
    cursor: default;
}

.day-cell.non-clickable:hover {
    /* 不可点击的日期不显示悬停效果 */
}

.day-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.day-name {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.day-indicators {
    display: flex;
    gap: 2px;
    margin-top: 2px;
}

.indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.holiday-indicator {
    background: #ff6b6b;
}

.lunar-indicator {
    background: #feca57;
}

.today {
    border-color: var(--primary-color) !important;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
}

.other-month {
    opacity: 0.3;
}

/* 右下角主题切换按钮 */
.theme-toggle-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(79, 172, 254, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(79, 172, 254, 0.4);
}

.theme-toggle-fab:active {
    transform: scale(0.95);
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-primary);
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close:hover {
    opacity: 0.7;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px;
    text-align: center;
    border-radius: 16px 16px 0 0;
    position: relative;
}

.modal-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.modal-day-name {
    font-size: 1rem;
    opacity: 0.9;
}

.modal-body {
    padding: 30px;
}

.holiday-info {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    display: none;
}

.holiday-info.show {
    display: block;
}

.lunar-info {
    display: none;
}

.lunar-info.show {
    display: block;
}

.fitness-section, .taboo-section {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 12px;
}

.fitness-section {
    background: rgba(40, 167, 69, 0.1);
    border-left: 4px solid #28a745;
}

.taboo-section {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #dc3545;
}

.fitness-section h3, .taboo-section h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.fitness-section p, .taboo-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .nav-brand-center h1 {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .nav-links {
        position: static;
        transform: none;
        justify-content: center;
    }
    
    .nav-link {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .calendar-container {
        width: 95%;
        padding: 15px;
    }
    
    .content-header {
        padding: 15px;
    }
    
    .theme-toggle-fab {
        width: 48px;
        height: 48px;
        bottom: 15px;
        right: 15px;
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 12px;
    }
    
    .nav-brand-center h1 {
        font-size: 1.4rem;
    }
    
    .subtitle {
        font-size: 0.75rem;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 0.85rem;
        border-radius: 16px;
    }
    
    .link-icon {
        font-size: 0.9rem;
    }
    
    .tab-content {
        padding: 10px;
    }
    
    .content-header {
        padding: 15px;
    }
    
    .calendar-container {
        padding: 15px;
        width: 100%;
    }
    
    .weekday {
        padding: 8px 4px;
        font-size: 0.8rem;
    }
    
    .day-number {
        font-size: 1rem;
    }
    
    .day-name {
        font-size: 0.6rem;
    }
    
    .calendar-grid {
        gap: 4px;
    }
    
    .indicator {
        width: 4px;
        height: 4px;
    }
    
    .theme-toggle-fab {
        width: 44px;
        height: 44px;
        bottom: 12px;
        right: 12px;
        font-size: 1.2rem;
    }
}