/* spacetime-analysis.css - 时空双层分析样式 */
/* 基于 test_spacetime_10star.html（电脑端）和 test_spacetime_formats.html（手机端）*/

/* === 占卜信息条 === */
.divination-info {
    max-width: 100%;
    margin: 0 0 20px 0;
    padding: 14px 20px;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 10px;
    text-align: center;
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    line-height: 1.8;
}

/* === 时空分析按钮样式（统一电脑端和手机端）=== */
.spacetime-toggle-btn {
    width: 100%;
    padding: 12px 15px;
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    border: none;
    border-radius: 8px;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    min-height: 44px;
    line-height: 1.4;
    box-shadow: 0 4px 15px rgba(250, 112, 154, 0.3);
    margin-top: 10px;
}

.spacetime-toggle-btn:active {
    box-shadow: 0 2px 8px rgba(250, 112, 154, 0.4);
}

.spacetime-toggle-btn .spacetime-arrow {
    transition: transform 0.3s;
    font-size: 16px;
    flex-shrink: 0;
    color: #333;
}

.spacetime-toggle-btn .spacetime-text {
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.spacetime-toggle-btn.active .spacetime-arrow {
    transform: rotate(180deg);
}

/* === 展开内容区 === */
.spacetime-content {
    max-height: 0;
    overflow: hidden;
    transition: none;
    margin-top: 0;
}

.spacetime-content.active {
    max-height: 99999px;
    overflow: visible;
    margin-top: 12px;
}

.content-wrapper {
    padding: 25px 0;
}

/* === 电脑端：左右分屏布局 === */
@media (min-width: 769px) {
    .split-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }

    .layer-panel {
        background: rgba(20, 25, 35, 0.8);
        border: 1px solid rgba(102, 126, 234, 0.2);
        border-radius: 12px;
        padding: 20px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    }

    .layer-body {
        display: block;
    }

    .layer-body-inner {
        display: flex;
        flex-direction: column;
        gap: 18px;
    }

    .layer-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 15px;
        padding-bottom: 12px;
        border-bottom: 2px solid rgba(255, 215, 0, 0.3);
        cursor: default;
    }

    .layer-icon {
        font-size: 26px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    .layer-title {
        flex: 1;
    }

    .layer-title h3 {
        color: #FFD700;
        font-size: 17px;
        margin: 0 0 4px 0;
        font-weight: 700;
    }

    .layer-title p {
        color: rgba(255, 255, 255, 0.95);
        font-size: 14px;
        font-weight: 700;
        margin: 0;
    }

    .layer-toggle {
        display: none;
    }

    .gua-item {
        background: rgba(0, 0, 0, 0.3);
        padding: 20px;
        border-radius: 10px;
        border-left: 4px solid #667eea;
        transition: all 0.25s ease;
        cursor: default;
        border-bottom: none;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        min-height: 255px;
        height: 255px;
        overflow-y: auto;
    }

    .gua-item:hover {
        transform: translateX(6px);
        border-left-width: 6px;
        background: rgba(0, 0, 0, 0.4);
    }

    .gua-item h4 {
        color: #8b9cff;
        font-size: 15px;
        margin: 0 0 14px 0;
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 700;
        padding: 0;
        background: transparent;
        cursor: default;
        justify-content: flex-start;
    }

    .gua-item h4::after {
        display: none;
    }

    .gua-item-content {
        display: block;
        max-height: none;
    }

    .gua-item-inner {
        padding: 0;
        background: transparent;
    }

    .gua-item p {
        color: rgba(255, 255, 255, 0.9);
        font-size: 14px;
        line-height: 1.9;
        margin: 8px 0;
        padding-left: 0;
        border-left: none;
    }

    .gua-item p:before {
        content: "";
        margin-right: 0;
    }
}

/* === 手机端：折叠手风琴布局 === */
@media (max-width: 768px) {
    .divination-info {
        padding: 12px 14px;
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 12px;
        line-height: 1.8;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .divination-info .divination-line1 {
        font-size: 14px;
        font-weight: 700;
    }

    .divination-info .divination-line2 {
        font-size: 12px;
        font-weight: 600;
        opacity: 0.9;
    }

    .content-wrapper {
        padding: 12px 0;
    }

    .split-container {
        display: block;
    }

    /* 手风琴嵌套式容器 */
    .split-container {
        background: rgba(20, 25, 35, 0.8);
        border-radius: 10px;
        overflow: hidden;
        width: 100%;
        box-sizing: border-box;
        padding: 0;
        margin: 0;
    }

    .layer-panel {
        border-bottom: 2px solid rgba(255, 215, 0, 0.2);
        width: 100%;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }

    .layer-panel:last-child {
        border-bottom: none;
    }

    .layer-header {
        padding: 12px 14px;
        background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 193, 7, 0.1));
        font-weight: 700;
        color: #FFD700;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        user-select: none;
        width: 100%;
        box-sizing: border-box;
    }

    .layer-header:active {
        opacity: 0.9;
    }

    .layer-icon {
        font-size: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        flex-shrink: 0;
    }

    .layer-title {
        flex: 1;
    }

    .layer-title h3 {
        font-size: 14px;
        margin-bottom: 3px;
        color: #FFD700;
        font-weight: 700;
    }

    .layer-title p {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.95);
        font-weight: 700;
    }

    .layer-toggle {
        font-size: 16px;
        transition: transform 0.3s;
        color: rgba(255, 255, 255, 0.7);
    }

    .layer-panel.active .layer-toggle {
        transform: rotate(180deg);
    }

    .layer-body {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        width: 100%;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }

    .layer-panel.active .layer-body {
        max-height: 1500px;
    }

    .layer-body-inner {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
    }

    /* 二级折叠面板（对比本卦、互卦、变卦）*/
    .gua-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        cursor: pointer;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        margin: 0;
        padding: 0;
    }

    .gua-item:last-child {
        border-bottom: none;
    }

    .gua-item h4 {
        padding: 12px 14px;
        background: rgba(102, 126, 234, 0.05);
        color: #8b9cff;
        font-size: 13px;
        margin: 0;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: space-between;
        user-select: none;
        transition: background 0.2s;
        width: 100%;
        box-sizing: border-box;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .gua-item h4:active {
        background: rgba(102, 126, 234, 0.15);
    }

    .gua-item h4::after {
        content: '▼';
        font-size: 14px;
        color: rgba(255, 255, 255, 0.5);
        transition: transform 0.3s;
        flex-shrink: 0;
        margin-left: 8px;
    }

    .gua-item.expanded h4::after {
        transform: rotate(180deg);
    }

    .gua-item-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        width: 100%;
    }

    .gua-item.expanded .gua-item-content {
        max-height: 800px;
    }

    .gua-item-inner {
        padding: 12px 14px;
        background: rgba(0, 0, 0, 0.2);
        width: 100%;
        box-sizing: border-box;
    }

    .gua-item p {
        color: rgba(255, 255, 255, 0.95);
        font-size: 14px;
        font-weight: 600;
        line-height: 1.8;
        margin-bottom: 8px;
        padding-left: 10px;
        border-left: 3px solid rgba(102, 126, 234, 0.5);
        word-wrap: normal;
        word-break: normal;
        white-space: normal;
        width: 100%;
        box-sizing: border-box;
    }

    .gua-item p:last-child {
        margin-bottom: 0;
    }
}

/* === 底部提示 === */
.footer-note {
    text-align: center;
    padding: 12px 14px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
    background: rgba(255, 193, 7, 0.15);
    border-radius: 10px;
    margin-top: 0;
    border: 1px dashed rgba(255, 193, 7, 0.4);
}

@media (min-width: 769px) {
    .footer-note {
        padding: 18px 25px;
        font-size: 16px;
        font-weight: 700;
        line-height: 1.8;
        margin-top: 25px;
    }
}

/* === 按钮样式增强 === */
/* 已移至顶部统一定义 */
