/* ===== 七巧板拼图 ===== */
#tgApp .tg-hero { text-align: center; padding: 12px 10px 0; }
#tgApp .tg-hero h1 { font-size: 30px; font-weight: 800; color: var(--c-text); margin-bottom: 10px; }
#tgApp .tg-hero p { font-size: 15px; color: var(--c-text-sub); line-height: 1.7; }

#tgApp .tg-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0; }
#tgApp .tg-tab {
    border: 2px solid var(--c-primary); background: transparent; color: var(--c-primary);
    border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: background .15s, color .15s;
}
#tgApp .tg-tab.is-on { background: var(--c-primary); color: #fff; }

#tgApp .tg-panel {
    max-width: 640px; margin: 0 auto; background: var(--c-surface);
    border: 1px solid var(--c-border); border-radius: var(--radius-md);
    padding: 20px 16px; box-shadow: var(--shadow-md); text-align: center;
}
#tgApp .tg-hud { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 14px; }
#tgApp .tg-chip {
    background: var(--c-surface-soft); border: 1px solid var(--c-border); border-radius: 999px;
    padding: 7px 14px; font-size: 14px; font-weight: 700; color: var(--c-text-sub);
}
#tgApp .tg-chip b { color: var(--c-primary); font-size: 17px; }

#tgApp .tg-tip {
    display: inline-block; margin-bottom: 12px; padding: 8px 16px; border-radius: 999px;
    background: var(--c-primary-soft); border: 1px solid var(--c-border);
    font-size: 14px; font-weight: 700; color: var(--c-primary);
}

#tgApp .tg-board {
    width: 100%; max-width: 520px; margin: 0 auto; border: 2px solid var(--c-border);
    border-radius: 14px; background: var(--c-surface-soft); overflow: hidden;
    touch-action: manipulation;
}
#tgApp .tg-board svg { width: 100%; height: auto; display: block; }
#tgApp .tg-slot { fill: #d8dee8; stroke: #d8dee8; stroke-width: 0.09; }
#tgApp .tg-grid { stroke: #e7ebf1; stroke-width: 0.03; }
#tgApp .tg-piece { stroke-width: 0.07; cursor: pointer; }
#tgApp .tg-piece.sel { stroke: var(--c-primary); stroke-width: 0.14; stroke-dasharray: 0.3 0.2; }
#tgApp .tg-piece.lock { stroke: #b8860b; stroke-width: 0.12; }
#tgApp .tg-hint { fill: none; stroke: var(--c-primary); stroke-width: 0.16; stroke-dasharray: 0.35 0.25; }
#tgApp .tg-traybg { fill: var(--c-surface); stroke: var(--c-border); stroke-width: 0.06; }

#tgApp .tg-msg { font-size: 17px; font-weight: 800; min-height: 26px; margin-top: 14px; color: var(--c-text); }
#tgApp .tg-msg.ok { color: var(--c-primary); }
#tgApp .tg-msg.bad { color: #e03131; }

#tgApp .tg-ctrl { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
#tgApp .tg-btn {
    border: none; border-radius: 999px; padding: 11px 18px; font-size: 15px; font-weight: 700;
    color: #fff; cursor: pointer; background: linear-gradient(135deg, var(--c-primary), var(--c-accent-cyan));
    box-shadow: var(--shadow-md);
}
#tgApp .tg-btn.gray { background: var(--c-surface-2); color: var(--c-text); box-shadow: none; border: 1px solid var(--c-border); }
#tgApp .tg-btn:disabled { opacity: .45; cursor: default; }

#tgApp .tg-ai, #tgApp .tg-info { max-width: 720px; margin: 30px auto 0; }
#tgApp .tg-ai h2, #tgApp .tg-info h2 { font-size: 20px; font-weight: 800; color: var(--c-text); margin-bottom: 10px; }
#tgApp .tg-ai p { font-size: 14px; color: var(--c-text-sub); line-height: 1.8; margin-bottom: 14px; }
#tgApp .tg-ai-row { display: flex; gap: 10px; flex-wrap: wrap; }
#tgApp .tg-out {
    margin-top: 14px; background: var(--c-surface-soft); border: 1px solid var(--c-border);
    border-radius: var(--radius-sm); padding: 16px 18px;
    font-size: 15px; line-height: 1.85; color: var(--c-text); white-space: pre-wrap;
}
#tgApp .tg-info ul { list-style: disc; padding-left: 22px; margin-bottom: 24px; }
#tgApp .tg-info li { font-size: 14px; line-height: 1.9; color: var(--c-text-sub); margin-bottom: 8px; }
#tgApp .tg-info li b { color: var(--c-text); }

@media (max-width: 560px) {
    #tgApp .tg-hero h1 { font-size: 24px; }
}
