﻿:root {
    --primary-color: #2c3e50;
    --yang-color: #c0392b;
    --yin-color: #2980b9;
    --bg-light: #f8f9fa;
    --border-color: #dee2e6;
}

.iching-container {
    display: flex;
    font-family: "Microsoft YaHei", sans-serif;
    flex-direction: column; /* Stack Sidebar on top of Main Content */
    min-height: 100vh;
}

.sidebar {
    margin-top:30px;
    width: 100%; /* Span the full width of the screen */
    height: auto; /* Allow height to be determined by content */
    background: #eee;
    padding: 10px 20px; /* Reduced vertical padding for a slimmer bar */
    border-bottom: 1px solid var(--border-color); /* Border moves to the bottom */
    border-right: none; /* Remove the old right border */
    position: sticky;
    top: 0;
    z-index: 1000; /* Ensure it stays above the main content */
    overflow-x: auto; /* Allow horizontal scrolling if 64 items overflow */
    display: flex; /* Use flex to layout children horizontally */
    align-items: center;
}

    /* You will also need to update the list container inside the sidebar */
    .sidebar .gua-list {
        display: flex; /* Lay out the 64 hexagrams in a row */
        flex-direction: row;
        gap: 1px; /* Space between items */
        white-space: nowrap; /* Prevent names from wrapping to a new line */
    }

.gua-list a {
    display: block;
    padding: 1px 3px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}

    .gua-list a:hover {
        background: #ddd;
    }

    .gua-list a.active {
        color: var(--yang-color);
        font-weight: bold;
        border-left: 3px solid var(--yang-color);
    }

/* 主内容 */
.main-content {
    flex: 1;
    padding: 40px;
    background: #fff;
}

.gua-header {
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 30px;
    padding-bottom: 20px;
}

.gua-number {
    color: #999;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.gua-desc {
    text-align:left;
    color: #666;
    font-style: italic;
    margin-top: 10px;
    font-size: 1.1rem;
}

/* 爻卡片 */
.yao-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.yao-card {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: transform 0.2s;
    background: var(--bg-light);
}

    .yao-card:hover {
        transform: translateX(5px);
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

.yao-sidebar {
    width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border-color);
    background: rgba(0,0,0,0.02);
}

.yao-name {
    font-weight: bold;
    margin-top: 10px;
}

/* 阴阳线视觉 */
.line-yang {
    width: 50px;
    height: 8px;
    background: var(--primary-color);
}

.line-yin {
    width: 50px;
    height: 8px;
    display: flex;
    justify-content: space-between;
}

    .line-yin span {
        width: 22px;
        height: 8px;
        background: var(--primary-color);
    }

.yao-info {
    padding: 20px;
    flex: 1;
}

.yao-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.yao-text {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* 标签 */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 5px;
    color: white;
}

.badge-central {
    background-color: #f39c12;
}

.badge-correct {
    background-color: #27ae60;
}

/* Takeaway 内容 */
.tk-item {
    border-left: 3px solid #ddd;
    padding-left: 15px;
    margin-bottom: 15px;
}

.tk-category {
    color: #999;
    font-size: 0.8rem;
}

.tk-lesson {
    margin: 5px 0;
    color: #333;
    font-size: 1.1rem;
}

.tk-context {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

.yang-card {
    border-left: 5px solid var(--yang-color);
}

.yin-card {
    border-left: 5px solid var(--yin-color);
}
