/* 全局样式 - 科技感深色主题 */
body {
    background-color: #0a0f1a; /* 非常深的蓝黑色背景 */
    color: #c0c5d1; /* 浅灰蓝色文字 */
    font-family: 'Roboto', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; /* 现代字体 */
    margin: 0;
    padding: 0;
    line-height: 1.7;
}

.container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 30px 40px;
    background-color: rgba(18, 25, 40, 0.85); /* 半透明深蓝背景 */
    border-radius: 10px;
    box-shadow: 0 0 25px rgba(0, 123, 255, 0.2), inset 0 0 10px rgba(0, 123, 255, 0.1); /* 蓝色辉光 + 内阴影 */
    border: 1px solid rgba(0, 123, 255, 0.3); /* 细微蓝色边框 */
}

h1 {
    color: #7df9ff; /* 明亮的电光蓝 */
    text-align: center;
    margin-bottom: 40px;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(125, 249, 255, 0.5); /* 文字辉光 */
}

h2 {
    color: #00f0ff; /* 亮青色 */
    border-bottom: 2px solid rgba(0, 240, 255, 0.5); /* 半透明青色下边框 */
    padding-bottom: 10px;
    margin-top: 45px;
    margin-bottom: 25px;
    font-weight: 600;
}

h3 {
    color: #90e0ef; /* 浅青色 */
    margin-bottom: 18px;
    font-weight: 600;
}

section {
    margin-bottom: 45px;
}

/* 表格样式 - 科技感 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: rgba(25, 35, 55, 0.7); /* 更深的半透明背景 */
    border: 1px solid rgba(0, 191, 255, 0.4); /* 深天蓝边框 */
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

th, td {
    border: 1px solid rgba(0, 123, 255, 0.25); /* 单元格边框 - 细微蓝色 */
    padding: 14px 18px;
    text-align: center;
    transition: background-color 0.3s ease;
}

th {
    background-color: rgba(0, 123, 255, 0.2); /* 浅蓝色透明表头 */
    color: #7df9ff; /* 电光蓝文字 */
    font-weight: 600;
    border-bottom: 2px solid rgba(0, 123, 255, 0.5);
    border-top: none;
}
/* 移除表格第一列左边框和最后一列右边框 */
table th:first-child, table td:first-child {
    border-left: none;
}
table th:last-child, table td:last-child {
    border-right: none;
}


/* 生肖表特殊处理 */
#shengxiao th, #shengxiao td {
     padding: 10px 8px;
}
#shengxiao th:first-child {
    background-color: rgba(255, 171, 0, 0.15); /* 浅琥珀色透明 */
    color: #ffab00; /* 琥珀色 */
    border-right: 1px solid rgba(255, 171, 0, 0.3);
    border-left: none;
}


tbody tr {
     transition: background-color 0.2s ease-in-out;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:nth-child(even) {
    background-color: rgba(30, 40, 60, 0.6); /* 偶数行稍亮 */
}

tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.3); /* 悬停时明显蓝色高亮 */
}

/* 列表样式 - 科技感卡片 */
ul {
    list-style: none;
    padding-left: 0;
}

li {
    background-color: rgba(30, 40, 60, 0.8); /* 列表项背景 */
    margin-bottom: 12px;
    padding: 14px 18px;
    border-radius: 5px;
    border: 1px solid rgba(0, 191, 255, 0.3); /* 边框 */
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

/* 为列表项循环添加不同的左边框颜色 - 霓虹色 */
li:nth-child(5n+1) { border-left: 4px solid #ff073a; } /* 霓虹红/粉 */
li:nth-child(5n+2) { border-left: 4px solid #ffab00; } /* 琥珀色 */
li:nth-child(5n+3) { border-left: 4px solid #00ff7f; } /* 春绿色 */
li:nth-child(5n+4) { border-left: 4px solid #7df9ff; } /* 电光蓝 */
li:nth-child(5n+5) { border-left: 4px solid #af00ff; } /* 电光紫 */


li:hover {
    transform: translateY(-3px) scale(1.01); /* 悬停效果 */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4), 0 0 10px rgba(var(--hover-glow-color, 0, 191, 255), 0.4); /* 增加辉光 */
    border-color: rgba(var(--hover-glow-color, 0, 191, 255), 0.7);
    background-color: rgba(40, 50, 70, 0.9);
}
/* 为悬停辉光设置颜色变量 */
li:nth-child(5n+1):hover { --hover-glow-color: 255, 7, 58; }
li:nth-child(5n+2):hover { --hover-glow-color: 255, 171, 0; }
li:nth-child(5n+3):hover { --hover-glow-color: 0, 255, 127; }
li:nth-child(5n+4):hover { --hover-glow-color: 125, 249, 255; }
li:nth-child(5n+5):hover { --hover-glow-color: 175, 0, 255; }


/* 网格布局 - 科技感面板 */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.grid-item {
    background: linear-gradient(145deg, rgba(30, 40, 60, 0.8), rgba(25, 35, 55, 0.9)); /* 背景渐变 */
    padding: 25px;
    border-radius: 8px;
    border: 1px solid rgba(0, 123, 255, 0.3);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.05); /* 外阴影+细微内高光 */
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.grid-item:hover {
     transform: translateY(-5px);
     box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(var(--hover-glow-color, 0, 123, 255), 0.5); /* 悬停辉光 */
     border-color: rgba(var(--hover-glow-color, 0, 123, 255), 0.6);
}

/* 为不同的 grid-item 添加不同的顶部边框和标题颜色 + 悬停辉光颜色 */
.grid-item:nth-child(6n+1) { border-top: 3px solid #ff073a; }
.grid-item:nth-child(6n+1) h3 { color: #ff073a; }
.grid-item:nth-child(6n+1):hover { --hover-glow-color: 255, 7, 58; }

.grid-item:nth-child(6n+2) { border-top: 3px solid #ffab00; }
.grid-item:nth-child(6n+2) h3 { color: #ffab00; }
.grid-item:nth-child(6n+2):hover { --hover-glow-color: 255, 171, 0; }

.grid-item:nth-child(6n+3) { border-top: 3px solid #00ff7f; }
.grid-item:nth-child(6n+3) h3 { color: #00ff7f; }
.grid-item:nth-child(6n+3):hover { --hover-glow-color: 0, 255, 127; }

.grid-item:nth-child(6n+4) { border-top: 3px solid #7df9ff; }
.grid-item:nth-child(6n+4) h3 { color: #7df9ff; }
.grid-item:nth-child(6n+4):hover { --hover-glow-color: 125, 249, 255; }

.grid-item:nth-child(6n+5) { border-top: 3px solid #af00ff; }
.grid-item:nth-child(6n+5) h3 { color: #af00ff; }
.grid-item:nth-child(6n+5):hover { --hover-glow-color: 175, 0, 255; }

.grid-item:nth-child(6n+6) { border-top: 3px solid #007bff; } /* 使用主蓝色 */
.grid-item:nth-child(6n+6) h3 { color: #00a0ff; }
.grid-item:nth-child(6n+6):hover { --hover-glow-color: 0, 123, 255; }


/* 纳音部分样式 - 科技感代码块 */
.nayin-section {
    /* 可以移除或保留 nayin-section 的特定样式，根据需要调整 */
}


.nayin-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Responsive columns */
    gap: 15px; /* Space between items */
}

.nayin-list li {
    background-color: #1a3a5a; /* Slightly different background for list items */
    padding: 10px;
    border-radius: 5px;
    border: 1px dashed #00ffff33; /* Subtle dashed border */
    font-size: 0.95em;
    /* list-style: none; */  /*Ensure no default list style */
    padding-left: 10px; /* Adjust padding as no ::before is used here */
}

.nayin-list li:hover {
    background-color: #1b7bce;
}

/* 确保旧的 pre 样式已被删除 */

.nayin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 创建三列等宽网格 */
    gap: 15px; /* 网格项之间的间距 */
    margin-top: 20px;
}

.nayin-item {
    background-color: rgba(30, 40, 60, 0.85); /* 深蓝背景，与 li 类似 */
    padding: 12px 15px 12px 30px; /* 调整内边距，左侧留出图标空间 */
    border-radius: 6px; /* 圆角 */
    border: 1px solid rgba(0, 123, 255, 0.35); /* 蓝色边框 */
    color: #c0c5d1; /* 浅灰蓝色文字 */
    font-size: 0.95em;
    position: relative; /* 为了定位伪元素 */
    transition: background-color 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.nayin-item::before {
    content: '◇'; /* 使用菱形字符 */
    position: absolute;
    left: 12px; /* 定位到左侧 */
    top: 50%;
    transform: translateY(-50%); /* 垂直居中 */
    color: #7df9ff; /* 图标颜色 - 电光蓝 */
    font-size: 0.8em; /* 图标大小 */
}

.nayin-item:hover {
    background-color: rgba(40, 50, 70, 0.95); /* 悬停背景加深 */
    border-color: rgba(0, 191, 255, 0.6); /* 悬停边框变亮 */
}

/* 响应式调整 */
@media (max-width: 992px) {
    .nayin-grid {
        grid-template-columns: repeat(2, 1fr); /* 中等屏幕两列 */
    }
}

@media (max-width: 576px) {
    .nayin-grid {
        grid-template-columns: 1fr; /* 小屏幕一列 */
    }
    .nayin-item {
        padding: 10px 15px 10px 28px; /* 调整移动端内边距 */
    }
    .nayin-item::before {
        left: 10px;
    }
}

/* 响应式调整 (保持不变) */
@media (max-width: 768px) {
    .container {
        margin: 20px;
        padding: 20px 25px;
        background-color: rgba(18, 25, 40, 0.95); /* 移动端背景更实一点 */
    }

    h1 {
        font-size: 1.6em;
    }

    h2 {
        font-size: 1.3em;
    }

    h3 {
        font-size: 1.1em;
    }

    .grid-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    th, td {
        padding: 10px 12px;
    }
     #shengxiao th, #shengxiao td {
         padding: 8px 5px;
    }
}

/* 24时辰对照图样式 */
.shichen-diagram-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    background: rgba(15, 20, 30, 0.7);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(0, 123, 255, 0.3);
}
#shichen-diagram {
    max-width: 100%;
    height: auto;
    overflow: visible;
}
.shichen-sector {
    stroke: #ffffff;
    stroke-width: 2px;
    transition: opacity 0.2s, transform 0.15s;
    cursor: pointer;
}
.shichen-sector.sector-hover {
    opacity: 0.5;
    stroke: #fff;
    stroke-width: 1px;
    transform: scale(1.0);
}
.shichen-label {
    fill: #fff;
    font-size: 12px;
    font-weight: bold;
    pointer-events: none;
    text-shadow: 0 1px 2px #222;
}
.shichen-time {
    fill: #29b1b1;
    font-size: 10px;
    pointer-events: none;
    text-shadow: 0 1px 2px #222;
}