/* ==========================================================================
   通用「测试案例」组件样式（青阳阁 · 工具模块共用）
   配套脚本：/js/tools/tool-case.js
   适用：八字 / 人居环境 / 黄历择日 / 姓名 / 号码 / 紫微 / 六爻 / 奇门 / 六壬
   ========================================================================== */

.tc-sec { margin: 24px 0 8px; }

.tc-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tc-h {
    font-size: 1.06rem;
    font-weight: 700;
    color: var(--text-primary, #2c2416);
}

.tc-sub {
    font-size: .8rem;
    color: var(--text-secondary, #8a7f6a);
}

.tc-count {
    margin-left: auto;
    font-size: .78rem;
    color: #9a8f78;
}

.tc-tip {
    font-size: .78rem;
    color: #8a6b2f;
    background: #fdf6e6;
    border: 1px solid #f0dfb4;
    border-radius: 6px;
    padding: 3px 10px;
}

.tc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
    gap: 12px;
}

.tc-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid #e8dfcc;
    border-radius: 10px;
    background: #fffdf8;
    cursor: pointer;
    text-decoration: none;
    transition: border-color .18s, box-shadow .18s, transform .18s;
}

.tc-card:hover {
    border-color: #c9a86a;
    box-shadow: 0 6px 18px rgba(160, 130, 70, .14);
    transform: translateY(-2px);
}

.tc-badge {
    align-self: flex-start;
    font-size: .7rem;
    padding: 1px 8px;
    border-radius: 999px;
    background: #f6ecd8;
    color: #8a6b2f;
    white-space: nowrap;
}

.tc-name {
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text-primary, #2c2416);
}

.tc-go {
    font-size: .76rem;
    color: #b08d4a;
}

.tc-empty {
    padding: 16px;
    border: 1px dashed #e2d7c0;
    border-radius: 10px;
    color: #9a8f78;
    font-size: .85rem;
    text-align: center;
    background: #fffdf8;
}

.tc-loading {
    padding: 18px;
    text-align: center;
    color: #9a8f78;
    font-size: .85rem;
}

/* ---------- 案例预览弹窗 ---------- */
.tc-mask {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(30, 24, 14, .55);
}

.tc-mask.open { display: flex; }

.tc-modal {
    display: flex;
    flex-direction: column;
    width: min(880px, 100%);
    max-height: 86vh;
    overflow: hidden;
    background: #fffdf8;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
}

.tc-modal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid #efe6d4;
}

.tc-modal-title {
    font-weight: 700;
    color: #2c2416;
}

.tc-modal-close {
    margin-left: auto;
    font-size: 1.35rem;
    line-height: 1;
    color: #9a8f78;
    cursor: pointer;
}

.tc-modal-tags {
    padding: 10px 18px;
    font-size: .82rem;
    line-height: 1.7;
    color: #7a6f5c;
    background: #fdfaf2;
    border-bottom: 1px dashed #efe6d4;
}

.tc-modal-body {
    padding: 16px 18px;
    overflow: auto;
    font-size: .9rem;
    line-height: 1.85;
    color: #3a3226;
}

.tc-modal-body h2,
.tc-modal-body h3,
.tc-modal-body h4 {
    margin: 14px 0 8px;
    color: #2c2416;
    line-height: 1.5;
}

.tc-modal-body p { margin: 8px 0; }

.tc-modal-body table {
    width: 100%;
    margin: 10px 0;
    border-collapse: collapse;
    font-size: .84rem;
}

.tc-modal-body th,
.tc-modal-body td {
    padding: 6px 8px;
    border: 1px solid #e8dfcc;
    text-align: left;
}

.tc-modal-body th { background: #faf5e9; }

.tc-modal-body ul,
.tc-modal-body ol { padding-left: 22px; }

.tc-modal-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 18px;
    border-top: 1px solid #efe6d4;
    font-size: .8rem;
    color: #8a7f6a;
}

.tc-modal-foot a {
    color: #b08d4a;
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 640px) {
    .tc-grid { grid-template-columns: 1fr; }
    .tc-modal { max-height: 92vh; }
}
