/* ========================================
   紫微斗数专业排盘样式 - 参考万宗紫微
   ======================================== */

/* 紫微命盘容器 - 4x4网格 */
.ziwei-pro-chart {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, auto);
    gap: 1px;
    background: #d4c4b0;
    border: 2px solid #8B4513;
    margin: 15px 0;
    font-size: 11px;
}

/* 宫位通用样式 */
.ziwei-pro-palace {
    background: #fff;
    padding: 6px;
    min-height: 110px;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 宫位顶部 */
.palace-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.palace-dir {
    font-size: 9px;
    color: #999;
}

.palace-zhi {
    font-size: 13px;
    color: #8B4513;
    font-weight: bold;
}

/* 宫位名称行 */
.palace-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 3px;
    border-bottom: 1px dashed #e0d5c8;
    margin-bottom: 4px;
}

.palace-gong {
    font-size: 10px;
    color: #666;
}

.palace-badges {
    display: flex;
    gap: 2px;
}

.badge-ming {
    background: #c41e3a;
    color: white;
    font-size: 9px;
    padding: 1px 3px;
    border-radius: 2px;
}

.badge-shen {
    background: #2e8b57;
    color: white;
    font-size: 9px;
    padding: 1px 3px;
    border-radius: 2px;
}

/* 星曜区域 */
.palace-stars {
    flex: 1;
    line-height: 1.5;
}

.star-item {
    display: inline;
    white-space: nowrap;
}

.star-main {
    color: #c41e3a;
    font-weight: bold;
}

.star-aux {
    color: #1e90ff;
}

.star-sha {
    color: #8b008b;
}

.star-misc {
    color: #666;
}

.star-bright {
    font-size: 8px;
    color: #999;
}

.star-sihua {
    font-size: 9px;
    font-weight: bold;
}

.sihua-lu { color: #2e8b57; }
.sihua-quan { color: #c41e3a; }
.sihua-ke { color: #1e90ff; }
.sihua-ji { color: #8b008b; }

/* 宫位底部信息 */
.palace-bottom {
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px dashed #e0d5c8;
    font-size: 9px;
    color: #888;
    line-height: 1.4;
}

.palace-ln { color: #1e90ff; }
.palace-xx { color: #2e8b57; }
.palace-dx { color: #c41e3a; font-weight: bold; }
.palace-dx.daxian-current { background: #c41e3a; color: white; padding: 1px 3px; border-radius: 2px; display: inline-block; }
.palace-cs { color: #8b4513; }

/* 中宫样式 */
.ziwei-pro-center {
    grid-column: 2 / 4;
    grid-row: 2 / 4;
    background: linear-gradient(135deg, #f8f5fc 0%, #f0e8f8 100%);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 220px;
    position: relative;
    overflow: hidden;
}

/* 知吉人水印 */
.ziwei-pro-center::before {
    content: '知吉人';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-20deg);
    font-size: 90px;
    font-family: 'Ma Shan Zheng', serif;
    color: rgba(128, 90, 160, 0.08);
    letter-spacing: 20px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 0;
}

.center-title {
    font-size: 20px;
    color: #5a3d6e;
    font-weight: bold;
    letter-spacing: 8px;
    margin-bottom: 5px;
    position: relative;
    z-index: 1;
}

/* 标题下金色横线 */
.center-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
    margin: 8px auto 0;
}

.center-info {
    font-size: 13px;
    color: #5a3d6e;
    margin: 10px 0 8px;
    position: relative;
    z-index: 1;
}

.center-time {
    font-size: 11px;
    color: #777;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

/* 四柱 */
.center-sizhu {
    display: flex;
    gap: 20px;
    margin: 10px 0;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    position: relative;
    z-index: 1;
}

.sz-col {
    text-align: center;
}

.sz-gan {
    display: block;
    font-size: 18px;
    color: #c41e3a;
    font-weight: bold;
}

.sz-zhi {
    display: block;
    font-size: 18px;
    color: #1e90ff;
    font-weight: bold;
}

/* 起运 */
.center-qiyun {
    font-size: 11px;
    color: #666;
    margin: 10px 0;
    position: relative;
    z-index: 1;
}

/* 大运 */
.center-dayun {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 8px 0;
    position: relative;
    z-index: 1;
}

.dx-item {
    text-align: center;
    padding: 4px 8px;
    background: rgba(255,255,255,0.8);
    border-radius: 4px;
    border: 1px solid #e0d5c8;
    font-size: 10px;
}

.dx-item.current {
    background: linear-gradient(135deg, #8b5a9e 0%, #6b3a7e 100%);
    color: white;
    border-color: #8b5a9e;
}

.dx-age {
    display: block;
    color: #888;
    font-size: 9px;
}

.dx-item.current .dx-age { color: rgba(255,255,255,0.8); }

.dx-gz { font-size: 11px; font-weight: bold; }
.dx-g { color: #c41e3a; }
.dx-z { color: #1e90ff; }
.dx-item.current .dx-g,
.dx-item.current .dx-z { color: white; }

/* 命主身主 */
.center-zhu {
    display: flex;
    gap: 25px;
    font-size: 12px;
    color: #555;
    margin: 10px 0;
    position: relative;
    z-index: 1;
}

.center-zhu b {
    color: #5a3d6e;
    font-weight: bold;
}

/* 四化图例 */
.center-sihua {
    display: flex;
    gap: 15px;
    font-size: 12px;
    margin-top: 8px;
    position: relative;
    z-index: 1;
    font-weight: bold;
}

.sh-lu { color: #2e8b57; font-weight: bold; }
.sh-quan { color: #c41e3a; font-weight: bold; }
.sh-ke { color: #1e90ff; font-weight: bold; }
.sh-ji { color: #8b008b; font-weight: bold; }

/* 底部大限时间线 */
.ziwei-daxian-bar {
    margin-top: 15px;
    padding: 12px;
    background: #faf8f5;
    border: 1px solid #e0d5c8;
    border-radius: 4px;
}

.daxian-title {
    font-size: 13px;
    color: #8B4513;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
}

.daxian-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.dx-block {
    text-align: center;
    padding: 6px 10px;
    background: white;
    border: 1px solid #e0d5c8;
    border-radius: 4px;
    min-width: 55px;
}

.dx-block.current {
    background: linear-gradient(135deg, #c41e3a 0%, #a01830 100%);
    color: white;
    border-color: #c41e3a;
}

.dx-label {
    font-size: 10px;
    color: #666;
}

.dx-block.current .dx-label { color: rgba(255,255,255,0.8); }

.dx-sub {
    font-size: 9px;
    color: #999;
}

.dx-block.current .dx-sub { color: rgba(255,255,255,0.7); }

.dx-name {
    font-size: 13px;
    font-weight: bold;
    margin: 3px 0;
}

.dx-name .g { color: #c41e3a; }
.dx-name .z { color: #1e90ff; }
.dx-block.current .dx-name,
.dx-block.current .dx-name .g,
.dx-block.current .dx-name .z { color: white; }

.dx-gong {
    font-size: 9px;
    color: #8B4513;
}

.dx-block.current .dx-gong { color: rgba(255,255,255,0.9); }

/* 流年四化 - 紫微专用 */
.zw-liunian {
    margin-top: 20px;
}

.zw-liunian-title {
    font-size: 13px;
    color: #8B4513;
    font-weight: bold;
    text-align: center;
    margin-bottom: 12px;
}

.zw-liunian-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.zw-ln-card {
    background: white;
    border: 1px solid #e0d5c8;
    border-radius: 6px;
    overflow: hidden;
}

.zw-ln-header {
    background: linear-gradient(135deg, #8B4513 0%, #a0522d 100%);
    color: white;
    padding: 8px;
    text-align: center;
}

.zw-ln-year {
    font-size: 16px;
    font-weight: bold;
}

.zw-ln-info {
    font-size: 10px;
    opacity: 0.9;
    margin-top: 2px;
}

.zw-ln-body {
    padding: 10px;
}

.zw-ln-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dashed #eee;
    font-size: 11px;
}

.zw-ln-row:last-child { border-bottom: none; }

.zw-ln-label {
    font-weight: bold;
}

.zw-ln-label.lu { color: #2e8b57; }
.zw-ln-label.quan { color: #c41e3a; }
.zw-ln-label.ke { color: #1e90ff; }
.zw-ln-label.ji { color: #8b008b; }

.zw-ln-val {
    color: #333;
}

/* 响应式 */
@media (max-width: 768px) {
    .ziwei-pro-chart {
        font-size: 9px;
    }
    
    .ziwei-pro-palace {
        min-height: 90px;
        padding: 4px;
    }
    
    .palace-zhi { font-size: 11px; }
    .star-main { font-size: 10px; }
    
    .ziwei-pro-center {
        padding: 8px;
        min-height: 180px;
    }
    
    .center-title { font-size: 14px; }
    .center-sizhu { gap: 8px; padding: 6px 8px; }
    .sz-gan, .sz-zhi { font-size: 12px; }
    
    .zw-liunian-cards {
        grid-template-columns: 1fr;
    }
    
    .daxian-list { gap: 4px; }
    .dx-block { padding: 4px 6px; min-width: 45px; }
}
