/* 黄历页面移动端样式 */
.content-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 10px;
}

.page-title {
    text-align: center;
    color: #8b0000;
    margin-bottom: 20px;
    font-size: 1.6rem;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
}

/* 日期控制区域 */
.date-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 15px auto;
    gap: 10px;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

/* 日期导航按钮区域 */
.date-navigation {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 10px;
    padding: 0 5px;
}

.date-navigation .btn {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    padding: 6px 5px;
    white-space: nowrap;
    margin: 0 2px;
}

/* 日期选择包装器调整 */
.date-selection-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
    align-items: center;
    padding: 0;
    box-sizing: border-box;
}

/* 日期组样式调整 */
.date-group {
    width: 95%; /* 设置为固定的95%宽度 */
    margin-left: auto; /* 左侧自动边距 */
    margin-right: auto; /* 右侧自动边距 */
    padding: 10px;
    box-sizing: border-box;
    border-radius: 8px;
}

/* 日期标签 */
.date-label {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 8px;
}

/* 日期选择容器 */
.date-selection-container {
    width: 100%;
}

/* 公历日期选择器 */
.date-picker {
    width: 100%;
    font-size: 0.95rem;
    padding: 6px 0px;
    max-width: none;
}

/* 农历日期输入容器 */
.lunar-date-inputs {
    display: flex;
    width: 100%;
    gap: 6px; /* 略微增加间距 */
    align-items: stretch; /* 确保所有子元素高度一致 */
    height: 34px; /* 固定高度确保一致性 */
}

/* 移除之前让所有子元素宽度相等的规则 */
.lunar-date-inputs > * {
    min-width: 0;
    box-sizing: border-box;
    height: 100%; /* 继承父容器高度 */
}

/* 农历年份容器 */
.lunar-year-input-container {
    position: relative;
    display: inline-flex;
    flex: 0.4; /* 占40%宽度 */
    width: 40%;
}

/* 农历月份选择器 - 增加宽度 */
#lunar-month {
    flex: 0.51; /* 占40%宽度 */
    width: 40%;
}

/* 农历日期选择器 - 减少宽度 */
#lunar-day {
    flex: 0.2; /* 占20%宽度 */
    width: 20%;
}

/* 农历选择器公共样式 */
.lunar-date-select {
    padding: 6px 5px;
    font-size: 0.95rem;
    max-width: none; /* 取消最大宽度限制 */
}

/* 年份下拉图标调整 */
.year-picker-icon {
    right: 3px;
    width: 16px;
    height: 16px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

/* 干支文本调整 */
.lunar-year-ganzhi {
    right: 22px;
    font-size: 0.95em;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    overflow: hidden;
    max-width: 40%;
    text-overflow: ellipsis;
}

/* 农历年份输入框 */
#lunar-year {
    width: 100%;
    padding-right: 40px; /* 为干支和下拉图标留出空间 */
}

/* 年份下拉列表 */
.year-dropdown {
    width: 300px; /* 增加宽度 */
    left: 50%;
    top: 50%;  /* 居中显示在屏幕中间 */
    transform: translate(-50%, -50%); /* 水平垂直居中 */
    max-height: 320px; /* 增加高度，显示更多内容 */
    overflow-y: auto;
    position: fixed; /* 改为固定定位，避免被遮挡 */
    background-color: rgba(255, 254, 245, 0.05); /* 半透明背景 */
    border: 1px solid rgba(217, 204, 179, 0.5); /* 半透明边框 */
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); /* 增强阴影效果 */
    padding: 15px; /* 增加内边距 */
    display: none;
    z-index: 1000;
    backdrop-filter: blur(5px); /* 添加模糊效果 */
}

/* 年份下拉框标题 */
.year-dropdown::before {
    content: "选择年份";
    display: block;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    color: #8B4513;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(217, 204, 179, 0.8);
}

/* 年份选项网格布局 */
.year-dropdown-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-bottom: 5px;
}

/* 年份选项按钮样式 */
.year-option {
    padding: 10px 5px;
    font-size: 1rem;
    text-align: center;
    background-color: rgba(245, 245, 220, 0.6);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.year-option:hover {
    background-color: rgba(235, 230, 197, 0.9);
    transform: scale(1.05);
    border-color: #8B4513;
}

/* 年份选择分区样式 */
.year-section {
    padding: 8px 0;
    border-bottom: 1px dashed rgba(224, 224, 224, 0.7);
    margin-bottom: 5px;
}

.year-section-title {
    font-weight: bold;
    padding: 8px 0;
    color: #8B4513;
    text-align: center;
    border-bottom: 2px solid rgba(217, 204, 179, 0.8);
    margin-bottom: 8px;
    font-size: 1.1rem;
    background-color: rgba(249, 244, 230, 0.8);
    border-radius: 4px;
}

/* 黄历容器调整 */
.huangli-container {
    margin-top: 10px;
}

.btn {
    padding: 6px 10px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn:hover {
    background-color: #e9e9e9;
}

.btn-primary {
    background-color: #8b0000;
    color: white;
    border-color: #8b0000;
}

.btn-primary:hover {
    background-color: #a52a2a;
}

/* 黄历容器 */
.huangli-container {
    background-color: rgba(255, 248, 220, 0.9);
    border-radius: 8px;
    padding: 5px;
    margin: 15px 0;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.huangli-header {
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #d4a76a;
    padding-bottom: 8px;
}

.huangli-header h3 {
    margin: 0;
    color: #8b4513;
    font-size: 1.3rem;
}

.current-time {
    margin-top: 8px;
    font-size: 1rem;
    color: #5a3d1c;
    font-weight: bold;
}

/* 新的黄历内容布局 */
.huangli-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.huangli-content h4 {
    font-size: 1rem;
    color: #8b4513;
    margin-bottom: 10px;
}


.huangli-top-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.huangli-middle-row {
    width: 100%;
}

.huangli-bottom-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 信息卡片样式 */
.info-card {
    background-color: rgba(255, 255, 240, 0.7);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #d4a76a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-title {
    margin-top: 0;
    margin-bottom: 10px;
    color: #8b4513;
    border-bottom: 1px dashed #d4a76a;
    padding-bottom: 5px;
    font-size: 1.2rem;
}

.info-grid {
    display: grid;
    gap: 8px;
}

.info-item {
    display: flex;
    align-items: center;
    font-size: 1rem;
}

/* 通用标签样式 */
.label {
    font-weight: bold;
    color: #8b4513;
    margin-right: 6px;
}

.gan-zhi-hour {
    font-style: italic;
    color: #555;
}

/* 日期信息区域 */
.date-info .info-grid {
    grid-template-columns: 1fr;
}

/* 宜忌区域 */
.suitable-unsuitable {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: space-between;
}

.yi-ji-section .suitable-unsuitable {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: space-between;
}

.suitable-section, .unsuitable-section {
    width: 48%;
}

.suitable-section h5, .unsuitable-section h5 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #8b4513;
    text-align: center;
    font-size: 1rem;
}

.ji-background {
    background-color: #8b451342;
}

.yi-background {
    background-color: #00640042;
}



.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    justify-content: center;
}

.tag {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 1.08em;
}

.suitable-tag {
    background-color: #e8f5e9;
    border: 1px solid #81c784;
    color: #2e7d32;
}

.unsuitable-tag {
    background-color: #ffebee;
    border: 1px solid #e57373;
    color: #c62828;
}

/* 彭祖百忌区域 */
.peng-zu-bai-ji {
    background-color: #f9f9f9;
    padding: 12px;
    border-radius: 4px;
    font-family: "SimSun", "宋体", serif;
    line-height: 1.5;
    color: #333;
    font-size: 0.9rem;
}

/* 神煞信息区域 */
.shen-sha-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shen-sha-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.shen-sha-item {
    flex: 1;
    min-width: 100%;
    font-size: 0.9rem;
}

.ji-xiong-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.shen-sha-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 九天黄历样式 */
.week-huangli {
    margin-top: 20px;
}

.extension-toggle {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 2px 12px;
    border: 0;
    border-top: 1px solid rgba(92, 49, 20, 0.3);
    border-bottom: 1px solid rgba(92, 49, 20, 0.3);
    background: transparent;
    color: #8b0000;
    font: 500 2rem/1.2 'YanTi', 'STKaiti', serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.extension-indicator {
    position: absolute;
    right: 6px;
    display: inline-block;
    color: #5c3114;
    font-size: 0.95rem;
    transition: transform 0.2s ease;
}

.extension-toggle[aria-expanded="true"] .extension-indicator {
    transform: rotate(90deg);
}

.extension-toggle:focus-visible {
    outline: none;
    box-shadow: inset 3px 0 #8b4513;
}

.week-huangli-panel {
    padding-top: 14px;
}

.scenario-filter {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 14px;
}

.scenario-option {
    min-width: 0;
    padding: 7px 1px;
    border: 1px solid #d4a76a;
    border-radius: 3px;
    background: rgba(255, 248, 220, 0.7);
    color: #5c3114;
    font: 500 0.82rem 'KaiTi', 'STKaiti', serif;
    cursor: pointer;
}

.scenario-option[aria-pressed="true"] {
    border-color: #8b4513;
    background: #8b4513;
    color: #fff;
}

.scenario-option:focus-visible {
    outline: 2px solid #8b4513;
    outline-offset: 1px;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.day-card {
    background-color: #fff8dc;
    border: 1px solid #d4a76a;
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.day-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.day-card.today {
    border: 2px solid #8b0000;
    background-color: #ffa50010;
    box-shadow: 10px 10px 10px 0 rgba(0, 0, 0, 0.5);
}

.scenario-mark {
    width: fit-content;
    margin: 6px auto 3px;
    padding: 4px 8px;
    border-radius: 3px;
    color: #fff;
    text-align: center;
    font-size: 0.88em;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
}

.scenario-宜 {
    background: #2f6b3c;
}

.scenario-忌 {
    background: #9b1c1c;
}

.date-title {
    text-align: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #d4a76a;
}

.solar-date {
    font-size: 0.9em;
    font-weight: bold;
}

.weekday {
    font-size: 0.85em;
    color: #8b4513;
}

.lunar-date {
    font-size: 1.2rem;
    color: #8b4513;
}

/* 九天黄历中的宜忌区域 */
.day-card .suitable-unsuitable {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.day-card .suitable-unsuitable-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
}

.day-card .suitable,
.day-card .unsuitable {
    width: 48%;
    min-height: 2.5em;
    display: flex;
    flex-direction: column;
}

.day-card .suitable .label,
.day-card .unsuitable .label {
    font-weight: bold;
    margin-right: 4px;
    flex-shrink: 0;
    text-align: center;
    font-size: 0.85em;
}

.day-card .suitable .content {
    color: #2e7d32;
    font-size: 0.85em;
}

.day-card .unsuitable .content {
    color: #c62828;
    font-size: 0.85em;
}

/* 九天黄历中的神煞信息 */
.shen-sha-brief {
    font-size: 0.7em;
    margin-top: 6px;
    color: #666;
    border-top: 1px dashed #d4a76a;
    padding-top: 6px;
    line-height: 1.3;
    text-align: left;
}

/* 节气与节日区域 */
.solar-term-section {
    margin-bottom: 15px;
}

.solar-term-festival {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.solar-term, .festival {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
}

.festival-list {
    display: flex;
    color: #006400;
    font-weight: bold;
    font-style: italic;
    flex-wrap: wrap;
    gap: 4px;
}

.festival-item {
    background-color: #f8f0e3;
    border: 1px solid #d4a76a;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 1em;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.huangli-container, .week-huangli {
    animation: fadeIn 0.6s ease-in-out;
}

/* 适配卷轴容器样式 */
.scroll-content {
    padding: 5px;
}



@keyframes fadeInPoem {
    from { 
        opacity: 0;
        transform: translateY(10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.divider {
    text-align: center;
    margin: 15px 0;
    position: relative;
}

.divider::before, .divider::after {
    content: "";
    display: inline-block;
    width: 35%;
    height: 1px;
    background: linear-gradient(to right, transparent, #d4a76a, transparent);
    vertical-align: middle;
}

.cloud-pattern {
    display: inline-block;
    width: 30px;
    height: 15px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 40' fill='%23d4a76a'%3E%3Cpath d='M0,20 Q10,5 20,20 T40,20 T60,20 T80,20 Q70,35 60,20 Q50,5 40,20 Q30,35 20,20 Q10,5 0,20'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    margin: 0 8px;
}

/* 九天黄历网格样式 */
.nine-days-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 15px;
    width: 100%;
}

.day-card {
    background-color: rgba(255, 248, 220, 0.9);
    border: 1px solid #d4a76a;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.day-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.day-date {
    font-size: 13px;
    margin-bottom: 6px;
    color: #8b4513;
    border-bottom: 1px dashed #d4a76a;
    padding-bottom: 4px;
}

.day-suitable {
    font-size: 11px;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.suitable {
    color: #006400;
}

.unsuitable {
    color: #8b0000;
}

.day-chong {
    font-size: 11px;
    color: #8b4513;
    font-weight: bold;
}

/* 错误信息样式 */
.error {
    color: #8b0000;
    text-align: center;
    padding: 15px;
    background-color: rgba(255, 248, 220, 0.9);
    border: 1px solid #d4a76a;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 0.9rem;
}

/* 九天黄历中的宜忌样式 */
.suitable-unsuitable .content {
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.5em;
    line-height: 1.3;
}

/* 节气信息样式 */
.solar-term-content {
    display: flex;
    flex-direction: row;
    gap: 50px;
    justify-content: center;
}

#currentSolarTerm {
    font-weight: bold;
    color: #8b4513;
}

.adjacent-solar-terms {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 1em;
}

.prev-solar-term, .next-solar-term {
    color: #666;
}

.prev-solar-term span, .next-solar-term span {
    color: #8b4513;
    font-weight: 500;
}

.prev-solar-term small, .next-solar-term small {
    font-style: italic;
    color: #888;
    margin-left: 4px;
}

/* 公历与农历日期输入框统一高度 */
.date-picker,
.lunar-date-select,
#lunar-year {
    height: 34px;
    box-sizing: border-box;
}

/* 这里可以添加其他移动端样式 */

/* 当前年份高亮样式 */
.year-option.current-year {
    background-color: rgba(139, 69, 19, 0.85);
    color: white;
    font-weight: bold;
    box-shadow: 0 0 4px rgba(139, 69, 19, 0.5);
}

/* 选中年份样式 */
.year-option.selected {
    background-color: rgba(162, 0, 0, 0.9);
    border: 1px solid #8B4513;
    font-weight: bold;
}

/* 年份行样式 */
.year-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 8px 0;
}

/* 年份区块标题样式 */
.year-section-title {
    font-weight: bold;
    padding: 8px 0;
    color: #8B0000;
    text-align: center;
    border-bottom: 2px solid rgba(217, 204, 179, 0.4);
    margin-bottom: 8px;
    font-size: 1.1rem;
    background-color: rgba(249, 244, 230, 0.5);
    border-radius: 4px;
}

/* 年份区块样式 */
.year-section {
    padding: 8px 0;
    border-bottom: 1px dashed rgba(224, 224, 224, 0.5);
    margin-bottom: 5px;
}

.year-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* 高亮动画 */
@keyframes highlight {
    0% { background-color: #f5f5dc; }
    50% { background-color: #8B4513; color: white; }
    100% { background-color: #f0e6dc; }
}

/* 关闭按钮 */
.year-dropdown-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(139, 69, 19, 0.1);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    color: #8B4513;
    transition: all 0.2s;
}

.year-dropdown-close:hover {
    background-color: rgba(139, 69, 19, 0.2);
    transform: rotate(90deg);
}

/* 年份选择器遮罩层 */
.year-dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: none;
}


