/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
}

body {
    font-family: 'Noto Sans SC', 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 15px;
}

.title i {
    color: #667eea;
}

.home-link {
    color: #667eea;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.1);
}

.home-link:hover {
    color: #5a67d8;
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.home-link i {
    font-size: 1.2em;
}

.current-date-display {
    text-align: right;
}

.today-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.solar-date {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 600;
    color: #2d3748;
}

.lunar-date {
    font-size: 1.1rem;
    color: #718096;
    font-weight: 500;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    flex: 1;
    align-items: start;
}

/* 日历部分 */
.calendar-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.nav-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

.nav-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.month-year {
    font-size: clamp(1.4rem, 3.5vw, 1.8rem);
    font-weight: 600;
    color: #2d3748;
}

.calendar-grid {
    width: 100%;
}

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

.weekday {
    padding: 15px 0;
    text-align: center;
    font-weight: 600;
    color: #4a5568;
    background: #f7fafc;
    border-radius: 8px;
}

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

.day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    padding: 8px;
    position: relative;
    background: white;
    border: 2px solid transparent;
    min-height: 60px;
    touch-action: manipulation;
}

.day:hover {
    background: #edf2f7;
    transform: scale(1.05);
}

.day.selected {
    background: #667eea;
    color: white;
    border-color: #5a67d8;
}

.day.today {
    background: #38b2ac;
    color: white;
    font-weight: 700;
}

.day.other-month {
    color: #cbd5e0;
    background: #f8f9fa;
}

.day.festival {
    color: #e53e3e !important;
    font-weight: 600;
}

.day-number {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.day-info {
    font-size: 0.7rem;
    text-align: center;
    line-height: 1.2;
    opacity: 0.8;
}

/* 右侧信息区域 */
.info-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h3 i {
    color: #667eea;
}

/* 日期详情 */
.date-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.detail-item:last-child {
    border-bottom: none;
}

.label {
    font-weight: 600;
    color: #4a5568;
}

.value {
    font-weight: 500;
    color: #2d3748;
    text-align: right;
    max-width: 60%;
}

/* 日期计算器 */
.calculator-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 600;
    color: #4a5568;
}

.date-input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    min-height: 44px;
    width: 100%;
}

.date-input:focus {
    outline: none;
    border-color: #667eea;
}

.result-display {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.interval-result {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    text-align: center;
}

/* 未来节日列表 */
.festivals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.festival-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f7fafc;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.festival-item:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.festival-name {
    font-weight: 600;
    color: #2d3748;
}

.festival-countdown {
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 500;
}

/* 底部 */
.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 16px;
    margin-top: 30px;
    text-align: center;
    color: white;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 15px;
    }
    
    .main-content {
        grid-template-columns: 1fr 350px;
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .container {
        padding: 12px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .info-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .upcoming-festivals {
        grid-column: 1 / -1;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .current-date-display {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .calendar-section,
    .card {
        padding: 15px;
    }
    
    .info-section {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .main-content {
        gap: 12px;
    }
    
    .day {
        padding: 4px;
        min-height: 50px;
    }
    
    .day-number {
        font-size: 0.9rem;
    }
    
    .day-info {
        font-size: 0.55rem;
    }
    
    .weekday {
        padding: 8px 0;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    .header {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .calendar-section,
    .card {
        padding: 12px;
    }
    
    .nav-btn {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .weekday {
        padding: 6px 0;
        font-size: 0.8rem;
    }
    
    .day {
        padding: 2px;
        min-height: 45px;
    }
    
    .day-number {
        font-size: 0.8rem;
    }
    
    .day-info {
        font-size: 0.5rem;
    }
    
    .main-content {
        gap: 10px;
    }
    
    .info-section {
        gap: 10px;
    }
    
    .card h3 {
        font-size: 1.1rem;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .container {
        padding: 5px;
    }
    
    .header {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .calendar-section,
    .card {
        padding: 10px;
    }
    
    .day {
        min-height: 40px;
        padding: 1px;
    }
    
    .day-number {
        font-size: 0.75rem;
    }
    
    .day-info {
        font-size: 0.45rem;
    }
    
    .weekday {
        padding: 4px 0;
        font-size: 0.75rem;
    }
    
    .nav-btn {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    .main-content {
        gap: 8px;
    }
    
    .info-section {
        gap: 8px;
    }
}

/* 特殊节日高亮 */
.day.major-festival {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.day.traditional-festival {
    background: linear-gradient(135deg, #feca57, #ff9ff3);
    color: white;
}

.day.solar-term {
    background: linear-gradient(135deg, #48dbfb, #0abde3);
    color: white;
}

.day.shopping-festival {
    background: linear-gradient(135deg, #ff9ff3, #54a0ff);
    color: white;
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.6s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}