/* =========================================================================
   太乙神数模块样式（完整版 · 九宫盘优化）
   ========================================================================= */

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

/* ---------- 表单 ---------- */
.ty-form {
    padding: 18px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 10px;
    margin-bottom: 20px;
}
.ty-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.ty-field { display: flex; flex-direction: column; gap: 4px; }
.ty-field label {
    font-size: 12px;
    color: var(--mn-text-muted, #888);
    font-weight: 600;
}
.ty-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;
}
.ty-field input:focus { border-color: var(--mn-primary, #0066cc); }

.ty-form-subtitle {
    margin: 6px 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--mn-primary, #0066cc);
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--mn-border-light, #f0f0f0);
}

.ty-layer-select {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.ty-layer-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--mn-bg-card, #fff);
    border: 2px solid var(--mn-border, #e5e7eb);
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s;
}
.ty-layer-item:hover {
    border-color: var(--mn-primary, #0066cc);
    transform: translateY(-2px);
}
.ty-layer-item:has(input:checked),
.ty-layer-item.is-active {
    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);
}
.ty-layer-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.ty-layer-short {
    display: inline-block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    border-radius: 50%;
    background: var(--mn-primary, #0066cc);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 4px;
}
.ty-layer-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--mn-text, #333);
    letter-spacing: 1px;
}
.ty-layer-desc {
    font-size: 12px;
    color: var(--mn-text-muted, #888);
    line-height: 1.6;
}

.ty-form-actions {
    text-align: right;
    padding-top: 12px;
    border-top: 1px dashed var(--mn-border-light, #f0f0f0);
}

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

/* ---------- 首页九宫预览 ---------- */
.ty-grid-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-width: 420px;
    margin: 0 auto 20px;
}
.ty-preview-cell {
    padding: 14px 8px;
    text-align: center;
    background: var(--mn-primary-subtle, #e8f1fb);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--mn-text, #333);
}
.ty-preview-center {
    background: var(--mn-primary, #0066cc);
    color: #fff;
}

/* ---------- 首页十精预览 ---------- */
.ty-shen12-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.ty-shen12-card {
    padding: 12px 14px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-top: 3px solid #94a3b8;
    border-radius: 10px;
}
.ty-shen12-card.is-ji   { border-top-color: #2563eb; }
.ty-shen12-card.is-fu   { border-top-color: #16a34a; }
.ty-shen12-card.is-jing { border-top-color: #7c3aed; }
.ty-shen12-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--mn-text, #333);
    letter-spacing: 1.5px;
    margin-bottom: 2px;
}
.ty-shen12-period {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 8px;
    background: var(--mn-bg-page, #fafbfc);
    font-size: 11px;
    color: var(--mn-text-muted, #888);
    margin-bottom: 6px;
    font-weight: 600;
}
.ty-shen12-desc {
    font-size: 12px;
    color: var(--mn-text-secondary, #666);
    line-height: 1.7;
}

/* ---------- 首页十格预览 ---------- */
.ty-pattern-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.ty-pattern-card {
    padding: 12px 14px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-left: 4px solid #94a3b8;
    border-radius: 10px;
}
.ty-pattern-card.is-ji    { border-left-color: #16a34a; }
.ty-pattern-card.is-zhong { border-left-color: #94a3b8; }
.ty-pattern-card.is-xiong { border-left-color: #dc2626; }
.ty-pattern-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 6px;
}
.ty-pattern-card-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--mn-text, #333);
    letter-spacing: 2px;
}
.ty-pattern-card-level {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 8px;
    background: var(--mn-bg-page, #fafbfc);
    color: var(--mn-text-muted, #888);
}
.ty-pattern-card.is-ji    .ty-pattern-card-level { background: #dcfce7; color: #15803d; }
.ty-pattern-card.is-xiong .ty-pattern-card-level { background: #fee2e2; color: #991b1b; }
.ty-pattern-card-desc {
    font-size: 12px;
    color: var(--mn-text-secondary, #666);
    line-height: 1.7;
}

/* =========================================================================
   结果页
   ========================================================================= */

.ty-info-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--mn-primary-subtle, #e8f1fb) 0%, var(--mn-bg-card, #fff) 70%);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 10px;
}
.ty-info-item { display: flex; flex-direction: column; gap: 2px; }
.ty-info-label {
    font-size: 11px;
    color: var(--mn-text-muted, #888);
    letter-spacing: .5px;
}
.ty-info-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--mn-text, #333);
    font-family: ui-monospace, "Noto Serif SC", serif;
}
.ty-ty-gong {
    color: var(--mn-primary, #0066cc);
    font-size: 16px;
}

/* ---------- 四层 Tab ---------- */
.ty-layer-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    padding: 4px;
    background: var(--mn-bg-page, #fafbfc);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 10px;
    flex-wrap: wrap;
}
.ty-layer-tab {
    flex: 1;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--mn-text-muted, #888);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
}
.ty-layer-tab:hover {
    color: var(--mn-primary, #0066cc);
    background: var(--mn-bg-card, #fff);
}
.ty-layer-tab.is-active {
    color: #fff;
    background: var(--mn-primary, #0066cc);
    box-shadow: 0 2px 6px rgba(0, 102, 204, .25);
}
.ty-layer-tab-short {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .25);
    font-size: 12px;
    font-weight: 800;
}
.ty-layer-tab.is-active .ty-layer-tab-short {
    background: rgba(255, 255, 255, .3);
}

.ty-layer-panel { display: none; }
.ty-layer-panel.is-active { display: block; }

.ty-layer-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-left: 5px solid var(--mn-primary, #0066cc);
    border-radius: 10px;
}

.ty-sub-h2 {
    margin: 20px 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--mn-primary, #0066cc);
    padding-left: 8px;
    border-left: 3px solid var(--mn-primary, #0066cc);
    line-height: 1.4;
}

/* ============================================================
   九宫盘 · 优化版
   ============================================================ */
.ty-pan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, minmax(180px, 1fr));
    gap: 10px;
    margin: 0 auto 24px;
    max-width: 780px;
}

.ty-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s, transform .2s;
}
.ty-cell:hover {
    border-color: var(--mn-primary, #0066cc);
    box-shadow: 0 6px 16px rgba(0, 102, 204, .08);
    transform: translateY(-1px);
}
.ty-cell.is-zhong {
    background: linear-gradient(135deg, var(--mn-primary, #0066cc) 0%, #084d99 100%);
    color: #fff;
    border-color: transparent;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 18px 14px;
}
.ty-cell.is-zhong:hover {
    box-shadow: 0 6px 20px rgba(0, 102, 204, .25);
    border-color: transparent;
}
.ty-cell.is-taiyi-active {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}
.ty-cell.is-taiyi-active:hover {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .2), 0 6px 16px rgba(0, 0, 0, .06);
}

/* 头部：宫名 + 五行 */
.ty-cell-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px dashed var(--mn-border-light, #f0f0f0);
}
.ty-cell-gong {
    font-size: 13px;
    font-weight: 800;
    color: var(--mn-text, #333);
    letter-spacing: 1px;
}
.ty-cell.is-zhong .ty-cell-head {
    border-bottom-color: rgba(255, 255, 255, .2);
}
.ty-cell.is-zhong .ty-cell-gong {
    color: rgba(255, 255, 255, .9);
}

.ty-cell-wx {
    font-size: 11px;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--mn-bg-page, #fafbfc);
    letter-spacing: 1px;
}
.ty-cell.is-zhong .ty-cell-wx {
    background: rgba(255, 255, 255, .2);
    color: #fff !important;
}

/* 方位小字 */
.ty-cell-dir {
    font-size: 11px;
    color: var(--mn-text-muted, #888);
    margin-bottom: 8px;
    letter-spacing: .5px;
}

/* 星曜区：横向排列，自动换行 */
.ty-cell-stars {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-content: flex-start;
    margin-bottom: 8px;
}
.ty-cell-empty {
    font-size: 14px;
    color: var(--mn-border, #e5e7eb);
    align-self: center;
    margin: 0 auto;
}

.ty-star {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.7;
    background: var(--mn-bg-page, #fafbfc);
    color: var(--mn-text, #333);
    white-space: nowrap;
    transition: transform .15s;
}
.ty-star:hover { transform: scale(1.05); }

/* 五将色系 */
.ty-star.is-taiyi    { background: #fef3c7; color: #92400e; }
.ty-star.is-wenchang { background: #dcfce7; color: #15803d; }
.ty-star.is-shiji    { background: #fee2e2; color: #991b1b; }
.ty-star.is-zhuda    { background: #dbeafe; color: #1e40af; }
.ty-star.is-keda     { background: #fce7f3; color: #be185d; }
.ty-star.is-zhucan   { background: #e0e7ff; color: #4338ca; }
.ty-star.is-kecan    { background: #fbcfe8; color: #9d174d; }
/* 十精色系 */
.ty-star.is-junji    { background: #fef9c3; color: #854d0e; }
.ty-star.is-chenji   { background: #cffafe; color: #155e75; }
.ty-star.is-minji    { background: #dcfce7; color: #166534; }
.ty-star.is-wufu     { background: #fef08a; color: #854d0e; }
.ty-star.is-dayou    { background: #fed7aa; color: #9a3412; }
.ty-star.is-xiaoyou  { background: #fef3c7; color: #92400e; }
.ty-star.is-tianyi   { background: #e0e7ff; color: #3730a3; }
.ty-star.is-diyi     { background: #d9f99d; color: #3f6212; }
.ty-star.is-zhifu    { background: #ede9fe; color: #5b21b6; }
.ty-star.is-sishen   { background: #fce7f3; color: #9d174d; }
.ty-star.is-taizun   { background: #fef3c7; color: #92400e; }
.ty-star.is-feiniao  { background: #dbeafe; color: #1e40af; }

/* 十六神底栏 */
.ty-cell-shen {
    padding-top: 8px;
    margin-top: auto;
    border-top: 1px dashed var(--mn-border-light, #f0f0f0);
}
.ty-shen-tag {
    font-size: 10.5px;
    color: var(--mn-text-muted, #888);
    font-weight: 600;
    letter-spacing: .3px;
}

/* 太乙角标 */
.ty-cell-taiyi-mark {
    position: absolute;
    top: -2px;
    right: 12px;
    padding: 2px 10px;
    border-radius: 0 0 10px 10px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 2px 6px rgba(220, 38, 38, .3);
}

/* 中宫内容 */
.ty-cell-center-label {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 6px;
    color: #fff;
    line-height: 1;
    margin-bottom: 10px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.ty-cell-center-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, .85);
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.ty-cell-center-pat {
    display: inline-block;
    padding: 3px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.ty-cell-center-suan {
    font-size: 11px;
    color: rgba(255, 255, 255, .75);
    letter-spacing: .5px;
    line-height: 1.7;
}
.ty-cell-center-suan strong {
    color: #fff;
    font-weight: 700;
    margin: 0 2px;
}

/* ---------- 五将列表 ---------- */
.ty-wujiang-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.ty-wj-item {
    padding: 14px 16px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-left: 4px solid #94a3b8;
    border-radius: 10px;
    transition: all .2s;
}
.ty-wj-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
}
.ty-wj-item.is-taiyi    { border-left-color: #f59e0b; }
.ty-wj-item.is-wenchang { border-left-color: #16a34a; }
.ty-wj-item.is-shiji    { border-left-color: #dc2626; }
.ty-wj-item.is-zhuda    { border-left-color: #2563eb; }
.ty-wj-item.is-keda     { border-left-color: #db2777; }

.ty-wj-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 6px;
}
.ty-wj-item-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--mn-text, #333);
    letter-spacing: 1.5px;
}
.ty-wj-item-type {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 8px;
    background: var(--mn-bg-page, #fafbfc);
    color: var(--mn-text-muted, #888);
}
.ty-wj-item-gong {
    font-size: 13px;
    color: var(--mn-primary, #0066cc);
    font-weight: 700;
    margin-bottom: 4px;
}
.ty-wj-item-desc {
    font-size: 12px;
    color: var(--mn-text-secondary, #666);
    line-height: 1.7;
}

/* ---------- 十精网格 ---------- */
.ty-shen12-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.ty-shen12-item {
    padding: 12px 14px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-top: 4px solid #94a3b8;
    border-radius: 10px;
}
.ty-shen12-item.is-ji   { border-top-color: #2563eb; }
.ty-shen12-item.is-fu   { border-top-color: #16a34a; }
.ty-shen12-item.is-jing { border-top-color: #7c3aed; }
.ty-shen12-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 6px;
}
.ty-shen12-item-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--mn-text, #333);
    letter-spacing: 1.5px;
}
.ty-shen12-item-period {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 8px;
    background: var(--mn-bg-page, #fafbfc);
    color: var(--mn-text-muted, #888);
}
.ty-shen12-item-gong {
    font-size: 13px;
    color: var(--mn-primary, #0066cc);
    font-weight: 700;
    margin-bottom: 4px;
}
.ty-shen12-item-desc {
    font-size: 12px;
    color: var(--mn-text-secondary, #666);
    line-height: 1.7;
}

/* ---------- 主客算（完整版） ---------- */
.ty-suans-full {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.ty-suan-block {
    padding: 14px 16px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-top: 4px solid #94a3b8;
    border-radius: 10px;
    transition: all .2s;
}
.ty-suan-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
}
.ty-suan-block.is-sancai   { border-top-color: #7c3aed; }
.ty-suan-block.is-zhu      { border-top-color: #1e40af; }
.ty-suan-block.is-ke       { border-top-color: #be185d; }
.ty-suan-block.is-yinyang  { border-top-color: #f59e0b; }
.ty-suan-block.is-tiandi   { border-top-color: #0ea5e9; }

.ty-suan-block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}
.ty-suan-block-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--mn-text, #333);
    letter-spacing: 1px;
}
.ty-suan-block-num {
    font-size: 24px;
    font-weight: 900;
    font-family: ui-monospace, monospace;
    line-height: 1;
    color: var(--mn-primary, #0066cc);
}
.ty-suan-block.is-sancai  .ty-suan-block-num { color: #7c3aed; }
.ty-suan-block.is-zhu     .ty-suan-block-num { color: #1e40af; }
.ty-suan-block.is-ke      .ty-suan-block-num { color: #be185d; }
.ty-suan-block.is-tiandi  .ty-suan-block-num { color: #0ea5e9; font-size: 18px; }
.ty-suan-yinyang {
    color: #f59e0b !important;
    font-size: 22px !important;
    letter-spacing: 1px;
}
.ty-suan-block-desc {
    font-size: 12px;
    color: var(--mn-text-secondary, #666);
    line-height: 1.75;
}

/* ---------- 太乙十格 ---------- */
.ty-pattern {
    padding: 18px 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid transparent;
}
.ty-pattern.is-ji    { background: linear-gradient(135deg, #dcfce7 0%, var(--mn-bg-card, #fff) 60%); border-color: #86efac; }
.ty-pattern.is-zhong { background: linear-gradient(135deg, #e0f2fe 0%, var(--mn-bg-card, #fff) 60%); border-color: #7dd3fc; }
.ty-pattern.is-xiong { background: linear-gradient(135deg, #fee2e2 0%, var(--mn-bg-card, #fff) 60%); border-color: #fca5a5; }

.ty-pattern-name {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 6px;
    margin-bottom: 6px;
    color: var(--mn-text, #333);
}
.ty-pattern.is-ji    .ty-pattern-name { color: #15803d; }
.ty-pattern.is-zhong .ty-pattern-name { color: #0369a1; }
.ty-pattern.is-xiong .ty-pattern-name { color: #b91c1c; }

.ty-pattern-level {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}
.ty-pattern.is-ji    .ty-pattern-level { background: #16a34a; }
.ty-pattern.is-zhong .ty-pattern-level { background: #0891b2; }
.ty-pattern.is-xiong .ty-pattern-level { background: #dc2626; }

.ty-pattern-desc {
    font-size: 14px;
    line-height: 1.9;
    color: var(--mn-text, #333);
    margin-bottom: 8px;
}
.ty-pattern-reason {
    font-size: 12.5px;
    color: var(--mn-text-muted, #888);
    padding-top: 10px;
    border-top: 1px dashed var(--mn-border, #e5e7eb);
    margin-top: 8px;
    line-height: 1.75;
}

/* ---------- 十六神说明 ---------- */
.ty-shen-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.ty-shen-item {
    padding: 12px 14px;
    background: var(--mn-bg-card, #fff);
    border: 1px solid var(--mn-border, #e5e7eb);
    border-radius: 8px;
}
.ty-shen-item.is-active {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, .15);
    background: linear-gradient(135deg, #fef2f2 0%, var(--mn-bg-card, #fff) 70%);
}
.ty-shen-item-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}
.ty-shen-item-gong {
    font-size: 13px;
    color: var(--mn-text-muted, #888);
    font-weight: 700;
}
.ty-shen-item-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--mn-primary, #0066cc);
    letter-spacing: 1.5px;
}
.ty-shen-item.is-active .ty-shen-item-name { color: #dc2626; }
.ty-shen-item-desc {
    font-size: 12px;
    color: var(--mn-text-secondary, #666);
    line-height: 1.7;
}

/* ---------- 底部说明 ---------- */
.ty-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: 720px) {
    .ty-form-grid { grid-template-columns: 1fr 1fr; }
    .ty-layer-select { grid-template-columns: 1fr; }

    .ty-pan-grid {
        grid-template-rows: repeat(3, minmax(130px, 1fr));
        gap: 6px;
    }
    .ty-cell { padding: 8px 10px; }
    .ty-cell-gong { font-size: 12px; }
    .ty-star { font-size: 10px; padding: 1px 6px; }
    .ty-shen-tag { font-size: 9.5px; }
    .ty-cell-center-label { font-size: 20px; letter-spacing: 4px; margin-bottom: 6px; }
    .ty-cell-center-pat { font-size: 11px; padding: 2px 10px; }
    .ty-cell-center-suan { font-size: 10px; }

    .ty-wujiang-list,
    .ty-shen12-grid,
    .ty-shen12-preview,
    .ty-pattern-preview,
    .ty-shen-list,
    .ty-suans-full { grid-template-columns: 1fr; }
    .ty-pattern-name { font-size: 20px; letter-spacing: 3px; }
    .ty-layer-tab { min-width: 0; padding: 8px 6px; font-size: 12px; }
    .ty-layer-tab-name { display: none; }
    .ty-layer-tab-short { width: 26px; height: 26px; font-size: 13px; }
}

@media (max-width: 480px) {
    .ty-pan-grid {
        grid-template-rows: repeat(3, minmax(110px, 1fr));
        gap: 4px;
    }
    .ty-cell { padding: 6px 8px; }
    .ty-star { font-size: 9.5px; padding: 1px 5px; }
    .ty-cell-dir { display: none; }
    .ty-cell-center-label { font-size: 16px; letter-spacing: 3px; }
}