/* ============================================================
 * components.css —— 通用组件
 * 命名约定：.block / .block__element / .is-state
 * ============================================================ */

/* ---------- 卡片 ---------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

.card--pad {
  padding: var(--sp-4);
}

.card__head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
}

.card__title {
  font-size: var(--fs-md);
  font-weight: 700;
}

.card__body {
  padding: var(--sp-4);
}

.section {
  margin-bottom: var(--sp-4);
}

.section__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-md);
  font-weight: 700;
  margin-bottom: var(--sp-2);
  color: var(--c-text);
}

.section__title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

/* ---------- 按钮 ---------- */
.btn {
  --btn-bg: var(--c-surface-2);
  --btn-fg: var(--c-text);
  --btn-bd: var(--c-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 var(--sp-4);
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  font-size: var(--fs-md);
  font-weight: 600;
  white-space: nowrap;
  transition: filter var(--dur) var(--ease), background var(--dur) var(--ease);
  user-select: none;
}

.btn:hover {
  filter: brightness(0.97);
}

.btn:active {
  transform: scale(0.98);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn--primary {
  --btn-bg: var(--c-brand);
  --btn-fg: #fff;
  --btn-bd: transparent;
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-bd: transparent;
  --btn-fg: var(--c-text-2);
}

.btn--ghost:hover {
  --btn-bg: var(--c-surface-2);
}

.btn--danger {
  --btn-bg: transparent;
  --btn-bd: var(--c-border);
  --btn-fg: var(--c-danger);
}

.btn--sm {
  height: 30px;
  padding: 0 var(--sp-3);
  font-size: var(--fs-sm);
  border-radius: var(--r-sm);
}

.btn--block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  color: var(--c-text-2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.icon-btn:hover {
  background: var(--c-surface-2);
  color: var(--c-text);
}

.icon-btn.is-active {
  color: var(--c-brand);
  background: var(--c-brand-soft);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* ---------- 输入 ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text-2);
}

.field__hint {
  font-size: var(--fs-xs);
  color: var(--c-text-3);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 38px;
  padding: 6px var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-bg-elevated);
  color: var(--c-text);
  font-size: var(--fs-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-brand) 18%, transparent);
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--c-text-3) 50%),
    linear-gradient(135deg, var(--c-text-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.5;
}

/* 搜索框 */
.searchbox {
  position: relative;
  display: flex;
  align-items: center;
}

.searchbox svg {
  position: absolute;
  left: var(--sp-3);
  width: 18px;
  height: 18px;
  color: var(--c-text-3);
  pointer-events: none;
}

.searchbox .input {
  padding-left: 38px;
  height: 42px;
  border-radius: var(--r-pill);
  background: var(--c-surface);
}

.searchbox__clear {
  position: absolute;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--c-text-3);
  background: var(--c-surface-2);
}

.searchbox__clear svg {
  position: static;
  width: 14px;
  height: 14px;
}

.toolbar {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.toolbar > .searchbox {
  flex: 1;
  min-width: 0;
}

/* ---------- 属性标签 ----------
 * 固定长度的「图标 + 文字 + 属性底色」卡片。
 * 图标方格比底色更深，右侧切出斜边，和文字区分开。
 * 尺寸通过 --w / --h / --icon-w / --fs 变量控制，四个档位见下。
 *
 * 图标是外部图片（assets/icons/types/*.png），宽高比并不统一（8:13 ~ 1.61:1）。
 * 图标高度由「图标框宽度 ÷ 最宽图比例(1.61)」算出来，再用 mask contain + 居中：
 * 这样 1:1、竖长、横宽的图都渲染成同一个高度，1:1 不会比 8:13 显得小，
 * 非正方形的图也始终在方格里居中。
 */
.tchip {
  --w: 88px;
  --h: 26px;
  --icon-w: 33px;
  --icon-ratio: 1.61;
  --icon-h: calc((var(--icon-w) - var(--slant) + 1px) / var(--icon-ratio));
  --fs: var(--fs-xs);
  --slant: 6px;

  display: inline-flex;
  align-items: stretch;
  flex: none;
  width: var(--w);
  height: var(--h);
  border-radius: 7px;
  overflow: hidden;
  background: var(--tb, var(--type-unknown));
  color: var(--type-ink);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.16);
  user-select: none;
  vertical-align: middle;
}

.tchip--xs {
  --w: 66px;
  --h: 20px;
  --icon-w: 23px;
  --icon-h: calc((var(--icon-w) - var(--slant) + 1px) / var(--icon-ratio));
  --fs: 10px;
  --slant: 4px;
  border-radius: 5px;
}

.tchip--sm {
  --w: 78px;
  --h: 23px;
  --icon-w: 28px;
  --icon-h: calc((var(--icon-w) - var(--slant) + 1px) / var(--icon-ratio));
  --fs: 11px;
  --slant: 5px;
}

.tchip--lg {
  --w: 96px;
  --h: 30px;
  --icon-w: 37px;
  --icon-h: calc((var(--icon-w) - var(--slant) + 1px) / var(--icon-ratio));
  --fs: var(--fs-sm);
  border-radius: 8px;
}

/* 图标方格：加深蒙版 + 右侧斜边 */
.tchip__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--icon-w);
  background: var(--type-icon-veil);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%);
  /* 斜边吃掉一点右侧空间，图标稍向左偏才居中 */
  padding-right: calc(var(--slant) - 1px);
  box-sizing: border-box;
  color: var(--type-ink);
}

/* 图标本体：图片当 mask 上色，颜色跟随 currentColor。
 * 框比图略宽（宽高比约 1.45），配合 contain + center：
 *   - 1:1 / 竖长的图 → 高度撑满 --icon-h，尺寸一致
 *   - 横宽的图（如地面 1.6:1）→ 宽度撑满，仍然居中
 */
.tchip__icon-img {
  display: block;
  width: 100%;
  height: var(--icon-h);
  background: currentColor;
  -webkit-mask: var(--type-icon) center / contain no-repeat;
  mask: var(--type-icon) center / contain no-repeat;
}

.tchip__text {
  flex: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 0 3px 0 1px;
  font-size: var(--fs);
  font-weight: 800;
  letter-spacing: 0.3px;
  white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

/* 每个属性色由 data-element 映射 */
[data-element='normal'] { --tb: var(--type-normal); }
[data-element='fire'] { --tb: var(--type-fire); }
[data-element='water'] { --tb: var(--type-water); }
[data-element='electric'] { --tb: var(--type-electric); }
[data-element='grass'] { --tb: var(--type-grass); }
[data-element='ice'] { --tb: var(--type-ice); }
[data-element='fighting'] { --tb: var(--type-fighting); }
[data-element='poison'] { --tb: var(--type-poison); }
[data-element='ground'] { --tb: var(--type-ground); }
[data-element='flying'] { --tb: var(--type-flying); }
[data-element='psychic'] { --tb: var(--type-psychic); }
[data-element='bug'] { --tb: var(--type-bug); }
[data-element='rock'] { --tb: var(--type-rock); }
[data-element='ghost'] { --tb: var(--type-ghost); }
[data-element='dragon'] { --tb: var(--type-dragon); }
[data-element='dark'] { --tb: var(--type-dark); }
[data-element='steel'] { --tb: var(--type-steel); }
[data-element='fairy'] { --tb: var(--type-fairy); }
[data-element='light'] { --tb: var(--type-light); }

/* 浅色属性：文字改深色，图标蒙版也调淡 */
[data-element='electric'],
[data-element='ice'],
[data-element='steel'],
[data-element='light'] {
  --type-ink: #33301f;
  --type-icon-veil: rgba(0, 0, 0, 0.16);
}

.tchip[data-element='electric'] .tchip__text,
.tchip[data-element='ice'] .tchip__text,
.tchip[data-element='steel'] .tchip__text,
.tchip[data-element='light'] .tchip__text {
  text-shadow: none;
}

/* ---------- 计数 / 徽标 ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--c-surface-2);
  color: var(--c-text-2);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.pill--brand {
  background: var(--c-brand-soft);
  color: var(--c-brand-strong);
}

/* ---------- 筛选芯片 ---------- */
.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 var(--sp-2);
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: all var(--dur) var(--ease);
}

.chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tb, var(--c-text-3));
}

.chip.is-active {
  background: var(--c-brand);
  border-color: var(--c-brand);
  color: #fff;
}

.chip.is-active .chip__dot {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

/* ---------- 分段控件 ---------- */
.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--c-surface-2);
  border-radius: var(--r-md);
  gap: 2px;
}

.segmented__item {
  padding: 5px 12px;
  border-radius: 7px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text-2);
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}

.segmented__item.is-active {
  background: var(--c-bg-elevated);
  color: var(--c-text);
  box-shadow: var(--shadow-1);
}

/* ---------- 工具条上的图标按钮（排序 / 筛选） ---------- */
.toolbar__btn {
  position: relative;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-2);
}

.toolbar__btn:hover {
  color: var(--c-text);
  background: var(--c-surface-2);
}

.toolbar__btn.is-active {
  color: var(--c-brand-strong);
  border-color: color-mix(in srgb, var(--c-brand) 40%, transparent);
  background: var(--c-brand-soft);
}

/* 筛选按钮上的小圆点：表示有筛选生效 */
.toolbar__btn[data-count]::after {
  content: attr(data-count);
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--c-brand);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--c-bg);
}

/* ---------- 选项列表（排序弹层用） ---------- */
.opt-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.opt-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--c-text-2);
  font-size: var(--fs-md);
  font-weight: 600;
  text-align: left;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.opt-item:hover {
  background: var(--c-surface-2);
}

/* 选中项加深颜色 */
.opt-item.is-active {
  background: var(--c-brand-soft);
  color: var(--c-brand-strong);
  font-weight: 800;
}

.opt-item__arrow {
  margin-left: auto;
  font-size: 13px;
  font-weight: 800;
  color: var(--c-text-3);
  opacity: 0.55;
}

.opt-item.is-active .opt-item__arrow {
  color: var(--c-brand-strong);
  opacity: 1;
}

/* ---------- 锚定浮层（排序 / 筛选：贴着按钮弹出） ---------- */
.pop-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.pop {
  position: fixed;
  z-index: 61;
  pointer-events: auto;
  padding: var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg-elevated);
  box-shadow: var(--shadow-3);
  max-height: min(70vh, 460px);
  overflow: auto;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.pop.is-placed {
  opacity: 1;
  transform: none;
}

.pop__head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 2px 2px var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--c-text-3);
}

.pop__head .icon-btn {
  margin-left: auto;
  width: 24px;
  height: 24px;
}

/* 贴着按钮的面板：选项文字靠右，像从按钮“长出来”的菜单 */
.pop .opt-item {
  justify-content: flex-end;
  text-align: right;
}

.pop .opt-item__arrow {
  margin-left: var(--sp-2);
  margin-right: 0;
}

/* ---------- 蛋组标签 ---------- */
.egg-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  border: 1px solid hsl(var(--eg-h, 210) 62% 82%);
  background: hsl(var(--eg-h, 210) 78% 93%);
  color: hsl(var(--eg-h, 210) 45% 30%);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-decoration: none;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.egg-tag:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}

.egg-tag svg {
  display: block;
  flex: none;
}

.egg-tag--sm {
  height: 22px;
  padding: 0 8px;
  gap: 4px;
  font-size: var(--fs-xs);
}

:root[data-theme='dark'] .egg-tag {
  border-color: hsl(var(--eg-h, 210) 34% 34%);
  background: hsl(var(--eg-h, 210) 38% 21%);
  color: hsl(var(--eg-h, 210) 72% 80%);
}

/* ---------- 筛选弹层里的开关行 ---------- */
.filter-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 4px 2px;
}

.filter-row__label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--c-text);
}

.filter-sep {
  height: 1px;
  margin: var(--sp-3) 0;
  background: var(--c-border);
}

.switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c-bg-elevated);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur) var(--ease);
}

.switch.is-on {
  background: var(--c-brand);
  border-color: var(--c-brand);
}

.switch.is-on::after {
  transform: translateX(18px);
}

/* ---------- 精灵卡片（图鉴网格） ---------- */
.dex-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2);
}

.dex-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.dex-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.dex-card:active {
  transform: scale(0.985);
}

.dex-card__art {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 90% at 50% 0%, var(--c-surface-2), var(--c-surface) 70%);
  overflow: hidden;
}

.dex-card__art::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to top, var(--tb, transparent), transparent);
  opacity: 0.1;
}

.dex-card__num {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: 3;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(14, 18, 26, 0.55);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  line-height: 1.35;
  backdrop-filter: blur(3px);
}

.dex-card__types {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-end;
}

/* 精灵图压在底层，编号 / 属性 / 收藏按钮浮在上层 */
.dex-card__art .sprite {
  position: relative;
  z-index: 1;
}

/* 收藏星标：浮在精灵图右下角 */
.dex-card__fav {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 3;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--c-text-3);
  background: color-mix(in srgb, var(--c-surface) 70%, transparent);
  backdrop-filter: blur(4px);
}

.dex-card__fav[aria-pressed='true'] {
  color: var(--c-accent);
}

.dex-card__info {
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
  border-top: 1px solid var(--c-border);
}

.dex-card__name {
  font-weight: 700;
  font-size: var(--fs-md);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dex-empty {
  grid-column: 1 / -1;
  padding: var(--sp-8) var(--sp-4);
  text-align: center;
  color: var(--c-text-3);
}

/* ------------- 精灵图像（有图用图，没图用占位） ------------- */
.sprite {
  position: relative;
  width: 78%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  z-index: 1;
}

.sprite img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.sprite__ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tb, var(--c-brand)) 14%, transparent);
  border: 2px dashed color-mix(in srgb, var(--tb, var(--c-brand)) 45%, transparent);
  color: color-mix(in srgb, var(--tb, var(--c-brand)) 80%, var(--c-text));
  font-weight: 800;
  font-size: clamp(20px, 7vw, 34px);
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.sprite__ph small {
  display: block;
  font-size: 9px;
  font-weight: 600;
  opacity: 0.75;
  letter-spacing: 1px;
  text-align: center;
  line-height: 1;
  margin-top: 2px;
}

.sprite--lg {
  width: 100%;
  max-width: 260px;
}

.sprite--lg .sprite__ph {
  font-size: clamp(40px, 14vw, 64px);
}

.sprite--sm {
  width: 44px;
  flex: none;
}

.sprite--sm .sprite__ph {
  font-size: 13px;
}

.sprite--sm .sprite__ph small {
  display: none;
}

.sprite--xs {
  width: 28px;
  flex: none;
}

.sprite--xs .sprite__ph {
  font-size: 10px;
  border-width: 1px;
}

.sprite--xs .sprite__ph small {
  display: none;
}

/* ---------- 数据表格 ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
}

.table {
  font-size: var(--fs-sm);
  min-width: 560px;
}

.table th,
.table td {
  padding: 9px var(--sp-3);
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--c-surface-2);
  font-weight: 700;
  color: var(--c-text-2);
  font-size: var(--fs-xs);
  letter-spacing: 0.4px;
  cursor: pointer;
  user-select: none;
}

.table th.is-sortable:hover {
  color: var(--c-text);
}

.table th .sort-ind {
  opacity: 0.35;
  margin-left: 2px;
}

.table th[aria-sort='ascending'] .sort-ind,
.table th[aria-sort='descending'] .sort-ind {
  opacity: 1;
  color: var(--c-brand);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: color-mix(in srgb, var(--c-brand) 4%, transparent);
}

.table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table th.num {
  text-align: right;
}

.table .cell-name {
  font-weight: 600;
  color: var(--c-text);
}

/* ---------- 列表行 ---------- */
.list {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  overflow: hidden;
}

.list__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  min-height: 54px;
}

.list__item:last-child {
  border-bottom: none;
}

a.list__item:hover {
  background: var(--c-surface-2);
}

.list__main {
  flex: 1;
  min-width: 0;
}

.list__title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.list__desc {
  font-size: var(--fs-xs);
  color: var(--c-text-3);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.list__chev {
  color: var(--c-text-3);
  width: 18px;
  height: 18px;
  flex: none;
}

/* ---------- 空状态 ---------- */
.empty {
  padding: var(--sp-8) var(--sp-4);
  text-align: center;
  color: var(--c-text-3);
}

.empty__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--sp-3);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c-surface-2);
}

.empty__icon svg {
  width: 24px;
  height: 24px;
}

/* ---------- 加载 / 提示 ---------- */
.skeleton {
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--c-surface-2) 25%, var(--c-border) 37%, var(--c-surface-2) 63%);
  background-size: 400% 100%;
  animation: skeleton 1.2s ease infinite;
}

@keyframes skeleton {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.notice {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--c-brand-soft);
  color: var(--c-brand-strong);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.notice--warn {
  background: color-mix(in srgb, var(--c-warning) 14%, var(--c-surface));
  color: color-mix(in srgb, var(--c-warning) 80%, var(--c-text));
}

.notice--danger {
  background: color-mix(in srgb, var(--c-danger) 12%, var(--c-surface));
  color: color-mix(in srgb, var(--c-danger) 85%, var(--c-text));
}

/* toast */
.toast-layer {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--sp-4));
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}

.toast {
  padding: 9px var(--sp-4);
  border-radius: var(--r-pill);
  background: rgba(20, 24, 34, 0.92);
  color: #fff;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-2);
  animation: fade-in 160ms var(--ease);
}

.toast--error {
  background: var(--c-danger);
}

.toast--success {
  background: var(--c-success);
}

@media (min-width: 900px) {
  .toast-layer {
    bottom: var(--sp-6);
  }
}
