﻿.gong {
    width: 230px;
    padding: 10px 18px;
    border-radius: 6px;
    box-sizing: border-box;
    min-height: 120px;
    color: #222;
    font-size: 13px;
    line-height: 1.4;
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
    border: 1px solid rgba(0,0,0,0.06);
    background-clip: padding-box;
    position: relative;
}

.gong:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

/* small wrapper classes inside each palace cell */
.gong .gong-title {
    font-weight: 700;
    margin-bottom: 6px;
    text-align:center;
    background-color:yellowgreen
}
.gong .gong-meta {
    color: #444;
    margin-bottom: 6px;
    font-size: 13px;
}
.gong .gong-extra {
    color: #333;
    font-size: 12px;
    margin-bottom: 4px;
}

/* Nine palace color variations (gong1..gong9) */
.gong1 { background: linear-gradient(180deg,#fffaf0,#fff2d9); border-color: #f0c36a; }
.gong2 { background: linear-gradient(180deg,#f6fffb,#e6fff3); border-color: #7bd9a4; }
.gong3 { background: linear-gradient(180deg,#f3f9ff,#e5f0ff); border-color: #8fbefc; }
.gong4 { background: linear-gradient(180deg,#fff6fb,#ffeef6); border-color: #f7a6d0; }
.gong5 { background: linear-gradient(180deg,#fffdf7,#fff7e7); border-color: #f5d186; }
.gong6 { background: linear-gradient(180deg,#f7fff7,#eaffef); border-color: #9be7b0; }
.gong7 { background: linear-gradient(180deg,#fff9ff,#ffeefe); border-color: #e8b3ff; }
.gong8 { background: linear-gradient(180deg,#f9fbff,#eef6ff); border-color: #bcd7ff; }
.gong9 { background: linear-gradient(180deg,#fffaf7,#fff0ea); border-color: #ffd0b0; }

/* Highlight the main palace (主事宫) */
.gong-main {
    z-index: 3;
    transform: scale(1.03);
    /* thicker, explicit border for clarity */
    border: 4px solid #ff9f1c !important;
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(255,159,28,0.20);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
    position: relative;
}

/* subtle glowing ring for emphasis */
.gong-main::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 12px;
    pointer-events: none;
    box-shadow: 0 0 32px rgba(255,159,28,0.22);
    opacity: 1;
}

/* Special palace highlights */
/* 值事宫 (zhiShi) - warm gold emphasis */
.gong-zhi-shi {
    z-index: 3;
    transform: scale(1.02);
    /* thicker, explicit border for clarity */
    border: 4px solid #ffd54a !important;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(255,213,74,0.16);
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
    position: relative;
}
.gong-zhi-shi::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 12px;
    pointer-events: none;
    box-shadow: 0 0 28px rgba(255,213,74,0.14);
}

/* 值符宫 (zhiFu) - teal/green emphasis */
.gong-zhi-fu {
    z-index: 3;
    transform: scale(1.02);
    /* thicker, explicit border for clarity */
    border: 4px solid #29c199 !important;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(41,193,153,0.16);
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
    position: relative;
}
.gong-zhi-fu::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 12px;
    pointer-events: none;
    box-shadow: 0 0 28px rgba(41,193,153,0.12);
}

/* 日干宫 (riGan) - cool blue/purple emphasis */
.gong-ri-gan {
    z-index: 3;
    transform: scale(1.02);
    /* thicker, explicit border for clarity */
    border: 4px solid #6f8cff !important;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(111,140,255,0.16);
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
    position: relative;
}
.gong-ri-gan::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 12px;
    pointer-events: none;
    box-shadow: 0 0 28px rgba(111,140,255,0.12);
}

/* label style for 主事宫文本 */
.zhu-gong-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.zhu-gong-label.zhu-gong-highlight {
    background: linear-gradient(90deg,#ffb86b,#ff8f3c);
    color: #fff;
    box-shadow: 0 6px 20px rgba(255,143,60,0.22);
}

/* Labels for RiGan / ZhiFu / ZhiShi (applied to #lbl_RiGanGong etc.) */
/* 日干宫标签 (ri-gan-gong-label) - cool blue */
.ri-gan-gong-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    background: linear-gradient(90deg,#6f8cff,#556be6);
    color: #fff;
    box-shadow: 0 6px 18px rgba(86,107,230,0.16);
}

/* 值符宫标签 (zhi-fu-gong-label) - teal/green */
.zhi-fu-gong-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    background: linear-gradient(90deg,#29c199,#12a67f);
    color: #fff;
    box-shadow: 0 6px 18px rgba(18,166,127,0.14);
}

/* 值事宫标签 (zhi-shi-gong-label) - warm gold */
.zhi-shi-gong-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    background: linear-gradient(90deg,#ffd54a,#ffb74d);
    color: #2b2b2b;
    box-shadow: 0 6px 18px rgba(255,183,77,0.12);
}

/* Table width kept as before */
.qimen-tbl {
    width: 690px;
}

/* 容器基础样式 */
.qimen-intro-container {
    max-width: 100%;
    margin: 5px auto;
    padding: 5px;
    background-color: #fff;
    border-top: 4px solid #b3935d; /* 尊贵金 */
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    color: #333;
    line-height: 1.8;
}

/* 标题样式 */
.qimen-header {
    text-align: center;
    margin-bottom: 1px;
    border-bottom: 1px solid #eee;
    padding-bottom: 1px;
}

    .qimen-header h1 {
        font-size: 2.2rem;
        margin: 0;
        letter-spacing: 4px;
        color: #1a1a1a;
    }

.english-title {
    display: block;
    font-size: 1rem;
    color: #999;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 5px;
}

.subtitle {
    font-size: 1.1rem;
    color: #b3935d;
    margin-top: 5px;
}

/* 内容区域 */
.main-description {
    font-size: 1.05rem;
    margin-bottom: 5px;
    text-align: justify;
}

/* 四要素网格 */
.qimen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.grid-item {
    background: #f9f9f9;
    padding: 5px;
    border-left: 3px solid #ddd;
    transition: all 0.3s ease;
}

    .grid-item:hover {
        background: #f2f2f2;
        border-left-color: #b3935d;
        transform: translateY(-3px);
    }

    .grid-item h3 {
        margin-top: 0;
        font-size: 1.1rem;
        color: #b3935d;
    }

/* 金句引用样式 */
.qimen-quote {
    position: relative;
    background: #fdfaf5;
    padding: 5px 10px;
    margin: 0;
    font-style: italic;
    border-radius: 4px;
    text-align: center;
    color: #666;
}

    .qimen-quote::before {
        content: "“";
        position: absolute;
        left: 15px;
        top: 5px;
        font-size: 3rem;
        color: #e0d0b0;
    }

/* 响应式调整 */
@media (max-width: 100%) {
    .qimen-intro-container {
        padding: 8px;
        margin: 1px;
    }

    .qimen-header h1 {
        font-size: 1.6rem;
    }
}

.ai-button {
    font-size: large;
    font: bold;
    margin: 50px;
    font-size: large;
    font: bold;
    background-color: blue;
    color: white !important;
    padding: 10px 30px 10px 30px;
    border-radius: 10px;
}
.message-center {
text-align:center;
margin-top: 10px;
}