/* =========================================================================
   号码吉凶模块样式 v2
   - 修复「通用号始终高亮」bug：只保留 :has(input:checked) 选中器
   - 去掉左边竖线装饰
   ========================================================================= */

/* ---------- 五行色 ---------- */
.is-jin  { --nm-wx: #c9a227; }
.is-mu   { --nm-wx: #3f8f4f; }
.is-shui { --nm-wx: #2f6fb0; }
.is-huo  { --nm-wx: #c0392b; }
.is-tu   { --nm-wx: #8a6a3a; }
.is-other{ --nm-wx: #6b7280; }

/* ---------- 表单 ---------- */
.nm-form {
    padding: 18px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 10px;
    margin-bottom: 20px;
}
.nm-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.nm-type-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    background: var(--mn-bg-card, #fff);
    border: 2px solid var(--mn-border, #e5e7eb);
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
    align-items: center;
}
.nm-type-card:hover {
    border-color: var(--mn-primary, #0066cc);
    transform: translateY(-2px);
}
/* ✅ 只保留 :has()，删除 .is-active（避免服务端渲染的 is-active 与用户选择冲突） */
.nm-type-card:has(input:checked) {
    border-color: var(--mn-primary, #0066cc);
    background: linear-gradient(135deg, var(--mn-primary-subtle, #e8f1fb) 0%, var(--mn-bg-card, #fff) 70%);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, .12);
}
.nm-type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.nm-type-icon { font-size: 26px; }
.nm-type-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--mn-text, #333);
    letter-spacing: 1px;
}
.nm-type-desc {
    font-size: 11px;
    color: var(--mn-text-muted, #888);
    line-height: 1.5;
}

.nm-input-row input {
    width: 100%;
    padding: 14px 18px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--mn-text, #333);
    border: 2px solid var(--mn-border, #e5e7eb);
    border-radius: 10px;
    background: var(--mn-bg-card, #fff);
    outline: none;
    box-sizing: border-box;
    transition: border-color .2s;
    font-family: ui-monospace, monospace;
    text-align: center;
}
.nm-input-row input:focus {
    border-color: var(--mn-primary, #0066cc);
}
.nm-input-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--mn-text-muted, #888);
    text-align: center;
}
.nm-form-actions {
    text-align: center;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px dashed var(--mn-border-light, #f0f0f0);
}

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

/* ---------- 结果 Hero ---------- */
.nm-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--mn-primary, #0066cc) 0%, #084d99 100%);
    color: #fff;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
}
.nm-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}
.nm-hero.is-daji    { background: linear-gradient(135deg, #16a34a 0%, #065f46 100%); }
.nm-hero.is-ji      { background: linear-gradient(135deg, #22c55e 0%, #15803d 100%); }
.nm-hero.is-zhong   { background: linear-gradient(135deg, #64748b 0%, #334155 100%); }
.nm-hero.is-xiong   { background: linear-gradient(135deg, #ea580c 0%, #9a3412 100%); }
.nm-hero.is-daxiong { background: linear-gradient(135deg, #dc2626 0%, #7f1d1d 100%); }

.nm-hero-left { flex: 1; min-width: 0; position: relative; z-index: 1; }
.nm-hero-number {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 2px;
    word-break: break-all;
    margin-bottom: 8px;
    font-family: ui-monospace, monospace;
    line-height: 1.3;
}
.nm-hero-type { font-size: 14px; opacity: .9; }
.nm-hero-right {
    flex-shrink: 0;
    text-align: center;
    position: relative;
    z-index: 1;
}
.nm-hero-score {
    font-size: 72px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 6px;
    font-family: ui-monospace, monospace;
}
.nm-hero-level {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 4px;
}
.nm-hero-word { font-size: 12px; opacity: .85; }

/* ---------- 数理卡（去掉左边竖线，改为完整边框 + 顶部色条） ---------- */
.nm-shuli-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    margin-bottom: 20px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-top: 4px solid var(--mn-primary, #0066cc);
    border-radius: 12px;
}
.nm-shuli-num {
    flex-shrink: 0;
    font-size: 60px;
    font-weight: 900;
    color: var(--mn-primary, #0066cc);
    line-height: 1;
    font-family: ui-monospace, monospace;
}
.nm-shuli-info { flex: 1; min-width: 0; }
.nm-shuli-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.nm-shuli-level {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #94a3b8;
}
.nm-shuli-level.is-daji    { background: #16a34a; }
.nm-shuli-level.is-ji      { background: #22c55e; }
.nm-shuli-level.is-zhong   { background: #94a3b8; }
.nm-shuli-level.is-xiong   { background: #ea580c; }
.nm-shuli-level.is-daxiong { background: #dc2626; }
.nm-shuli-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--mn-text, #333);
}
.nm-shuli-desc {
    font-size: 13px;
    line-height: 1.75;
    color: var(--mn-text-secondary, #666);
    margin-bottom: 6px;
}
.nm-shuli-calc {
    font-size: 12px;
    color: var(--mn-text-muted, #888);
    font-family: ui-monospace, monospace;
    padding-top: 6px;
    border-top: 1px dashed var(--mn-border-light, #f0f0f0);
}

/* ---------- 末尾 4 位 ---------- */
.nm-tail4-card {
    padding: 20px 24px;
    margin-bottom: 20px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 12px;
}
.nm-tail4-digits {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 14px;
}
.nm-tail4-digit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: var(--mn-primary-subtle, #e8f1fb);
    color: var(--mn-primary, #0066cc);
    font-size: 32px;
    font-weight: 900;
    font-family: ui-monospace, monospace;
    letter-spacing: 0;
}
.nm-tail4-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.nm-tail4-shuli {
    font-size: 13px;
    color: var(--mn-text-muted, #888);
    font-family: ui-monospace, monospace;
}
.nm-tail4-level {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #94a3b8;
}
.nm-tail4-level.is-daji    { background: #16a34a; }
.nm-tail4-level.is-ji      { background: #22c55e; }
.nm-tail4-level.is-zhong   { background: #94a3b8; }
.nm-tail4-level.is-xiong   { background: #ea580c; }
.nm-tail4-level.is-daxiong { background: #dc2626; }
.nm-tail4-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--mn-text, #333);
}
.nm-tail4-desc {
    font-size: 13px;
    line-height: 1.75;
    color: var(--mn-text-secondary, #666);
    text-align: center;
}

/* ---------- 五行分布 ---------- */
.nm-wuxing {
    padding: 16px 20px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 10px;
    margin-bottom: 20px;
}
.nm-wx-row {
    display: grid;
    grid-template-columns: 40px 1fr 30px;
    gap: 12px;
    align-items: center;
    padding: 6px 4px;
}
.nm-wx-label {
    font-size: 15px;
    font-weight: 800;
    color: var(--nm-wx, #333);
    text-align: center;
}
.nm-wx-bar-wrap {
    height: 10px;
    background: var(--mn-border-light, #f0f0f0);
    border-radius: 5px;
    overflow: hidden;
}
.nm-wx-bar {
    height: 100%;
    background: var(--nm-wx, #0066cc);
    border-radius: 5px;
    transition: width .5s ease;
    min-width: 3px;
}
.nm-wx-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--mn-text, #333);
    text-align: center;
    font-family: ui-monospace, monospace;
}

/* ---------- 谐音列表（去掉左边竖线，改为完整边框 + 圆点） ---------- */
.nm-harmony-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}
.nm-harmony-item {
    display: grid;
    grid-template-columns: 40px 60px 80px 40px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 8px;
    font-size: 13px;
    position: relative;
    padding-left: 24px;
}
/* 用一个圆点代替原来的左边竖线 */
.nm-harmony-item::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
}
.nm-harmony-item.is-ji    { border-color: rgba(22, 163, 74, .3); }
.nm-harmony-item.is-xiong { border-color: rgba(220, 38, 38, .3); }
.nm-harmony-item.is-zhong { border-color: rgba(148, 163, 184, .3); }
.nm-harmony-item.is-ji::before    { background: #16a34a; }
.nm-harmony-item.is-xiong::before { background: #dc2626; }
.nm-harmony-item.is-zhong::before { background: #94a3b8; }

.nm-harmony-digit {
    font-size: 22px;
    font-weight: 900;
    color: var(--mn-text, #333);
    text-align: center;
    font-family: ui-monospace, monospace;
}
.nm-harmony-pinyin {
    font-size: 12px;
    color: var(--mn-text-muted, #888);
    font-family: ui-monospace, monospace;
}
.nm-harmony-meaning {
    font-size: 13px;
    font-weight: 700;
    color: var(--mn-text, #333);
}
.nm-harmony-luck {
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}
.nm-harmony-item.is-ji    .nm-harmony-luck { color: #16a34a; }
.nm-harmony-item.is-xiong .nm-harmony-luck { color: #dc2626; }
.nm-harmony-item.is-zhong .nm-harmony-luck { color: #64748b; }
.nm-harmony-desc {
    font-size: 12px;
    color: var(--mn-text-secondary, #666);
}

/* ---------- 奇偶平衡 ---------- */
.nm-parity {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.nm-parity-item {
    padding: 14px 16px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 10px;
    text-align: center;
}
.nm-parity-label {
    display: block;
    font-size: 12px;
    color: var(--mn-text-muted, #888);
    margin-bottom: 6px;
}
.nm-parity-num {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: var(--mn-primary, #0066cc);
    font-family: ui-monospace, monospace;
}

/* ---------- 建议（去掉左边竖线，改为完整边框） ---------- */
.nm-advice {
    padding: 16px 20px;
    margin-bottom: 20px;
    background: var(--mn-comp-alert-warning-bg, #fef3c7);
    border: 1px solid var(--mn-comp-alert-warning-border, #fde68a);
    border-radius: 10px;
}
.nm-advice ul {
    margin: 0;
    padding-left: 22px;
    font-size: 13.5px;
    line-height: 2;
    color: var(--mn-comp-alert-warning-text, #92400e);
}
.nm-advice li { margin-bottom: 4px; }

/* ---------- 底部说明 ---------- */
.nm-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) {
    .nm-type-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .nm-type-card { padding: 10px 8px; }
    .nm-type-icon { font-size: 22px; }
    .nm-type-name { font-size: 13px; }

    .nm-input-row input { font-size: 16px; padding: 12px 14px; }

    .nm-hero { flex-direction: column; padding: 20px; gap: 12px; text-align: center; }
    .nm-hero-score { font-size: 56px; }
    .nm-hero-number { font-size: 18px; }

    .nm-shuli-card { flex-direction: column; gap: 10px; text-align: center; }
    .nm-shuli-num { font-size: 48px; }
    .nm-shuli-head { justify-content: center; }

    .nm-tail4-digit { width: 48px; height: 48px; font-size: 24px; }

    .nm-harmony-item {
        grid-template-columns: 36px 1fr 40px;
        gap: 8px;
    }
    .nm-harmony-pinyin { display: none; }
    .nm-harmony-desc {
        grid-column: 1 / -1;
        padding-top: 4px;
        border-top: 1px dashed var(--mn-border-light, #f0f0f0);
        font-size: 11.5px;
    }
}