/* ============================================
   64卦查询模块 - 独立样式文件 v6.2
   最后更新：2025-12-28 - 移除冲突的移动端样式
   避免与现有系统冲突，使用 gua64- 前缀
   ============================================ */

/* === 容器基础 === */
.gua64-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    box-sizing: border-box;
}

/* === 搜索栏 === */
.gua64-search-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px 25px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(20, 20, 30, 0.6));
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gua64-search-bar input {
    flex: 1;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    color: var(--text-color, #fff);
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.gua64-search-bar input:focus {
    border-color: var(--gold, #FFD700);
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.gua64-search-bar input::placeholder {
    color: rgba(255, 215, 0, 0.5);
}

/* 搜索图标悬停效果 */
#gua64-search-icon {
    transition: all 0.3s ease;
    user-select: none;
}

#gua64-search-icon:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

#gua64-search-icon:active {
    transform: scale(1.1);
}

.gua64-search-bar button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.gua64-search-bar button:hover {
    background: linear-gradient(135deg, #FFA500, #FF8C00);
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.4);
    transform: translateY(-1px);
}

/* === 布局（上下结构） === */
.gua64-layout {
    width: 100%;
    margin-bottom: 30px;
    position: relative;  /* ✅ 新增：为Drawer提供定位上下文 */
    min-height: 600px;   /* ✅ 新增：确保有足够高度容纳Drawer */
}

.gua64-matrix-container {
    width: 100%;
    transition: opacity 0.3s ease;  /* ✅ 新增：变暗动画 */
}

/* === 详情面板容器（在矩阵下方） === */
.gua64-detail-container {
    width: 100%;
    margin-top: 40px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(20, 20, 30, 0.6));
    border-radius: 15px;
    padding: 30px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 40px rgba(255, 215, 0, 0.15);
    min-height: 250px;
    position: relative;
    overflow: hidden;
}

.gua64-detail-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.gua64-detail {
    width: 100%;
    position: relative;
    z-index: 1;
}

/* === 8x8 卦象矩阵（电脑端） === */
.gua64-matrix {
    display: grid;
    grid-template-columns: 75px repeat(8, 1fr);
    grid-template-rows: 90px repeat(8, minmax(140px, auto));
    gap: 3px;
    background: rgba(15, 20, 30, 1);
    padding: 8px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(100, 150, 180, 0.1);
    border: 1px solid rgba(100, 150, 180, 0.2);
}

/* 表头 - 横排八卦 */
.gua64-matrix-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;  /* 改为flex-start，从顶部开始 */
    background: rgba(25, 35, 50, 1);
    border-radius: 8px;
    padding: 4px 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(100, 150, 180, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    gap: 2px;  /* 减小间距：3px -> 2px */
    height: 100%;
}

/* 表头序号 - 清晰不发光 */
.gua64-header-number {
    font-size: 18px;  /* 放大字体：13px -> 18px */
    font-weight: 700;
    color: var(--gold, #FFD700);
    text-shadow: none;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    height: auto;
    line-height: 1;
    margin: 0;
}

/* 表头图标+卦名组合容器 - 紧贴在一起 */
.gua64-header-icon-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;  /* 图标和卦名之间3px间距 */
    flex-shrink: 1;
    height: 100%;
    justify-content: flex-end;  /* 底部对齐 */
}

/* 表头图标容器 */
.gua64-header-icon {
    width: 100%;
    height: auto;
    max-height: 30px;  /* 减小最大高度：48px -> 30px，匹配三爻卦象实际高度 */
    display: flex;
    justify-content: center;
    align-items: flex-end;  /* 图标底部对齐 */
    flex-shrink: 0;  /* 不允许缩小 */
    position: relative;
    z-index: 2;
    margin: 0;
    line-height: 0;  /* 移除行高间隙 */
}

.gua64-header-icon svg {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 30px;  /* 减小最大高度：48px -> 30px */
}

/* 表头卦名 - 使用上标样式 */
.gua64-header-name {
    font-size: 18px;
    font-weight: 700;
    text-shadow: none;
    white-space: nowrap;
    line-height: 1;
    text-align: center;
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 0;  /* 移除任何padding */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    flex-shrink: 0;
}

.gua64-header-name-sup {
    font-size: 14px;  /* 上标也相应放大：11px -> 14px */
    font-weight: 500;
    vertical-align: super;
    margin-left: 1px;
}

/* 移除横排表头的伪元素发光特效 */

.gua64-matrix-header:hover {
    background: rgba(35, 50, 70, 1);  /* 纯色，悬停时稍亮 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
    border-color: rgba(100, 150, 180, 0.4);
}

/* 表头 - 竖排八卦 */
.gua64-matrix-sidebar {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;  /* ✅ 居中对齐，消除空旷感 */
    background: rgba(25, 35, 50, 1);
    border-radius: 8px;
    padding: 4px 2px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(100, 150, 180, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    gap: 3px !important;  /* ✅ 序号和图标之间3px间距 */
    height: 100%;
}

/* 侧边栏序号 - 清晰不发光 */
.gua64-sidebar-number {
    font-size: 18px;  /* 放大字体：13px -> 18px */
    font-weight: 700;
    color: var(--gold, #FFD700);
    text-shadow: none;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    height: auto;
    line-height: 1;
    margin: 0;
}

/* 侧边栏图标+卦名组合容器 - 图标和卦名之间留3px间距 */
.gua64-sidebar-icon-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;  /* 图标和卦名之间3px间距 */
    flex-shrink: 1;
    justify-content: center;  /* ✅ 居中对齐，配合父容器的center */
}

/* 侧边栏图标容器 */
.gua64-sidebar-icon {
    width: 100%;
    height: auto;
    max-height: 30px;  /* 减小最大高度：48px -> 30px，匹配三爻卦象实际高度 */
    display: flex;
    justify-content: center;
    align-items: flex-end;  /* 图标底部对齐 */
    flex-shrink: 0;  /* 不允许缩小 */
    position: relative;
    z-index: 2;
    margin: 0;
    line-height: 0;  /* 移除行高间隙 */
}

.gua64-sidebar-icon svg {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 30px;  /* 减小最大高度：48px -> 30px */
}

/* 侧边栏卦名 - 使用上标样式 */
.gua64-sidebar-name {
    font-size: 18px;
    font-weight: 700;
    text-shadow: none;
    white-space: nowrap;
    line-height: 1;
    text-align: center;
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 0;  /* 移除任何padding */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    flex-shrink: 0;
}

.gua64-sidebar-name-sup {
    font-size: 14px;  /* 上标也相应放大：11px -> 14px */
    font-weight: 500;
    vertical-align: super;
    margin-left: 1px;
}

/* 移除侧边栏的伪元素发光特效 */

.gua64-matrix-sidebar:hover {
    background: rgba(35, 50, 70, 1);  /* 纯色，悬停时稍亮，与横排表头一致 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transform: translateX(-2px);
    border-color: rgba(100, 150, 180, 0.4);
}

/* 左上角空白格 - 斜线样式 */
.gua64-matrix-corner {
    background: rgba(25, 35, 50, 1);  /* 纯色统一，与表头相同 */
    border-radius: 8px;
    border: 1px solid rgba(100, 150, 180, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* 斜线 - 从左上到右下 */
.gua64-corner-line {
    position: absolute;
    width: 150%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold, #FFD700), transparent);
    top: 50%;
    left: -25%;
    transform: rotate(45deg);  /* 改为45度，从左上到右下 */
    transform-origin: center;
}

/* 上卦文字 - 右上角右对齐 */
.gua64-corner-top {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 16px;  /* 增大字体 13px -> 16px */
    font-weight: 700;
    color: var(--gold, #FFD700);
    text-shadow: none;
    text-align: right;
}

/* 下卦文字 - 左下角左对齐 */
.gua64-corner-bottom {
    position: absolute;
    bottom: 8px;
    left: 8px;
    font-size: 16px;  /* 增大字体 13px -> 16px */
    font-weight: 700;
    color: var(--gold, #FFD700);
    text-shadow: none;
    text-align: left;
}

/* 卦象卡片 - 垂直布局 */
.gua64-card {
    background: rgba(25, 35, 50, 1);
    border: 2px solid rgba(100, 150, 180, 0.25);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gua64-card:hover {
    background: rgba(35, 50, 70, 1);
    border-color: rgba(100, 150, 180, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

/* 卡片统一容器 */
.gua64-card-unified-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
}

/* 卡片顶部组 - 序号和卦象 */
.gua64-card-top-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.gua64-card-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--gold, #FFD700);
}

.gua64-card-hexagram-combined {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 卡片底部组 - 卦名和卦义 */
.gua64-card-bottom-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.gua64-card-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.gua64-card-meaning {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

/* 卦象图标容器 */
.gua64-hexagram-icon {
    display: flex;
    flex-direction: column;
    gap: 6px;  /* 减小间距 8px -> 6px */
    align-items: center;
    position: relative;
}

/* 上下卦分组 */
.gua64-trigram-group {
    display: flex;
    flex-direction: column;
    gap: 2px;  /* 减小间距 3px -> 2px */
}

/* 单爻样式 - 尺寸由JS控制 */
.gua64-yao {
    border-radius: 2px;
    transition: all 0.3s;
}

/* 阳爻 - 实心 */
.gua64-yao.yang {
    background: var(--yao-color);
}

/* 阴爻 - 断开（使用伪元素） */
.gua64-yao.yin {
    background: transparent;
    position: relative;
}

.gua64-yao.yin::before,
.gua64-yao.yin::after {
    content: '';
    position: absolute;
    height: 100%;
    width: 20px;
    background: var(--yao-color);
    border-radius: 2px;
}

.gua64-yao.yin::before {
    left: 0;
}

.gua64-yao.yin::after {
    right: 0;
}

/* 上下卦分隔箭头 */
.gua64-relation-arrow {
    font-size: 16px;
    font-weight: bold;
    color: var(--relation-color);
    animation: gua64-arrow-pulse 1.5s ease-in-out infinite;
}

@keyframes gua64-arrow-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* 相生相克标签 */
.gua64-relation-label {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    background: var(--relation-bg);
    color: var(--relation-text);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* 相生 - 金色 */
.gua64-card.relation-sheng {
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.gua64-card.relation-sheng .gua64-relation-label {
    --relation-bg: linear-gradient(135deg, #FFD700, #FFA500);
    --relation-text: #000;
}

/* 相克 - 红色 */
.gua64-card.relation-ke {
    border-color: #FF4500;
    box-shadow: inset 0 0 15px rgba(255, 69, 0, 0.4);
}

.gua64-card.relation-ke .gua64-relation-label {
    --relation-bg: linear-gradient(135deg, #FF4500, #FF6347);
    --relation-text: #fff;
}

/* 比合 - 白色 */
.gua64-card.relation-bihe {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.gua64-card.relation-bihe .gua64-relation-label {
    --relation-bg: linear-gradient(135deg, #fff, #f0f0f0);
    --relation-text: #333;
}

/* 被生 - 绿色 */
.gua64-card.relation-bei-sheng {
    border-color: #90EE90;
    box-shadow: 0 0 15px rgba(144, 238, 144, 0.5);
}

.gua64-card.relation-bei-sheng .gua64-relation-label {
    --relation-bg: linear-gradient(135deg, #90EE90, #98FB98);
    --relation-text: #000;
}

/* 被克 - 橙色 */
.gua64-card.relation-bei-ke {
    border-color: #FF6347;
    box-shadow: inset 0 0 12px rgba(255, 99, 71, 0.3);
}

.gua64-card.relation-bei-ke .gua64-relation-label {
    --relation-bg: linear-gradient(135deg, #FF6347, #FF7F50);
    --relation-text: #fff;
}

/* === 详情面板 === */
.gua64-detail {
    color: var(--text-color, #fff);
}

.gua64-detail-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 215, 0, 0.6);
    font-size: 16px;
    line-height: 2;
}

.gua64-detail-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid transparent;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.5), transparent) bottom / 80% 2px no-repeat;
}

.gua64-detail-name {
    font-size: 28px;
    font-weight: 800;
    color: var(--gold, #FFD700);
    margin-bottom: 12px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.gua64-detail-composition {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.gua64-detail-icon-large {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin: 25px 0;
}

.gua64-detail-section {
    margin-bottom: 25px;
}

.gua64-detail-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold, #FFD700);
    margin-bottom: 12px;
    padding-left: 15px;
    border-left: 5px solid var(--gold, #FFD700);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.gua64-detail-section-content {
    font-size: 15px;
    line-height: 2;
    color: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.gua64-yaoci-item {
    margin-bottom: 18px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border-left: 4px solid var(--gold, #FFD700);
    border-radius: 6px;
    transition: all 0.3s;
}

.gua64-yaoci-item:hover {
    background: rgba(0, 0, 0, 0.5);
    border-left-width: 6px;
    transform: translateX(5px);
}

.gua64-yaoci-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--gold, #FFD700);
    margin-bottom: 8px;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.3);
}

.gua64-yaoci-text {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    font-size: 14px;
}

/* === 手机端选择器 === */
.gua64-mobile-selector {
    display: none;
}

.gua64-selector-step {
    margin-bottom: 30px;
}

.gua64-selector-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gold, #FFD700);
    text-align: center;
    margin-bottom: 15px;
}

.gua64-selector-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.gua64-selector-btn {
    padding: 20px 10px;
    background: var(--card-bg, rgba(0, 0, 0, 0.4));
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.gua64-selector-btn:hover,
.gua64-selector-btn.selected {
    border-color: var(--gold, #FFD700);
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.gua64-selector-btn-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color, #fff);
    margin-top: 8px;
}

.gua64-selector-btn-element {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* === 响应式设计 === */

/* 平板端 */
@media (max-width: 1024px) {
    .gua64-layout {
        grid-template-columns: 1fr 350px;
    }

    .gua64-matrix {
        grid-template-columns: 60px repeat(8, 1fr);
        grid-template-rows: 50px repeat(8, 1fr);
        gap: 6px;
    }

    .gua64-card {
        min-height: 80px;
        padding: 8px;
    }

    .gua64-yao {
        width: 40px;
        height: 5px;
    }
}

/* 手机端 */
@media (max-width: 768px) {
    .gua64-container {
        padding: 15px;
    }

    /* 隐藏电脑端8x8矩阵 */
    .gua64-matrix {
        display: none;
    }

    /* 显示手机端4列网格 */
    .gua64-mobile-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        padding: 15px 0;
    }

    .gua64-search-bar {
        flex-direction: row;
        padding: 15px 10px;
        gap: 8px;
    }

    .gua64-search-bar input {
        flex: 1;
        font-size: 13px;
        padding: 10px 12px;
        min-width: 0;
    }

    .gua64-search-bar input::placeholder {
        font-size: 12px;
    }

    .gua64-search-bar button {
        padding: 10px 16px;
        font-size: 14px;
        flex-shrink: 0;
    }

    /* 手机端卦象卡片 */
    .gua64-mobile-card {
        background: rgba(25, 35, 50, 0.9);
        border: 1px solid rgba(255, 215, 0, 0.3);
        border-radius: 8px;
        padding: 6px 3px;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        min-height: 110px;
        overflow: hidden;
    }

    .gua64-mobile-card:active {
        background: rgba(35, 50, 70, 0.9);
        border-color: rgba(255, 215, 0, 0.6);
        transform: scale(0.95);
    }

    .gua64-mobile-card-top {
        display: flex;
        align-items: center;
        gap: 3px;
        width: 100%;
        justify-content: center;
        flex-shrink: 0;
    }

    .gua64-mobile-card-number {
        font-size: 10px;
        font-weight: 700;
        color: var(--gold, #FFD700);
        flex-shrink: 0;
    }

    .gua64-mobile-card-fullname {
        font-size: 10px;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.9);
        flex-shrink: 0;
        white-space: nowrap;
    }

    .gua64-mobile-card-svg {
        flex-shrink: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 44px;
        width: 100%;
    }

    .gua64-mobile-card-svg svg {
        display: block;
    }

    .gua64-mobile-card-bottom {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        width: 100%;
        flex-shrink: 0;
        overflow: hidden;
    }

    .gua64-mobile-card-shortname {
        font-size: 11px;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.95);
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
    }

    .gua64-mobile-card-meaning {
        font-size: 9px;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.6);
        text-align: center;
        line-height: 1.3;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        width: 100%;
    }

    .gua64-mobile-card-svg {
        flex-shrink: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 44px;
        width: 100%;
    }

    .gua64-mobile-card-svg svg {
        display: block;
    }

    /* 抽屉在手机端占满屏幕 */
    .gua64-drawer {
        height: 85vh;
        border-radius: 16px 16px 0 0;
    }

    .gua64-drawer-title {
        font-size: 20px;
    }

    .gua64-four-guas {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        padding: 15px !important;
        height: auto !important;
        min-height: auto !important;
        margin-bottom: 20px !important;
        background: rgba(0, 0, 0, 0.15) !important;
        grid-template-columns: none !important;
    }

    /* 旧的 .gua64-single-gua 移动端样式已移除，使用 .gua64-single-gua-mobile 代替 */

    .gua64-yaoci-grid {
        grid-template-columns: 1fr;
    }

    .gua64-drawer-nav-btn {
        font-size: 14px;
        padding: 12px 16px;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .gua64-selector-grid {
        gap: 8px;
    }

    .gua64-selector-btn {
        padding: 15px 8px;
    }

    .gua64-yao {
        width: 35px;
        height: 4px;
    }
}

/* === 滚动条美化 === */
.gua64-right-panel::-webkit-scrollbar {
    width: 8px;
}

.gua64-right-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.gua64-right-panel::-webkit-scrollbar-thumb {
    background: var(--gold, #FFD700);
    border-radius: 4px;
}

.gua64-right-panel::-webkit-scrollbar-thumb:hover {
    background: #FFA500;
}

/* ============================================
   右侧滑出面板 (Drawer) 样式 v5.0
   ============================================ */

/* 遮罩层 */
.gua64-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.gua64-drawer-overlay.active {
    display: block;
    animation: gua64-fadeIn 0.3s ease;
}

/* 底部抽屉 - 从底部滑出 */
.gua64-drawer {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 70vh;
    background: linear-gradient(135deg, rgba(20, 30, 45, 0.98) 0%, rgba(30, 45, 65, 0.98) 100%);
    border: 2px solid rgba(255, 215, 0, 0.6);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.8), 0 0 80px rgba(255, 215, 0, 0.3);
    z-index: 10000;
    display: none;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.gua64-drawer.open {
    transform: translateY(0);
}

/* 抽屉头部 */
.gua64-drawer-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(40, 55, 75, 0.6) 0%, rgba(25, 35, 50, 0.6) 100%);
    flex-shrink: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.gua64-drawer-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gold, #FFD700);
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    letter-spacing: 1px;
}

.gua64-drawer-close {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 215, 0, 0.4);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: 300;
}

.gua64-drawer-close:hover {
    background: rgba(255, 69, 0, 0.2);
    border-color: rgba(255, 69, 0, 0.6);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 15px rgba(255, 69, 0, 0.4);
}

/* 抽屉内容区 */
.gua64-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;  /* 确保flex子元素可以正确触发overflow */
}

/* 4种卦象组合显示 */
.gua64-four-guas {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 15px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    height: 450px;
}

.gua64-single-gua {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 10px 6px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
    height: 100%;
}

/* 本卦样式 - 加大加粗 */
.gua64-single-gua.bengua .gua64-gua-label {
    font-size: 20px;
    font-weight: 900;
}

.gua64-single-gua.bengua .gua64-gua-name {
    font-size: 18px;
    font-weight: 900;
}

.gua64-single-gua.bengua .gua64-gua-info {
    font-size: 17px;
    font-weight: 700;
}

.gua64-single-gua:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

/* 卦象图标+左右标签容器 */
.gua64-gua-icon-with-labels {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    flex: 1;
}

/* 左侧标签（乾金 乾金） */
.gua64-gua-left-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;  /* 上下两端对齐 */
    align-items: center;
    height: 150px;
    width: 50px;
    padding: 8px 0;
    position: relative;
    gap: 0;  /* 移除间距，使用绝对定位 */
    flex-shrink: 0;
}

.gua64-gua-left-label {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    /* writing-mode: vertical-rl; */  /* 改为横向显示 */
    letter-spacing: 2px;
    position: absolute;  /* 使用绝对定位 */
    z-index: 1;
    width: 100%;
}

/* 第一个标签（上卦）固定在顶部 */
.gua64-gua-left-label:first-child {
    top: 8px;
}

/* 最后一个标签（下卦）固定在底部 */
.gua64-gua-left-label:last-child {
    bottom: 8px;
}

/* 五行关系文字 */
.gua64-relation-text {
    font-size: 16px;
    font-weight: 900;
    color: rgba(255, 215, 0, 0.95);
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    padding: 4px 6px;
    border-radius: 4px;
}

/* 箭头样式 */
.gua64-label-arrow {
    font-size: 14px;
    color: rgba(255, 215, 0, 0.8);
    line-height: 1;
}

/* 右侧爻位标签（上九、九五等） */
.gua64-gua-right-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 150px;
    padding: 5px 0;
}

.gua64-yao-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    line-height: 1;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gua64-gua-icon {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gua64-gua-label {
    font-size: 16px;
    color: rgba(255, 215, 0, 0.8);
    font-weight: bold;
    margin-top: 4px;
}

.gua64-gua-name {
    font-size: 16px;
    text-align: center;
    font-weight: bold;
    margin-top: 2px;
}

.gua64-gua-info {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    line-height: 1.2;
    margin-top: 2px;
}

/* 抽屉底部导航 */
.gua64-drawer-footer {
    padding: 16px 25px;
    border-top: 1px solid rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, rgba(25, 35, 50, 0.6) 0%, rgba(40, 55, 75, 0.6) 100%);
    flex-shrink: 0;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.gua64-drawer-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
}

.gua64-drawer-nav-btn {
    flex: 1;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.08));
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 10px;
    color: var(--gold, #FFD700);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gua64-drawer-nav-btn:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.15));
    border-color: rgba(255, 215, 0, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.gua64-drawer-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.gua64-drawer-hint {
    text-align: center;
    color: #888;
    font-size: 12px;
}

/* 抽屉内section样式 - 复用现有的detail样式 */
.gua64-drawer-section {
    margin-bottom: 18px;
    margin-top: 30px;
}

.gua64-drawer-section-title {
    font-size: 17px;
    font-weight: bold;
    color: var(--gold, #FFD700);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gua64-drawer-section-content {
    font-size: 14px;
    line-height: 1.7;
    color: #ddd;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid rgba(255, 215, 0, 0.5);
}

.gua64-drawer-section-content p {
    margin: 8px 0;
    line-height: 1.8;
}

.gua64-drawer-section-content p:first-child {
    margin-top: 0;
}

.gua64-drawer-section-content p:last-child {
    margin-bottom: 0;
}

.gua64-drawer-section-content strong {
    color: var(--gold, #FFD700);
    font-weight: 700;
}

/* 爻辞样式 - 网格布局 */
.gua64-yaoci-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.gua64-drawer-yaoci-item {
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s;
}

.gua64-drawer-yaoci-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.1);
}

.gua64-drawer-yaoci-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--gold, #FFD700);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.gua64-drawer-yaoci-text {
    color: #ddd;
    line-height: 1.8;
    font-size: 14px;
    margin-bottom: 8px;
}

.gua64-drawer-yaoci-xiang {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    font-size: 13px;
    font-style: italic;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 215, 0, 0.15);
}

/* 抽屉打开时，矩阵容器变暗 */
.gua64-matrix-container.drawer-open {
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

/* 防止body fixed时出现白色背景 */
html, body {
    min-height: 100%;
    height: auto;
}

body.gua64-modal-open {
    overflow: hidden !important;
}

/* 卡片高亮状态 */
.gua64-card.active {
    border-color: var(--gold, #FFD700) !important;
    background: rgba(255, 215, 0, 0.1) !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5) !important;
}

/* 抽屉滚动条 */
.gua64-drawer-body::-webkit-scrollbar {
    width: 8px;
}

.gua64-drawer-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.gua64-drawer-body::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 4px;
}

.gua64-drawer-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

/* 淡入动画 */
@keyframes gua64-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 右侧滑入动画 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式：小屏幕时抽屉占满全屏 */
@media (max-width: 768px) {
    .gua64-drawer {
        width: 100%;
    }
}

/* === 变卦卡片样式 === */
.gua64-change-card {
    transition: all 0.3s ease;
}

.gua64-change-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,215,0,0.6) !important;
    background: rgba(40,40,40,0.8) !important;
    box-shadow: 0 5px 15px rgba(255,215,0,0.3);
}

.gua64-view-change-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(255,215,0,0.5);
}

.gua64-change-hexagram-box {
    transition: all 0.3s ease;
}

.gua64-change-hexagram-box:hover {
    background: rgba(255,215,0,0.12) !important;
    border-color: rgba(255,215,0,0.4) !important;
}

/* 变卦预览图样式 */
.gua64-changed-hexagrams-grid {
    animation: gua64-fadeIn 0.5s ease-in;
}

/* ============================================
   移动端专用样式 - 使用独立HTML结构
   ============================================ */
@media (max-width: 768px) {
    /* 移动端卦象卡片 */
    .gua64-single-gua-mobile {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        padding: 15px 10px !important;
        background: rgba(0, 0, 0, 0.25) !important;
        border: 1px solid rgba(255, 215, 0, 0.25) !important;
        border-radius: 6px !important;
        margin-bottom: 0 !important;
        width: 100% !important;
    }

    .gua64-single-gua-mobile.bengua {
        border-color: rgba(255, 215, 0, 0.5);
        background: rgba(255, 215, 0, 0.08);
    }

    .gua64-gua-label-mobile {
        font-size: 16px;
        color: rgba(255, 215, 0, 0.8);
        font-weight: bold;
        margin-bottom: 8px;
    }

    .gua64-single-gua-mobile.bengua .gua64-gua-label-mobile {
        font-size: 18px;
        font-weight: 900;
    }

    .gua64-gua-content-mobile {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        width: 100% !important;
        justify-content: center !important;
    }

    .gua64-gua-left-labels-mobile {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        min-width: 50px !important;
        flex-shrink: 0 !important;
        height: 100px !important;
    }

    .gua64-gua-left-label-mobile {
        font-size: 16px;
        font-weight: 700;
        text-align: center;
        line-height: 1.3;
        white-space: nowrap;
        writing-mode: vertical-rl;
        letter-spacing: 2px;
    }

    .gua64-relation-wrapper-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    .gua64-relation-arrow-mobile {
        position: absolute;
        left: -15px;
        font-size: 14px;
        line-height: 1;
    }

    .gua64-relation-text-mobile {
        font-size: 16px;
        font-weight: 700;
        text-align: center;
        line-height: 1;
        padding: 3px 5px;
        border-radius: 4px;
        writing-mode: vertical-rl;
        letter-spacing: 0;
    }

    .gua64-gua-icon-mobile {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex-shrink: 0 !important;
    }

    .gua64-gua-right-labels-mobile {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        gap: 0 !important;
        min-width: 35px !important;
        flex-shrink: 0 !important;
        height: 100px !important;
        padding: 2px 0 !important;
    }

    .gua64-yao-label-mobile {
        font-size: 13px;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.8);
        text-align: center;
        line-height: 1;
        height: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .gua64-gua-name-mobile {
        font-size: 15px;
        text-align: center;
        font-weight: bold;
        margin-top: 6px;
    }

    .gua64-single-gua-mobile.bengua .gua64-gua-name-mobile {
        font-size: 16px;
        font-weight: 900;
    }

    .gua64-gua-info-mobile {
        font-size: 13px;
        color: rgba(255, 255, 255, 0.5);
        text-align: center;
        margin-top: 2px;
    }

    .gua64-single-gua-mobile.bengua .gua64-gua-info-mobile {
        font-size: 14px;
        font-weight: 600;
    }

    /* 隐藏桌面版卦象 */
    .gua64-single-gua {
        display: none !important;
    }
}

/* ============================================
   五行关系箭头和比合样式 - 仅电脑端
   ============================================ */

/* 相生、相克：箭头跨越上下卦，文字在右侧 - 仅电脑端 - 只应用于64卦查询 */
@media (min-width: 769px) {
    .gua64-single-gua .left-relation.relation-arrow-style {
        position: absolute;
        left: 5px;
        top: 0;
        bottom: 0;
        width: 40px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        z-index: 2;
    }

    /* 箭头容器（垂直布局，固定高度） */
    .gua64-single-gua .arrow-line-top,
    .gua64-single-gua .arrow-line-bottom {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
        flex-shrink: 0;
        height: 70px;
    }

    /* 向下箭头：粗线条 + 向下箭头尖 */
    .gua64-single-gua .arrow-line-top::before {
        content: '';
        display: block;
        width: 6px;
        height: 50px;
        background: var(--arrow-top-color, #32CD32);
    }

    .gua64-single-gua .arrow-line-top::after {
        content: '';
        display: block;
        width: 0;
        height: 0;
        border-left: 9px solid transparent;
        border-right: 9px solid transparent;
        border-top: 14px solid var(--arrow-top-color, #32CD32);
        margin-top: -1px;
    }

    /* 向上箭头：向上箭头尖 + 粗线条 */
    .gua64-single-gua .arrow-line-bottom::before {
        content: '';
        display: block;
        width: 0;
        height: 0;
        border-left: 9px solid transparent;
        border-right: 9px solid transparent;
        border-bottom: 14px solid var(--arrow-bottom-color, #FF4500);
        margin-bottom: -1px;
    }

    .gua64-single-gua .arrow-line-bottom::after {
        content: '';
        display: block;
        width: 6px;
        height: 50px;
        background: var(--arrow-bottom-color, #FF4500);
    }

    /* 文字在箭头右侧，与五行字大小和粗细一致 */
    .gua64-single-gua .left-relation.relation-arrow-style .relation-text {
        position: relative;
        z-index: 3;
        margin: 0;
        padding: 0;
        font-size: 18px;
        font-weight: 800;
        white-space: nowrap;
        align-self: center;
        line-height: 1;
        text-shadow: none !important;
    }

    /* 确保左侧标签容器有相对定位，以便箭头绝对定位 */
    .gua64-gua-left-labels {
        position: relative;
    }
}

/* 比合关系：两条并排的竖线（||） - 仅电脑端 - 只应用于64卦查询 */
@media (min-width: 769px) {
    .gua64-single-gua .left-relation.relation-bihe {
        position: absolute;
        left: 5px;
        top: 0;
        bottom: 0;
        width: 40px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        z-index: 2;
    }

    /* 竖线容器 - 居中显示 */
    .gua64-single-gua .bihe-line-container {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 3px;
        height: 70px;
        flex-shrink: 0;
    }

    .gua64-single-gua .bihe-line-top,
    .gua64-single-gua .bihe-line-bottom {
        display: block;
        width: 6px;
        height: 70px;
    }

    /* 文字在竖线右侧 */
    .gua64-single-gua .left-relation.relation-bihe .relation-text {
        position: relative;
        z-index: 3;
        margin: 0;
        padding: 2px 5px;
        font-size: 16px;
        font-weight: 900;
        writing-mode: vertical-rl;
        text-orientation: upright;
        white-space: nowrap;
        align-self: center;
        letter-spacing: 2px;
        text-shadow: none !important;
    }

    /* 隐藏比合关系的箭头符号 */
    .left-relation.relation-bihe .arrow {
        display: none !important;
    }
}
