/* bagua-wanwu.css - 万物类象功能样式
 * 包含：弹窗、分类折叠、智能高亮、移动端适配
 * 版本：1.0.0
 * 更新：2026-01-18
 */

/* ============================================
   万物类象弹窗样式
   ============================================ */

/* 弹窗遮罩 */
.wanwu-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 弹窗主体 */
.wanwu-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 弹窗头部 */
.wanwu-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.wanwu-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wanwu-trigram-icon {
    font-size: 32px;
    line-height: 1;
}

.wanwu-trigram-name {
    font-size: 20px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

.wanwu-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wanwu-tag {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.wanwu-tag-element {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.wanwu-tag-smart {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    animation: smartPulse 2s ease-in-out infinite;
}

@keyframes smartPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(245, 87, 108, 0); }
    50% { transform: scale(1.05); box-shadow: 0 0 15px rgba(245, 87, 108, 0.5); }
}

.wanwu-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wanwu-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* 问题信息区 */
.wanwu-question-info {
    padding: 18px 28px;
    background: rgba(102, 126, 234, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wanwu-question-type {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.question-icon {
    font-size: 16px;
}

.question-text {
    font-size: 15px;
    font-weight: 600;
    color: #667eea;
}

.wanwu-question-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    padding-left: 24px;
}

/* 弹窗主体内容 */
.wanwu-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px;
}

/* 自定义滚动条 */
.wanwu-modal-body::-webkit-scrollbar {
    width: 8px;
}

.wanwu-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.wanwu-modal-body::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

.wanwu-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* 分类容器 */
.wanwu-category {
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: all 0.3s;
}

.wanwu-category:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(102, 126, 234, 0.3);
}

/* 分类头部 */
.wanwu-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
}

.wanwu-category-header:hover {
    background: rgba(102, 126, 234, 0.1);
}

.category-icon {
    font-size: 24px;
    line-height: 1;
}

.category-name {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.5px;
}

.category-toggle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.3s;
}

.wanwu-category.expanded .category-toggle {
    transform: rotate(180deg);
}

/* 分类内容 */
.wanwu-category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.wanwu-category.expanded .wanwu-category-content {
    max-height: 2000px;
}

/* 维度项 */
.wanwu-dimension-item {
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.wanwu-dimension-item:first-child {
    border-top: none;
}

.wanwu-dimension-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* 高亮维度 */
.wanwu-dimension-item.highlight {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.12), transparent);
    border-left: 3px solid #FFD700;
    padding-left: 17px;
    animation: highlightPulse 2.5s ease-in-out infinite;
}

@keyframes highlightPulse {
    0%, 100% {
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
        background: linear-gradient(90deg, rgba(255, 215, 0, 0.12), transparent);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
        background: linear-gradient(90deg, rgba(255, 215, 0, 0.18), transparent);
    }
}

.dim-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.highlight-badge {
    color: #FFD700;
    font-size: 12px;
    animation: starTwinkle 1.5s ease-in-out infinite;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.dim-value {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
}

/* 弹窗底部 */
.wanwu-modal-footer {
    padding: 16px 28px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0 0 16px 16px;
}

.wanwu-footer-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* ============================================
   移动端适配
   ============================================ */

@media (max-width: 768px) {
    .wanwu-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .wanwu-modal-header {
        padding: 18px 16px;
        flex-wrap: wrap;
    }

    .wanwu-header-left {
        flex: 1;
    }

    .wanwu-trigram-icon {
        font-size: 24px;
    }

    .wanwu-trigram-name {
        font-size: 16px;
    }

    .wanwu-header-right {
        width: 100%;
        margin-top: 10px;
        justify-content: space-between;
    }

    .wanwu-tag {
        padding: 4px 10px;
        font-size: 11px;
    }

    .wanwu-question-info {
        padding: 14px 16px;
    }

    .wanwu-modal-body {
        padding: 16px;
    }

    .wanwu-category-header {
        padding: 12px 16px;
    }

    .category-icon {
        font-size: 20px;
    }

    .category-name {
        font-size: 14px;
    }

    .wanwu-dimension-item {
        padding: 12px 16px;
    }

    .dim-label {
        font-size: 13px;
    }

    .dim-value {
        font-size: 13px;
    }

    .wanwu-modal-footer {
        padding: 12px 16px;
    }

    .wanwu-footer-hint {
        font-size: 11px;
    }
}

/* ============================================
   64卦查询 - 移动端快捷访问网格
   ============================================ */

/* 快捷访问容器 */
.bagua-quick-access {
    margin-bottom: 20px;
}

/* 网格布局 */
.bagua-quick-scroll {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 0;
}

/* 卦象项 */
.bagua-quick-item {
    background: rgba(20, 30, 50, 0.8);
    border: 1px solid rgba(100, 150, 200, 0.3);
    border-radius: 12px;
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.bagua-quick-item:hover {
    background: rgba(100, 150, 200, 0.2);
    border-color: rgba(100, 150, 200, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(100, 150, 200, 0.3);
}

.bagua-quick-item:active {
    transform: translateY(-1px);
}

.bagua-quick-icon {
    font-size: 28px;
    line-height: 1;
}

.bagua-quick-name {
    font-size: 15px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.bagua-quick-element {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* 桌面端隐藏移动端快捷访问 */
@media (min-width: 769px) {
    .bagua-quick-access {
        display: none;
    }
}

/* 移动端样式调整 */
@media (max-width: 768px) {
    .bagua-quick-scroll {
        gap: 8px;
        padding: 8px;
    }

    .bagua-quick-item {
        padding: 10px 6px;
        border-radius: 10px;
    }

    .bagua-quick-icon {
        font-size: 24px;
    }

    .bagua-quick-name {
        font-size: 13px;
    }

    .bagua-quick-element {
        font-size: 11px;
    }
}

/* ============================================
   64卦查询 - 桌面端可点击样式
   ============================================ */

.clickable-trigram {
    cursor: pointer;
    transition: all 0.3s;
}

.clickable-trigram:hover {
    background: rgba(102, 126, 234, 0.2) !important;
    transform: scale(1.05);
}
