/* ===== 字母乐园 /tool/letter-learn ===== */

.detail-wrap {
    --ll-orange: #fb923c;
    --ll-pink: #f472b6;
    --ll-grad: linear-gradient(135deg, #fb923c 0%, #f472b6 100%);
    --ll-green: #22c55e;
    --ll-red: #ef4444;
    --ll-amber: #f59e0b;
}

/* 头部 */
.ll-head { display: flex; gap: 22px; align-items: center; margin-bottom: 30px; }
.ll-head-icon {
    width: 74px; height: 74px; border-radius: 20px; display: grid; place-items: center;
    font-size: 38px; background: var(--ll-grad); color: #fff;
    box-shadow: 0 14px 30px rgba(244, 114, 182, .32);
}
.ll-head-main h1 { margin: 0 0 8px; font-size: 32px; font-weight: 900; letter-spacing: -.02em; color: var(--c-text); }
.ll-head-sub { margin: 0 0 14px; font-size: 15px; line-height: 1.7; color: var(--c-sub); max-width: 64ch; }
.ll-head-badges { display: flex; flex-wrap: wrap; gap: 8px; }

/* 主体 */
.ll-board { margin-bottom: 40px; }

/* 模式切换 */
.ll-modebar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.ll-mode-btn {
    padding: 11px 20px; border-radius: 12px; cursor: pointer; font-size: 15px; font-weight: 800;
    border: 2px solid var(--c-border); background: var(--c-card); color: var(--c-sub);
    transition: .15s; font-family: inherit;
}
.ll-mode-btn:hover { border-color: var(--ll-orange); color: var(--c-text); }
.ll-mode-btn.is-on { background: var(--ll-grad); border-color: transparent; color: #fff; box-shadow: 0 8px 20px rgba(244, 114, 182, .28); }

.ll-warn {
    margin-bottom: 18px; padding: 12px 16px; border-radius: 12px; font-size: 13.5px; line-height: 1.7;
    background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .4); color: var(--c-text);
}
.ll-warn b { color: var(--ll-red); }

.ll-panel[hidden] { display: none !important; }
.ll-card { background: var(--c-card); border: 1px solid var(--c-border); border-radius: 18px; padding: 22px; margin-bottom: 18px; }
.ll-card > *[hidden] { display: none !important; }

.ll-mini {
    padding: 10px 16px; border-radius: 11px; cursor: pointer; font-size: 14px; font-weight: 700;
    border: 2px solid var(--c-border); background: var(--c-bg); color: var(--c-text); font-family: inherit; transition: .15s;
}
.ll-mini:hover { border-color: var(--ll-orange); }
.ll-mini.gray { color: var(--c-sub); }
.ll-mini-main { background: var(--ll-grad); border-color: transparent; color: #fff; box-shadow: 0 8px 18px rgba(244, 114, 182, .25); }
.ll-mini-main:hover { filter: brightness(1.05); }
.ll-mini:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 模式一：认读 ---------- */
.ll-stage { text-align: center; padding: 6px 0 4px; }
.ll-stage-letter {
    font-size: 110px; line-height: 1.05; font-weight: 900; letter-spacing: -.02em;
    background: var(--ll-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ll-stage-row { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 2px; }
.ll-stage-lower { font-size: 46px; font-weight: 900; color: var(--c-text); }
.ll-stage-word { font-size: 19px; font-weight: 700; color: var(--c-sub); }
.ll-stage-phon { margin-top: 8px; font-size: 13.5px; color: var(--c-muted); }
.ll-stage-btns { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.ll-stage-btns .ll-mini { padding: 11px 20px; font-size: 15px; }

.ll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 12px; }
.ll-tile {
    aspect-ratio: 1 / 1; border: 0; border-radius: 16px; cursor: pointer; font-family: inherit;
    font-size: 34px; font-weight: 900; color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, .22);
    background: var(--lt, #228be6); transition: transform .12s, box-shadow .12s; position: relative;
}
.ll-tile:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 10px 20px rgba(0, 0, 0, .18); }
.ll-tile.is-active { outline: 4px solid var(--c-text); outline-offset: 2px; transform: translateY(-3px) scale(1.05); }
.ll-tile small { position: absolute; right: 7px; bottom: 4px; font-size: 13px; font-weight: 700; opacity: .85; }

.ll-tile:nth-child(6n+1) { --lt: #ff6b6b; }
.ll-tile:nth-child(6n+2) { --lt: #f59f00; }
.ll-tile:nth-child(6n+3) { --lt: #40c057; }
.ll-tile:nth-child(6n+4) { --lt: #228be6; }
.ll-tile:nth-child(6n+5) { --lt: #ae3ec9; }
.ll-tile:nth-child(6n+6) { --lt: #f06595; }

/* ---------- 模式二：配对 ---------- */
.ll-match-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.ll-match-progress, .ll-match-score { font-size: 14px; color: var(--c-sub); }
.ll-match-progress b, .ll-match-score b { color: var(--c-text); font-size: 16px; }
.ll-match-hint { margin: 12px 0 16px; font-size: 13.5px; line-height: 1.7; color: var(--c-muted); }
.ll-match-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.ll-match-row-low { margin-top: 14px; }
.ll-match-row-low .ll-mtile { background: var(--c-bg); border-style: dashed; }

.ll-mtile {
    width: 74px; height: 74px; border-radius: 16px; cursor: pointer; font-family: inherit;
    font-size: 32px; font-weight: 900; color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, .2);
    border: 3px solid transparent; background: #f59f00; transition: transform .12s, border-color .12s, background .2s;
}
.ll-mtile:hover { transform: translateY(-3px); }
.ll-mtile.is-sel { border-color: var(--c-text); transform: translateY(-4px) scale(1.05); }
.ll-mtile.is-hit { background: var(--ll-green) !important; cursor: default; opacity: .9; }
.ll-mtile.is-bad { background: var(--ll-red) !important; animation: ll-shake .4s; }
.ll-mtile:disabled { cursor: default; }
@keyframes ll-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.ll-match-msg { margin-top: 18px; padding: 12px 16px; border-radius: 12px; font-size: 14px; text-align: center;
    background: var(--c-bg); border: 1px solid var(--c-border); color: var(--c-sub); }
.ll-match-msg.ok { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .35); color: var(--c-text); }
.ll-match-msg.bad { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .35); color: var(--c-text); }
.ll-match-msg.win { background: var(--ll-grad); border-color: transparent; color: #fff; font-weight: 800; }

/* ---------- 模式三：字母歌 ---------- */
.ll-song-head { display: flex; flex-wrap: wrap; gap: 10px; }
.ll-song-hint { margin: 12px 0 18px; font-size: 13.5px; line-height: 1.7; color: var(--c-muted); }
.ll-song-lines { display: flex; flex-direction: column; gap: 12px; }
.ll-song-line { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ll-song-tile {
    width: 62px; height: 62px; border-radius: 14px; display: grid; place-items: center;
    font-size: 27px; font-weight: 900; color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, .2);
    background: var(--lt, #228be6); transition: transform .12s, box-shadow .12s, filter .12s;
}
.ll-song-tile.is-sing { transform: scale(1.22); filter: brightness(1.18); box-shadow: 0 0 0 4px var(--c-text); z-index: 2; }
.ll-song-tile.is-done { opacity: .45; }
.ll-song-tile:nth-child(6n+1) { --lt: #ff6b6b; }
.ll-song-tile:nth-child(6n+2) { --lt: #f59f00; }
.ll-song-tile:nth-child(6n+3) { --lt: #40c057; }
.ll-song-tile:nth-child(6n+4) { --lt: #228be6; }
.ll-song-tile:nth-child(6n+5) { --lt: #ae3ec9; }
.ll-song-tile:nth-child(6n+6) { --lt: #f06595; }
.ll-song-msg { margin-top: 18px; padding: 12px 16px; border-radius: 12px; font-size: 14px; text-align: center;
    background: var(--c-bg); border: 1px solid var(--c-border); color: var(--c-sub); }
.ll-song-msg.win { background: var(--ll-grad); border-color: transparent; color: #fff; font-weight: 800; }

/* 提示 */
.ll-tip {
    font-size: 13px; line-height: 1.8; color: var(--c-sub);
    background: var(--c-bg); border: 1px solid var(--c-border); border-left: 4px solid var(--ll-orange);
    border-radius: 12px; padding: 14px 16px; margin-top: 16px;
}
.ll-tip b { color: var(--c-text); }

/* tabs 内容 */
.ll-block-head { font-size: 19px; font-weight: 800; color: var(--c-text); margin: 0 0 16px; }
.ll-block-head:not(:first-child) { margin-top: 28px; }
.ll-feature-chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; margin-bottom: 26px; }
.ll-feature-chip { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--c-sub); }
.ll-feature-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ll-orange); flex-shrink: 0; }
.ll-prose { font-size: 15px; line-height: 1.9; color: var(--c-sub); }
.ll-prose b { color: var(--c-text); }

.ll-how { display: flex; flex-direction: column; gap: 12px; }
.ll-how-item { display: flex; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--c-card); border: 1px solid var(--c-border); }
.ll-how-item .n { flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--ll-grad); font-size: 14px; }
.ll-how-item div { font-size: 14px; color: var(--c-sub); line-height: 1.75; }
.ll-how-item b { color: var(--c-text); }

.ll-faq { display: flex; flex-direction: column; gap: 10px; }
.ll-faq details { border: 1px solid var(--c-border); border-radius: 14px; background: var(--c-card); padding: 0 16px; }
.ll-faq summary { cursor: pointer; padding: 14px 0; font-weight: 700; font-size: 14.5px; color: var(--c-text); list-style: none; }
.ll-faq summary::-webkit-details-marker { display: none; }
.ll-faq summary::after { content: "+"; float: right; color: var(--ll-orange); font-size: 20px; line-height: 1; }
.ll-faq details[open] summary::after { content: "−"; }
.ll-faq .ll-faq-a { padding: 0 0 16px; font-size: 13.5px; line-height: 1.8; color: var(--c-sub); }
.ll-faq .ll-faq-a b { color: var(--c-text); }

/* 相关 */
.ll-related { margin-top: 42px; }
.ll-related h2 { font-size: 22px; font-weight: 800; color: var(--c-text); margin: 0 0 16px; }
.ll-rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.ll-rel-item { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: var(--c-card); border: 1px solid var(--c-border); text-decoration: none; transition: .18s; }
.ll-rel-item:hover { transform: translateY(-2px); border-color: var(--ll-orange); box-shadow: 0 10px 24px rgba(244, 114, 182, .12); }
.ll-rel-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; background: var(--c-bg); flex-shrink: 0; }
.ll-rel-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ll-rel-body b { font-size: 15px; font-weight: 700; color: var(--c-text); }
.ll-rel-body small { font-size: 12px; color: var(--c-muted); }
.ll-rel-go { margin-left: auto; color: var(--ll-orange); font-weight: 800; }

/* 深色模式微调 */
@media (prefers-color-scheme: dark) {
    .ll-head-icon { box-shadow: 0 14px 30px rgba(244, 114, 182, .2); }
    .ll-mode-btn.is-on { box-shadow: 0 8px 20px rgba(244, 114, 182, .2); }
    .ll-tile { text-shadow: 0 2px 4px rgba(0, 0, 0, .35); }
    .ll-mtile, .ll-song-tile { text-shadow: 0 2px 4px rgba(0, 0, 0, .35); }
    .ll-mode-btn { background: var(--c-card); }
}

/* 响应式 */
@media (max-width: 720px) {
    .ll-head { flex-direction: column; align-items: flex-start; }
    .ll-head-badges { justify-content: center; }
    .ll-stage-letter { font-size: 84px; }
    .ll-grid { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 9px; }
    .ll-tile { font-size: 26px; border-radius: 13px; }
    .ll-mtile { width: 58px; height: 58px; font-size: 26px; border-radius: 13px; }
    .ll-song-tile { width: 48px; height: 48px; font-size: 21px; border-radius: 12px; }
    .ll-feature-chips { grid-template-columns: 1fr; }
    .ll-match-head { flex-direction: column; align-items: stretch; }
}
