/* ==========================================================================
   正統五格剖象高階東方玄學 UI 樣式系統 (joe.name.css v2.0)
   ========================================================================== */

.name-result-wrapper {
    position: relative;
    padding-top: 10px;
}

/* 頂部姓名與總分鑑定區域 */
.name-header-card {
    display: flex;
    align-items: center;
    gap: 25px;
    background: linear-gradient(135deg, #fdfcf9 0%, #f7f4ed 100%);
    border-left: 5px solid #d93a49;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}
.name-header-card::before {
    content: '☯';
    position: absolute;
    right: -15px;
    bottom: -25px;
    font-size: 8rem;
    color: rgba(217, 58, 73, 0.03);
    pointer-events: none;
    user-select: none;
}

.name-badge-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.name-score-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 4px solid #d93a49;
    background: #fff;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    transition: border-color 0.5s ease;
}

.name-score-number {
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1;
    color: #2c3e50;
    font-family: "Georgia", serif;
}

.name-score-label {
    font-size: 0.8rem;
    color: #888;
    margin-top: 2px;
}

/* 古典金石印章 (Score & Fortune Seals) */
.score-seal,
.fortune-seal,
.verdict-seal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "KaiTi", "STKaiti", serif;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 4px;
    position: relative;
    user-select: none;
}

.score-seal {
    font-size: 0.85rem;
    padding: 3px 10px;
    border: 1.5px solid transparent;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.stamp-daji { background: #c62828; color: #fff; border-color: #ffd54f; }
.stamp-ji { background: #d93a49; color: #fff; border-color: #ffcdd2; }
.stamp-ping { background: #2e7d32; color: #fff; border-color: #c8e6c9; }
.stamp-jidai { background: #ef6c00; color: #fff; border-color: #ffe0b2; }
.stamp-xiong { background: #37474f; color: #fff; border-color: #cfd8dc; }

.verdict-seal {
    font-size: 1.1rem;
    padding: 5px 16px;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.name-title-area {
    flex-grow: 1;
}

.res-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.res-fullname {
    font-size: 2.2rem;
    font-family: "Songti TC", "Noto Serif TC", "STSong", "KaiTi", serif;
    font-weight: 800;
    color: #222;
    margin: 0;
    letter-spacing: 3px;
}

.report-badge {
    font-size: 0.8rem;
    background: #fff8e1;
    color: #b78103;
    border: 1px solid #ffe082;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.res-subtitle {
    font-size: 0.95rem;
    color: #718096;
    margin: 0 0 14px 0;
}

/* 漢字六書剖析銘牌 */
.res-chars-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.char-plate {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.char-main {
    font-size: 1.4rem;
    font-family: "KaiTi", "STKaiti", serif;
    font-weight: bold;
    color: #1a202c;
}

.char-meta {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    line-height: 1.3;
}

.char-stroke {
    color: #718096;
}

.char-wuxing {
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-align: center;
    font-weight: bold;
}

/* 五行專屬色彩標籤 */
.ele-木 { background: #2e7d32 !important; color: #fff !important; }
.ele-火 { background: #c62828 !important; color: #fff !important; }
.ele-土 { background: #ef6c00 !important; color: #fff !important; }
.ele-金 { background: #f9a825 !important; color: #1a1a1a !important; font-weight: 800 !important; }
.ele-水 { background: #1565c0 !important; color: #fff !important; }
.char-wuxing.ele-金, .grid-ele.ele-金, .sancai-node-circle.ele-金 .node-ele { color: #1a1a1a !important; font-weight: 800 !important; }

/* 模組標題 */
.module-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.module-title span {
    color: #d93a49;
}

/* ==========================================================================
   三才配置：立體相生流向圖 (Sancai Flow Layout)
   ========================================================================== */
.sancai-card {
    background: #fff;
    border-radius: 14px;
    padding: 22px;
}

.sancai-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.sancai-luck-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sancai-luck-text {
    font-size: 0.95rem;
    color: #718096;
}

.fortune-seal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "KaiTi", "STKaiti", serif;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 2px 10px;
    border-radius: 4px;
    border: 1.5px solid;
    position: relative;
    user-select: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.seal-daji { 
    background: #fff5f5; 
    color: #c62828; 
    border-color: #c62828; 
    box-shadow: inset 0 0 0 1px #ffcdd2, 0 2px 6px rgba(198, 40, 40, 0.15); 
}
.seal-ji { 
    background: #fff5f5; 
    color: #d93a49; 
    border-color: #d93a49; 
    box-shadow: inset 0 0 0 1px #ffcdd2, 0 2px 6px rgba(217, 58, 73, 0.12); 
}
.seal-ping { 
    background: #f1f8e9; 
    color: #2e7d32; 
    border-color: #2e7d32; 
    box-shadow: inset 0 0 0 1px #c8e6c9, 0 2px 6px rgba(46, 125, 50, 0.12); 
}
.seal-jidai { 
    background: #fff8e1; 
    color: #e65100; 
    border-color: #f57c00; 
    box-shadow: inset 0 0 0 1px #ffe082, 0 2px 6px rgba(230, 81, 0, 0.15); 
}
.seal-xiong { 
    background: #f5f5f5; 
    color: #263238; 
    border-color: #37474f; 
    box-shadow: inset 0 0 0 1px #cfd8dc, 0 2px 6px rgba(55, 71, 79, 0.18); 
}

/* 三才立體相生流向容器 */
.sancai-flow-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: linear-gradient(180deg, #fbfaf8 0%, #f4f1ea 100%);
    border: 1px solid #ede8de;
    border-radius: 12px;
    padding: 24px 15px;
    margin: 20px 0;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.02);
}

.sancai-flow-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 80px;
}

.sancai-node-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    margin-bottom: 8px;
    transition: transform 0.3s ease;
}
.sancai-node-circle:hover {
    transform: scale(1.08);
}

.node-primary-pulse {
    width: 72px;
    height: 72px;
    border: 3px solid #ffd54f;
    box-shadow: 0 0 20px rgba(255, 213, 79, 0.5), 0 8px 18px rgba(0,0,0,0.2);
}

.node-ele {
    font-size: 1.6rem;
    font-family: "KaiTi", "STKaiti", serif;
    font-weight: 900;
}

.sancai-node-label {
    font-size: 1rem;
    font-weight: bold;
    color: #2d3748;
}

.sancai-node-sub {
    font-size: 0.78rem;
    color: #a0aec0;
    margin-top: 2px;
}

.sancai-flow-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-grow: 1;
    max-width: 120px;
    padding: 0 8px;
}

.connector-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #cbd5e0 0%, #a0aec0 50%, #cbd5e0 100%);
    position: relative;
}

.connector-pill {
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: bold;
    letter-spacing: 1px;
}
.rel-相生 { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.rel-比和 { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.rel-相剋 { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.rel-平和 { background: #f5f5f5; color: #616161; border: 1px solid #e0e0e0; }

.connector-arrow {
    font-size: 0.9rem;
    color: #a0aec0;
    line-height: 1;
}

/* 三才三維運勢獨立卡片 */
.sancai-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.sancai-sub-card {
    background: #fdfdfd;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    padding: 16px;
    transition: all 0.3s ease;
}
.sancai-sub-card:hover {
    border-color: #cbd5e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.sub-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.sub-card-icon {
    font-size: 1.1rem;
}

.sub-card-title {
    font-size: 0.95rem;
    font-weight: bold;
    color: #4a5568;
    flex-grow: 1;
}

.sub-badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
    font-family: "KaiTi", "STKaiti", serif;
}
.badge-daji { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.badge-ji { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.badge-xiong { background: #eceff1; color: #37474f; border: 1px solid #b0bec5; }

.sub-card-desc {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #4a5568;
    margin: 0;
    text-align: justify;
}

/* ==========================================================================
   五格神諭卡牌 (Oracle Cards Grid)
   ========================================================================== */
.name-grid-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.name-grid-card {
    position: relative;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.name-grid-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

/* 內層裝飾邊框，營造神諭卡牌質感 */
.card-inner-frame {
    border: 1px solid #f0eee9;
    border-radius: 8px;
    padding: 16px;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.primary-card {
    border: 2px solid #3182ce;
    box-shadow: 0 6px 18px rgba(49, 130, 206, 0.12);
}
.primary-card .card-inner-frame {
    background: linear-gradient(180deg, rgba(49, 130, 206, 0.02) 0%, #fff 100%);
}

.full-width-card {
    grid-column: 1 / -1;
}

.name-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.name-grid-title {
    font-size: 1.05rem;
    font-weight: bold;
    color: #4a5568;
}
.primary-title {
    color: #2b6cb0;
}

.name-grid-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.grid-strokes {
    font-size: 1.15rem;
    font-weight: bold;
    color: #2d3748;
}

.grid-ele {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.name-grid-poem {
    font-family: "KaiTi", "STKaiti", serif;
    font-size: 1.25rem;
    font-weight: bold;
    color: #1a202c;
    margin: 8px 0 14px 0;
    letter-spacing: 1.5px;
    line-height: 1.4;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
    background: #fdfcf9;
    border: 1px solid #f2ede4;
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
}

.name-grid-desc {
    font-size: 0.88rem;
    color: #718096;
    line-height: 1.65;
    text-align: justify;
    border-top: 1px dashed #edf2f7;
    padding-top: 10px;
    margin-top: auto;
}

/* ==========================================================================
   姓名總評與開運錦囊 (Overall Evaluation & 4D Advice)
   ========================================================================== */
.overall-eval-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.04);
}

.eval-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2f7;
}

.eval-brief-quote {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #fdfbf7 0%, #f6f1e5 100%);
    border-left: 4px solid #d93a49;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 22px;
}

.brief-quote-icon {
    font-size: 3rem;
    line-height: 1;
    color: #d93a49;
    font-family: "Georgia", serif;
    opacity: 0.4;
}

.brief-quote-body {
    flex-grow: 1;
}

.brief-title {
    font-size: 0.85rem;
    color: #8c7355;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.brief-text {
    font-size: 1.35rem;
    font-family: "KaiTi", "STKaiti", serif;
    font-weight: bold;
    color: #2d3748;
    letter-spacing: 2px;
}

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

.eval-dim-card {
    background: #fafaf9;
    border: 1px solid #edebe4;
    border-radius: 10px;
    padding: 18px;
}
.full-width-dim {
    grid-column: 1 / -1;
    background: #fffaf0;
    border-color: #feebc8;
}

.dim-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.dim-icon {
    font-size: 1.2rem;
}

.dim-title {
    font-size: 1rem;
    font-weight: bold;
    color: #2d3748;
}

.dim-content {
    font-size: 0.92rem;
    line-height: 1.7;
    color: #4a5568;
    margin: 0;
    text-align: justify;
}

.dim-content-rich .advice-list {
    margin: 0;
    padding-left: 20px;
    font-size: 0.92rem;
    line-height: 1.75;
    color: #4a5568;
}
.dim-content-rich .advice-list li {
    margin-bottom: 8px;
}
.dim-content-rich .advice-list li:last-child {
    margin-bottom: 0;
}
.dim-content-rich strong {
    color: #9c4221;
}

/* ==========================================================================
   響應式適配 (Mobile Responsive)
   ========================================================================== */
@media (max-width: 767px) {
    .name-header-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px 15px;
    }
    .res-name-row {
        justify-content: center;
    }
    .res-chars-breakdown {
        justify-content: center;
    }
    .sancai-flow-container {
        flex-direction: column;
        gap: 15px;
    }
    .sancai-flow-connector {
        max-width: 100%;
        transform: rotate(90deg);
        margin: 10px 0;
    }
    .sancai-cards-grid {
        grid-template-columns: 1fr;
    }
    .name-grid-cards {
        grid-template-columns: 1fr;
    }
    .eval-dimensions-grid {
        grid-template-columns: 1fr;
    }
}

/* 社交分享按鈕 (硃砂赤金漸變高光) */
.btn-orange {
    background: linear-gradient(135deg, #d93a49 0%, #ef6c00 100%) !important;
    box-shadow: 0 4px 15px rgba(217, 58, 73, 0.3) !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
}
.btn-orange:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(217, 58, 73, 0.45) !important;
}

/* 重新測算按鈕 (優雅黛灰次級按鈕) */
#recalc-btn {
    background: #fff !important;
    color: #4a5568 !important;
    border: 1.5px solid #cbd5e0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}
#recalc-btn:hover {
    background: #f7fafc !important;
    color: #2d3748 !important;
    border-color: #a0aec0 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* ==========================================================================
   社交裂變與一鍵分享模組 (Viral Social Share Grid)
   ========================================================================== */
.name-social-share-wrap {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.social-share-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
}

.social-share-title .share-icon {
    font-size: 1.1rem;
}

.social-share-title .share-heading {
    font-size: 0.95rem;
    font-weight: bold;
    color: #2d3748;
    letter-spacing: 0.5px;
}

.social-share-title .share-subhint {
    font-size: 0.82rem;
    color: #a0aec0;
}

.social-share-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.social-share-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.25s ease;
    cursor: pointer;
    border: 1px solid transparent;
    box-sizing: border-box;
    white-space: nowrap;
}

.social-share-item svg {
    flex-shrink: 0;
}

/* LINE: 翠綠清新 */
.social-share-item.item-line {
    background: #edfbf2;
    color: #059440;
    border-color: #b7eed0;
}
.social-share-item.item-line:hover {
    background: #06c755;
    color: #fff;
    border-color: #06c755;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 199, 85, 0.25);
}

/* Threads: 極簡黑金潮感 */
.social-share-item.item-threads {
    background: #f7fafc;
    color: #1a202c;
    border-color: #e2e8f0;
}
.social-share-item.item-threads:hover {
    background: #111;
    color: #fff;
    border-color: #111;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Facebook: 經典科技藍 */
.social-share-item.item-fb {
    background: #ebf5ff;
    color: #1877f2;
    border-color: #c3ddfd;
}
.social-share-item.item-fb:hover {
    background: #1877f2;
    color: #fff;
    border-color: #1877f2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.25);
}

/* WhatsApp: 薄荷深綠 */
.social-share-item.item-wa {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}
.social-share-item.item-wa:hover {
    background: #25d366;
    color: #fff;
    border-color: #25d366;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

/* 複製連結: 靈動紫水晶質感 */
.social-share-item.item-copy {
    background: #f5f3ff;
    color: #6c5ce7;
    border-color: #ddd6fe;
    font-family: inherit;
    line-height: inherit;
}
.social-share-item.item-copy:hover {
    background: #6c5ce7;
    color: #fff;
    border-color: #6c5ce7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.25);
}

@media (max-width: 767px) {
    .social-share-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    .social-share-item.item-copy {
        grid-column: 1 / -1;
    }
}

/* ==========================================================================
   好友測算迎賓引流橫條 (Visitor Welcome Banner)
   ========================================================================== */
.visitor-welcome-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #fdfbf7 0%, #fff9ec 100%);
    border: 1px solid #f6e0b5;
    border-left: 4px solid #d97706;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.08);
    animation: fadeInSlide 0.4s ease-out;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.visitor-welcome-banner .banner-icon-col {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.visitor-welcome-banner .banner-content-col {
    flex: 1;
}

.visitor-welcome-banner .banner-main-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #92400e;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.visitor-welcome-banner .banner-sub-desc {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.45;
}

.visitor-welcome-banner .banner-sub-desc strong {
    color: #1a1a1a;
}

.visitor-welcome-banner .banner-close-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.visitor-welcome-banner .banner-close-btn:hover {
    color: #333;
}

/* ==========================================================================
   專屬分享文案即時預覽氣泡卡片 (Share Preview Bubble Card)
   ========================================================================== */
.social-share-preview-card {
    background: #fff;
    border: 1px solid #ede9e1;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.social-share-preview-card.is-high-score {
    border-color: #fbd38d;
    background: linear-gradient(180deg, #fffdfa 0%, #fff 100%);
    box-shadow: 0 4px 14px rgba(237, 137, 54, 0.08);
}

.social-share-preview-card.is-low-score {
    border-color: #cbd5e0;
    background: linear-gradient(180deg, #f7fafc 0%, #fff 100%);
}

.preview-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
}

.preview-header-badge {
    font-size: 0.78rem;
    font-weight: 700;
    color: #718096;
    background: #edf2f7;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.is-high-score .preview-header-badge {
    color: #c05621;
    background: #feebc8;
}

.is-low-score .preview-header-badge {
    color: #4a5568;
    background: #e2e8f0;
}

.preview-header-hint {
    font-size: 0.76rem;
    color: #a0aec0;
}

.preview-quote-bubble {
    position: relative;
    padding: 8px 14px;
    background: #fbf9f5;
    border-radius: 8px;
    border-left: 3px solid #6c5ce7;
}

.is-high-score .preview-quote-bubble {
    border-left-color: #dd6b20;
    background: #fffaf0;
}

.is-low-score .preview-quote-bubble {
    border-left-color: #4a5568;
    background: #f7fafc;
}

.preview-quote-bubble .quote-symbol {
    font-family: Georgia, serif;
    font-size: 1.4rem;
    color: #a0aec0;
    line-height: 1;
    vertical-align: middle;
}

.preview-quote-text {
    display: inline;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #2d3748;
    font-weight: 500;
    margin: 0 4px;
}

/* ==========================================================================
   姓名打分 SEO 深度百科指南與常見問答 (Encyclopedia & FAQ)
   ========================================================================== */

.name-encyclopedia-section {
    margin-top: 32px;
    padding: 36px 30px;
    background: var(--background, #fff);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--classC, #eaeaea);
    position: relative;
    overflow: hidden;
}

.name-encyclopedia-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #d93a49 0%, #e67e22 50%, #f39c12 100%);
}

/* 頂部標題與引言 */
.encyclopedia-header {
    text-align: center;
    max-width: 820px;
    margin: 0 auto 36px;
    position: relative;
}

.encyclopedia-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 18px;
    background: rgba(217, 58, 73, 0.08);
    color: #d93a49;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 14px;
    letter-spacing: 0.5px;
}

.encyclopedia-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--main, #2c3e50);
    margin: 0 0 12px 0;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.encyclopedia-lead {
    font-size: 0.96rem;
    color: var(--muted, #718096);
    line-height: 1.75;
    margin: 0;
}

/* 章節通用樣式 */
.encyclopedia-chapter {
    margin-bottom: 35px;
    padding-bottom: 30px;
    border-bottom: 1px dashed var(--classC, #e2e8f0);
}

.encyclopedia-chapter:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.chapter-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--main, #2d3748);
    margin: 0 0 14px 0;
}

.chapter-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.chapter-desc {
    font-size: 0.94rem;
    color: var(--routine, #4a5568);
    line-height: 1.75;
    margin-bottom: 16px;
}

/* 五格計算推算表格 */
.wuge-table-wrapper {
    overflow-x: auto;
    margin: 16px 0 20px;
    border-radius: 10px;
    border: 1px solid var(--classC, #eaeaea);
    background: var(--background, #fff);
}

.wuge-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.wuge-table th {
    background: var(--classD, #f8f9fa);
    color: var(--main, #2d3748);
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 1px solid var(--classC, #eaeaea);
    white-space: nowrap;
}

.wuge-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--classC, #eaeaea);
    color: var(--routine, #4a5568);
    line-height: 1.6;
}

.wuge-table tr:last-child td {
    border-bottom: none;
}

.wuge-table tr:hover td {
    background: rgba(217, 58, 73, 0.02);
}

.wuge-tag-cell {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(var(--theme-rgb, 78, 136, 243), 0.1);
    color: var(--theme, #4e88f3);
}

/* 三才生剋微指南卡片 */
.sancai-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.sancai-guide-item {
    background: var(--classD, #fbfbfb);
    border: 1px solid var(--classC, #eaeaea);
    border-radius: 10px;
    padding: 18px;
    border-left: 4px solid var(--theme, #4e88f3);
}

.sancai-guide-item.item-success {
    border-left-color: #27ae60;
}

.sancai-guide-item.item-foundation {
    border-left-color: #e67e22;
}

.sancai-guide-item.item-social {
    border-left-color: #3498db;
}

.sancai-guide-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--main, #2d3748);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sancai-guide-text {
    font-size: 0.88rem;
    color: var(--muted, #718096);
    line-height: 1.65;
    margin: 0;
}

/* 康熙部首速查微卡片矩陣 */
.radical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.radical-card {
    background: var(--classD, #f8f9fa);
    border: 1px solid var(--classC, #e2e8f0);
    border-radius: 10px;
    padding: 14px 16px;
    transition: all 0.2s ease;
}

.radical-card:hover {
    border-color: #d93a49;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 58, 73, 0.08);
}

.radical-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.radical-name {
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--main, #2d3748);
}

.radical-stroke-badge {
    font-size: 0.78rem;
    font-weight: 700;
    color: #d93a49;
    background: rgba(217, 58, 73, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.radical-rule {
    font-size: 0.84rem;
    color: var(--muted, #718096);
    line-height: 1.5;
    margin: 0 0 6px 0;
}

.radical-examples {
    font-size: 0.82rem;
    color: var(--routine, #4a5568);
    margin: 0;
    background: var(--background, #fff);
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 2px solid #d93a49;
}

/* 起名五大黃金法則微卡片 */
.principles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.principle-card {
    background: var(--classD, #f8f9fa);
    border: 1px solid var(--classC, #e2e8f0);
    border-radius: 10px;
    padding: 18px 16px;
    position: relative;
    overflow: hidden;
}

.principle-num {
    font-size: 1.6rem;
    font-weight: 900;
    color: rgba(217, 58, 73, 0.18);
    position: absolute;
    top: 8px;
    right: 12px;
    font-family: Georgia, serif;
}

.principle-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--main, #2d3748);
    margin: 0 0 8px 0;
}

.principle-text {
    font-size: 0.86rem;
    color: var(--muted, #718096);
    line-height: 1.6;
    margin: 0;
}

/* 常見問題 FAQ 手風琴 */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}

.faq-item {
    border: 1px solid var(--classC, #e2e8f0);
    border-radius: 10px;
    background: var(--classD, #fbfbfb);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.faq-item[open] {
    border-color: rgba(217, 58, 73, 0.4);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    background: var(--background, #fff);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--main, #2d3748);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: color 0.2s;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question:hover {
    color: #d93a49;
}

.faq-toggle-icon {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--muted, #a0aec0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
}

.faq-item[open] .faq-toggle-icon {
    transform: rotate(45deg);
    color: #d93a49;
}

.faq-answer {
    padding: 0 20px 18px 20px;
    font-size: 0.91rem;
    line-height: 1.75;
    color: var(--routine, #4a5568);
    border-top: 1px dashed var(--classC, #edf2f7);
    padding-top: 14px;
    margin: 0;
}

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

html[data-night="night"] .wuge-table-wrapper {
    background: var(--background-secondary, #1a202c);
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-night="night"] .wuge-table th {
    background: rgba(255, 255, 255, 0.04);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-night="night"] .wuge-table td {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

html[data-night="night"] .wuge-tag-cell {
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e0;
}

html[data-night="night"] .sancai-guide-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

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

html[data-night="night"] .radical-examples {
    background: rgba(0, 0, 0, 0.2);
}

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

html[data-night="night"] .faq-item[open] {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(217, 58, 73, 0.5);
}

html[data-night="night"] .faq-answer {
    border-top-color: rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   東方輕奢命理風 (Oriental Light-Luxury Metaphysics) 首屏美學系統
   ========================================================================== */

/* 1. 頂部工具矩陣：膠囊化與輕量化 (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);
}

.page-tools-container .tools-matrix .tool-card:hover {
    background: #fff;
    border-color: #d93a49;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 58, 73, 0.12);
}

.page-tools-container .tools-matrix .tool-card.is-active {
    background: linear-gradient(135deg, #d93a49 0%, #c02c38 100%) !important;
    border-color: #d93a49 !important;
    box-shadow: 0 4px 14px rgba(217, 58, 73, 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;
}

.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;
}

.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; /* 在膠囊導航中隱藏次要長描述，保持靈秀緊湊 */
}

/* 2. 輸入表單：東方金石與文人雅趣 (Oriental Input Card) */
.name-input-card-oriental {
    background: var(--background, #fff) !important;
    border: 1px solid var(--classC, #eaeaea) !important;
    border-radius: 16px !important;
    padding: 28px 26px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04) !important;
    position: relative;
    overflow: hidden;
}

.name-input-card-oriental::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: linear-gradient(90deg, #d93a49 0%, #e67e22 50%, #f39c12 100%) !important;
}

.name-form-header {
    margin-bottom: 22px;
}

.name-input-card-oriental .bazi-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--main, #2c3e50);
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bazi-title-icon {
    font-size: 1.3rem;
}

.bazi-title-badge {
    font-size: 0.76rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    color: #d93a49;
    background: rgba(217, 58, 73, 0.08);
    border: 1px solid rgba(217, 58, 73, 0.2);
    letter-spacing: 0.5px;
}

.name-form-subtitle {
    font-size: 0.85rem;
    color: var(--muted, #718096);
    margin: 0;
    line-height: 1.5;
}

.name-input-card-oriental label {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--main, #2d3748);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.label-symbol {
    color: #d93a49;
    font-size: 0.82rem;
}

.label-tag {
    font-size: 0.78rem;
    font-weight: normal;
    color: var(--muted, #a0aec0);
}

.name-text-input {
    background: #fdfcf9 !important;
    border: 1.5px solid var(--classC, #e2e8f0) !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    font-size: 1rem !important;
    color: var(--main, #2d3748) !important;
    transition: all 0.25s ease !important;
}

.name-text-input:focus {
    border-color: #d93a49 !important;
    box-shadow: 0 0 0 3px rgba(217, 58, 73, 0.12) !important;
    background: #fff !important;
}

.input-hint {
    font-size: 0.78rem;
    color: var(--muted, #a0aec0);
    margin-top: 6px;
}

/* 測算主按鈕：硃砂印泥漸層 + 儀式感 */
.name-btn-primary {
    background: linear-gradient(135deg, #d93a49 0%, #c02c38 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 13px 20px !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    box-shadow: 0 4px 16px rgba(217, 58, 73, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin-top: 24px !important;
}

.name-btn-primary:hover {
    background: linear-gradient(135deg, #e04353 0%, #d93a49 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(217, 58, 73, 0.4) !important;
}

.name-btn-primary:active {
    transform: translateY(0) !important;
}

.btn-arrow {
    transition: transform 0.2s;
}

.name-btn-primary:hover .btn-arrow {
    transform: translateX(4px);
}

/* 3. 右側空白態：命盤虛位以待 (Mystic Empty State) */
.name-empty-state-oriental {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 36px 24px !important;
    background: linear-gradient(135deg, #fdfcf9 0%, #f9f6ef 100%) !important;
    border: 1px dashed rgba(217, 58, 73, 0.25) !important;
    border-radius: 16px !important;
}

.empty-taiji-seal {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid rgba(217, 58, 73, 0.3);
    box-shadow: 0 4px 18px rgba(217, 58, 73, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
}

.empty-taiji-seal::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px dashed rgba(217, 58, 73, 0.2);
    animation: rotateTaijiSeal 20s linear infinite;
}

@keyframes rotateTaijiSeal {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.taiji-symbol {
    font-size: 2.2rem;
    color: #d93a49;
    line-height: 1;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--main, #2c3e50);
    margin: 0 0 8px 0;
    letter-spacing: 0.5px;
}

.empty-state-desc {
    font-size: 0.9rem;
    color: var(--muted, #718096);
    line-height: 1.65;
    max-width: 480px;
    margin: 0 auto 24px;
}

.empty-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 520px;
}

.empty-feature-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--classC, #e8e8e2);
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.feat-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.feat-text strong {
    display: block;
    font-size: 0.86rem;
    color: var(--main, #2d3748);
    margin-bottom: 2px;
}

.feat-text span {
    display: block;
    font-size: 0.76rem;
    color: var(--muted, #a0aec0);
}

/* 4. 右側測算規範說明卡片升級 (Oriental Info Card) */
.name-info-card-oriental {
    border-radius: 16px !important;
    border: 1px solid var(--classC, #eaeaea) !important;
    background: var(--background, #fff) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
}

.name-info-card-oriental .wuxing-summary h4 {
    font-size: 1.05rem !important;
    font-weight: 700;
    color: var(--main, #2d3748);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.name-info-card-oriental .number-detail {
    border-left: 4px solid #d93a49 !important;
    background: rgba(217, 58, 73, 0.03) !important;
    color: var(--routine, #4a5568) !important;
    border-radius: 0 8px 8px 0;
    padding: 14px 16px !important;
    line-height: 1.7;
}

@media (max-width: 600px) {
    .empty-feature-grid {
        grid-template-columns: 1fr;
    }
    .page-tools-container .tools-matrix .tool-card {
        padding: 5px 10px;
        font-size: 0.82rem;
    }
}

/* 5. 暗黑模式全面適配 (Dark Mode Support) */
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);
}

html[data-night="night"] .name-input-card-oriental {
    background: var(--background-secondary, #1a202c) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-night="night"] .name-text-input {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

html[data-night="night"] .name-empty-state-oriental {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(217, 58, 73, 0.3) !important;
}

html[data-night="night"] .empty-taiji-seal {
    background: #1a202c;
    border-color: rgba(217, 58, 73, 0.5);
}

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

html[data-night="night"] .name-info-card-oriental {
    background: var(--background-secondary, #1a202c) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-night="night"] .name-info-card-oriental .number-detail {
    background: rgba(217, 58, 73, 0.06) !important;
}

/* 6. 81 數理常遇大吉數速查微卡片 (Lucky Numbers Guide Box) */
.name-lucky-guide-box {
    margin-top: 22px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(217, 58, 73, 0.03) 0%, rgba(243, 156, 18, 0.04) 100%);
    border: 1px dashed rgba(217, 58, 73, 0.22);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.name-lucky-guide-box:hover {
    border-color: rgba(217, 58, 73, 0.4);
    box-shadow: 0 4px 14px rgba(217, 58, 73, 0.05);
}

.lucky-guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.lucky-guide-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--main, #2d3748);
    display: flex;
    align-items: center;
    gap: 6px;
}

.lucky-title-icon {
    color: #d93a49;
    font-size: 0.85rem;
}

.lucky-guide-badge {
    font-size: 0.72rem;
    color: #d93a49;
    background: rgba(217, 58, 73, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    border: 1px solid rgba(217, 58, 73, 0.15);
}

.lucky-pills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.lucky-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    background: #fff;
    border: 1px solid rgba(217, 58, 73, 0.15);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
    cursor: default;
}

.lucky-pill:hover {
    border-color: #d93a49;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(217, 58, 73, 0.12);
}

.pill-num {
    font-size: 0.95rem;
    font-weight: 800;
    color: #d93a49;
    line-height: 1;
    margin-bottom: 2px;
    font-family: Georgia, serif;
}

.pill-name {
    font-size: 0.72rem;
    color: var(--muted, #718096);
    font-weight: 600;
}

.lucky-guide-footer {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px dashed rgba(217, 58, 73, 0.15);
}

.footer-lamp {
    font-size: 0.92rem;
    flex-shrink: 0;
    line-height: 1.4;
}

.footer-tip {
    font-size: 0.8rem;
    color: var(--muted, #718096);
    line-height: 1.55;
    margin: 0;
}

.footer-tip strong {
    color: #d93a49;
}

@media (max-width: 600px) {
    .lucky-pills-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
}

html[data-night="night"] .name-lucky-guide-box {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(217, 58, 73, 0.3);
}

html[data-night="night"] .lucky-pill {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-night="night"] .pill-name {
    color: #a0aec0;
}

html[data-night="night"] .footer-tip {
    color: #a0aec0;
}

/* ==========================================================================
   姓名測算左右兩欄頂格與底部嚴格等高齊平 (Equal-Height Stretch Alignment)
   ========================================================================== */
/* 防止 Google AdSense 自動廣告插入 flex 容器破壞兩欄排版 */
.tools-bazi-section > .google-auto-placed {
    display: none !important;
}

/* 確保測算結果生成時，JS 隱藏 input-area 的行為能 100% 優先執行 */
#input-area[style*="display: none"],
.name-input-card-oriental[style*="display: none"] {
    display: none !important;
}

@media (min-width: 768px) {
    .page-tools-container .tools-bazi-section {
        align-items: stretch;
    }
    .name-input-card-oriental {
        display: flex;
        flex-direction: column;
        height: auto;
        box-sizing: border-box;
    }
    .name-input-card-oriental .name-lucky-guide-box {
        margin-top: auto;
    }
}
