﻿:root {
    --bg-color: #fdfaf5;
    --card-bg: #ffffff;
    --primary-text: #2c3e50;
    --accent-color: #b38b59; /* 古铜金 */
    --secondary-text: #7f8c8d;
    --shadow: 0 4px 15px rgba(0,0,0,0.05);
}

body {
    background-color: var(--bg-color);
    font-family: 'Noto Sans SC', sans-serif;
    color: var(--primary-text);
    margin: 0;
    padding: 40px 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 60px;
}

h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 2.5em;
    color: var(--primary-text);
    margin-bottom: 10px;
}

.subtitle {
    color: var(--secondary-text);
    font-weight: 300;
}

/* 挑战卡片网格 */
.challenge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.challenge-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

    .challenge-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.1);
        border-bottom-color: var(--accent-color);
    }

    .challenge-card h3 {
        font-family: 'Noto Serif SC', serif;
        margin-top: 0;
        font-size: 1.4em;
        color: var(--accent-color);
    }

    .challenge-card p {
        font-size: 0.95em;
        line-height: 1.6;
        color: var(--secondary-text);
    }

.view-btn {
    margin-top: 20px;
    font-size: 0.85em;
    color: var(--accent-color);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tag-list {
    margin-top: 8px;
}

.tag {
    display: inline-block;
    background: #eee;
    padding: 3px 8px;
    margin: 2px;
    font-size: 12px;
    border-radius: 4px;
}

.path-block {
    margin-bottom: 15px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 6px;
}

.path-seq {
    font-weight: bold;
    margin-bottom: 5px;
}

.path-desc {
    font-size: 13px;
    color: #666;
}

.role-title {
    margin-top: 15px;
    font-size: 16px;
    border-left: 4px solid #333;
    padding-left: 8px;
}

.rec-card {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.hex-title {
    font-weight: bold;
}

.hex-meaning {
    font-size: 13px;
    color: #555;
}

.hex-strategy {
    margin-top: 5px;
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: none; /* 初始隐藏 */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-color);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: 15px;
    padding: 40px;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--secondary-text);
}

.modal-header h2 {
    font-family: 'Noto Serif SC', serif;
    color: var(--primary-text);
    margin-top: 0;
}

/* 卦象解决方案布局 */
.recommendation-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.hex-box {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid var(--accent-color);
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 20px;
}

.hex-number {
    font-size: 2em;
    font-family: 'Noto Serif SC', serif;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fdfaf5;
    border-radius: 8px;
}

.hex-details h4 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
}

.hex-meaning {
    font-weight: bold;
    color: var(--accent-color);
    font-size: 0.9em;
    margin-bottom: 10px;
    display: block;
}

.hex-strategy {
    font-size: 0.95em;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .hex-box {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .modal-content {
        padding: 20px;
    }
}

.hexagram-container {
    display: flex;
    flex-direction: column-reverse;
    gap: 15px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    width: fit-content;
    /* margin-right 增加，防止文字切断 */
    margin: 10px auto 10px auto;
    position: relative;
}

.yao-row {
    display: flex;
    justify-content: space-between;
    width: var(--line-width);
    height: var(--line-height);
    cursor: pointer;
    position: relative;
}

.line-half {
    height: 100%;
    background-color: var(--gua-color);
    transition: width var(--transition-speed) ease-in-out, background-color 0.3s;
    border-radius: 0px;
}

/* --- 阴阳逻辑 --- */
.yao-row.yang .line-half {
    width: 50%;
}

.yao-row.yin .line-half {
    width: 42%;
}

/* 悬停变色 */
.yao-row:hover .line-half {
    background-color: #b1271b;
}

/* --- 文字定位与间距 --- */
.yao-label {
    position: absolute;
    /* 这里的 -90px 让文字离线更远，你可以根据喜好调整这个数值 */
    right: -90px;
    width: 60px;
    color: #777;
    font-size: 14px;
    line-height: var(--line-height);
    text-align: left;
    font-family: "Microsoft YaHei", sans-serif;
    /* 增加一点左边距，确保即使在小屏幕上也有留白 */
    padding-left: 20px;
    white-space: nowrap;
}
:root {
    --taiji-size: 100px;
    --bg-color: #fdfdfd; /* 页面背景色，用于空隙 */
}

.taiji-css {
    --taiji-size: 50px; 
}

/* 1. 主容器：负责左黑右白和整体顺时针旋转 */
.taiji-loader {
    width: var(--taiji-size);
    height: var(--taiji-size);
    border-radius: 50%;
    position: relative;
    /* 左黑右白 */
    background: linear-gradient(to right, #000 50%, #fff 50%);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin: 50px auto;
    /* 顺时针旋转 */
    animation: rotate-cw 20s linear infinite;
}

    /* 2. 两个大圆（鱼身）：上下分布 */
    .taiji-loader::before,
    .taiji-loader::after {
        content: '';
        position: absolute;
        width: 50%;
        height: 50%;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 上半部分：黑色区域的白色大圆 */
    .taiji-loader::before {
        top: 0;
        background: #000; /* 修正：这里应该是黑色背景，因为在左半边黑色里，它在顶部形成圆润弧度 */
        /* 我们直接通过这个伪元素画出鱼眼 */
    }

    /* 下半部分：白色区域的黑色大圆 */
    .taiji-loader::after {
        bottom: 0;
        background: #fff;
    }

/* 3. 内部的核心圆点（鱼眼）：负责逆时针旋转 */
.eye {
    position: absolute;
    width: 50%;
    height: 50%;
    left: 25%;
    border-radius: 50%;
    z-index: 10;
    /* 核心：应用逆时针旋转 */
    animation: rotate-ccw 8s linear infinite;
}

    /* 位于上方的鱼眼（黑底白圆） */
    .eye.top {
        top: 0;
        background: radial-gradient(circle, #fff 25%, transparent 25%);
    }

    /* 位于下方的鱼眼（白底黑圆） */
    .eye.bottom {
        bottom: 0;
        background: radial-gradient(circle, #000 25%, transparent 25%);
    }

/* 4. 动画定义 */
@keyframes rotate-cw {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes rotate-ccw {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}
