/* ========================================
   万年历 - 样式表
   兼容响应式设计
   ======================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background: #f0f2f5;
    line-height: 1.6;
}

a {
    color: #1a73e8;
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: #e84518; text-decoration: underline; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px 30px;
}

/* ========== 头部 ========== */
.header {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff;
    padding: 15px 20px;
    border-radius: 0 0 8px 8px;
    margin-bottom: 15px;
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.logo {
    font-size: 24px;
    font-weight: bold;
    color: #fff !important;
    text-decoration: none !important;
}
.logo:hover { color: #ffe0b2 !important; }
.header-links a {
    color: #fff;
    margin-left: 15px;
    font-size: 14px;
}
.header-links a:hover { color: #ffe0b2; text-decoration: none; }

.header-info {
    margin-top: 8px;
    font-size: 13px;
    opacity: 0.9;
}
.header-info span { margin-right: 15px; }

/* ========== 年份导航 ========== */
.year-nav {
    background: #fff;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.year-nav-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    margin-bottom: 8px;
    color: #666;
    font-size: 13px;
}

.decade-nav { font-weight: normal; font-size: 12px; }
.decade-nav a {
    color: #e74c3c;
    margin: 0 5px;
    text-decoration: none;
}
.decade-nav a:hover { text-decoration: underline; }
.current-decade {
    color: #333;
    font-weight: bold;
    margin: 0 5px;
}

.year-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.year-link {
    display: inline-block;
    padding: 3px 10px;
    font-size: 13px;
    color: #555;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
    min-width: 48px;
    text-align: center;
}
.year-link:hover {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
    text-decoration: none;
}
.year-link.active {
    background: #e74c3c;
    color: #fff;
    border-color: #c0392b;
    font-weight: bold;
}
.year-ellipsis {
    background: #fff;
    border-style: dashed;
    color: #999;
    font-size: 12px;
}
.year-ellipsis:hover {
    background: #f5f5f5;
    color: #e74c3c;
    border-style: solid;
}

/* ========== 月份导航栏 ========== */
.month-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.month-title {
    text-align: center;
}
.month-title h2 {
    font-size: 22px;
    color: #333;
}
.ganzhi-badge {
    display: inline-block;
    font-size: 13px;
    color: #e74c3c;
    background: #fef0ed;
    padding: 2px 10px;
    border-radius: 12px;
    margin-top: 3px;
}
.nav-btn {
    padding: 8px 18px;
    background: #e74c3c;
    color: #fff !important;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none !important;
    white-space: nowrap;
}
.nav-btn:hover { background: #c0392b; }
.nav-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
    color: #999 !important;
}

/* ========== 月份快速切换 ========== */
.month-switch {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.month-btn {
    flex: 1;
    min-width: 55px;
    text-align: center;
    padding: 6px 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
}
.month-btn:hover {
    background: #fde8e5;
    border-color: #e74c3c;
    color: #e74c3c;
    text-decoration: none;
}
.month-btn.current {
    background: #e74c3c;
    color: #fff;
    border-color: #c0392b;
    font-weight: bold;
}

/* ========== 节气提示 ========== */
.jieqi-bar {
    background: #fef9e7;
    border: 1px solid #f9e79f;
    border-radius: 4px;
    padding: 8px 15px;
    margin-bottom: 12px;
    font-size: 13px;
}
.jieqi-label { font-weight: bold; color: #d35400; }
.jieqi-item {
    display: inline-block;
    margin: 0 8px;
    color: #7d6608;
}
.jieqi-item:before {
    content: '|';
    margin-right: 8px;
    color: #ccc;
}

/* ========== 日历主体 ========== */
.calendar-wrapper {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.calendar-table thead th {
    background: #e74c3c;
    color: #fff;
    padding: 10px;
    font-size: 14px;
    font-weight: normal;
}
.calendar-table thead th.weekend { background: #c0392b; }

.calendar-table td {
    border: 1px solid #eee;
    vertical-align: top;
    height: 75px;
    width: 14.28%;
}
.calendar-table td.empty-cell {
    background: #f9f9f9;
}

.day-cell {
    position: relative;
    background: #fff;
    transition: background 0.2s;
}
.day-cell:hover { background: #fef5f4; }

.day-link {
    display: block;
    padding: 5px 6px;
    color: #333;
    text-decoration: none;
    height: 100%;
    min-height: 65px;
}
.day-link:hover { text-decoration: none; color: #333; }

.solar-day {
    display: block;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}
.lunar-text {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
    line-height: 1.3;
}

/* 今天 */
.day-cell.today {
    background: #eaf7ea !important;
    border: 2px solid #27ae60 !important;
}
.day-cell.today .solar-day {
    color: #27ae60;
    font-size: 18px;
}

/* 周末 */
.day-cell.weekend-cell .solar-day { color: #e74c3c; }

/* 节日单元格 */
.day-cell.holiday-cell { background: #fff8e1; }
.day-cell.lunar-holiday-cell { background: #fde8ef; }

/* 节日标签样式 */
.holiday-text {
    display: block;
    font-size: 10px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.holiday-text.solar-tag { color: #d35400; font-weight: bold; }
.holiday-text.lunar-tag { color: #c0392b; font-weight: bold; }

/* ========== 每日详情列表 ========== */
.daily-list {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}
.section-title {
    background: #f5f5f5;
    padding: 10px 15px;
    font-size: 15px;
    color: #333;
    border-bottom: 2px solid #e74c3c;
}
.daily-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
    gap: 10px;
}
.daily-row:hover { background: #fafafa; }
.daily-row.today-row { background: #f0faf0; }

.daily-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    text-decoration: none;
}
.daily-solar {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}
.daily-week { font-size: 12px; color: #888; }

.daily-lunar-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #666;
    flex: 1;
}
.daily-lunar-date { color: #e74c3c; }
.daily-ganzhi { color: #555; }
.daily-shengxiao { color: #888; }
.daily-xingzuo { color: #888; }

.daily-holiday {
    display: flex;
    gap: 4px;
}
.holiday-tag {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
}
.solar-holiday {
    background: #fff3e0;
    color: #e65100;
}
.lunar-holiday {
    background: #fce4ec;
    color: #c62828;
}

/* ========== 面包屑 ========== */
.breadcrumb {
    background: #fff;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #888;
}
.breadcrumb a { color: #666; }
.breadcrumb span { color: #333; font-weight: bold; }

/* ========== 日期导航栏（详情页） ========== */
.date-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.date-title {
    text-align: center;
}
.date-title h2 {
    font-size: 20px;
    color: #333;
}
.date-week {
    font-size: 13px;
    color: #888;
    margin-right: 8px;
}
.today-badge {
    display: inline-block;
    font-size: 11px;
    background: #e74c3c;
    color: #fff;
    padding: 1px 8px;
    border-radius: 10px;
    vertical-align: middle;
}

/* ========== 详情内容 ========== */
.detail-content {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.detail-main { flex: 1; min-width: 0; }
.detail-sidebar { width: 260px; flex-shrink: 0; }

.detail-card {
    background: #fff;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card-title {
    font-size: 16px;
    color: #e74c3c;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}
.holiday-card .card-title { color: #f39c12; }

.info-table { width: 100%; border-collapse: collapse; }
.info-table td {
    padding: 6px 8px;
    border-bottom: 1px dotted #eee;
    font-size: 14px;
}
.info-label {
    width: 100px;
    color: #888;
    font-weight: bold;
}
.jieqi-highlight {
    background: #fef9e7;
    font-weight: bold;
}

.holiday-list { padding: 5px; }
.holiday-item {
    padding: 10px;
    margin: 5px 0;
    border-radius: 6px;
}
.solar-holiday-item { background: #fff8e1; }
.lunar-holiday-item { background: #fce4ec; }
.holiday-icon { font-size: 18px; margin-right: 8px; }
.holiday-name { font-size: 16px; font-weight: bold; }
.holiday-type { font-size: 12px; color: #999; margin-left: 5px; }

/* ========== 侧边栏 ========== */
.sidebar-calendar {
    background: #fff;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.sidebar-title {
    font-size: 14px;
    color: #333;
    text-align: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}
.sidebar-title a {
    color: #e74c3c;
    text-decoration: none;
}

.mini-calendar {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.mini-calendar th {
    padding: 4px;
    background: #f5f5f5;
    color: #666;
    text-align: center;
    font-weight: normal;
}
.mini-calendar td {
    text-align: center;
    padding: 6px 0;
    border: 1px solid #f5f5f5;
}
.mini-calendar td a {
    display: block;
    color: #555;
    text-decoration: none;
    padding: 4px 0;
    border-radius: 3px;
}
.mini-calendar td a:hover {
    background: #fde8e5;
    color: #e74c3c;
}
.mini-selected {
    background: #e74c3c !important;
}
.mini-selected span {
    color: #fff;
    font-weight: bold;
}
.mini-today {
    background: #eaf7ea;
}
.mini-today a { color: #27ae60; font-weight: bold; }
.mini-empty { background: #fafafa; }

.sidebar-links {
    background: #fff;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.quick-links { display: flex; flex-direction: column; gap: 6px; }
.quick-link {
    display: block;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 4px;
    color: #555;
    font-size: 13px;
    text-align: center;
    text-decoration: none;
}
.quick-link:hover {
    background: #e74c3c;
    color: #fff;
    text-decoration: none;
}

/* ========== 推荐区域 ========== */
.recommend-section {
    margin-bottom: 20px;
}
.recommend-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.recommend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-decoration: none;
    flex: 1;
    min-width: 180px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.recommend-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    text-decoration: none;
}
.rec-icon { font-size: 22px; }
.rec-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}
.rec-desc {
    font-size: 12px;
    color: #999;
    margin-left: auto;
}

/* ========== 关于万年历 ========== */
.about-section {
    background: #fff;
    border-radius: 6px;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}
.about-content {
    padding: 15px;
    font-size: 13px;
    color: #666;
    line-height: 1.8;
}
.about-content p { margin-bottom: 8px; }
.about-content strong { color: #e74c3c; }

/* ========== 页脚 ========== */
.footer {
    text-align: center;
    padding: 15px;
    color: #999;
    font-size: 12px;
    line-height: 1.8;
}
.footer a { color: #888; }

/* ========== 详情页 - 农历概览 ========== */
.lunar-summary-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #fff8e1 0%, #fff 100%) !important;
    border-left: 4px solid #e74c3c;
}
.lunar-day-big {
    font-size: 48px;
    color: #e74c3c;
    font-weight: bold;
    line-height: 1;
    min-width: 80px;
    text-align: center;
}
.lunar-summary-info {
    font-size: 14px;
    line-height: 2;
}

/* 日期导航条 */
.date-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.date-title {
    text-align: center;
    flex: 1;
}
.date-title h2 {
    font-size: 20px;
    color: #333;
}
.date-week {
    font-size: 14px;
    color: #888;
    margin-right: 6px;
}
.today-badge {
    display: inline-block;
    background: #27ae60;
    color: #fff;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
}
.nav-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 4px;
    color: #555;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}
.nav-btn:hover { background: #e74c3c; color: #fff; text-decoration: none; }
.nav-btn.disabled { background: #fafafa; color: #ccc; cursor: default; }

/* 宜忌 */
.yiji-card .card-title { color: #e74c3c; }
.yiji-row {
    display: flex;
    padding: 6px 0;
    border-bottom: 1px dotted #eee;
    font-size: 14px;
    line-height: 1.8;
}
.yi-label {
    display: inline-block;
    background: #27ae60;
    color: #fff;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 10px;
    min-width: 36px;
    text-align: center;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 3px;
}
.ji-label {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 10px;
    min-width: 36px;
    text-align: center;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 3px;
}
.yi-content { color: #27ae60; }
.ji-content { color: #e74c3c; }

/* 宜忌文字链接 */
.yiji-link {
    display: inline-block;
    margin: 2px 4px;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}
.yi-link {
    color: #27ae60;
    border: 1px solid #a3e4bc;
    background: #f0faf4;
}
.yi-link:hover { background: #27ae60; color: #fff; text-decoration: none; }
.ji-link {
    color: #e74c3c;
    border: 1px solid #f5b7b1;
    background: #fdf0ef;
}
.ji-link:hover { background: #e74c3c; color: #fff; text-decoration: none; }

/* 节日链接 */
.holiday-item {
    padding: 8px 10px;
    margin: 3px 0;
    border-radius: 6px;
    background: #fef9e7;
}
.holiday-link {
    font-size: 15px;
    font-weight: bold;
    color: #d35400;
    text-decoration: none;
}
.holiday-link:hover { color: #e74c3c; text-decoration: underline; }
.holiday-cat {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 6px;
    font-size: 11px;
    background: #fdebd0;
    color: #b9770e;
    border-radius: 8px;
}

/* 面包屑 */
.breadcrumb {
    padding: 8px 0;
    font-size: 13px;
    color: #888;
}
.breadcrumb a { color: #888; }
.breadcrumb a:hover { color: #e74c3c; }
.breadcrumb span { color: #333; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .detail-content {
        flex-direction: column;
    }
    .detail-sidebar {
        width: 100%;
    }
    .recommend-links {
        flex-direction: column;
    }
    .recommend-item {
        min-width: auto;
    }
    .month-switch {
        gap: 2px;
    }
    .month-btn {
        padding: 5px 0;
        font-size: 11px;
        min-width: 40px;
    }
    .calendar-table td {
        height: 60px;
    }
    .day-link {
        padding: 3px;
        min-height: 54px;
    }
    .solar-day { font-size: 14px; }
    .lunar-text { font-size: 10px; }
    .month-nav-bar { padding: 10px; }
    .month-title h2 { font-size: 18px; }
    .nav-btn { padding: 6px 12px; font-size: 13px; }
    .daily-row { flex-direction: column; align-items: flex-start; }
    .daily-date { flex-direction: row; gap: 5px; }
    .year-nav-list { max-height: 200px; overflow-y: auto; }
}
