/* =========================================================================
   六爻纳甲模块样式
   ========================================================================= */

/* ---------- 表单 ---------- */

.ly-shared-date {
    padding: 10px 14px;
    margin-bottom: 16px;
    background: var(--mn-bg-page, #fafbfc);
    border-left: 3px solid var(--mn-primary, #0066cc);
    border-radius: 6px;
    font-size: 13px;
    color: var(--mn-text-muted, #888);
}

.ly-form {
    padding: 18px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 10px;
    margin-bottom: 20px;
}
.ly-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.ly-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ly-field label {
    font-size: 12px;
    color: var(--mn-text-muted, #888);
    font-weight: 600;
}
.ly-field input {
    padding: 10px 12px;
    font-size: 15px;
    color: var(--mn-text, #333);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 6px;
    background: var(--mn-bg-card, #fff);
    outline: none;
    transition: border-color .2s;
}
.ly-field input:focus {
    border-color: var(--mn-primary, #0066cc);
}
.ly-form-actions {
    text-align: right;
    padding-top: 12px;
    border-top: 1px dashed var(--mn-border-light, #f0f0f0);
}
.ly-form-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--mn-text-muted, #888);
}

.ly-intro-list {
    padding-left: 22px;
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 2;
    color: var(--mn-text, #333);
}
.ly-intro-list strong {
    color: var(--mn-primary, #0066cc);
    font-weight: 600;
    margin-right: 4px;
}

/* ---------- 起卦来源条 ---------- */

.ly-source-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding: 12px 16px;
    margin-bottom: 20px;
    background: var(--mn-primary-subtle, #e8f1fb);
    border-left: 4px solid var(--mn-primary, #0066cc);
    border-radius: 8px;
    font-size: 13px;
}
.ly-src-item { color: var(--mn-text, #333); }
.ly-src-item strong {
    color: var(--mn-primary, #0066cc);
    margin-right: 6px;
    font-weight: 700;
}

/* ---------- 主盘 ---------- */

.ly-chart {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}
@media (max-width: 900px) {
    .ly-chart { grid-template-columns: 1fr; }
}

.ly-pan {
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
}
.ly-pan-ben  { border-top: 4px solid #0066cc; }
.ly-pan-bian { border-top: 4px solid #dc2626; }

.ly-pan-head {
    padding: 12px 16px;
    background: var(--mn-bg-page, #fafbfc);
    border-bottom: 1px solid var(--mn-border-light, #f0f0f0);
}
.ly-pan-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--mn-text, #333);
    letter-spacing: 2px;
    margin-bottom: 4px;
}
.ly-pan-ben  .ly-pan-title { color: #0066cc; }
.ly-pan-bian .ly-pan-title { color: #dc2626; }
.ly-pan-meta {
    font-size: 12px;
    color: var(--mn-text-muted, #888);
}

/* ---------- 六爻表 ---------- */

.ly-pan-body {
    padding: 12px 14px 14px;
}
.ly-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.ly-table th {
    padding: 6px 8px;
    text-align: left;
    color: var(--mn-text-muted, #888);
    font-weight: 600;
    font-size: 11px;
    border-bottom: 1px solid var(--mn-border-light, #f0f0f0);
    white-space: nowrap;
}
.ly-table td {
    padding: 8px 8px;
    vertical-align: middle;
    border-bottom: 1px dashed var(--mn-border-light, #f0f0f0);
}
.ly-row:last-child td { border-bottom: none; }

.ly-row.is-move-row { background: rgba(220, 38, 38, .04); }
.ly-row.is-shi-row  { background: rgba(0, 102, 204, .04); }
.ly-row.is-ying-row { background: rgba(124, 58, 237, .04); }
.ly-row.is-move-row.is-shi-row { background: linear-gradient(90deg, rgba(220, 38, 38, .05) 0%, rgba(0, 102, 204, .05) 100%); }

.ly-liushen {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.ly-liushen.is-qinglong { color: #16a34a; }
.ly-liushen.is-zhuque   { color: #dc2626; }
.ly-liushen.is-gouchen  { color: #a16207; }
.ly-liushen.is-tengshe  { color: #7c3aed; }
.ly-liushen.is-baihu    { color: #6b7280; }
.ly-liushen.is-xuanwu   { color: #1e40af; }

.ly-yao-symbol { font-family: ui-monospace, monospace; }
.ly-bar { letter-spacing: -1px; }
.ly-bar-yang { color: var(--mn-text, #333); }
.ly-bar-yin  { color: var(--mn-text, #333); }

.ly-yao-label {
    font-size: 11px;
    color: var(--mn-text-muted, #888);
    white-space: nowrap;
}
.ly-gz {
    font-family: ui-monospace, monospace;
    font-weight: 700;
    color: var(--mn-text, #333);
    white-space: nowrap;
}
.ly-wx {
    font-size: 12px;
    color: var(--mn-text-secondary, #666);
    white-space: nowrap;
}
.ly-lq {
    font-weight: 800;
    font-size: 13px;
    white-space: nowrap;
}
.ly-lq.is-fumu   { color: #0ea5e9; }
.ly-lq.is-xiongdi{ color: #16a34a; }
.ly-lq.is-zisun  { color: #7c3aed; }
.ly-lq.is-qicai  { color: #ea580c; }
.ly-lq.is-guangui{ color: #dc2626; }

.ly-marks { white-space: nowrap; }
.ly-mark {
    display: inline-block;
    margin-right: 2px;
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}
.ly-mark-世 { background: #0066cc; }
.ly-mark-应 { background: #7c3aed; }
.ly-mark-动 { background: #dc2626; }

/* ---------- 用神参考表 ---------- */

.ly-help {
    padding: 10px 14px;
    margin-bottom: 12px;
    background: var(--mn-bg-page, #fafbfc);
    border-left: 3px solid var(--mn-primary, #0066cc);
    border-radius: 6px;
    font-size: 12px;
    color: var(--mn-text-muted, #888);
    line-height: 1.7;
}

.ly-yongshen-table {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--mn-border, #e5e7eb);
    margin-bottom: 24px;
}
.ly-ys-head {
    display: grid;
    grid-template-columns: 160px 100px 1fr;
    padding: 10px 14px;
    background: var(--mn-primary, #0066cc);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    gap: 12px;
}
.ly-ys-row {
    display: grid;
    grid-template-columns: 160px 100px 1fr;
    padding: 10px 14px;
    gap: 12px;
    font-size: 13px;
    background: var(--mn-bg-card, #fff);
    border-top: 1px solid var(--mn-border-light, #f0f0f0);
}
.ly-ys-row:nth-child(even) { background: var(--mn-bg-page, #fafbfc); }
.ly-ys-matter { color: var(--mn-text, #333); font-weight: 600; }
.ly-ys-lq { font-weight: 800; }
.ly-ys-lq.is-fumu   { color: #0ea5e9; }
.ly-ys-lq.is-xiongdi{ color: #16a34a; }
.ly-ys-lq.is-zisun  { color: #7c3aed; }
.ly-ys-lq.is-qicai  { color: #ea580c; }
.ly-ys-lq.is-guangui{ color: #dc2626; }
.ly-ys-pos { color: var(--mn-text-secondary, #666); }
.ly-ys-none { color: var(--mn-text-muted, #888); font-size: 12px; }

/* ---------- 卦义 ---------- */

.ly-reading {
    padding: 16px 20px;
    margin-bottom: 20px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 10px;
}
.ly-reading p {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.85;
    color: var(--mn-text, #333);
}
.ly-reading p strong { color: var(--mn-primary, #0066cc); }
.ly-reading p:last-child { margin-bottom: 0; }

/* ---------- 底部说明 ---------- */

.ly-footnote {
    padding: 14px 18px;
    margin-bottom: 16px;
    background: var(--mn-bg-page, #fafbfc);
    border: 1px dashed var(--mn-border, #e5e7eb);
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.85;
    color: var(--mn-text-muted, #888);
    text-align: center;
}

/* ---------- 响应式 ---------- */

@media (max-width: 640px) {
    .ly-form-row { grid-template-columns: 1fr 1fr; }

    .ly-table th, .ly-table td {
        padding: 6px 4px;
        font-size: 12px;
    }
    .ly-table th:nth-child(3),
    .ly-table td:nth-child(3) { display: none; } /* 隐藏「卦爻」列，节省空间 */

    .ly-ys-head, .ly-ys-row {
        grid-template-columns: 1fr 80px;
        gap: 8px;
    }
    .ly-ys-head span:nth-child(3),
    .ly-ys-row .ly-ys-pos {
        grid-column: 1 / -1;
        padding-left: 4px;
        font-size: 12px;
    }
}