/* =============================
   命理知识库 - Knowledge Base
   ============================= */

/* 整体容器 */
.kb-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* Hero 标题区 */
.kb-hero {
    text-align: center;
    padding: 2.5rem 1rem 2rem;
    margin-bottom: 2rem;
}

.kb-hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(251, 191, 36, 0.15));
    border: 1px solid rgba(167, 139, 250, 0.4);
    border-radius: 20px;
    padding: 0.35rem 1.2rem;
    font-size: 0.8rem;
    color: #a78bfa;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.kb-hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a78bfa 50%, #fbbf24 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.6rem;
}

.kb-hero-sub {
    color: rgba(255, 255, 255, 0.55);
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Tab 切换 */
.kb-tabs {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 4px;
    gap: 4px;
}

.kb-tab {
    padding: 0.55rem 1.8rem;
    border-radius: 46px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.kb-tab.active {
    background: linear-gradient(135deg, #a78bfa, #667eea);
    color: #fff;
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
}

.kb-tab:hover:not(.active) {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* 面板 */
.kb-panel {
    display: none;
}

.kb-panel.active {
    display: block;
    animation: kbFadeIn 0.4s ease;
}

@keyframes kbFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section 通用 */
.kb-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(8px);
}

.kb-section-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.kb-section-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.kb-section-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.3rem;
}

.kb-section-header p {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.88rem;
    margin: 0;
}

/* -------- 12星座 -------- */
.zodiac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.zodiac-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 1.2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.zodiac-card:hover {
    background: rgba(167, 139, 250, 0.1);
    border-color: rgba(167, 139, 250, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(167, 139, 250, 0.2);
}

.zodiac-card.expanded {
    grid-column: span 2;
    background: rgba(167, 139, 250, 0.08);
    border-color: rgba(167, 139, 250, 0.35);
}

.zodiac-symbol {
    font-size: 2.2rem;
    line-height: 1;
    margin-bottom: 0.4rem;
}

.zodiac-name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.25rem;
}

.zodiac-date {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.5rem;
}

.zodiac-element {
    display: inline-block;
    font-size: 0.68rem;
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
}

.zodiac-element.fire {
    background: rgba(251, 99, 64, 0.2);
    color: #fb6340;
    border: 1px solid rgba(251, 99, 64, 0.3);
}

.zodiac-element.earth {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.zodiac-element.air {
    background: rgba(116, 192, 252, 0.2);
    color: #74c0fc;
    border: 1px solid rgba(116, 192, 252, 0.3);
}

.zodiac-element.water {
    background: rgba(99, 230, 190, 0.2);
    color: #63e6be;
    border: 1px solid rgba(99, 230, 190, 0.3);
}

.zodiac-detail {
    display: none;
    margin-top: 1rem;
    text-align: left;
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.8rem;
}

.zodiac-detail p {
    margin: 0.3rem 0;
}

.zodiac-detail strong {
    color: #a78bfa;
}

.zodiac-card.expanded .zodiac-detail {
    display: block;
}

/* -------- 行星 -------- */
.planet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.8rem;
}

.planet-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1.2rem 0.8rem;
    text-align: center;
    transition: all 0.3s ease;
}

.planet-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(167, 139, 250, 0.3);
    transform: translateY(-3px);
}

.planet-symbol {
    font-size: 1.8rem;
    margin-bottom: 0.4rem;
}

.planet-symbol.sun {
    color: #ffd43b;
    text-shadow: 0 0 12px rgba(255, 212, 59, 0.6);
}

.planet-symbol.moon {
    color: #c5f6fa;
    text-shadow: 0 0 12px rgba(197, 246, 250, 0.5);
}

.planet-symbol.mercury {
    color: #74c0fc;
}

.planet-symbol.venus {
    color: #f8a8c8;
}

.planet-symbol.mars {
    color: #ff6b6b;
}

.planet-symbol.jupiter {
    color: #ffa94d;
}

.planet-symbol.saturn {
    color: #e2b44b;
}

.planet-symbol.uranus {
    color: #63e6be;
}

.planet-symbol.neptune {
    color: #a9e34b;
}

.planet-symbol.pluto {
    color: #a78bfa;
}

.planet-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.planet-desc {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}

.planet-desc small {
    display: block;
    margin-top: 0.3rem;
    color: rgba(255, 255, 255, 0.35);
}

/* -------- 宫位 -------- */
.house-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.house-item {
    display: grid;
    grid-template-columns: 5rem 7rem 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.25s ease;
    font-size: 0.88rem;
}

.house-item:hover {
    background: rgba(167, 139, 250, 0.08);
    border-color: rgba(167, 139, 250, 0.25);
    padding-left: 1.3rem;
}

.house-num {
    color: #a78bfa;
    font-weight: 600;
}

.house-name {
    color: #fbbf24;
    font-weight: 500;
}

.house-desc {
    color: rgba(255, 255, 255, 0.55);
}

/* -------- CTA -------- */
.kb-cta {
    text-align: center;
    padding: 2rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin-top: 2rem;
}

.kb-cta p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* -------- 五行 -------- */
.wuxing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.wuxing-card {
    border-radius: 16px;
    padding: 1.4rem;
    text-align: center;
    border: 1px solid;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wuxing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.wuxing-card.wood {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.3);
}

.wuxing-card.fire {
    background: rgba(251, 99, 64, 0.08);
    border-color: rgba(251, 99, 64, 0.3);
}

.wuxing-card.earth {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.3);
}

.wuxing-card.metal {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.wuxing-card.water {
    background: rgba(96, 165, 250, 0.08);
    border-color: rgba(96, 165, 250, 0.3);
}

.wx-symbol {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.4rem;
}

.wuxing-card.wood .wx-symbol {
    color: #34d399;
    text-shadow: 0 0 16px rgba(52, 211, 153, 0.5);
}

.wuxing-card.fire .wx-symbol {
    color: #fb6340;
    text-shadow: 0 0 16px rgba(251, 99, 64, 0.5);
}

.wuxing-card.earth .wx-symbol {
    color: #fbbf24;
    text-shadow: 0 0 16px rgba(251, 191, 36, 0.5);
}

.wuxing-card.metal .wx-symbol {
    color: #e2e8f0;
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.4);
}

.wuxing-card.water .wx-symbol {
    color: #60a5fa;
    text-shadow: 0 0 16px rgba(96, 165, 250, 0.5);
}

.wx-name {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 0.8rem;
    letter-spacing: 0.05em;
}

.wx-attrs {
    text-align: left;
    margin-bottom: 0.8rem;
}

.wx-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
}

.wx-row span:first-child {
    color: rgba(255, 255, 255, 0.35);
}

.wx-desc {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.55;
    text-align: left;
    margin: 0;
}

/* 五行相生相克 */
.wuxing-cycle {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1.2rem 1.5rem;
}

.cycle-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.8rem;
}

.cycle-diagram {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.cycle-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cycle-badge {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    white-space: nowrap;
}

.cycle-badge.sheng {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.cycle-badge.ke {
    background: rgba(251, 99, 64, 0.2);
    color: #fb6340;
    border: 1px solid rgba(251, 99, 64, 0.3);
}

.cycle-text {
    font-size: 0.83rem;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.02em;
}

/* -------- 天干地支 -------- */
.ganzhi-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.ganzhi-block h4 {
    font-size: 1rem;
    color: #fbbf24;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.ganzhi-grid {
    display: grid;
    gap: 0.5rem;
}

.tg-grid {
    grid-template-columns: repeat(5, 1fr);
}

.dz-grid {
    grid-template-columns: repeat(6, 1fr);
}

.gz-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 0.3rem;
    border-radius: 10px;
    border: 1px solid;
    text-align: center;
    transition: all 0.25s ease;
    cursor: default;
}

.gz-item:hover {
    transform: scale(1.06);
}

.gz-item.wood-c {
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.25);
}

.gz-item.fire-c {
    background: rgba(251, 99, 64, 0.1);
    border-color: rgba(251, 99, 64, 0.25);
}

.gz-item.earth-c {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.25);
}

.gz-item.metal-c {
    background: rgba(226, 232, 240, 0.08);
    border-color: rgba(226, 232, 240, 0.2);
}

.gz-item.water-c {
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.25);
}

.gz-char {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.gz-item.wood-c .gz-char {
    color: #34d399;
}

.gz-item.fire-c .gz-char {
    color: #fb9070;
}

.gz-item.earth-c .gz-char {
    color: #fbbf24;
}

.gz-item.metal-c .gz-char {
    color: #e2e8f0;
}

.gz-item.water-c .gz-char {
    color: #74c0fc;
}

.gz-info {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.3;
}

/* -------- 四柱图 -------- */
.sizhu-diagram {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.sizhu-col {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 1.2rem 0.8rem;
    text-align: center;
    transition: all 0.3s ease;
}

.sizhu-col:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-3px);
}

.sizhu-col.highlight {
    background: rgba(167, 139, 250, 0.1);
    border-color: rgba(167, 139, 250, 0.4);
    box-shadow: 0 0 24px rgba(167, 139, 250, 0.15);
}

.sizhu-header {
    font-size: 0.9rem;
    font-weight: 700;
    color: #a78bfa;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sizhu-tg,
.sizhu-dz {
    font-size: 0.8rem;
    padding: 0.5rem;
    border-radius: 8px;
    margin-bottom: 0.4rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sizhu-tg.day-master {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.3);
    color: #fbbf24;
    font-weight: 600;
}

.sizhu-label {
    margin-top: 0.8rem;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.7;
}

/* -------- 十神 -------- */
.shishen-section {
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 1.5rem;
}

.shishen-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fbbf24;
    margin-bottom: 1rem;
}

.shishen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.6rem;
}

.ss-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: all 0.25s ease;
}

.ss-card:hover {
    background: rgba(167, 139, 250, 0.08);
    border-color: rgba(167, 139, 250, 0.25);
    transform: translateX(3px);
}

.ss-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #a78bfa;
}

.ss-relation {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.35);
}

.ss-meaning {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* -------- 响应式 -------- */
@media (max-width: 768px) {
    .kb-hero-title {
        font-size: 1.6rem;
    }

    .zodiac-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .zodiac-card.expanded {
        grid-column: span 1;
    }

    .planet-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .house-item {
        grid-template-columns: 4rem 5.5rem 1fr;
        font-size: 0.78rem;
    }

    .wuxing-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ganzhi-container {
        grid-template-columns: 1fr;
    }

    .tg-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .dz-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .sizhu-diagram {
        grid-template-columns: repeat(2, 1fr);
    }

    .shishen-grid {
        grid-template-columns: 1fr;
    }
}