/* 工具页面全局容器 */
.page-tools-container {
    padding: 20px 0;
    max-width: 1200px;
    margin: 0 auto;
    font-family: var(--font-family, sans-serif);
}

/* 广告位样式 */
.tools-ad-slot {
    margin-bottom: 20px;
    background-color: var(--background, #fff);
    border-radius: var(--radius-wrap, 8px);
    overflow: hidden;
    text-align: center;
    box-shadow: var(--box-shadow, 0 1px 3px rgba(0,0,0,0.1));
}
.tools-ad-slot--top {
    min-height: 90px;
}
.tools-ad-slot--right {
    min-height: 250px;
    margin-top: 20px;
}

/* 工具矩阵 */
.tools-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.tool-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background-color: var(--background, #fff);
    border-radius: var(--radius-wrap, 8px);
    box-shadow: var(--box-shadow, 0 1px 3px rgba(0,0,0,0.1));
    text-decoration: none;
    color: var(--main, #333);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover, 0 4px 12px rgba(0,0,0,0.15));
}
.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: var(--theme, #4e88f3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}
.tool-info {
    flex-grow: 1;
}
.tool-name {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}
.tool-desc {
    margin: 0;
    font-size: 13px;
    color: var(--muted, #999);
}
.tool-card.is-disabled {
    cursor: not-allowed;
    opacity: 0.8;
}
.tool-card.is-disabled:hover {
    transform: none;
    box-shadow: var(--box-shadow, 0 1px 3px rgba(0,0,0,0.1));
}
.tool-mask {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}
/* 暗黑模式适配 */
html[data-night="night"] .tool-mask {
    background: rgba(0,0,0,0.7);
}
.tool-mask span {
    background: var(--theme, #4e88f3);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

/* 左右两栏日历区 */
.tools-calendar-section {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.calendar-grid-area {
    flex: 6;
    background-color: var(--background, #fff);
    border-radius: var(--radius-wrap, 8px);
    box-shadow: var(--box-shadow, 0 1px 3px rgba(0,0,0,0.1));
    padding: 20px;
}
.calendar-detail-area {
    flex: 4;
    background-color: var(--background, #fff);
    border-radius: var(--radius-wrap, 8px);
    box-shadow: var(--box-shadow, 0 1px 3px rgba(0,0,0,0.1));
    padding: 20px;
    position: sticky;
    top: 80px;
}

/* 日历头部 */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.cal-month-label {
    font-size: 20px;
    font-weight: bold;
    color: var(--main, #333);
}
.cal-nav-btn, .cal-today-btn {
    border: 1px solid var(--classC, #eee);
    background: var(--background, #fff);
    color: var(--main, #333);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.cal-nav-btn:hover, .cal-today-btn:hover {
    background: var(--theme, #4e88f3);
    color: #fff;
    border-color: var(--theme, #4e88f3);
}

/* 日历网格 */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    color: var(--muted, #999);
    margin-bottom: 10px;
}
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.cal-day-cell {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    border: 1px solid transparent;
}
.cal-day-cell:hover {
    background-color: var(--classD, #f5f5f5);
}
.cal-day-cell.is-other-month {
    opacity: 0.3;
}
.cal-day-cell.is-today {
    border-color: var(--theme, #4e88f3);
}
.cal-day-cell.is-selected {
    background-color: var(--theme, #4e88f3);
    color: #fff;
}
.cal-day-solar {
    font-size: 18px;
    font-weight: bold;
}
.cal-day-lunar {
    font-size: 12px;
    color: var(--muted, #999);
    margin-top: 2px;
}
.cal-day-cell.is-selected .cal-day-lunar {
    color: rgba(255,255,255,0.8);
}
.cal-day-cell .has-festival {
    color: var(--theme, #4e88f3);
    font-weight: bold;
}
.cal-day-cell.is-selected .has-festival {
    color: #fff;
}

/* 右侧详情面板 */
.detail-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--classC, #eee);
}
.detail-solar {
    font-size: 24px;
    font-weight: bold;
    color: var(--theme, #4e88f3);
    margin-bottom: 5px;
}
.detail-lunar {
    font-size: 16px;
    color: var(--main, #333);
}
.detail-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
.info-row {
    background: var(--classD, #f5f5f5);
    padding: 10px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}
.info-label {
    color: var(--muted, #999);
}
.info-value {
    color: var(--main, #333);
    font-weight: bold;
}

/* 宜忌显示 */
.detail-yiji {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.yiji-item {
    display: flex;
    align-items: flex-start;
    background: var(--classD, #f5f5f5);
    padding: 12px;
    border-radius: 6px;
}
.yiji-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    margin-right: 12px;
}
.yiji-badge.yi { background-color: #52c41a; }
.yiji-badge.ji { background-color: #ff4d4f; }
.yiji-content {
    font-size: 14px;
    color: var(--main, #333);
    line-height: 1.6;
}

/* 推荐阅读 */
.recommend-title {
    font-size: 16px;
    margin: 0 0 15px 0;
    color: var(--main, #333);
    border-left: 4px solid var(--theme, #4e88f3);
    padding-left: 10px;
}
.recommend-list {
    min-height: 100px;
    position: relative;
}
.recommend-loading {
    text-align: center;
    color: var(--muted, #999);
    padding: 20px 0;
}

/* 响应式适配 */
@media screen and (max-width: 900px) {
    .tools-calendar-section {
        flex-direction: column;
    }
    .calendar-grid-area, .calendar-detail-area {
        flex: none;
        width: 100%;
    }
}
@media screen and (max-width: 480px) {
    .tools-matrix {
        grid-template-columns: 1fr;
    }
    .cal-day-cell {
        aspect-ratio: auto;
        padding: 10px 0;
    }
}
