/* 成就查詢 */
.ach__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ach__bar { position: sticky; top: 72px; z-index: 20; display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 10px 14px; align-items: center; padding: 12px 14px; box-shadow: var(--shadow); }
.ach__opts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.select { height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

/* 獎牌色 */
[data-m] { --mc: #5aa8ff; }
[data-m="金"] { --mc: #f4c443; } [data-m="銀"] { --mc: #c7d2de; } [data-m="銅"] { --mc: #d08a52; } [data-m="藍"] { --mc: #5aa8ff; }
html:is([data-theme="light"],[data-theme="paper"]) [data-m="金"] { --mc: #b8860b; } html:is([data-theme="light"],[data-theme="paper"]) [data-m="銀"] { --mc: #74808c; }
html:is([data-theme="light"],[data-theme="paper"]) [data-m="銅"] { --mc: #a55a22; } html:is([data-theme="light"],[data-theme="paper"]) [data-m="藍"] { --mc: #1f63c6; }
.medal i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--mc); }

.ach__layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; margin-top: 18px; align-items: start; }
.ach__cats { position: sticky; top: 196px; max-height: calc(100vh - 212px); overflow-y: auto; padding: 8px; scrollbar-width: thin; }
.cat { display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.cat:hover { background: var(--surface-2); }
.cat[aria-current="true"] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.cat small { color: var(--faint); font: 600 12px var(--mono); }
.cat--main { margin-top: 6px; font-weight: 800; }
.cat--sub { padding-left: 22px; font-size: 13.5px; color: var(--muted); }
.cat--all { font-weight: 800; }

.ach__sum { display: grid; gap: 8px; margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ach__sum p { margin: 0; color: var(--muted); font-size: 14px; }
.ach__sum b { color: var(--text); }
.ach__sum details summary { color: var(--faint); font-size: 12.5px; cursor: pointer; }
.totals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tot { display: inline-flex; gap: 6px; padding: 3px 10px; border-radius: 7px; background: var(--surface-2); font-size: 13px; }
.tot b { color: var(--accent); font-variant-numeric: tabular-nums; }

.ach__list { display: grid; gap: 10px; }
.ac { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 4px 14px; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--mc); border-radius: 12px; background: var(--surface); scroll-margin-top: 210px; }
.ac:target, .ac.is-focus { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); border-left-color: var(--mc); }
.ac__medal { grid-row: 1 / span 3; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: color-mix(in srgb, var(--mc) 18%, transparent); color: var(--mc); font-weight: 900; font-size: 15px; border: 2px solid var(--mc); }
.ac__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ac__top h3 { margin: 0; font-size: 16.5px; }
.ac__title { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); font-size: 12.5px; font-weight: 800; }
.ac__title::before { content: "稱號"; margin-right: 6px; opacity: .7; font-weight: 600; font-size: 11px; }
.ac__cat { margin-left: auto; color: var(--faint); font-size: 12px; }
.ac__desc { margin: 0; color: var(--muted); font-size: 14px; }
.ac__rw { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.rw { display: inline-flex; gap: 4px; padding: 2px 9px; border-radius: 6px; background: var(--surface-2); font-size: 13px; }
.rw b { color: var(--accent); font-variant-numeric: tabular-nums; }
.rw--item { background: color-mix(in srgb, var(--r-史詩, #b06cff) 16%, transparent); }
.rw--none { color: var(--faint); background: none; padding-left: 0; }
.ac__links { display: flex; flex-wrap: wrap; gap: 5px; font-size: 13px; }
.ac__links a, .ac__links button { padding: 2px 9px; border: 1px solid var(--line-strong); border-radius: 999px; background: none; color: var(--text); font: inherit; font-size: 12.5px; text-decoration: none; cursor: pointer; }
.ac__links a:hover, .ac__links button:hover { border-color: var(--accent); color: var(--accent); }
.ac__links .lbl { color: var(--faint); font-size: 12px; align-self: center; }
.ac__flags { display: inline-flex; gap: 4px; }
.flag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; background: var(--surface-3); color: var(--muted); font-size: 11.5px; font-weight: 700; }
.flag--off { background: color-mix(in srgb, var(--r-太古) 18%, transparent); color: var(--r-太古); }

/* 系列 */
.steps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.step { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 6px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.step i { width: 8px; height: 8px; border-radius: 50%; background: var(--mc); }
.step[aria-current="true"] { border-color: var(--accent); color: var(--text); font-weight: 800; background: var(--accent-soft); }
.step:hover { border-color: var(--accent); }
.steps .lbl { align-self: center; margin-right: 4px; color: var(--faint); font-size: 12px; }

.more { display: block; width: 100%; margin: 14px 0; height: 42px; border: 1px dashed var(--line-strong); border-radius: 10px; background: transparent; color: var(--accent); font-weight: 700; cursor: pointer; }
.empty { padding: 40px 20px; text-align: center; color: var(--faint); }
.catsel { display: none; }

@media (max-width: 900px) {
  .ach__bar { position: static; grid-template-columns: 1fr; }
  .ach__layout { grid-template-columns: 1fr; }
  .ach__cats { display: none; }
  .catsel { display: block; width: 100%; margin-bottom: 12px; }
  .ac { grid-template-columns: 1fr; }
  .ac__medal { display: none; }
  .ac__cat { margin-left: 0; width: 100%; }
}
.ac > *:not(.ac__medal) { grid-column: 2; min-width: 0; }
.linkish { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.muted { color: var(--faint); }
@media (max-width: 900px) { .ac > *:not(.ac__medal) { grid-column: 1; } }
.more[hidden] { display: none; }
.ac__d { display: none; color: var(--mc); font-weight: 800; }
@media (max-width: 900px) { .ac__d { display: inline; } }
