/* ==================== 仪表盘模块样式 ==================== */
/* 从 admin.css 拆分，包含：仪表盘布局、天气卡片、万年历、黄历详情 */
/* 依赖：admin.css 中的设计令牌（CSS 变量） */

/* ==================== 仪表盘 - 顶部左右布局 ==================== */

/* 顶层：左侧内容 + 右侧万年历 */
.dash-top-grid {
    display: grid;
    grid-template-columns: 1fr 425px;
    gap: 16px;
    align-items: start;
}

/* 右侧万年历卡片 - 由万年历样式区块统一定义 */

/* 右侧列容器（万年历 + 近期生日） */
.dash-right-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 统计卡片4列（缩短） */
.stat-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* 缩短版统计卡片 */
.stat-card-sm {
    padding: 14px 12px;
    gap: 10px;
}

.stat-card-sm .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 17px;
}

.stat-card-sm .stat-value {
    font-size: 20px;
}

.stat-card-sm .stat-label {
    font-size: 11px;
}

/* 下方双列（已弃用，保留兼容） */
.dash-bottom-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
}

@media (max-width: 1200px) {
    .dash-top-grid {
        grid-template-columns: 1fr 385px;
    }
}

@media (max-width: 1024px) {
    .dash-top-grid {
        grid-template-columns: 1fr;
    }
    .dash-cal-card {
        position: static;
    }
    .stat-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    .dash-bottom-grid {
        grid-template-columns: 1fr;
    }
    .dash-right-col {
        position: static;
    }
}

@media (max-width: 640px) {
    .stat-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== 万年历样式（百度万年历风格 · 白底蓝色扁平） ==================== */

/* ---- 三日天气预报卡片 ---- */
.dash-weather-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    padding: 14px 16px 12px;
    /* 与万年历卡片一致的过渡动画 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 天气卡片 hover — 与万年历卡片一致的上浮 + 阴影效果 */
.dash-weather-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #cbd5e1;
}

/* 天气内部容器 */
.weather-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 当前天气：左侧图标+温度，右侧天气描述+城市 */
.weather-current {
    display: flex;
    align-items: center;
    gap: 14px;
}

.weather-cur-left {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-shrink: 0;
}

.weather-cur-icon {
    font-size: 28px;
    line-height: 1;
}

.weather-cur-temp {
    font-size: 32px;
    font-weight: 700;
    color: #222;
    line-height: 1;
}

.weather-cur-right {
    flex: 1;
    min-width: 0;
}

.weather-cur-text {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.weather-cur-city {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* 预警标签 */
.weather-warning {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.weather-warning-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #fff3e0;
    color: #e65100;
}

/* 三日预报横排 */
.weather-forecast {
    display: flex;
    gap: 8px;
}

.weather-day {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    background: #f7f8fa;
    border-radius: 8px;
}

.weather-day-label {
    font-size: 11px;
    font-weight: 600;
    color: #333;
}

.weather-day-icon {
    font-size: 22px;
    line-height: 1;
}

.weather-day-text {
    font-size: 11px;
    color: #999;
}

.weather-day-temp {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* ---- 万年历卡片 ---- */
.dash-cal-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
}

/* 日历头部：年月导航 */
.cal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 6px;
    padding: 0 4px;
}

.cal-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    text-align: center;
    user-select: none;
    padding: 0 2px;
}

.cal-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    background: #fff;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    line-height: 1;
}

.cal-nav-btn:hover {
    background: #f5f5f5;
    color: #333;
    border-color: #d0d0d0;
}

/* "今天"按钮 */
.cal-today-btn {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    width: auto;
    padding: 4px 14px;
    margin-left: 6px;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    background: #fff;
}

.cal-today-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

/* 日历网格 */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

/* 星期行 */
.cal-weekdays {
    border-bottom: none;
    margin-bottom: 2px;
    padding: 0;
    /* 浅底色区分星期行 */
    background: rgba(106, 92, 255, 0.08);
    border-radius: 6px;
}

.cal-weekday {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #999;
    padding: 4px 0;
    user-select: none;
}

/* 周六日红色 */
.cal-weekend-label {
    color: #EB3333;
    opacity: 0.85;
}

/* 日期网格 - 加间距让节假日粉色不粘连 */
.cal-days {
    gap: 3px;
    padding: 0 4px 4px;
}

/* 日期单元格 - 百度风格 */
.cal-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 2px 3px;
    min-height: 52px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s ease;
    user-select: none;
    background: transparent;
    box-shadow: none;
}

.cal-cell:hover {
    background: #f5f5f5;
}

/* 非当月日期 */
.cal-other-month {
    opacity: 0.3;
}

.cal-other-month:hover {
    opacity: 0.45;
}

/* 公历日期 */
.cal-solar {
    font-size: 17px;
    font-weight: 500;
    color: #333;
    line-height: 1.2;
}

/* 周末红色 */
.cal-weekend .cal-solar {
    color: #EB3333;
}

/* 今日高亮 - 蓝色边框包裹整个格子（百度截图：框在粉色背景外面） */
.cal-today {
    box-shadow: inset 0 0 0 2px #4e6ef2;
    background: transparent;
}

.cal-today .cal-solar {
    color: #4e6ef2;
    font-weight: 600;
}

/* 今日+节假日同时：蓝框 + 粉色背景 */
.cal-today.cal-holiday {
    background: rgba(235, 51, 51, 0.05);
    box-shadow: inset 0 0 0 2px #4e6ef2;
}

.cal-today.cal-holiday .cal-solar {
    color: #EB3333;
    font-weight: 600;
}

/* 选中日期 - 蓝色浅底 */
.cal-selected {
    background: rgba(78, 110, 242, 0.06);
    border-radius: 6px;
    box-shadow: none;
}

.cal-selected .cal-solar {
    color: #4e6ef2;
    font-weight: 600;
}

/* 今天+选中同时 */
.cal-today.cal-selected {
    box-shadow: inset 0 0 0 2px #4e6ef2;
    background: rgba(78, 110, 242, 0.06);
}

.cal-today.cal-selected .cal-solar {
    color: #4e6ef2;
    font-weight: 600;
}

/* 节假日单元格 - 粉色背景（百度截图：#EB33330D） */
.cal-holiday {
    background: rgba(235, 51, 51, 0.05);
    border-radius: 6px;
}

.cal-holiday .cal-solar {
    color: #EB3333;
    font-weight: 500;
}

.cal-holiday:hover {
    background: rgba(235, 51, 51, 0.1);
}

/* 调休上班 */
.cal-workday .cal-solar {
    color: #333;
}

/* 休/班 角标 - 百度风格 */
.cal-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 1px 4px;
    border-radius: 3px;
}

/* 休 - 红色文字+浅红背景 */
.cal-badge-rest {
    color: #EB3333;
    background: rgba(235, 51, 51, 0.1);
}

/* 班 - 灰色文字+浅灰背景 */
.cal-badge-work {
    color: #999;
    background: rgba(0, 0, 0, 0.06);
}

/* 农历文字 */
.cal-lunar {
    font-size: 10px;
    color: #999;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-top: 1px;
}

/* 节假日名称 - 红色 */
.cal-holiday-name {
    color: #EB3333;
    font-weight: 500;
}

/* 节气 - 绿色 */
.cal-jieqi {
    color: #52c41a;
    font-weight: 500;
}

/* 生日标记 */
.cal-birthday {
    font-size: 10px;
    line-height: 1;
    position: absolute;
    bottom: 1px;
    left: 2px;
}

/* ==================== 黄历详情面板（百度风格 · 简洁扁平） ==================== */

/* 黄历区域 */
.dash-almanac-wrap {
    padding: 12px 14px 14px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
}

/* 黄历卡片容器 */
.alm-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 节日/节气标签栏（百度截图：节日百科 + 节日名） */
.alm-festival-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.alm-tag-holiday {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(235, 51, 51, 0.06);
    color: #EB3333;
}

.alm-tag-work {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    background: #f5f5f5;
    color: #666;
}

.alm-tag-jieqi {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    background: #f6ffed;
    color: #52c41a;
}

/* 主体：宜忌 + 节日列表 */
.alm-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #eef3ff 0%, #f0f7ff 100%);
    border-radius: 8px;
    border: none;
    box-shadow: none;
}

.alm-yi-ji-row {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.6;
}

/* 宜/忌图标 - 圆形，固定宽度对齐 */
.alm-yi-icon,
.alm-ji-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.alm-yi-icon {
    background: #52c41a;
    color: #fff;
}

.alm-ji-icon {
    background: #EB3333;
    color: #fff;
}

/* 宜忌文字 */
.alm-yi-ji-text {
    font-size: 13px;
    word-break: break-all;
    line-height: 22px;
}

.alm-yi-color {
    color: #333;
}

.alm-ji-color {
    color: #333;
}

/* 本年第X周，第X天 */
.alm-week-info {
    font-size: 13px;
    color: #666;
    padding: 4px 0;
    line-height: 1.5;
}

/* 距离天数（XX节日还有X天） */
.alm-diff-day {
    font-size: 13px;
    color: #e67e22;
    padding: 2px 0;
    line-height: 1.5;
    font-weight: 500;
}

/* 节日汇总行 */
.alm-festival-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    line-height: 1.6;
}

/* 节日标签（蓝色圆形，与宜忌图标等宽对齐） */
.alm-festival-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    background: #037de4;
    color: #fff;
    flex-shrink: 0;
}

/* 节日名称文字 */
.alm-festival-text {
    font-size: 13px;
    color: #555;
    word-break: break-all;
    line-height: 22px;
}

/* 农历日标签（如"初三"） */
.alm-tag-lunar {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    background: #EB3333;
    color: #fff;
}

/* 底部：干支 + 冲煞 */
.alm-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #999;
    padding-top: 2px;
}

.alm-footer-item {
    white-space: nowrap;
}

/* ==================== 黄历响应式 ==================== */
@media (max-width: 640px) {
    .alm-body {
        padding: 8px 10px;
    }
}
