/* ============================================================
   liuyao-extra.css  —  追加样式，不修改原 index.css
   ============================================================ */

/* ── 面板通用框 ── */
.panel {
    max-width: 800px;
    margin: 0 auto 14px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #d0b8f0;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(160, 120, 255, 0.12);
    overflow: hidden;
}

.panel-title {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #663399;
    background: rgba(230, 215, 255, 0.5);
    border-bottom: 1px solid #d0b8f0;
    letter-spacing: 0.05em;
}

.panel-body {
    padding: 14px 18px;
}

/* ── 时间行 ── */
.form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.form-label {
    font-size: 14px;
    color: #555;
    white-space: nowrap;
}

.form-row select {
    padding: 6px 24px 6px 10px;
    font-size: 14px;
    border: 1px solid #c8a8e8;
    border-radius: 8px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a078d0'/%3E%3C/svg%3E") no-repeat right 8px center;
    appearance: none;
    -webkit-appearance: none;
    color: #333;
    cursor: pointer;
    min-width: 70px;
    transition: border-color 0.2s;
}

.form-row select:focus {
    outline: none;
    border-color: #9060cc;
}

/* ── 六爻网格 ── */
.yao-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.yao-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.yao-item label {
    font-size: 13px;
    color: #663399;
    font-weight: 500;
}

.yao-item select {
    width: 100%;
    padding: 6px 4px;
    font-size: 13px;
    border: 1px solid #c8a8e8;
    border-radius: 8px;
    background: #fff;
    color: #333;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.yao-item select:focus {
    outline: none;
    border-color: #9060cc;
}

/* ── 排盘结果区域 ── */
.ganzhi-section {
    max-width: 800px;
    margin: 0 auto 14px;
    text-align: center;
}

/* ── 结果线框（桌面） ── */
#ganzhiDisplay {
    display: block;
    font-family: 'Sarasa Mono SC', 'Source Han Mono', 'Noto Sans Mono CJK SC', 'Microsoft YaHei Mono', monospace;
    font-size: 14px;
    line-height: 1.85;
    color: #2a1a44;
    white-space: pre;
    overflow-x: auto;
    text-align: left;
    border: 1px solid #b898dc;
    border-radius: 10px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: inset 0 1px 4px rgba(160,120,255,0.08),
                0 2px 8px rgba(160,120,255,0.10);
    margin: 0 0 12px 0;
}

#ganzhiDisplay:empty {
    display: none;
}

/* ── config 选项行 ── */
.config-group {
    justify-content: center;
    align-items: center;
}

.config-group label {
    font-size: 14px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.config-group input[type="checkbox"] {
    accent-color: #8040cc;
    width: 14px;
    height: 14px;
}

.config-group .custom-select {
    padding: 5px 24px 5px 10px;
    font-size: 14px;
    border: 1px solid #c8a8e8;
    border-radius: 8px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a078d0'/%3E%3C/svg%3E") no-repeat right 8px center;
    appearance: none;
    -webkit-appearance: none;
    color: #333;
    cursor: pointer;
}

/* ================================================================
   手机端优化
   ================================================================ */
@media (max-width: 768px) {

    .panel {
        border-radius: 10px;
        margin-left: 0;
        margin-right: 0;
    }

    .form-row { gap: 6px 8px; }

    .form-row select {
        min-width: 58px;
        font-size: 13px;
        padding: 5px 20px 5px 7px;
    }

    .yao-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    /* ── 手机结果框：放大字号、允许横滑 ── */
    #ganzhiDisplay {
        font-size: 13px;
        line-height: 1.75;
        padding: 12px 10px;
        /* 横向可以滑动，不折行，内容完整显示 */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: pre;
        /* 限制最大宽度为视口，不撑破外框 */
        max-width: calc(100vw - 32px);
        box-sizing: border-box;
    }

    /* 结果外层容器也不能溢出 */
    .ganzhi-section {
        overflow: hidden;
    }

    #baziDisplayArea {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 420px) {
    .yao-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #ganzhiDisplay {
        font-size: 12px;
        padding: 10px 8px;
    }
}
