/* ==========================================================================
   Melo 游戏商店 · app.css
   布局：左侧图标栏（PS 式）+ 顶部搜索栏 + 横向货架（Switch 式）
   ========================================================================== */

/* ---------- 应用骨架 ---------- */
.app { display: flex; min-height: 100dvh; }

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-w);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-right: 1px solid var(--line);
}
.rail__brand {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  margin-bottom: 10px;
  border-radius: 15px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  font-size: 1.25rem;
  box-shadow: 0 8px 20px rgba(26, 99, 245, .3);
}
@media (min-width: 1180px) {
  .rail__brand { display: flex; }
  .rail__brandtext { display: none; }
}
.rail__list { display: grid; gap: 6px; width: 100%; }
.rail__foot { margin-top: auto; display: grid; gap: 6px; width: 100%; }

.rail__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 10px 4px;
  border-radius: var(--r-md);
  color: var(--text-2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.rail__item:hover { background: var(--bg-sunken); color: var(--text); }
.rail__item.is-active { background: var(--brand-soft); color: var(--brand-strong); }
html[data-theme="dark"] .rail__item.is-active { color: var(--brand); }
.rail__item.is-active::before {
  content: "";
  position: absolute;
  left: -10px; top: 50%;
  width: 4px; height: 22px;
  border-radius: 0 4px 4px 0;
  background: var(--brand);
  transform: translateY(-50%);
}
.rail__ico { width: 24px; height: 24px; display: grid; place-items: center; }
.rail__ico svg { width: 100%; height: 100%; }
.rail__label { font-size: .72rem; font-weight: 650; letter-spacing: .01em; }

.main-col {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: var(--rail-w);
  display: flex;
  flex-direction: column;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--topbar-h);
  padding: 0 var(--gutter);
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar__brand { display: grid; line-height: 1.15; }
.topbar__wordmark { font-size: 1.05rem; font-weight: 850; letter-spacing: -.01em; }
.topbar__tag { font-size: .72rem; color: var(--text-3); font-weight: 600; }

.topbar__search {
  flex: 1 1 auto;
  max-width: 540px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--bg-sunken);
  border: 1.5px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.topbar__search:focus-within {
  background: var(--bg-elev);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.topbar__searchico { width: 20px; height: 20px; color: var(--text-3); flex: none; }
.topbar__searchico svg { width: 100%; height: 100%; }
.topbar__search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font-size: .95rem;
  color: var(--text);
}
.topbar__search input::placeholder { color: var(--text-3); }
.topbar__search input::-webkit-search-cancel-button { display: none; }
.topbar__kbd {
  font-family: var(--font-num);
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  color: var(--text-3);
}

.topbar__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.iconbtn {
  position: relative;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bg-sunken);
  color: var(--text-2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.iconbtn:hover { background: var(--line); color: var(--text); }
.iconbtn:active { transform: scale(.95); }
.iconbtn svg { width: 21px; height: 21px; }
.iconbtn--profile { background: var(--brand); color: #fff; }
.iconbtn--profile:hover { background: var(--brand-strong); color: #fff; }
.iconbtn__text {
  position: absolute;
  right: -1px; bottom: -1px;
  min-width: 18px; height: 18px;
  display: grid; place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: .62rem;
  font-weight: 800;
  box-shadow: var(--shadow-1);
}

/* ---------- 页面容器 ---------- */
.view {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 22px var(--gutter) 56px;
  flex: 1 1 auto;
}
.view--enter { animation: viewIn .34s var(--ease) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.page-head { display: grid; gap: 14px; margin-bottom: 22px; }
.page-title {
  font-size: clamp(1.55rem, 2.6vw, 2.35rem);
  font-weight: 850;
  letter-spacing: -.022em;
  line-height: 1.12;
}
.page-sub { color: var(--text-2); font-size: .95rem; max-width: 68ch; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--text-3); font-weight: 650; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--brand); }

/* ---------- Hero 轮播 ---------- */
.hero {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--bg-elev);
  box-shadow: 0 20px 54px rgba(214, 0, 26, .12), var(--shadow-2);
  border: 1px solid var(--line);
}
.hero__slide {
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  min-height: 372px;
}
.hero__slide[hidden] { display: none; }
.hero__art { position: relative; min-height: 260px; overflow: hidden; }
.hero__art svg { width: 100%; height: 100%; display: block; filter: saturate(1.35) contrast(1.04); }
.hero__art::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 55%, var(--bg-elev));
  pointer-events: none;
}
.hero__body {
  position: relative;
  padding: clamp(22px, 3vw, 44px);
  background: var(--grad-hero);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 13px;
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--coral);
}
.hero__eyebrow svg.ico { width: 1.05em; height: 1.05em; }
.hero__title {
  font-size: clamp(1.75rem, 3.1vw, 2.9rem);
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1.06;
}
.hero__tag { color: var(--text-2); font-size: .98rem; max-width: 48ch; }
.hero__meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.hero__dots {
  position: absolute;
  right: clamp(18px, 3vw, 34px);
  bottom: 18px;
  display: flex; gap: 7px;
  padding: 7px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-1);
}
.hero__dots button {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: width var(--dur) var(--ease), background var(--dur) var(--ease);
}
.hero__dots button.is-active { width: 24px; background: var(--brand); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  font-size: .95rem;
  font-weight: 750;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: scale(.975); }
.btn--primary { background: var(--grad-brand); color: #fff; box-shadow: 0 10px 26px rgba(214, 0, 26, .32); }
.btn--primary:hover { background: var(--brand-strong); filter: saturate(1.12) brightness(1.03); transform: translateY(-1px); }
.btn--coral { background: var(--grad-sale); color: #fff; box-shadow: 0 8px 22px rgba(255, 90, 0, .32); }
.btn--coral:hover { transform: translateY(-1px); }
.btn--ghost { background: var(--bg-sunken); color: var(--text); }
.btn--ghost:hover { background: var(--line); }
.btn--outline { border: 1.5px solid var(--line-strong); color: var(--text); }
.btn--outline:hover { border-color: var(--brand); color: var(--brand); }
.btn--sm { height: 38px; padding: 0 15px; font-size: .85rem; }
.btn--wide { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- 货架 ---------- */
.section { margin-top: 36px; }
.section:first-child { margin-top: 0; }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 12px;
}
.section__title {
  position: relative;
  font-size: 1.26rem; font-weight: 850; letter-spacing: -.015em;
  display: flex; align-items: center; gap: 10px;
  padding-left: 14px;
}
.section__title::before {
  content: "";
  position: absolute;
  left: 0; top: .12em; bottom: .12em;
  width: 5px;
  border-radius: 4px;
  background: var(--grad-brand);
}
.section__count { font-size: .8rem; font-weight: 700; color: var(--brand); }
.section__link {
  font-size: .86rem; font-weight: 700; color: var(--brand);
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: var(--r-pill);
}
.section__link:hover { background: var(--brand-soft); }
.section__link svg { width: 15px; height: 15px; }

.shelf { position: relative; }
.shelf__track {
  display: flex;
  gap: var(--shelf-gap);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 6px 6px 20px;
  margin: -6px -6px -12px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.shelf__track::-webkit-scrollbar { display: none; }
.shelf__track > * { scroll-snap-align: start; flex: 0 0 auto; }
.shelf__nav {
  position: absolute;
  top: 36%;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bg-elev);
  color: var(--text-2);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--line);
  z-index: 6;
  opacity: 0;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.shelf:hover .shelf__nav, .shelf__nav:focus-visible { opacity: 1; }
.shelf__nav:hover { color: var(--brand); transform: scale(1.05); }
.shelf__nav svg { width: 20px; height: 20px; }
.shelf__nav--prev { left: -12px; }
.shelf__nav--next { right: -12px; }

/* ---------- 游戏卡片 ---------- */
.card {
  width: var(--card-w);
  display: flex;
  flex-direction: column;
  gap: 9px;
  border-radius: var(--r-lg);
  padding: 0;
  text-align: left;
  color: inherit;
  background: none;
}
.card__art {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-sunken);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  border: 1px solid var(--line);
}
.card__art svg { width: 100%; height: 100%; display: block; filter: saturate(1.45) contrast(1.04); }
.card:hover .card__art,
.card:focus-visible .card__art { transform: translateY(-4px); box-shadow: var(--shadow-2); filter: saturate(1.6) contrast(1.05); }
.card__badges { position: absolute; top: 9px; left: 9px; display: flex; gap: 6px; flex-wrap: wrap; max-width: calc(100% - 18px); }
.card__badges .badge { box-shadow: 0 2px 8px rgba(8, 16, 28, .22); backdrop-filter: blur(6px); }
.card__price { position: absolute; right: 9px; bottom: 9px; }
.card__title {
  font-size: .97rem; font-weight: 750; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .78rem; color: var(--text-3); font-weight: 600; }
.card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.card--wide { width: 336px; }
.card--wide .card__art { aspect-ratio: 21 / 10; }

/* 价格 */
.price {
  display: inline-flex; align-items: baseline; gap: 2px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-elev);
  color: var(--text);
  font-weight: 850;
  font-size: .88rem;
  box-shadow: var(--shadow-1);
  font-variant-numeric: tabular-nums;
}
.price--free { background: var(--grad-free); color: #fff; box-shadow: 0 4px 12px rgba(0, 168, 107, .32); }
.price--sale { background: var(--grad-sale); color: #fff; box-shadow: 0 4px 12px rgba(255, 70, 0, .3); }
.price__old { margin-left: 4px; font-size: .74rem; font-weight: 600; text-decoration: line-through; opacity: .75; }

/* 分级 & 小标签 */
.rating {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .01em;
  background: var(--bg-sunken);
  color: var(--text-2);
}
.rating[data-r="all"] { background: var(--ok-soft); color: var(--ok); }
.rating[data-r="12"] { background: #ffedc2; color: #7a4a00; }
.rating[data-r="16"] { background: #ffdfe3; color: #a8001a; }
html[data-theme="dark"] .rating[data-r="12"] { background: #33260c; color: #f0b64a; }
html[data-theme="dark"] .rating[data-r="16"] { background: #38171a; color: #ff8f94; }

.score { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; font-size: .8rem; color: var(--text-2); }
.score svg { width: 13px; height: 13px; color: var(--warn); }
.score--top { color: #b07000; }

/* ---------- 筛选与工具栏 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar__spacer { flex: 1 1 auto; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 38px;
  padding: 0 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text-2);
  font-size: .86rem;
  font-weight: 650;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(214, 0, 26, .25); }
html[data-theme="dark"] .chip.is-active { background: var(--grad-brand); border-color: var(--brand); color: #fff; }
.chip__count { font-size: .74rem; opacity: .7; font-variant-numeric: tabular-nums; }

.select {
  height: 40px;
  padding: 0 38px 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  font-size: .87rem;
  font-weight: 650;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d8da1' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 15px;
}
.select:hover { border-color: var(--line-strong); }

.resultbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin: 18px 0 10px;
  color: var(--text-2); font-size: .87rem; font-weight: 650;
}
.resultbar strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- 网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 24px 18px;
}
.grid .card { width: auto; }

/* ---------- 详情页 ---------- */
.detail { display: grid; gap: 30px; }
.detail__hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
}
.detail__art { position: relative; min-height: 320px; }
.detail__art svg { width: 100%; height: 100%; display: block; filter: saturate(1.35) contrast(1.04); }
.detail__body { padding: clamp(22px, 3vw, 40px); display: flex; flex-direction: column; gap: 13px; justify-content: center; }
.detail__title { font-size: clamp(1.6rem, 2.8vw, 2.5rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.08; }
.detail__sub { color: var(--text-3); font-size: .9rem; font-weight: 650; }
.detail__tag { color: var(--text-2); max-width: 52ch; }
.detail__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.detail__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.fact { padding: 13px 15px; border-radius: var(--r-md); background: var(--bg-elev); border: 1px solid var(--line); }
.fact__k { font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.fact__v { font-weight: 750; margin-top: 3px; font-size: .95rem; }
.detail__cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .9fr); gap: 26px; align-items: start; }
.prose { color: var(--text-2); font-size: .96rem; line-height: 1.75; display: grid; gap: 12px; }
.prose h3 { color: var(--text); font-size: 1.05rem; font-weight: 800; margin-top: 6px; }
.taglist { display: flex; gap: 7px; flex-wrap: wrap; }
.shots { display: flex; gap: 12px; overflow-x: auto; padding: 4px 4px 14px; margin: 0 -4px; }
.shots figure { flex: 0 0 auto; width: 300px; border-radius: var(--r-md); overflow: hidden; background: var(--bg-sunken); border: 1px solid var(--line); }
.shots figure svg { width: 100%; aspect-ratio: 16/9; display: block; }
.shots figcaption { font-size: .74rem; color: var(--text-3); padding: 7px 10px; }
.a11y-list { display: grid; gap: 8px; }
.a11y-item { display: flex; gap: 9px; align-items: flex-start; font-size: .86rem; color: var(--text-2); }
.a11y-item svg { width: 17px; height: 17px; flex: none; color: var(--ok); margin-top: 1px; }

/* ---------- 我的库 ---------- */
.stack-list { display: grid; gap: 12px; }
.lib-item {
  display: flex; gap: 16px; align-items: center;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.lib-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.lib-item__art { width: 128px; flex: none; border-radius: var(--r-md); overflow: hidden; }
.lib-item__art svg { width: 100%; aspect-ratio: 16/10; display: block; }
.lib-item__body { flex: 1 1 auto; min-width: 0; display: grid; gap: 6px; }
.lib-item__title { font-weight: 800; font-size: 1rem; }
.lib-item__meta { font-size: .8rem; color: var(--text-3); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lib-empty {
  display: grid; gap: 12px; justify-items: center; text-align: center;
  padding: 56px 24px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-xl);
  background: var(--bg-elev);
}
.lib-empty__ico { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; background: var(--brand-soft); color: var(--brand); }
.lib-empty__ico svg { width: 30px; height: 30px; }
.progress { height: 7px; border-radius: 999px; background: var(--bg-sunken); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--coral)); }

/* ---------- 设置 ---------- */
.settings { display: grid; gap: 16px; max-width: 920px; }
.panel { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; }
.panel__head { margin-bottom: 6px; }
.panel__title { font-size: 1.02rem; font-weight: 850; display: flex; align-items: center; gap: 9px; }
.panel__title svg { width: 18px; height: 18px; color: var(--brand); }
.panel__desc { font-size: .84rem; color: var(--text-2); margin-top: 3px; }
.field {
  display: flex; gap: 18px; align-items: center; justify-content: space-between;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.field:first-of-type { border-top: 0; }
.field__main { display: grid; gap: 2px; }
.field__label { font-weight: 700; font-size: .94rem; }
.field__hint { font-size: .8rem; color: var(--text-3); }
.field__control { flex: none; display: flex; align-items: center; gap: 8px; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--bg-sunken); border-radius: var(--r-pill); flex-wrap: wrap; }
.seg button {
  height: 34px; padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: .84rem; font-weight: 650;
  color: var(--text-2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.seg button:hover { color: var(--text); }
.seg button.is-active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-1); }
.switch {
  position: relative;
  width: 54px; height: 31px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background var(--dur) var(--ease);
  flex: none;
}
.switch::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 25px; height: 25px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(8, 16, 28, .3);
  transition: transform var(--dur) var(--ease);
}
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(23px); }
.settings__note {
  font-size: .82rem; color: var(--text-2);
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--brand-soft); color: var(--brand-strong);
}
html[data-theme="dark"] .settings__note { color: var(--brand); }

/* ---------- 搜索遮罩 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: start center;
  padding: clamp(16px, 10vh, 110px) 16px 16px;
  background: rgba(8, 14, 22, .5);
  backdrop-filter: blur(6px);
  animation: fadeIn .18s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.overlay__panel {
  width: min(780px, 94vw);
  max-height: 80vh;
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.search-field {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.search-field svg { width: 22px; height: 22px; color: var(--text-3); flex: none; }
.search-field input {
  flex: 1; min-width: 0;
  border: 0; background: none;
  font-size: 1.08rem;
  color: var(--text);
}
.search-field input::placeholder { color: var(--text-3); }
.search-field .kbd { font-size: .72rem; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--text-3); font-family: var(--font-num); }
.search-results { overflow: auto; padding: 8px; display: grid; gap: 2px; }
.search-hit {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 9px 10px;
  border-radius: var(--r-md);
  text-align: left;
}
.search-hit:hover, .search-hit:focus-visible { background: var(--bg-sunken); }
.search-hit__art { width: 66px; flex: none; border-radius: 9px; overflow: hidden; }
.search-hit__art svg { width: 100%; aspect-ratio: 16/10; display: block; }
.search-hit__title { font-weight: 750; font-size: .94rem; }
.search-hit__meta { font-size: .76rem; color: var(--text-3); }
.search-hit__price { margin-left: auto; flex: none; }
.search-empty { padding: 34px 20px; text-align: center; color: var(--text-3); font-size: .9rem; display: grid; gap: 8px; justify-items: center; }
.search-empty svg { width: 34px; height: 34px; opacity: .5; }

/* ---------- 播放器 ---------- */
.player {
  position: fixed; inset: 0; z-index: 130;
  display: flex; flex-direction: column;
  background: #04070c;
}
.player__bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: #0a1018;
  border-bottom: 1px solid #1b2a3a;
  color: #e9f0f8;
  flex: none;
}
.player__bar h2 { font-size: .95rem; font-weight: 750; display: grid; }
.player__bar small { font-size: .72rem; color: #8fa3b8; font-weight: 600; }
.player__hint { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: .78rem; color: #8fa3b8; }
.player__close {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .08); color: #fff;
}
.player__close:hover { background: rgba(255, 255, 255, .16); }
.player__close svg { width: 20px; height: 20px; }
.player__frame-wrap { position: relative; flex: 1 1 auto; background: #000; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player__loading { position: absolute; inset: 0; display: grid; place-items: center; color: #8fa3b8; font-size: .9rem; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 160; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: var(--text);
  color: var(--bg);
  font-size: .87rem;
  font-weight: 700;
  box-shadow: var(--shadow-2);
  animation: toastIn .26s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 页脚 ---------- */
.foot {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 18px var(--gutter) 44px;
  color: var(--text-3);
  font-size: .78rem;
  display: grid;
  gap: 5px;
  border-top: 1px solid var(--line);
  width: 100%;
}
.foot strong { color: var(--text-2); }
.foot__meta { max-width: 90ch; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  :root { --card-w: 224px; }
  .detail__cols { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  :root { --rail-w: 76px; }
  .hero__slide { grid-template-columns: 1fr; min-height: 0; }
  .hero__art { min-height: 240px; }
  .hero__art::after { background: linear-gradient(180deg, transparent 60%, var(--bg-elev)); }
  .detail__hero { grid-template-columns: 1fr; }
  .detail__art { min-height: 230px; }
  .hero__art::after { display: none; }
}
@media (max-width: 860px) {
  :root { --topbar-h: 60px; }
  .rail {
    inset: auto 0 0 0;
    width: auto;
    height: 66px;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom, 0px));
    border-right: 0;
    border-top: 1px solid var(--line);
    justify-content: space-around;
  }
  .rail__brand, .rail__foot { display: none; }
  .rail__list { display: flex; flex: 1; justify-content: space-around; margin: 0; }
  .rail__list li { flex: 1; }
  .rail__item { flex-direction: column; gap: 2px; padding: 6px 2px; height: 100%; justify-content: center; }
  .rail__item.is-active::before { left: 50%; top: 0; width: 22px; height: 3px; transform: translateX(-50%); border-radius: 0 0 4px 4px; }
  .rail__label { font-size: .66rem; }
  .rail__ico { width: 22px; height: 22px; }
  .main-col { margin-left: 0; padding-bottom: 78px; }
  .topbar__search { display: none; }
  .topbar__tag { display: none; }
  .view { padding-top: 16px; }
  .shelf__nav { display: none; }
}
@media (max-width: 640px) {
  :root { --card-w: 168px; --shelf-gap: 12px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .hero__body { padding: 20px; }
  .hero__title { font-size: 1.6rem; }
  .hero__actions .btn { flex: 1 1 auto; }
  .lib-item__art { width: 96px; }
  .field { flex-direction: column; align-items: flex-start; gap: 10px; }
  .field__control { width: 100%; }
  .seg { width: 100%; }
  .seg button { flex: 1; }
  .player__hint { display: none; }
  .hero__dots { display: none; }
}
@media (min-width: 861px) {
  .rail__brand { display: none; }
}

/* 动效降级：关掉卡片位移与轮播动画 */
html[data-motion="reduced"] .card:hover .card__art,
html[data-motion="reduced"] .card:focus-visible .card__art,
html[data-motion="reduced"] .btn:hover,
html[data-motion="reduced"] .shelf__nav:hover { transform: none; }
