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

/* 广告位样式 */
.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;
}

/* ==========================================================================
   全站工具矩陣：膠囊化與輕量化導航條 (Capsule Nav Ribbon)
   ========================================================================== */
.page-tools-container .tools-matrix {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 10px;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: var(--background, #fff);
    border-radius: 16px;
    border: 1px solid var(--classC, #eaeaea);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.02);
}

.page-tools-container .tools-matrix .tool-card {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 24px;
    background: var(--classD, #fbfbf9);
    border: 1px solid var(--classC, #e8e8e2);
    box-shadow: none;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.page-tools-container .tools-matrix .tool-card:hover {
    background: #fff;
    border-color: var(--theme, #4e88f3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--theme-rgb, 78, 136, 243), 0.15);
}

.page-tools-container .tools-matrix .tool-card.is-active {
    background: var(--theme, #4e88f3) !important;
    border-color: var(--theme, #4e88f3) !important;
    box-shadow: 0 4px 14px rgba(var(--theme-rgb, 78, 136, 243), 0.3) !important;
}

.page-tools-container .tools-matrix .tool-card .tool-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(var(--theme-rgb, 78, 136, 243), 0.08);
    color: var(--theme, #4e88f3);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    margin: 0;
}

.page-tools-container .tools-matrix .tool-card .tool-icon svg {
    width: 14px;
    height: 14px;
}

.page-tools-container .tools-matrix .tool-card.is-active .tool-icon {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

.page-tools-container .tools-matrix .tool-card .tool-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-grow: 0;
}

.page-tools-container .tools-matrix .tool-card .tool-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--main, #2d3748);
    margin: 0;
    white-space: nowrap;
}

.page-tools-container .tools-matrix .tool-card.is-active .tool-name {
    color: #fff !important;
}

.page-tools-container .tools-matrix .tool-card .tool-desc {
    display: none; /* 在膠囊導航中隱藏次要長描述，保持靈秀緊湊 */
}

.page-tools-container .tools-matrix .tool-card.is-disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.page-tools-container .tools-matrix .tool-card .tool-mask {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    font-size: 11px;
}

/* 暗黑模式適配 */
html[data-night="night"] .page-tools-container .tools-matrix {
    background: var(--background-secondary, #1a202c);
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-night="night"] .page-tools-container .tools-matrix .tool-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-night="night"] .page-tools-container .tools-matrix .tool-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 600px) {
    .page-tools-container .tools-matrix {
        gap: 6px 8px;
        padding: 10px 12px;
    }
    .page-tools-container .tools-matrix .tool-card {
        padding: 5px 10px;
        font-size: 0.82rem;
    }
}

/* ==========================================================================
 * 【老黃曆 二級模組】傳統逐日老黃曆與月曆網格（東方宣紙金石水墨典雅風）
 * ========================================================================== */

/* 1. 兩欄容器佈局 */
.tools-calendar-section {
    display: flex;
    gap: 24px;
    align-items: stretch;
    margin-top: 18px;
    box-sizing: border-box;
}

.calendar-grid-area {
    flex: 1.15;
    background-color: var(--background, #fff);
    border-radius: 14px;
    border: 1px solid #e8e2d5;
    box-shadow: 0 4px 20px rgba(40, 30, 20, 0.04);
    padding: 22px 24px;
    box-sizing: border-box;
    transition: background-color 0.3s, border-color 0.3s;
}

.calendar-detail-area {
    flex: 0.85;
    background-color: var(--background, #fff);
    border-radius: 14px;
    border: 1px solid #e8e2d5;
    box-shadow: 0 4px 20px rgba(40, 30, 20, 0.04);
    padding: 22px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 80px;
    transition: background-color 0.3s, border-color 0.3s;
}

/* 2. 左欄：月曆頭部導航 */
.calendar-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0eae1;
    flex-wrap: wrap;
    gap: 12px;
}

.cal-nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cal-current-month {
    font-size: 1.35rem;
    font-weight: 700;
    color: #2c2523;
    font-family: "Noto Serif TC", "Songti SC", "SimSun", serif;
    letter-spacing: 0.5px;
    position: relative;
    padding-left: 14px;
    line-height: 1.2;
}

.cal-current-month::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background: #b22222;
    border-radius: 2px;
}

.cal-nav-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cal-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #dfd7ca;
    background: #fcfbfa;
    color: #5a4e42;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    padding: 0;
}

.cal-nav-btn:hover {
    background: #b22222;
    color: #ffffff;
    border-color: #b22222;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(178, 34, 34, 0.25);
}

.cal-today-btn {
    height: 32px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid #b22222;
    background: #fff5f5;
    color: #b22222;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: "Noto Serif TC", "Songti SC", serif;
}

.cal-today-btn:hover {
    background: #b22222;
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(178, 34, 34, 0.25);
}

/* 3. 星期表頭 */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: #6e6456;
    margin-bottom: 12px;
    padding: 9px 0;
    background: #faf7f2;
    border-radius: 8px;
    border: 1px solid #f2ede4;
    font-size: 0.88rem;
}

.cal-weekday.is-weekend {
    color: #b22222;
    font-weight: 700;
}

/* 4. 42 格日曆網格 */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.cal-day-cell {
    aspect-ratio: 1 / 1;
    min-height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    background: transparent;
    padding: 4px;
    position: relative;
    user-select: none;
    box-sizing: border-box;
}

.cal-day-cell:hover {
    background-color: #fbf8f2;
    border-color: #ebdcc4;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cal-day-cell.is-other-month {
    opacity: 0.25;
    filter: grayscale(1);
}

.cal-day-cell.is-today {
    border: 1.5px solid #b22222;
    background-color: #fffaf7;
}

.cal-day-cell.is-today::after {
    content: "今";
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 9px;
    color: #b22222;
    font-weight: 700;
    transform: scale(0.85);
}

/* 選中態：故宮宮廷朱砂紅印泥質感（徹底告別突兀電光藍） */
.cal-day-cell.is-selected {
    background: linear-gradient(135deg, #b22222 0%, #8b1818 100%) !important;
    color: #ffffff !important;
    border-color: #8b1818 !important;
    box-shadow: 0 4px 14px rgba(178, 34, 34, 0.38) !important;
    transform: scale(1.02);
}

.cal-day-solar {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2e2825;
    line-height: 1.15;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cal-day-cell.is-selected .cal-day-solar {
    color: #ffffff !important;
}

.cal-day-lunar {
    font-size: 0.72rem;
    color: #8c8275;
    margin-top: 3px;
    line-height: 1.1;
    font-family: "Noto Serif TC", "Songti SC", "SimSun", serif;
}

.cal-day-cell.is-selected .cal-day-lunar {
    color: #ffe8d6 !important;
}

.cal-day-cell .has-festival {
    color: #b22222;
    font-weight: 700;
}

.cal-day-cell.is-selected .has-festival {
    color: #fff1e0 !important;
}

/* 5. 右欄：黃曆吉凶籤紙面板 */
.detail-header {
    text-align: center;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0eae1;
}

.detail-date-solar {
    font-size: 1.35rem;
    font-weight: 700;
    color: #2c2523;
    font-family: "Noto Serif TC", "Songti SC", "SimSun", serif;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.detail-date-lunar {
    font-size: 1.05rem;
    font-weight: 600;
    color: #b22222;
    font-family: "Noto Serif TC", "Songti SC", "SimSun", serif;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.detail-tags {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 6px;
}

.detail-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 16px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: "Noto Serif TC", "Songti SC", serif;
}

.tag-zodiac {
    background: #fdf3e7;
    color: #b56a15;
    border: 1px solid #f9dfbe;
}

.tag-ganzhi {
    background: #f5f2ea;
    color: #5c5043;
    border: 1px solid #e3dcce;
}

/* 6. 宜忌對照古風印章卡 */
.detail-yiji-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.yiji-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 13px 15px;
    border-radius: 10px;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

/* 宜事：朱砂印泥微金箋質感 */
.yiji-item.is-yi {
    background: linear-gradient(135deg, #fffaf4 0%, #fffdfa 100%);
    border: 1px solid #faebd0;
    border-left: 4px solid #b22222;
}

.yiji-item.is-yi:hover {
    box-shadow: 0 4px 12px rgba(178, 34, 34, 0.08);
}

.yiji-item.is-yi .yiji-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: #b22222;
    color: #ffffff;
    font-family: "Noto Serif TC", "Songti SC", "SimSun", serif;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(178, 34, 34, 0.35);
    border: 1px solid #8b1818;
    margin-top: 1px;
}

.yiji-item.is-yi .yiji-content {
    font-size: 0.93rem;
    color: #3b2f29;
    line-height: 1.7;
    font-weight: 500;
    word-break: break-word;
}

/* 忌事：玄墨方印淡墨紙質感 */
.yiji-item.is-ji {
    background: linear-gradient(135deg, #f9f9f9 0%, #f4f4f4 100%);
    border: 1px solid #e7e7e7;
    border-left: 4px solid #484848;
}

.yiji-item.is-ji:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.yiji-item.is-ji .yiji-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: #383838;
    color: #ffffff;
    font-family: "Noto Serif TC", "Songti SC", "SimSun", serif;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    border: 1px solid #222222;
    margin-top: 1px;
}

.yiji-item.is-ji .yiji-content {
    font-size: 0.93rem;
    color: #525252;
    line-height: 1.7;
    font-weight: 400;
    word-break: break-word;
}

/* 7. 相關文章精選推薦 */
.detail-recommend-area {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px dashed #e7decb;
}

.recommend-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2c2523;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: "Noto Serif TC", "Songti SC", serif;
}

.recommend-title .rec-icon {
    color: #b22222;
}

.recommend-list {
    min-height: 80px;
    position: relative;
}

.recommend-loading {
    text-align: center;
    color: #9c9183;
    padding: 16px 0;
    font-size: 0.85rem;
}

.tools-recommend-wrap {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.tr-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #faf8f5;
    border: 1px solid #eee7db;
    border-radius: 8px;
    padding: 7px 10px;
    text-decoration: none !important;
    transition: all 0.25s ease;
}

.tr-item:hover {
    background: #ffffff;
    border-color: #d8cdbe;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.tr-thumb {
    width: 64px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #ebe6dc;
}

.tr-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tr-placeholder {
    width: 100%;
    height: 100%;
    background: #ebe6dc;
}

.tr-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
}

.tr-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: #2c2523;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.2s;
}

.tr-item:hover .tr-title {
    color: #b22222;
}

.tr-meta {
    font-size: 0.72rem;
    color: #9c9183;
}

/* 8. 響應式移動端適配 */
@media screen and (max-width: 900px) {
    .tools-calendar-section {
        flex-direction: column;
    }
    .calendar-grid-area, .calendar-detail-area {
        flex: none;
        width: 100%;
    }
    .calendar-detail-area {
        position: static;
    }
}

@media screen and (max-width: 480px) {
    .calendar-grid-area, .calendar-detail-area {
        padding: 16px 14px;
    }
    .cal-day-cell {
        aspect-ratio: auto;
        min-height: 48px;
        padding: 6px 1px;
    }
    .cal-day-solar {
        font-size: 1.05rem;
    }
    .cal-day-lunar {
        font-size: 0.65rem;
    }
    .calendar-nav-bar {
        justify-content: space-between;
    }
    .cal-current-month {
        font-size: 1.15rem;
    }
}

/* 9. 暗黑模式專屬適配 */
html[data-night="night"] .calendar-grid-area,
html[data-night="night"] .calendar-detail-area {
    background-color: #232326;
    border-color: #38383c;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

html[data-night="night"] .calendar-nav-bar,
html[data-night="night"] .detail-header {
    border-color: #38383c;
}

html[data-night="night"] .cal-current-month,
html[data-night="night"] .detail-date-solar {
    color: #e5e3de;
}

html[data-night="night"] .cal-nav-btn {
    background: #2c2c30;
    border-color: #424248;
    color: #d0cdc7;
}

html[data-night="night"] .cal-nav-btn:hover {
    background: #b22222;
    border-color: #b22222;
    color: #fff;
}

html[data-night="night"] .cal-today-btn {
    background: #342222;
    border-color: #c0392b;
    color: #ff8b80;
}

html[data-night="night"] .cal-today-btn:hover {
    background: #b22222;
    color: #fff;
}

html[data-night="night"] .calendar-weekdays {
    background: #29292d;
    border-color: #38383c;
    color: #a59e94;
}

html[data-night="night"] .cal-day-cell:hover {
    background-color: #2d2d32;
    border-color: #4a4a52;
}

html[data-night="night"] .cal-day-cell.is-today {
    border-color: #e04b4b;
    background-color: #352525;
}

html[data-night="night"] .cal-day-cell.is-today::after {
    color: #ff7875;
}

html[data-night="night"] .cal-day-solar {
    color: #e5e3de;
}

html[data-night="night"] .cal-day-lunar {
    color: #8f8a82;
}

html[data-night="night"] .cal-day-cell.is-other-month {
    opacity: 0.2;
}

html[data-night="night"] .cal-day-cell.is-selected {
    background: linear-gradient(135deg, #b22222 0%, #751414 100%) !important;
    color: #ffffff !important;
}

html[data-night="night"] .tag-zodiac {
    background: #3d2f1f;
    color: #e59a43;
    border-color: #59442a;
}

html[data-night="night"] .tag-ganzhi {
    background: #2d2b27;
    color: #c2b9aa;
    border-color: #464239;
}

html[data-night="night"] .yiji-item.is-yi {
    background: linear-gradient(135deg, #2b2520 0%, #25221f 100%);
    border-color: #4d3d2c;
    border-left: 4px solid #c0392b;
}

html[data-night="night"] .yiji-item.is-yi .yiji-content {
    color: #dfd7cc;
}

html[data-night="night"] .yiji-item.is-ji {
    background: linear-gradient(135deg, #252528 0%, #202022 100%);
    border-color: #38383c;
    border-left: 4px solid #666666;
}

html[data-night="night"] .yiji-item.is-ji .yiji-content {
    color: #b3b0a8;
}

html[data-night="night"] .recommend-title {
    color: #e5e3de;
}

html[data-night="night"] .detail-recommend-area {
    border-color: #38383c;
}

html[data-night="night"] .tr-item {
    background: #28282c;
    border-color: #38383c;
}

html[data-night="night"] .tr-item:hover {
    background: #2f2f34;
    border-color: #484850;
}

html[data-night="night"] .tr-title {
    color: #e0deda;
}

html[data-night="night"] .tr-title:hover {
    color: #ff7875;
}

html[data-night="night"] .tr-meta {
    color: #7a766e;
}


/* ==========================================================================
 * 【老黃曆 v2.0 · Auspicious Finder】主動反向擇吉視覺系統 (東方金石水墨)
 * ========================================================================== */

/* 1. Auspicious Finder 主模組容器 */
.auspicious-finder-card {
    background: var(--background, #fff);
    border-radius: 16px;
    border: 1px solid var(--classC, #eaeaea);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    padding: 24px 28px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.auspicious-finder-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #c23531 0%, #e06a3b 50%, #d4a373 100%);
}

.finder-header-box {
    margin-bottom: 20px;
    text-align: center;
}

.finder-title-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.finder-seal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #c23531;
    color: #fff;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(194, 53, 49, 0.3);
}

.finder-main-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--main, #333);
    margin: 0;
    letter-spacing: 0.5px;
}

.finder-subtitle {
    font-size: 14px;
    color: var(--minor, #777);
    margin: 0;
}

/* 2. Step 1：意圖選擇器 (Chips Grid) */
.finder-step-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--main, #333);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.finder-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.finder-chip-item {
    padding: 9px 18px;
    border-radius: 24px;
    border: 1px solid var(--classC, #e2e2da);
    background: var(--classD, #f9f9f6);
    color: var(--main, #444);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.finder-chip-item:hover {
    border-color: #c23531;
    color: #c23531;
    transform: translateY(-2px);
    background: #fff;
    box-shadow: 0 3px 10px rgba(194, 53, 49, 0.12);
}

.finder-chip-item.is-active {
    background: #c23531 !important;
    border-color: #c23531 !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(194, 53, 49, 0.35) !important;
    font-weight: 600;
}

/* 3. Step 2 & 2.5：篩選控制行 (範圍 + 生肖) */
.finder-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--classD, #fafaf7);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 22px;
    border: 1px dashed var(--classC, #e5e5dc);
}

.finder-control-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.finder-control-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--minor, #666);
}

.finder-radio-btn-group {
    display: inline-flex;
    background: var(--background, #fff);
    border-radius: 8px;
    padding: 3px;
    border: 1px solid var(--classC, #e0e0e0);
}

.finder-radio-label {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-size: 13px;
    color: var(--minor, #666);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    user-select: none;
}

.finder-radio-label input {
    display: none;
}

.finder-radio-label:has(input:checked) {
    background: #c23531;
    color: #fff;
    font-weight: 600;
}

/* 生肖 Pills 選擇條 */
.finder-zodiac-pills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.finder-zodiac-pill {
    padding: 4px 10px;
    border-radius: 16px;
    border: 1px solid var(--classC, #e0e0e0);
    background: var(--background, #fff);
    color: var(--minor, #666);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.finder-zodiac-pill:hover {
    border-color: #c23531;
    color: #c23531;
}

.finder-zodiac-pill.is-active {
    background: #c23531;
    border-color: #c23531;
    color: #fff;
    font-weight: 600;
}

/* 4. 查詢按鈕行 */
.finder-submit-wrap {
    text-align: center;
    margin-bottom: 24px;
}

.finder-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 42px;
    background: linear-gradient(135deg, #c23531 0%, #a82420 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(194, 53, 49, 0.35);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.8px;
}

.finder-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(194, 53, 49, 0.45);
    background: linear-gradient(135deg, #d33c37 0%, #ba2824 100%);
}

.finder-btn-submit:active {
    transform: translateY(1px);
}

/* 5. 結果區容器（CLS 骨架約束） */
.finder-results-wrapper {
    min-height: 280px;
    contain: layout;
}

.finder-loading-box {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 0;
    color: var(--minor, #777);
    font-size: 15px;
}

.finder-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(194, 53, 49, 0.2);
    border-top-color: #c23531;
    border-radius: 50%;
    animation: finderSpin 0.8s linear infinite;
}

@keyframes finderSpin {
    to { transform: rotate(360deg); }
}

/* 天梯榜結果卡片 */
.finder-header-summary {
    background: var(--classD, #fafaf7);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
    border-left: 4px solid #c23531;
}

.summary-badge {
    font-size: 12px;
    font-weight: 700;
    color: #c23531;
    margin-bottom: 4px;
}

.summary-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--main, #333);
}

.summary-user-tag {
    font-size: 13px;
    color: var(--minor, #666);
    margin-top: 4px;
}

.finder-ladder-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.finder-day-card {
    background: var(--background, #fff);
    border-radius: 12px;
    border: 1px solid var(--classC, #e8e8e2);
    padding: 18px 20px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.25s ease;
}

.finder-day-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    border-color: #c23531;
}

.finder-day-card.is-golden {
    border-color: #d4a373;
    background: linear-gradient(180deg, rgba(212, 163, 115, 0.04) 0%, var(--background, #fff) 100%);
    box-shadow: 0 4px 16px rgba(212, 163, 115, 0.15);
}

.card-main-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--classC, #ecece4);
    margin-bottom: 12px;
}

.card-stars-col {
    display: flex;
    align-items: center;
    gap: 8px;
}

.star-rating {
    color: #f5a623;
    font-size: 16px;
    letter-spacing: 2px;
}

.rank-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: #c23531;
    color: #fff;
}

.finder-day-card.is-golden .rank-tag {
    background: linear-gradient(135deg, #d4a373 0%, #b07d4b 100%);
}

.card-date-col {
    display: flex;
    flex-direction: column;
}

.date-solar {
    font-size: 16px;
    font-weight: 700;
    color: var(--main, #333);
}

.date-lunar {
    font-size: 12px;
    color: var(--minor, #777);
    margin-top: 2px;
}

.card-officer-col {
    display: flex;
    align-items: center;
    gap: 6px;
}

.officer-badge {
    font-size: 13px;
    font-weight: 700;
    color: #c23531;
}

.officer-desc {
    font-size: 12px;
    color: var(--minor, #777);
}

.card-clash-col {
    display: flex;
    align-items: center;
    gap: 6px;
}

.clash-tag {
    font-size: 12px;
    color: #d9534f;
    background: rgba(217, 83, 79, 0.08);
    padding: 3px 8px;
    border-radius: 4px;
}

.sha-tag {
    font-size: 12px;
    color: var(--minor, #777);
}

/* 文化警示條 */
.finder-warning-bar {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.finder-warning-bar.is-danger {
    background: rgba(217, 83, 79, 0.1);
    color: #c9302c;
    border-left: 3px solid #d9534f;
}

.finder-warning-bar.is-warning {
    background: rgba(240, 173, 78, 0.12);
    color: #b37400;
    border-left: 3px solid #f0ad4e;
}

.finder-warning-bar.is-info {
    background: rgba(91, 192, 222, 0.1);
    color: #31708f;
    border-left: 3px solid #5bc0de;
}

.warning-badge {
    font-weight: 700;
    flex-shrink: 0;
}

/* 宜忌與吉時行 */
.card-details-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 14px;
}

@media (max-width: 768px) {
    .card-details-row {
        grid-template-columns: 1fr;
    }
}

.yiji-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.yiji-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.yiji-lbl {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.yiji-line.yi .yiji-lbl {
    background: #2e7d32;
}

.yiji-line.ji .yiji-lbl {
    background: #c23531;
}

.yiji-cnt {
    color: var(--main, #444);
}

.hour-solution-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--minor, #666);
    line-height: 1.5;
}

/* 操作按鈕行 */
.card-actions-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.btn-goto-calendar {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--classC, #ddd);
    background: var(--background, #fff);
    color: var(--main, #555);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-goto-calendar:hover {
    border-color: #c23531;
    color: #c23531;
}

.btn-save-poster {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #c23531;
    background: rgba(194, 53, 49, 0.08);
    color: #c23531;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save-poster:hover {
    background: #c23531;
    color: #fff;
}

/* 尊嚴保底提示 */
.finder-dignity-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(212, 163, 115, 0.1);
    border: 1px solid #d4a373;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 14px;
    font-size: 13px;
    color: #8c5b2d;
    line-height: 1.5;
}

/* 智能分發卡 */
.finder-distribute-card {
    display: none;
    margin-top: 20px;
    background: linear-gradient(135deg, rgba(78, 136, 243, 0.05) 0%, rgba(194, 53, 49, 0.05) 100%);
    border: 1px solid var(--classC, #e2e2da);
    border-radius: 12px;
    padding: 16px 20px;
}

.distribute-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.distribute-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.distribute-text {
    flex: 1;
    min-width: 200px;
}

.distribute-badge {
    font-size: 11px;
    font-weight: 700;
    color: #c23531;
    background: rgba(194, 53, 49, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.distribute-lead {
    font-size: 14px;
    color: var(--main, #333);
    margin: 0;
    font-weight: 500;
}

.distribute-btn {
    padding: 8px 18px;
    border-radius: 20px;
    background: var(--theme, #4e88f3);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.distribute-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 136, 243, 0.3);
}

/* 6. 傳統日曆折疊控制 */
.almanac-collapse-section {
    margin-top: 10px;
    margin-bottom: 24px;
}

.almanac-divider-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px 0 24px;
    position: relative;
}

.almanac-divider-row::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--classC, #eaeaea);
    z-index: 1;
}

.almanac-collapse-toggle-btn {
    position: relative;
    z-index: 2;
    background: var(--background, #fff);
    border: 1px solid var(--classC, #ddd);
    padding: 7px 20px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--minor, #666);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.almanac-collapse-toggle-btn:hover {
    border-color: #c23531;
    color: #c23531;
}

.traditional-almanac-collapse.is-collapsed {
    display: none;
}

/* 7. SSR 民俗闢謠百科樣式 (<details><summary>) */
.almanac-encyclopedia-section {
    background: var(--background, #fff);
    border-radius: 16px;
    border: 1px solid var(--classC, #eaeaea);
    padding: 28px;
    margin-top: 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.02);
}

.encyclopedia-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--classC, #eee);
}

.encyclopedia-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--main, #333);
    margin: 0 0 6px;
}

.encyclopedia-header p {
    font-size: 13px;
    color: var(--minor, #777);
    margin: 0;
}

.almanac-today-summary-block {
    background: var(--classD, #f9f9f6);
    border-left: 4px solid #c23531;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--main, #444);
}

.encyclopedia-accordion-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.encyclopedia-item {
    border: 1px solid var(--classC, #e8e8e2);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

.encyclopedia-item[open] {
    border-color: #c23531;
    box-shadow: 0 2px 8px rgba(194, 53, 49, 0.08);
}

.encyclopedia-summary {
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 600;
    color: var(--main, #333);
    background: var(--classD, #fafaf8);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.encyclopedia-summary::-webkit-details-marker {
    display: none;
}

.encyclopedia-summary::after {
    content: "▼";
    font-size: 11px;
    color: var(--minor, #888);
    transition: transform 0.2s;
}

.encyclopedia-item[open] .encyclopedia-summary::after {
    transform: rotate(180deg);
    color: #c23531;
}

.encyclopedia-content {
    padding: 16px 20px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--main, #444);
    background: var(--background, #fff);
    border-top: 1px dashed var(--classC, #eee);
}

/* 8. 暗黑模式適配 (嚴格遵守 html[data-night="night"]) */
html[data-night="night"] .auspicious-finder-card,
html[data-night="night"] .almanac-encyclopedia-section {
    background: #1e1e20;
    border-color: #333336;
}

html[data-night="night"] .finder-chip-item {
    background: #2a2a2d;
    border-color: #3a3a3e;
    color: #ddd;
}

html[data-night="night"] .finder-chip-item:hover {
    background: #333338;
}

html[data-night="night"] .finder-controls-row,
html[data-night="night"] .finder-header-summary,
html[data-night="night"] .almanac-today-summary-block {
    background: #252528;
    border-color: #3a3a3e;
}

html[data-night="night"] .finder-radio-btn-group,
html[data-night="night"] .finder-zodiac-pill,
html[data-night="night"] .btn-goto-calendar {
    background: #1e1e20;
    border-color: #3a3a3e;
    color: #ccc;
}

html[data-night="night"] .finder-day-card {
    background: #252528;
    border-color: #3a3a3e;
}

html[data-night="night"] .finder-day-card.is-golden {
    background: linear-gradient(180deg, rgba(212, 163, 115, 0.08) 0%, #252528 100%);
    border-color: #8c5b2d;
}

html[data-night="night"] .encyclopedia-summary {
    background: #252528;
}

html[data-night="night"] .encyclopedia-content {
    background: #1e1e20;
    color: #ccc;
}

html[data-night="night"] .almanac-collapse-toggle-btn {
    background: #1e1e20;
    border-color: #3a3a3e;
    color: #ccc;
}


/* ==========================================================================
 * 吉日裂變海報模組彈窗樣式 (Canvas 580px 宣紙水墨高奢箋卡)
 * ========================================================================== */
.almanac-poster-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.almanac-poster-modal.is-open {
    display: flex;
}

.poster-modal-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.poster-modal-dialog {
    position: relative;
    z-index: 2;
    background: var(--background, #fff);
    border-radius: 16px;
    padding: 16px 20px;
    max-width: 480px;
    width: 92%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.poster-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--minor, #888);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.poster-modal-close:hover {
    color: #c23531;
}

.poster-preview-box {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 12px;
}

.poster-rendered-img {
    width: auto;
    max-width: 320px;
    max-height: 50vh;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.poster-loading {
    padding: 40px 0;
    color: var(--minor, #777);
    font-size: 14px;
}

.poster-share-toolbar {
    width: 100%;
    text-align: center;
}

.btn-download-poster {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 310px !important;
    margin: 0 auto 12px auto !important;
    padding: 10px 18px !important;
    background: linear-gradient(135deg, #c23531 0%, #9e1f1c 100%) !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 22px !important;
    cursor: pointer !important;
    box-shadow: 0 3px 12px rgba(194, 53, 49, 0.35) !important;
    transition: all 0.25s ease !important;
    outline: none !important;
    text-decoration: none !important;
}

.btn-download-poster:hover {
    background: linear-gradient(135deg, #d63c38 0%, #b32521 100%) !important;
    box-shadow: 0 5px 16px rgba(194, 53, 49, 0.5) !important;
    transform: translateY(-1px);
}

.share-divider {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 340px !important;
    margin: 0 auto 10px auto !important;
    font-size: 12px !important;
    color: #888 !important;
}
.share-divider::before, .share-divider::after {
    content: '' !important;
    flex: 1 !important;
    height: 1px !important;
    background: #e8dec8 !important;
}
.share-divider span {
    padding: 0 10px !important;
    font-weight: 600 !important;
    color: #7a4f22 !important;
}
html[data-night="night"] .share-divider span {
    color: #d4c7b0 !important;
}

.share-btn-group {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: center !important;
    max-width: 380px !important;
    margin: 0 auto !important;
}

.share-btn-group button {
    padding: 6px 12px !important;
    border-radius: 16px !important;
    border: none !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    outline: none !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
}

.btn-share-line {
    background: #06c755 !important;
    color: #ffffff !important;
}
.btn-share-line:hover {
    background: #05b04a !important;
    box-shadow: 0 2px 8px rgba(6, 199, 85, 0.35) !important;
}

.btn-share-threads {
    background: #000000 !important;
    color: #ffffff !important;
}
.btn-share-threads:hover {
    background: #222222 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

.btn-share-fb {
    background: #1877f2 !important;
    color: #ffffff !important;
}
.btn-share-fb:hover {
    background: #166fe5 !important;
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.35) !important;
}

.btn-share-whatsapp {
    background: #25d366 !important;
    color: #ffffff !important;
}
.btn-share-whatsapp:hover {
    background: #20ba5a !important;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35) !important;
}

.btn-share-x {
    background: #000000 !important;
    color: #ffffff !important;
    border: 1px solid #444444 !important;
}
.btn-share-x:hover {
    background: #222222 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

.btn-share-copy {
    background: #f0f0f0 !important;
    color: #333333 !important;
    border: 1px solid #d0d0d0 !important;
}
.btn-share-copy:hover {
    background: #e8e8e8 !important;
    border-color: #c23531 !important;
    color: #c23531 !important;
}

html[data-night="night"] .poster-modal-dialog {
    background: #1e1e20;
    border: 1px solid #333336;
}

html[data-night="night"] .share-title {
    color: #ddd;
}

/* 吉度評分標籤 */
.score-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(245, 166, 35, 0.15);
    color: #d48806;
    border: 1px solid rgba(245, 166, 35, 0.3);
}

/* 生肖合參交互狀態標籤 */
.zodiac-status-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.zodiac-status-pill.is-safe {
    background: rgba(46, 125, 50, 0.1);
    color: #2e7d32;
    border: 1px solid rgba(46, 125, 50, 0.25);
}

.zodiac-status-pill.is-liuhe {
    background: rgba(142, 36, 170, 0.1);
    color: #8e24aa;
    border: 1px solid rgba(142, 36, 170, 0.3);
    box-shadow: 0 0 6px rgba(142, 36, 170, 0.15);
}

.zodiac-status-pill.is-sanhe {
    background: rgba(230, 81, 0, 0.1);
    color: #e65100;
    border: 1px solid rgba(230, 81, 0, 0.25);
}

.zodiac-status-pill.is-clash {
    background: rgba(217, 83, 79, 0.12);
    color: #c9302c;
    border: 1px solid rgba(217, 83, 79, 0.3);
    animation: clashPulse 2s infinite;
}

@keyframes clashPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

html[data-night="night"] .score-pill {
    background: rgba(245, 166, 35, 0.2);
    color: #f5a623;
}

html[data-night="night"] .zodiac-status-pill.is-liuhe {
    background: rgba(186, 104, 200, 0.2);
    color: #ba68c8;
}

html[data-night="night"] .zodiac-status-pill.is-sanhe {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
}

/* ============================================================
   🛡️ 擇吉安全掃描摘要條 (finder-safety-scan) — v2.3
   ============================================================ */
.finder-safety-scan {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin: 10px 0 14px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fff8ef;
    border: 1px solid #f5c57a;
    font-size: 13px;
    color: #7a4a10;
    cursor: default;
}
.finder-safety-scan.is-clear {
    background: #f0faf2;
    border-color: #82c99a;
    color: #2a6a3a;
}
.finder-safety-scan .safety-icon {
    font-size: 18px;
    flex-shrink: 0;
}
.finder-safety-scan .safety-title {
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.finder-safety-scan .safety-count {
    flex: 1;
    font-size: 13px;
}
.finder-safety-scan .safety-count strong {
    color: #c0392b;
    font-weight: 700;
}
.finder-safety-scan.is-clear .safety-count strong {
    color: #27ae60;
}
.finder-safety-scan .safety-toggle-arrow {
    font-size: 12px;
    color: #b05a00;
    white-space: nowrap;
    user-select: none;
}
/* 展開後的明細區 */
.safety-scan-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    width: 100%;
}
.safety-scan-body {
    width: 100%;
    margin-top: 8px;
    border-top: 1px dashed #f5c57a;
    padding-top: 8px;
}
.scan-intro {
    margin: 0 0 6px;
    font-size: 12px;
    color: #a0681a;
}
.scan-excluded-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4px 8px;
    padding: 5px 0;
    border-bottom: 1px solid #fce8c3;
    font-size: 12px;
}
.scan-excluded-item:last-child { border-bottom: none; }
.scan-ex-date {
    font-weight: 600;
    color: #6a3c08;
    white-space: nowrap;
}
.scan-ex-warnings {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.scan-warn-badge {
    font-weight: 700;
    font-size: 11px;
    white-space: nowrap;
}
.scan-warn-text {
    color: #8b4513;
    font-size: 11px;
}

/* 夜間模式 */
html[data-night="night"] .finder-safety-scan {
    background: rgba(180, 100, 0, 0.12);
    border-color: rgba(200, 130, 30, 0.4);
    color: #f5c57a;
}
html[data-night="night"] .finder-safety-scan.is-clear {
    background: rgba(30, 100, 50, 0.15);
    border-color: rgba(80, 180, 100, 0.4);
    color: #7fe09a;
}
html[data-night="night"] .safety-toggle-arrow { color: #d4a060; }
html[data-night="night"] .scan-intro { color: #c8904a; }
html[data-night="night"] .scan-excluded-item { border-color: rgba(200,130,30,0.25); }
html[data-night="night"] .safety-scan-body { border-color: rgba(200,130,30,0.35); }
html[data-night="night"] .scan-ex-date { color: #f0c080; }
html[data-night="night"] .scan-warn-text { color: #d4a060; }

/* ============================================================
   ⚖️ 宜忌維度與全量神煞對照卡片 (finder-methodology-card)
   ============================================================ */
.finder-methodology-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin: 0 0 16px;
    padding: 10px 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fbfaf6 0%, #f7f4ed 100%);
    border: 1px solid #e5dcce;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: all 0.25s ease;
}

.finder-methodology-card:hover {
    background: linear-gradient(135deg, #fdfcf9 0%, #f3ede2 100%);
    border-color: #d1be9e;
    box-shadow: 0 4px 14px rgba(160, 110, 40, 0.12);
    transform: translateY(-1px);
}

.methodology-card-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.methodology-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.methodology-content {
    font-size: 13px;
    line-height: 1.5;
    color: #5c4d3c;
}

.methodology-title {
    font-weight: 700;
    color: #4a3724;
}

.methodology-desc {
    color: #6d5b47;
}

.methodology-desc strong {
    color: #b35900;
    font-weight: 600;
}

.methodology-card-action {
    flex-shrink: 0;
}

.methodology-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #8a5722;
    background: rgba(180, 120, 40, 0.08);
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(180, 120, 40, 0.2);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.finder-methodology-card:hover .methodology-link {
    background: #8a5722;
    color: #fff;
    border-color: #8a5722;
}

.methodology-link .action-arrow {
    transition: transform 0.2s ease;
}

.finder-methodology-card:hover .action-arrow {
    transform: translateX(3px);
}

/* 移動端響應式 */
@media (max-width: 768px) {
    .finder-methodology-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 14px;
        gap: 10px;
    }
    .methodology-card-action {
        width: 100%;
    }
    .methodology-link {
        display: flex;
        justify-content: center;
        width: 100%;
        text-align: center;
    }
}

/* 夜間模式 */
html[data-night="night"] .finder-methodology-card {
    background: linear-gradient(135deg, #252422 0%, #1e1d1b 100%);
    border-color: #3d3730;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

html[data-night="night"] .finder-methodology-card:hover {
    border-color: #635340;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

html[data-night="night"] .methodology-content {
    color: #b8a896;
}

html[data-night="night"] .methodology-title {
    color: #ded1c1;
}

html[data-night="night"] .methodology-desc {
    color: #a89886;
}

html[data-night="night"] .methodology-desc strong {
    color: #e59a44;
}

html[data-night="night"] .methodology-link {
    color: #e5a04e;
    background: rgba(229, 160, 78, 0.12);
    border-color: rgba(229, 160, 78, 0.3);
}

html[data-night="night"] .finder-methodology-card:hover .methodology-link {
    background: #b5732b;
    color: #fff;
    border-color: #b5732b;
}


/* ==========================================================================
 * 【移動端自適應修復 v2.8.4】Auspicious Finder 晶片與控制行窄屏佈局優化
 * ========================================================================== */
@media (max-width: 600px) {
    /* 1. 控制行（時間範圍 + 生肖）改為縱向堆疊，消除右側空白矩形 */
    .finder-controls-row {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 14px;
    }

    /* 2. 每個控制組撐滿容器全寬 */
    .finder-control-group {
        width: 100%;
        align-items: flex-start;
        gap: 8px;
    }

    /* 3. 時間範圍按鈕組撐滿全寬，三個選項等比例分佈 */
    .finder-radio-btn-group {
        width: 100%;
        display: flex;
    }

    .finder-radio-label {
        flex: 1;
        justify-content: center;
        text-align: center;
        padding: 6px 4px;
    }

    /* 4. 生肖 Pills 撐滿全寬 */
    .finder-zodiac-pills-wrap {
        width: 100%;
    }

    /* 5. 晶片 Grid 佈局：兩欄等分，消除 flex 換行產生的右側空白 */
    .finder-chips-wrap {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    /* 6. 晶片按鈕撐滿格子，居中對齊 */
    .finder-chip-item {
        width: 100%;
        justify-content: center;
        padding: 9px 10px;
        font-size: 13px;
    }

    /* 7. 最後一個單獨的晶片（9個=奇數，最後一個居中跨兩欄） */
    .finder-chip-item:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        width: 60%;
        margin: 0 auto;
    }
}


/* ==========================================================================
   Layer 4：三層交叉引流矩陣 · 歲時易理合參指津 (Almanac 2x2 Referral Grid)
   ========================================================================== */
.almanac-referral-section {
    background: var(--background, #fff);
    border-radius: var(--radius-wrap, 12px);
    box-shadow: var(--box-shadow, 0 1px 3px rgba(0,0,0,0.1));
    border: 1px solid #E5D4B5;
    padding: 30px;
    margin-top: 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

html[data-night="night"] .almanac-referral-section {
    background: var(--background, #252830);
    border-color: rgba(255, 255, 255, 0.08);
}

.referral-header-box {
    margin-bottom: 24px;
    border-bottom: 1px solid #F2E8D5;
    padding-bottom: 18px;
}

html[data-night="night"] .referral-header-box {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.referral-badge-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.referral-seal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #98252A;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: "Noto Serif TC", serif;
    box-shadow: 0 2px 6px rgba(152, 37, 42, 0.25);
}

.referral-top-badge {
    font-size: 0.82rem;
    font-weight: 700;
    color: #B38622;
    letter-spacing: 0.5px;
}

.referral-main-title {
    font-family: "Noto Serif TC", serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-color, #231815);
    margin: 4px 0 10px 0;
    line-height: 1.4;
}

.referral-subtitle {
    font-size: 0.9rem;
    color: var(--minor, #666);
    line-height: 1.7;
    margin: 0;
}

.almanac-referral-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 680px) {
    .almanac-referral-section {
        padding: 20px 16px;
    }
    .almanac-referral-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.almanac-ref-card {
    display: block;
    text-decoration: none !important;
    color: inherit !important;
    background: #FFFCF7;
    border: 1px solid #E5D4B5;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

html[data-night="night"] .almanac-ref-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.almanac-ref-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #B38622 0%, #98252A 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.almanac-ref-card:hover {
    border-color: #B38622;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(179, 134, 34, 0.15);
}

.almanac-ref-card:hover::before {
    opacity: 1;
}

.almanac-ref-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ref-card-badge {
    font-size: 0.78rem;
    font-weight: 700;
    color: #B38622;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.ref-card-title {
    font-family: "Noto Serif TC", serif;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-color, #231815);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.ref-card-desc {
    font-size: 0.86rem;
    color: var(--minor, #666);
    line-height: 1.65;
    margin: 0 0 16px 0;
    flex-grow: 1;
}

.ref-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #98252A;
    transition: gap 0.2s ease, color 0.2s ease;
}

.almanac-ref-card:hover .ref-card-btn {
    gap: 10px;
    color: #B31D28;
}

.ref-arrow {
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.almanac-ref-card:hover .ref-arrow {
    transform: translateX(4px);
}
