/* ================================================================
   Info Modal 弹窗样式
   用于首页的知识库查询弹窗和相关交互元素
   ================================================================ */

/* 可点击元素 */
.clickable {
    cursor: pointer;
    text-decoration: none !important;
}

.clickable:hover {
    opacity: 0.8;
}

/* 弹窗背景遮罩 */
.info-modal {
    display: block;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    overflow: auto;
}

/* 弹窗内容区 */
.info-modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 0 auto;
    margin-top: 50vh;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 8px 8px 0 0;
    width: 92%;
    max-width: 1000px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    height: 50vh;
    display: flex;
    flex-direction: column;
}

/* 弹窗关闭按钮区域 */
.info-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    margin-left: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 5px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    cursor: default;
}

.info-modal-close span:first-child {
    float: left;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    cursor: default;
    user-select: text;
}

.info-modal-close span:first-child span {
    cursor: default;
    user-select: text;
}

.info-modal-close span:last-child {
    float: right;
    font-size: 28px;
    color: #aaa;
    cursor: default;
}

.info-modal-close .close-btn {
    float: right;
    font-size: 28px;
    color: #aaa;
    cursor: pointer;
}

.info-modal-close .close-btn:hover {
    color: #333;
}

/* 弹窗主体内容区 */
.info-modal-body {
    margin-top: 5px;
    max-height: 40vh;
    overflow-y: auto;
    line-height: 1.5;
}

/* 加载动画 */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 2s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* iframe 样式 */
iframe {
    flex: 1;
    min-height: 40vh;
    height: 45vh;
    background-color: #f9f9f9;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    padding: 10px;
    box-sizing: border-box;
}

/* 关系标签样式 */
.guanxi-item {
    margin: 0 5px;
    padding: 2px 5px;
    border-radius: 3px;
    display: inline-block;
}

.he, .sanhe, .liuhe, .banhe, .anhe { 
    background-color: #e6f7ff; 
}

.chong { 
    background-color: #fff1f0; 
}

.xing { 
    background-color: #fff7e6; 
}

.hai { 
    background-color: #f6ffed; 
}

.po { 
    background-color: #f9f0ff; 
}

.jue { 
    background-color: #fff2e8; 
}

.ke { 
    background-color: #e6fffb; 
}

.sanhui { 
    background-color: #fcffe6; 
}

/* 新增样式，修复藏干布局问题 */
.canggan-text > span > span {
    display: inline !important;
    margin: 0 1px;
}

/* 下拉菜单样式 */
.dropdown-btn:hover {
    background-color: #1976d2 !important;
}

.dropdown-content a:hover {
    background-color: #e3f2fd !important;
    color: #1976d2 !important;
}

/* 神煞行单元格顶部对齐 */
.detailed-bazi-table tr:last-child td, 
.detailed-bazi-table tr:last-child th {
    vertical-align: top !important;
}

/* 兼容神煞行不是最后一行的情况（如有空亡、纳音等） */
.detailed-bazi-table .shensha-row td, 
.detailed-bazi-table .shensha-row th {
    vertical-align: top !important;
    background-color: rgb(255, 255, 255) !important;
    color: #e65100 !important;
    font-weight: 500 !important;
}

/* ================================================================
   Markdown 样式支持（用于弹窗内容）
   ================================================================ */

/* 标题样式 */
.info-modal-body h1, 
.info-modal-body h2, 
.info-modal-body h3, 
.info-modal-body h4, 
.info-modal-body h5, 
.info-modal-body h6 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: bold;
    color: #667eea;
}

.info-modal-body h1 { 
    font-size: 24px; 
    border-bottom: 2px solid #eee; 
    padding-bottom: 5px; 
}

.info-modal-body h2 { 
    font-size: 20px; 
    border-bottom: 1px solid #eee; 
    padding-bottom: 3px; 
}

.info-modal-body h3 { 
    font-size: 18px; 
}

.info-modal-body h4 { 
    font-size: 16px; 
}

.info-modal-body h5 { 
    font-size: 14px; 
}

.info-modal-body h6 { 
    font-size: 12px; 
}

/* 段落样式 */
.info-modal-body p {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* 列表样式 */
.info-modal-body ul, 
.info-modal-body ol {
    margin-bottom: 10px;
    padding-left: 20px;
}

.info-modal-body li {
    margin-bottom: 5px;
    line-height: 1.5;
}

/* 引用样式 */
.info-modal-body blockquote {
    border-left: 4px solid #ddd;
    margin: 15px 0;
    padding: 10px 15px;
    background-color: #f9f9f9;
    font-style: italic;
}

/* 代码样式 */
.info-modal-body code {
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.info-modal-body pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 15px 0;
    border: 1px solid #ddd;
}

.info-modal-body pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

/* 表格样式 */
.info-modal-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
}

.info-modal-body th, 
.info-modal-body td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.info-modal-body th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.info-modal-body tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* 链接样式 */
.info-modal-body a {
    color: #007bff;
    text-decoration: none;
}

.info-modal-body a:hover {
    text-decoration: underline;
}

/* 图片样式 */
.info-modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 10px 0;
}

/* 分割线样式 */
.info-modal-body hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 20px 0;
}

/* 按钮样式 */
.info-modal-body .btn {
    display: inline-block;
    padding: 6px 12px;
    margin: 2px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
}

.info-modal-body .btn-outline-secondary {
    color: #6c757d;
    background-color: transparent;
    border-color: #6c757d;
}

.info-modal-body .btn-outline-secondary:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.info-modal-body .btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

