/* 狛荷屋 · 琉璃云母 (Prism Mica) Application Stylesheet */

:root {
  --toy-safe-top: env(safe-area-inset-top, 0px);
  --toy-safe-right: env(safe-area-inset-right, 0px);
  --toy-safe-bottom: env(safe-area-inset-bottom, 0px);
  --toy-safe-left: env(safe-area-inset-left, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }

/* 始终给竖向滚动条留出位置：短页面（养成、深渊、空祈愿）和打开详情面板时，布局不会因为滚动条出现/消失而左右跳动 */
html {
  scrollbar-gutter: stable;
  background-color: var(--mica-canvas);
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--ink-primary);
  background-color: var(--mica-canvas);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button, input, select {
  font: inherit;
  color: inherit;
}

button, a, [role="button"] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tabular { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

/* Whisper-quiet ambient Mica daylight wash */
.mica-ambient {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 68% 42% at 18% -4%, var(--wash-primary), transparent 68%),
    radial-gradient(ellipse 56% 40% at 86% 2%, var(--wash-secondary), transparent 66%);
  transition: background 0.6s var(--ease-out);
}

/* Main App Frame */
.app-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  min-height: var(--toy-vp-height, 100vh);
  max-width: 1640px;
  margin: 0 auto;
}

/* Left Slim Mica Navigation Rail */
.nav-rail {
  position: sticky;
  top: 0;
  height: var(--toy-vp-height, 100vh);
  padding: calc(16px + var(--toy-safe-top)) 12px calc(14px + var(--toy-safe-bottom)) calc(12px + var(--toy-safe-left));
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid var(--line-subtle);
  background: var(--mica-rail);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  text-decoration: none;
  color: var(--ink-primary);
}
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 17px; height: 17px; }
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand-name {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-section-label {
  /* 分组标题：和导航项同字号，靠加粗、墨色和右侧细线区分层级 */
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink-primary);
  padding: 8px 10px 4px;
  letter-spacing: 0.04em;
}
.nav-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-default);
}
.nav-section:first-child .nav-section-label { padding-top: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6.5px 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  font-size: var(--fs-base);
  line-height: 1.35;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.nav-link:hover {
  background: var(--surface-veil);
  color: var(--ink-primary);
}
.nav-link.active {
  background: var(--mica-surface-solid);
  color: var(--ink-primary);
  font-weight: 600;
  border-color: var(--line-subtle);
  box-shadow: var(--shadow-xs);
}
.nav-link.active svg { color: var(--accent); opacity: 1; }
.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-2);
}

.preset-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--ink-tertiary);
  font-size: var(--fs-sm);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.preset-link:hover {
  background: var(--surface-veil);
  color: var(--ink-primary);
}

.rail-footer {
  margin-top: auto;
  padding: 12px 10px 4px;
  border-top: 1px solid var(--line-subtle);
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Main Content Pane */
.main-pane {
  min-width: 0;
  padding: calc(20px + var(--toy-safe-top)) calc(28px + var(--toy-safe-right)) calc(48px + var(--toy-safe-bottom)) 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Page Header Bar */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink-primary);
  white-space: nowrap;
}
.page-count {
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  color: var(--ink-tertiary);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Native-feel Search Input */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 248px;
}
.search-box svg {
  position: absolute;
  left: 11px;
  z-index: 1;
  width: 15px;
  height: 15px;
  color: var(--ink-muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 36px;
  padding: 0 32px 0 33px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-default);
  background: var(--mica-surface);
  box-shadow: var(--specular-top), var(--shadow-xs);
  font-size: var(--fs-md);
  outline: none;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}
.search-input::placeholder { color: var(--ink-muted); }
.search-input:focus {
  background: var(--mica-surface-solid);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.search-kbd {
  position: absolute;
  right: 9px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-default);
  background: var(--surface-pill);
  pointer-events: none;
}
.search-clear {
  position: absolute;
  right: 7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--surface-pill-hover);
  color: var(--ink-secondary);
  font-size: var(--fs-md);
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.search-clear:hover { background: var(--surface-pill-strong); }

.mica-select {
  height: 36px;
  padding: 0 30px 0 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-default);
  background-color: var(--mica-surface);
  box-shadow: var(--specular-top), var(--shadow-xs);
  font-size: var(--fs-sm);
  color: var(--ink-primary);
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.mica-select::-ms-expand { display: none; }
.mica-select:hover { border-color: var(--line-strong); background-color: var(--mica-surface-hover); }
.mica-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }

.segmented-ctrl {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-subtle);
  background: var(--surface-pill);
  gap: 2px;
}
.seg-item {
  height: 28px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--ink-tertiary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.seg-item svg { width: 14px; height: 14px; }
.seg-item:hover { color: var(--ink-primary); }
.seg-item.active {
  background: var(--mica-surface-solid);
  color: var(--ink-primary);
  box-shadow: var(--shadow-xs);
}

/* Filter Bar (Single restrained Mica strip) */
.filter-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-sm);
}

.filter-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.filter-sep {
  width: 1px;
  height: 20px;
  background: var(--line-default);
  margin: 0 2px;
}

.icon-filter-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.icon-filter-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.72;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.icon-filter-btn:hover {
  background: var(--surface-pill);
}
.icon-filter-btn:hover img { opacity: 1; }
.icon-filter-btn.active {
  background: var(--mica-surface-solid);
  border-color: var(--line-default);
  box-shadow: var(--shadow-xs);
}
.icon-filter-btn.active img { opacity: 1; transform: scale(1.06); }

/* Weapon type crisp monochrome icons (auto-invert in dark mode) */
.icon-filter-btn.weapon-icon-btn img {
  filter: brightness(0) saturate(100%) invert(var(--icon-invert, 0));
  opacity: 0.56;
}
.icon-filter-btn.weapon-icon-btn:hover img { opacity: 0.88; }
.icon-filter-btn.weapon-icon-btn.active {
  background: var(--mica-surface-solid);
  border-color: var(--accent-border);
}
.icon-filter-btn.weapon-icon-btn.active img {
  filter: brightness(0) saturate(100%) invert(var(--icon-invert, 0));
  opacity: 0.96;
}

.pill-filter-btn {
  height: 30px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.pill-filter-btn:hover {
  background: var(--surface-pill);
  color: var(--ink-primary);
}
.pill-filter-btn.active {
  background: var(--mica-surface-solid);
  color: var(--ink-primary);
  font-weight: 600;
  border-color: var(--line-default);
  box-shadow: var(--shadow-xs);
}
.pill-filter-btn.r5.active { color: var(--r5-ink); border-color: rgba(197, 142, 46, 0.35); background: var(--r5-pill-bg); }
.pill-filter-btn.r4.active { color: var(--r4-ink); border-color: rgba(127, 99, 196, 0.35); background: var(--r4-pill-bg); }
.pill-filter-btn.r3.active { color: var(--r3-ink); border-color: rgba(78, 134, 184, 0.35); background: var(--r3-pill-bg); }

.reset-filter-btn {
  margin-left: auto;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-default);
  background: transparent;
  color: var(--ink-tertiary);
  font-size: var(--fs-sm);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}
.reset-filter-btn:hover {
  background: var(--mica-surface-solid);
  color: var(--ink-primary);
  border-color: var(--line-strong);
}

/* Responsive Card Grid */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: 14px;
}

.entity-card {
  border-radius: var(--radius-lg);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-xs);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.entity-card:hover {
  background: var(--mica-surface-solid);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.entity-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-art {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid transparent;
}
.card-art.r5 {
  background: linear-gradient(165deg, var(--r5-bg-top) 0%, var(--r5-bg-bot) 100%);
  border-bottom-color: var(--r5-accent);
}
.card-art.r4 {
  background: linear-gradient(165deg, var(--r4-bg-top) 0%, var(--r4-bg-bot) 100%);
  border-bottom-color: var(--r4-accent);
}
.card-art.r3 {
  background: linear-gradient(165deg, var(--r3-bg-top) 0%, var(--r3-bg-bot) 100%);
  border-bottom-color: var(--r3-accent);
}
.card-art.r2 {
  background: linear-gradient(165deg, var(--r2-bg-top) 0%, var(--r2-bg-bot) 100%);
  border-bottom-color: var(--r2-accent);
}
.card-art.r1 {
  background: linear-gradient(165deg, var(--r1-bg-top) 0%, var(--r1-bg-bot) 100%);
  border-bottom-color: var(--r1-accent);
}

.card-art::after {
  content: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.55), transparent 72%);
  pointer-events: none;
}

.card-art img.char-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  position: relative;
  z-index: 1;
  transition: transform 0.36s var(--ease-out);
}
.entity-card:hover .card-art img.char-img {
  transform: scale(1.02);
}

.card-art img.weapon-img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 8px 12px rgba(20, 24, 32, 0.14));
  transition: transform 0.36s var(--ease-out);
}
.entity-card:hover .card-art img.weapon-img {
  transform: scale(1.03);
}

.card-el-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-veil-strong);
  backdrop-filter: blur(8px);
  border: 1px solid var(--surface-rim);
  box-shadow: 0 2px 6px rgba(20, 24, 32, 0.08);
  display: grid;
  place-items: center;
}
.card-el-badge img { width: 15px; height: 15px; object-fit: contain; }

.card-weapon-corner {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  background: var(--surface-veil);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
}
.card-weapon-corner img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(var(--icon-invert, 0));
  opacity: 0.72;
}

.card-rarity-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
  background: var(--surface-veil-strong);
  backdrop-filter: blur(6px);
  border: 1px solid var(--surface-rim);
}
.card-rarity-tag.r5 { color: var(--r5-ink); }
.card-rarity-tag.r4 { color: var(--r4-ink); }
.card-rarity-tag.r3 { color: var(--r3-ink); }
.card-rarity-tag.r2 { color: var(--r2-ink); }
.card-rarity-tag.r1 { color: var(--r1-ink); }

.card-meta {
  padding: 9px 11px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface-veil);
}
.card-name {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-sub {
  font-size: var(--fs-xs);
  color: var(--ink-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

/* Crisp Table View */
.catalog-table-wrap {
  border-radius: var(--radius-lg);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-sm);
  overflow-x: auto;
}
.catalog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-md);
}
.catalog-table th {
  text-align: left;
  padding: 11px 14px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-tertiary);
  border-bottom: 1px solid var(--line-subtle);
  background: var(--surface-muted);
  white-space: nowrap;
}
.catalog-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-subtle);
  vertical-align: middle;
  white-space: nowrap;
}
.catalog-table tbody tr {
  cursor: pointer;
  transition: background-color 0.14s ease;
}
.catalog-table tbody tr:hover { background: var(--surface-veil); }
.catalog-table tbody tr:last-child td { border-bottom: none; }

.tbl-entity-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}
.tbl-thumb {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.tbl-thumb img.char-img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.tbl-thumb img.weapon-img { width: 84%; height: 84%; object-fit: contain; }

/* 除法器外，游戏里的武器图标底部本身就是被裁掉的：贴到底边，让裁切线落在稀有度色条上，而不是悬在半空 */
.card-art img.weapon-img.cut-bottom,
.tbl-thumb img.weapon-img.cut-bottom,
.detail-portrait img.weapon-img.cut-bottom {
  align-self: flex-end;
  height: 92%;
  object-position: center bottom;
  transform-origin: center bottom;
}

/* 风之翼图标直边同时贴紧卡片右上角与左下角：铺满 100% 方形区 */
.card-art img.weapon-img.glider-img,
.tbl-thumb img.weapon-img.glider-img,
.detail-portrait img.weapon-img.glider-img {
  width: 100%;
  height: 100%;
  margin: 0;
  align-self: stretch;
  object-fit: cover;
  object-position: right top;
  transform-origin: center;
}
.tbl-name-en { font-size: var(--fs-xs); color: var(--ink-muted); }

/* Empty State */
.empty-state {
  padding: 64px 20px;
  text-align: center;
  color: var(--ink-tertiary);
  border-radius: var(--radius-lg);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
}
.empty-state p { margin: 0 0 12px; font-size: var(--fs-base); }

/* Slide-Over Frosted Mica Detail Sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--scrim-sheet);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s var(--ease-std);
}
.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.detail-sheet {
  position: fixed;
  top: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 50;
  /* 约占屏幕一半：1440 宽时 760px，1920 宽时约 1000px，最宽 1120px */
  width: min(clamp(760px, 52vw, 1120px), calc(100vw - 20px));
  border-radius: var(--radius-xl);
  background: var(--mica-sheet);
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
  border: 1px solid var(--surface-rim);
  box-shadow: var(--specular-top), var(--shadow-sheet);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(calc(100% + 24px));
  transition: transform 0.34s var(--ease-out);
}
.detail-sheet.open {
  transform: translateX(0);
}

.sheet-grabber {
  display: none;
}

.sheet-topbar {
  flex-shrink: 0;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-subtle);
  background: var(--surface-veil);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sheet-nav-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.sheet-top-title {
  font-size: var(--fs-sm);
  color: var(--ink-tertiary);
  margin-left: 6px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-icon-btn {
  height: 30px;
  min-width: 30px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-default);
  background: var(--mica-surface-solid);
  color: var(--ink-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: var(--fs-sm);
  transition: all 0.14s ease;
}
.sheet-icon-btn[hidden] { display: none; }
.sheet-icon-btn:hover:not(:disabled) {
  color: var(--ink-primary);
  border-color: var(--line-strong);
}
.sheet-icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.sheet-icon-btn svg { width: 14px; height: 14px; }
.sheet-back-btn {
  height: 30px;
  max-width: 176px;
  padding: 0 9px 0 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border);
  background: var(--accent-tint);
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}
.sheet-back-btn[hidden] { display: none; }
.sheet-back-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.sheet-back-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-back-btn:hover {
  background: var(--mica-surface-solid);
  border-color: var(--accent);
}

.sheet-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 28px 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sheet-scroll > * {
  flex-shrink: 0;
}

/* Detail Header */
.detail-hero {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.detail-portrait {
  width: 98px;
  height: 98px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--line-subtle);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  position: relative;
}
.detail-portrait img.char-img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.detail-portrait img.weapon-img { width: 84%; height: 84%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(20, 24, 32,0.16)); }

.detail-ident {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detail-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-title-row h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.detail-en {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
}
.detail-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  background: var(--surface-pill);
  font-size: var(--fs-sm);
  color: var(--ink-secondary);
}
.meta-chip img { width: 14px; height: 14px; object-fit: contain; }
.meta-chip.stars-5 { background: var(--r5-pill-bg); color: var(--r5-ink); }
.meta-chip.stars-4 { background: var(--r4-pill-bg); color: var(--r4-ink); }
.meta-chip.stars-3 { background: var(--r3-pill-bg); color: var(--r3-ink); }

.detail-desc {
  margin: 2px 0 0;
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--ink-secondary);
}

/* Stat Inspector Box */
.stat-box {
  border-radius: var(--radius-lg);
  background: var(--mica-surface-solid);
  border: 1px solid var(--line-subtle);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stat-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.level-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.lv-pill {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-subtle);
  background: var(--mica-canvas);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-secondary);
  cursor: pointer;
}
.lv-pill.active {
  background: var(--ink-primary);
  color: var(--ink-inverse);
  border-color: var(--ink-primary);
}

.stat-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stat-slider-row input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 28px;           /* 加大可点击区域，轨道本身仍是细线 */
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  touch-action: none;     /* 触屏拖动时不触发面板滚动 */
}

.stat-kv-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.stat-kv-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-kv {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--mica-canvas);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-kv span { font-size: var(--fs-xs); color: var(--ink-tertiary); }
.stat-kv strong { font-family: var(--font-mono); font-size: var(--fs-lg); font-weight: 600; color: var(--ink-primary); }

/* Detail Tabs & Skill Cards */
.detail-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line-subtle);
  padding-bottom: 1px;
}
.detail-tab {
  padding: 8px 14px;
  border: none;
  background: transparent;
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--ink-tertiary);
  cursor: pointer;
  position: relative;
}
.detail-tab:hover { color: var(--ink-primary); }
.detail-tab.active {
  color: var(--ink-primary);
  font-weight: 600;
}
.detail-tab.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  border-radius: var(--radius-xs);
  background: var(--accent);
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.skill-card {
  border-radius: var(--radius-lg);
  background: var(--mica-surface-solid);
  border: 1px solid var(--line-subtle);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skill-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.skill-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--stage-emblem-bg);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.skill-icon-wrap img { width: 32px; height: 32px; object-fit: contain; }
.skill-name { font-size: var(--fs-base); font-weight: 600; color: var(--ink-primary); }
.skill-kind { font-size: var(--fs-xs); color: var(--ink-muted); }
.skill-desc {
  font-size: var(--fs-md);
  line-height: 1.72;
  color: var(--ink-secondary);
  white-space: pre-line;
}

/* Light-mode readable rich-text highlights (replacing raw unreadable #FFD780) */
.gi-hl {
  font-weight: 600;
  color: var(--hl-ink);
  background: var(--hl-bg);
  padding: 0 3px;
  border-radius: var(--radius-xs);
}
.gi-el-pyro { font-weight: 600; color: var(--el-pyro); }
.gi-el-hydro { font-weight: 600; color: var(--el-hydro); }
.gi-el-anemo { font-weight: 600; color: var(--el-anemo); }
.gi-el-electro { font-weight: 600; color: var(--el-electro); }
.gi-el-dendro { font-weight: 600; color: var(--el-dendro); }
.gi-el-cryo { font-weight: 600; color: var(--el-cryo); }
.gi-el-geo { font-weight: 600; color: var(--el-geo); }

/* Interactive Talent Hyperlinks & Secondary Nested Expansion */
.gi-link {
  display: inline;
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 1.5px dashed currentColor;
  padding: 0 2px;
  margin: 0;
  font: inherit;
  font-weight: 600;
  line-height: inherit;
  color: var(--hl-ink);
  border-radius: 3px 3px 0 0;
  cursor: pointer;
  text-align: inherit;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}
.gi-hl > .gi-link {
  padding: 0;
  background: none;
}
.gi-link > .gi-hl {
  padding: 0;
  background: none;
}
.gi-link:hover,
.gi-link:focus-visible {
  background: var(--hl-bg);
  outline: none;
}
.gi-link.is-open {
  background: var(--accent-tint);
  color: var(--accent);
  border-bottom-style: solid;
}
.gi-link.is-open > .gi-hl {
  color: inherit;
}

.skill-link-stack:empty { display: none; }
.skill-link-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}
.skill-link-drawer {
  margin-left: calc(var(--link-depth, 0) * 14px);
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-border);
  border-left: 3px solid var(--accent);
  background: var(--mica-surface-subtle);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.skill-link-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.skill-link-title-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex-wrap: wrap;
}
.skill-link-badge {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}
.skill-link-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-primary);
}
.skill-link-close {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 140ms ease, color 140ms ease;
}
.skill-link-close:hover {
  background: var(--surface-pill-hover);
  color: var(--ink-primary);
}
.skill-link-body {
  font-size: var(--fs-sm);
  line-height: 1.68;
  color: var(--ink-secondary);
  white-space: pre-line;
}

/* Skill Multipliers Table */
.mult-details summary {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.mult-details summary::-webkit-details-marker { display: none; }
.mult-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: var(--fs-sm);
}
.mult-table tr { border-top: 1px solid var(--line-subtle); }
.mult-table td { padding: 6px 4px; }
.mult-table td:last-child {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink-primary);
}

/* Refinement Passive Box */
.refine-box {
  border-radius: var(--radius-lg);
  background: var(--mica-surface-solid);
  border: 1px solid var(--line-subtle);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.refine-num {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 0 4px;
  border-radius: var(--radius-xs);
}

/* Materials Grid */
.mat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 8px;
}
.mat-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: var(--radius-md);
  background: var(--mica-surface-solid);
  border: 1px solid var(--line-subtle);
}
.mat-thumb {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.mat-thumb img { width: 28px; height: 28px; object-fit: contain; }

/* 可反查的素材格子：整格可点 */
button.mat-chip {
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
}
.mat-chip.is-link,
.home-domain-head.is-link {
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}
.mat-chip.is-link:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-xs);
}
.mat-chip.is-link:hover .mat-name,
.home-domain-head.is-link:hover .home-domain-name { color: var(--accent); }
.mat-chip.is-link:focus-visible,
.home-domain-head.is-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.mat-info { min-width: 0; }
.mat-name {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mat-qty {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-tertiary);
}

/* Loading skeleton */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: 14px;
}
.skeleton-card {
  height: 205px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--skel-a) 25%, var(--skel-b) 50%, var(--skel-a) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border: 1px solid var(--line-subtle);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 920px) {
  .app-layout { grid-template-columns: 1fr; }
  .search-box { width: 100%; }
  .stat-kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ======================================================
 * 页面切换动效
 * ====================================================== */
@keyframes page-leave {
  to { opacity: 0; transform: translateY(-6px); }
}
@keyframes page-enter {
  from { opacity: 0; transform: translateY(14px); }
}
@keyframes page-card-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
}
.main-pane.is-leaving > * {
  animation: page-leave 160ms cubic-bezier(0.4, 0, 1, 1) forwards;
  pointer-events: none;
}
.main-pane.is-entering > *,
.main-pane.is-entering > .home-shell > *,
.main-pane.is-entering > .ach-shell > * {
  animation: page-enter 520ms var(--ease-out) backwards;
  animation-delay: calc(var(--enter-i, 0) * 45ms);
}
.main-pane.is-entering > .home-shell,
.main-pane.is-entering > .ach-shell { animation: none; }
.main-pane.is-entering :is(.catalog-grid, .shop-goods-grid, .shop-vendors-grid, .suite-grid, .nc-gallery-grid, .books-grid, .art-sets-grid, .tcg-grid, .wish-cols-grid, .home-domain-grid, .home-bday-grid) > * {
  animation: page-card-enter 460ms var(--ease-out) backwards;
  animation-delay: calc(90ms + var(--enter-i, 24) * 16ms);
}

/* 左侧导航：滑动的选中底板 */
.nav-scroll { position: relative; }
.nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: var(--radius-md);
  background: var(--mica-surface-solid);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--shadow-xs);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  box-sizing: border-box;
  transition: transform 420ms var(--ease-out), height 420ms var(--ease-out), width 420ms var(--ease-out), opacity 180ms ease;
}
.nav-indicator::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-2);
}
.nav-indicator.no-anim { transition: none; }
.nav-scroll .nav-link { position: relative; z-index: 1; }
.nav-scroll .nav-link.active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.nav-scroll .nav-link.active::before { display: none; }
@media (max-width: 920px) {
  .nav-indicator { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }
}

/* ======================================================
 * 成就页 (Achievements) — Split Mica Tracker
 * ====================================================== */
.ach-summary-pills {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.primo-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-xs);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-primary);
}
.primo-pill img { width: 15px; height: 15px; object-fit: contain; }

.ach-workspace {
  display: grid;
  grid-template-columns: 274px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
#achWorkspaceHost {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ach-cat-rail {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  padding: 8px;
  border-radius: var(--radius-lg);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ach-cat-item {
  width: 100%;
  flex-shrink: 0;
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}
.ach-cat-item:hover { background: var(--surface-veil); }
.ach-cat-item.active {
  background: var(--mica-surface-solid);
  border-color: var(--line-default);
  box-shadow: var(--shadow-xs);
}
.ach-cat-emblem {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--stage-emblem-bg);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ach-cat-emblem img { width: 22px; height: 22px; object-fit: contain; }
.ach-cat-text { min-width: 0; flex: 1; }
.ach-cat-name {
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ach-cat-item.active .ach-cat-name { font-weight: 600; }
.ach-cat-sub {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1px;
}
.ach-cat-prog {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 2px;
  height: 2px;
  border-radius: var(--radius-xs);
  background: var(--surface-pill);
  overflow: hidden;
}
.ach-cat-prog > i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.25s var(--ease-out);
}

.ach-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ach-banner {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.ach-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}
.ach-banner-emblem {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--stage-emblem-bg);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ach-banner-emblem img { width: 36px; height: 36px; object-fit: contain; }
.ach-banner-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
}
.ach-banner-bar {
  margin-top: 7px;
  height: 5px;
  max-width: 280px;
  border-radius: 99px;
  background: var(--surface-pill-hover);
  overflow: hidden;
}
.ach-banner-bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.3s var(--ease-out);
}

.ach-namecard {
  width: 226px;
  height: 82px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line-default);
  flex-shrink: 0;
  background: var(--stage-emblem-bg);
}
.ach-namecard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ach-namecard-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 10px 6px;
  background: linear-gradient(180deg, transparent, rgba(20, 24, 32, 0.78));
  color: #FFFFFF;
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ach-list {
  border-radius: var(--radius-lg);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-sm);
  overflow: hidden;
}

.ach-row {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-subtle);
  transition: background-color 0.14s ease, opacity 0.16s ease;
}
.ach-row:last-child { border-bottom: none; }
.ach-row:hover { background: var(--surface-veil); }
.ach-row.completed { opacity: 0.62; }

.ach-check {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-strong);
  background: var(--mica-surface-solid);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.14s ease;
}
.ach-check:hover { border-color: var(--accent); }
.ach-check.checked {
  background: var(--accent);
  border-color: var(--accent);
}
.ach-check svg { width: 13px; height: 13px; }

.ach-content { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ach-title-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.ach-name { font-size: var(--fs-base); font-weight: 600; color: var(--ink-primary); }
.ach-hidden-tag {
  font-size: var(--fs-xs);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-pill);
  color: var(--ink-tertiary);
  font-weight: 500;
}
.ach-cat-tag {
  font-size: var(--fs-xs);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: 500;
}
.ach-desc { font-size: var(--fs-sm); color: var(--ink-secondary); line-height: 1.55; }

.ach-stages {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
}
.ach-stage-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-subtle);
  background: var(--surface-muted);
  font-size: var(--fs-sm);
  color: var(--ink-secondary);
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
}
.ach-stage-btn:hover { background: var(--mica-surface-solid); border-color: var(--line-default); }
.ach-stage-btn.done {
  background: var(--accent-tint);
  border-color: var(--accent-border);
  color: var(--ink-primary);
}

.ach-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ach-guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 27px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-subtle);
  background: var(--surface-muted);
  color: var(--ink-secondary);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.ach-guide-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.ach-guide-btn:hover {
  background: var(--accent-tint);
  border-color: var(--accent-border);
  color: var(--accent);
}
.ach-guide-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ach-reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  border: 1px solid var(--line-subtle);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-secondary);
  flex-shrink: 0;
}
.ach-reward img { width: 15px; height: 15px; object-fit: contain; }

/* ======================================================
 * 词典页 (Multilingual Dictionary) — genshin-dictionary.com inspired
 * ====================================================== */
.dict-search-bar {
  position: relative;
  display: flex;
  align-items: center;
}
.dict-search-bar svg {
  position: absolute;
  left: 15px;
  z-index: 1;
  width: 17px;
  height: 17px;
  color: var(--ink-muted);
  pointer-events: none;
}
.dict-search-input {
  width: 100%;
  height: 46px;
  padding: 0 42px 0 44px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-default);
  background: var(--mica-surface-solid);
  box-shadow: var(--specular-top), var(--shadow-sm);
  font-size: var(--fs-base);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.dict-search-input::placeholder { color: var(--ink-muted); }
.dict-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint), var(--shadow-sm);
}

.dict-quick-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: var(--fs-sm);
  color: var(--ink-muted);
}
.dict-quick-chip {
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface);
  color: var(--ink-secondary);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: all 0.14s ease;
}
.dict-quick-chip:hover {
  background: var(--mica-surface-solid);
  border-color: var(--line-default);
  color: var(--ink-primary);
}

.dict-tag-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-xs);
}
.dict-tag-btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: all 0.14s ease;
}
.dict-tag-btn:hover { background: var(--surface-pill); color: var(--ink-primary); }
.dict-tag-btn.active {
  background: var(--mica-surface-solid);
  color: var(--accent);
  font-weight: 600;
  border-color: var(--accent-border);
  box-shadow: var(--shadow-xs);
}

.dict-list-wrap {
  border-radius: var(--radius-lg);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-sm);
  overflow: hidden;
}
.dict-head-row {
  display: grid;
  grid-template-columns: repeat(var(--dict-cols, 3), minmax(0, 1fr));
  gap: 16px;
  padding: 10px 18px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line-subtle);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-tertiary);
}
.dict-entry {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background-color 0.14s ease;
}
.dict-entry:last-child { border-bottom: none; }
.dict-entry:hover { background: var(--surface-veil); }

.dict-terms-grid {
  display: grid;
  grid-template-columns: repeat(var(--dict-cols, 3), minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.dict-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dict-copy-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  width: fit-content;
  max-width: 100%;
  transition: background-color 0.14s ease;
}
.dict-copy-btn:hover { background: var(--accent-tint); }
.dict-term-zh { font-size: var(--fs-base); font-weight: 600; color: var(--ink-primary); word-break: break-word; }
.dict-term-en { font-size: var(--fs-md); font-weight: 500; color: var(--ink-secondary); word-break: break-word; }
.dict-term-ja { font-size: var(--fs-base); font-weight: 500; color: var(--ink-primary); word-break: break-word; }
.dict-kana { font-size: var(--fs-xs); color: var(--ink-muted); padding-left: 1px; }
.dict-copied-badge {
  font-size: var(--fs-xs);
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
}

.dict-meta-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.dict-note {
  font-size: var(--fs-sm);
  color: var(--ink-tertiary);
  line-height: 1.5;
}
.dict-inline-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.dict-inline-tag {
  border: none;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--surface-pill);
  color: var(--ink-tertiary);
  font-size: var(--fs-xs);
  cursor: pointer;
}
.dict-inline-tag:hover { background: var(--accent-tint); color: var(--accent); }

mark.dict-mark {
  background: var(--hl-mark-bg);
  color: inherit;
  padding: 0 1px;
  border-radius: var(--radius-xs);
}

.load-more-bar {
  padding: 14px;
  text-align: center;
  border-top: 1px solid var(--line-subtle);
  background: var(--surface-muted);
}
.load-more-btn {
  padding: 7px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-default);
  background: var(--mica-surface-solid);
  color: var(--ink-primary);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.load-more-btn:hover { border-color: var(--line-strong); }

@media (min-width: 981px) {
  .main-pane:has(> .ach-shell) {
    height: calc(100vh - var(--toy-safe-top) - var(--toy-safe-bottom));
    max-height: 100vh;
    overflow: hidden;
    padding-bottom: 16px;
  }
  .ach-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .ach-shell #achWorkspaceHost {
    flex: 1;
    min-height: 0;
  }
  .ach-shell .ach-workspace {
    flex: 1;
    min-height: 0;
    align-items: stretch;
  }
  .ach-shell .ach-cat-rail {
    position: relative;
    max-height: none;
    height: 100%;
    overscroll-behavior: contain;
  }
  .ach-shell .ach-main {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
  .ach-shell .ach-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 980px) {
  .ach-workspace { grid-template-columns: 1fr; }
  .ach-cat-rail {
    position: static;
    max-height: 220px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .ach-cat-item { min-width: 185px; }
  .dict-head-row { display: none; }
  .dict-terms-grid { grid-template-columns: 1fr; gap: 6px; }
}

/* ======================================================
 * Custom Thin Scrollbars (Refined Mica finish)
 * ====================================================== */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }

/* Elevated Card & Detail Refinements */
.card-art {
  box-shadow: inset 0 0 0 1px var(--line-subtle);
}
.card-meta {
  background: var(--mica-surface);
}
.detail-subtitle {
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--ink-tertiary);
}
.filter-scroll-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

/* ======================================================
 * Custom Frosted MicaSelect Popover Dropdown (Zero native <select>)
 * ====================================================== */
.mica-dd-trigger {
  height: 36px;
  padding: 0 11px 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-default);
  background: var(--mica-surface);
  box-shadow: var(--specular-top), var(--shadow-xs);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 112px;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.mica-dd-trigger.compact {
  height: 30px;
  padding: 0 9px 0 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  min-width: 104px;
}
.mica-dd-trigger:hover {
  border-color: var(--line-strong);
  background: var(--mica-surface-solid);
}
.mica-dd-trigger.open,
.mica-dd-trigger:focus-visible {
  outline: none;
  background: var(--mica-surface-solid);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.mica-dd-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.mica-dd-chevron {
  width: 14px;
  height: 14px;
  color: var(--ink-tertiary);
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-out);
}
.mica-dd-trigger.open .mica-dd-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.mica-dd-menu {
  position: fixed;
  z-index: 120;
  max-height: min(392px, 64vh);
  overflow-y: auto;
  padding: 6px;
  border-radius: var(--radius-lg);
  background: var(--surface-overlay);
  backdrop-filter: blur(28px) saturate(165%);
  -webkit-backdrop-filter: blur(28px) saturate(165%);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-popover);
  opacity: 0;
  transform: scale(0.96) translateY(-4px);
  transition: opacity 0.14s var(--ease-out), transform 0.16s var(--ease-out);
}
.mica-dd-menu.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.mica-dd-group-label {
  padding: 6px 10px 3px;
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.03em;
}
.mica-dd-divider {
  height: 1px;
  background: var(--line-subtle);
  margin: 4px 6px;
}

.mica-dd-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-primary);
  font-size: var(--fs-sm);
  font-weight: 450;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.mica-dd-option:hover,
.mica-dd-option:focus-visible {
  outline: none;
  background: var(--surface-pill);
}
.mica-dd-option.selected {
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: 600;
}
.mica-dd-opt-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mica-dd-opt-meta {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
}
.mica-dd-check {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}
.mica-dd-check-ph {
  width: 14px;
  flex-shrink: 0;
}

/* ======================================================
 * Character & Weapon Media Asset Gallery
 * ====================================================== */
.media-gallery {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.media-checker {
  background-color: var(--stage-checker-a);
  background-image:
    linear-gradient(45deg, var(--stage-checker-b) 25%, transparent 25%),
    linear-gradient(-45deg, var(--stage-checker-b) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--stage-checker-b) 75%),
    linear-gradient(-45deg, transparent 75%, var(--stage-checker-b) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
}

.media-hero-card,
.media-card,
.media-namecard-row {
  border-radius: var(--radius-lg);
  background: var(--mica-surface-solid);
  border: 1px solid var(--line-subtle);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.media-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
  min-height: 0;
}
.media-stage img {
  transition: transform 0.32s var(--ease-out);
  display: block;
}
.media-stage:hover img {
  transform: scale(1.025);
}
.media-stage.hero-stage {
  height: 276px;
  padding: 12px;
}
.media-stage.hero-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.media-stage.tall {
  height: 192px;
  padding: 12px;
}
.media-stage.tall img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.media-stage.square {
  height: 144px;
  padding: 14px;
}
.media-stage.square img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.media-stage.wide-stage {
  height: 112px;
  background: var(--stage-emblem-bg);
}
.media-stage.wide-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.media-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.media-grid.cols-3 .media-stage.tall {
  padding: 26px;
}
.media-grid.cols-3 .media-stage.tall img {
  max-width: 86%;
  max-height: 86%;
}

.media-card-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--line-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--mica-surface-solid);
}
.media-card-foot.compact { padding: 8px 11px; }
.media-card-title { font-size: var(--fs-md); font-weight: 600; color: var(--ink-primary); }
.media-card-sub { font-size: var(--fs-xs); color: var(--ink-muted); margin-top: 1px; }

.media-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-default);
  background: var(--mica-canvas);
  color: var(--ink-primary);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.media-dl-btn svg { width: 13px; height: 13px; }
.media-dl-btn:hover {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: var(--ink-inverse);
}

.media-dl-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-subtle);
  background: var(--mica-canvas);
  color: var(--ink-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.14s ease;
}
.media-dl-icon svg { width: 13px; height: 13px; }
.media-dl-icon:hover {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: var(--ink-inverse);
}

/* ======================================================
 * Full-Screen Asset Lightbox
 * ====================================================== */
.asset-lightbox {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(20, 24, 32, 0.72);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.asset-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lb-topbar {
  flex-shrink: 0;
  padding: calc(12px + var(--toy-safe-top)) calc(18px + var(--toy-safe-right)) 12px calc(18px + var(--toy-safe-left));
  background: var(--surface-overlay);
  border-bottom: 1px solid var(--line-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.lb-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.lb-title { font-size: var(--fs-base); color: var(--ink-primary); }
.lb-sub { font-size: var(--fs-sm); color: var(--ink-tertiary); }
.lb-dim {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-pill);
}
.lb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lb-bg-seg { height: 32px; }
.lb-bg-seg .seg-item { height: 24px; font-size: var(--fs-xs); padding: 0 8px; }

.lb-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--ink-primary);
  color: var(--ink-inverse);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
}
.lb-dl-btn svg { width: 14px; height: 14px; }
.lb-dl-btn:hover { background: var(--accent-solid); color: #FFFFFF; }
.lb-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border);
  background: var(--accent-tint);
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
}
.lb-share-btn svg { width: 14px; height: 14px; }
.lb-share-btn:hover { background: var(--accent-border); }
.lb-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-default);
  background: var(--mica-surface-solid);
  font-size: var(--fs-xl);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.lb-stage {
  flex: 1;
  min-height: 0;
  padding: 24px calc(24px + var(--toy-safe-right)) calc(24px + var(--toy-safe-bottom)) calc(24px + var(--toy-safe-left));
  display: grid;
  place-items: center;
  overflow: auto;
}
.lb-stage img {
  max-width: min(100%, 1180px);
  max-height: calc(100vh - 110px);
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.lb-stage.bg-checker {
  background-color: var(--stage-lb-checker-a);
  background-image:
    linear-gradient(45deg, var(--stage-lb-checker-b) 25%, transparent 25%),
    linear-gradient(-45deg, var(--stage-lb-checker-b) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--stage-lb-checker-b) 75%),
    linear-gradient(-45deg, transparent 75%, var(--stage-lb-checker-b) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.lb-stage.bg-light { background: #FAFBFC; }
.lb-stage.bg-dark { background: #15171B; }

/* Whisper Toast */
.mica-toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + var(--toy-safe-bottom));
  z-index: 200;
  transform: translate(-50%, 14px);
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--toast-bg);
  backdrop-filter: blur(12px);
  color: var(--toast-ink);
  font-size: var(--fs-sm);
  font-weight: 500;
  box-shadow: 0 12px 28px -8px rgba(20, 24, 32, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.24s var(--ease-out);
}
.mica-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ======================================================
 * Mobile First-Class Chrome & Responsive Overrides
 * ====================================================== */
.mobile-safe-scrim,
.mobile-topbar,
.mobile-toy-masthead,
.mobile-bottom-nav,
.ach-mobile-cat-bar {
  display: none;
}

.ach-namecard {
  padding: 0;
  cursor: zoom-in;
  text-align: left;
}
.ach-namecard:hover img { transform: scale(1.04); }
.ach-namecard img { transition: transform 0.3s var(--ease-out); }

@media (max-width: 920px) {
  .nav-rail { display: none !important; }
  [data-toy-top-band="1"] .mobile-safe-scrim {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--toy-safe-top);
    z-index: 25;
    pointer-events: none;
    background: linear-gradient(180deg, var(--mob-scrim-a) 0%, var(--mob-scrim-b) 65%, var(--mob-scrim-c) 100%);
  }
  .mobile-topbar {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    z-index: 30;
    padding: var(--toy-safe-top) calc(12px + var(--toy-safe-right)) 8px calc(12px + var(--toy-safe-left));
    background:
      radial-gradient(ellipse 68% 95% at 14% 0%, var(--accent-tint), transparent 72%),
      radial-gradient(ellipse 56% 90% at 86% 0%, var(--accent-2-tint), transparent 70%),
      linear-gradient(180deg, var(--mob-topbar-top) 0%, var(--mica-canvas) 100%);
    border-bottom: 1px solid var(--line-subtle);
  }
  .mobile-topbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 40px;
  }
  .mob-search-bar {
    flex: 1;
    min-width: 54px;
    max-width: 240px;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--line-default);
    background: var(--surface-veil-strong);
    color: var(--ink-muted);
    font-size: var(--fs-xs);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s ease, color 0.15s ease;
  }
  .mob-search-bar:hover { border-color: var(--accent-border); color: var(--ink-secondary); }
  .mob-search-bar svg { width: 14px; height: 14px; flex-shrink: 0; }
  .mob-search-bar span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-toy-masthead {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0 4px;
    width: 100%;
    pointer-events: auto;
  }
  [data-toy-top-band="1"] .mobile-toy-masthead {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--toy-safe-top);
    padding: 0 104px 8px calc(12px + var(--toy-safe-left));
    pointer-events: none;
  }
  .toy-masthead-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    pointer-events: auto;
  }
  .toy-masthead-charge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid var(--charge-border);
    background: linear-gradient(135deg, var(--charge-bg-a), var(--charge-bg-b));
    color: var(--charge-ink);
    font-size: var(--fs-xs);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    flex-shrink: 0;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
  }
  .toy-masthead-charge svg {
    width: 12px;
    height: 12px;
    color: var(--charge-icon);
    flex-shrink: 0;
  }
  .toy-masthead-charge:hover {
    border-color: var(--charge-border-hover);
    color: var(--charge-ink-hover);
  }
  .toy-masthead-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--surface-veil-strong);
    border: 1px solid var(--accent-border);
    color: var(--ink-secondary);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: var(--shadow-xs);
    min-width: 0;
  }
  .toy-masthead-badge span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .toy-masthead-badge svg,
  .toy-masthead-badge img {
    width: 14px;
    height: 14px;
    color: var(--accent-2);
    object-fit: contain;
    display: block;
    flex-shrink: 0;
  }
  .mobile-topbar .brand-lockup { padding: 0; gap: 6px; flex-shrink: 0; }
  .mobile-topbar .brand-mark { width: 26px; height: 26px; }
  .mobile-topbar .brand-name { white-space: nowrap; font-size: var(--fs-base); }
  .mobile-ver {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: var(--fs-xs);
    color: var(--ink-muted);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--surface-pill);
    flex-shrink: 0;
  }
  @media (max-width: 480px) {
    .mobile-topbar-row { gap: 6px; }
    .mobile-topbar .brand-mark { width: 24px; height: 24px; }
    .mobile-topbar .brand-name { font-size: 14px; }
    .mobile-top-actions { gap: 5px; }
    .mob-search-bar { height: 28px; padding: 0 8px; gap: 4px; }
    .mobile-ver { font-size: 11px; padding: 2px 5px; }
  }

  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    padding: 6px calc(8px + var(--toy-safe-right)) calc(6px + var(--toy-safe-bottom)) calc(8px + var(--toy-safe-left));
    background: var(--surface-veil-strong);
    backdrop-filter: blur(26px) saturate(180%);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    border-top: 1px solid var(--line-subtle);
    box-shadow: 0 -6px 20px -10px rgba(20, 24, 32, 0.08);
  }
  .mob-tab {
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 4px;
    border-radius: var(--radius-md);
    color: var(--ink-tertiary);
    font-size: var(--fs-xs);
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
  }
  .mob-tab svg { width: 19px; height: 19px; }
  .mob-tab.active {
    color: var(--accent);
    font-weight: 600;
  }

  html { scrollbar-gutter: auto; }
  .main-pane {
    padding: 12px calc(14px + var(--toy-safe-right)) calc(82px + var(--toy-safe-bottom)) calc(14px + var(--toy-safe-left));
    gap: 12px;
  }
  .desktop-only-seg { display: none; }
  .header-controls {
    width: 100%;
    gap: 8px;
  }
  .header-controls .search-box {
    flex: 1;
    min-width: 160px;
    width: auto !important;
  }
  .search-input { height: 38px; }
  .search-input,
  .cmd-input,
  .dict-search-input,
  .uid-input,
  input[type="text"],
  input[type="search"],
  input[type="url"],
  textarea,
  select.mica-select {
    font-size: 16px;
  }
  .search-kbd { display: none; }

  .filter-strip {
    padding: 8px 10px;
    border-radius: var(--radius-lg);
  }
  .filter-scroll-row {
    display: flex;
    align-items: center;
    position: relative;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
  }
  .filter-scroll-row:not(:has(.reset-filter-btn)) {
    padding-right: 18px;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
  }
  .filter-scroll-row .reset-filter-btn {
    position: sticky;
    right: 0;
    z-index: 2;
    flex-shrink: 0;
    background: var(--mica-surface-solid);
    box-shadow: -10px 0 12px var(--mica-surface);
  }
  .filter-scroll-row::-webkit-scrollbar { display: none; }
  .filter-group { flex-wrap: nowrap; flex-shrink: 0; }
  .filter-sep { flex-shrink: 0; }

  /* Achievements mobile category picker replaces vertical rail */
  .ach-cat-rail { display: none !important; }
  .ach-mobile-cat-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-lg);
    background: var(--mica-surface);
    border: 1px solid var(--line-subtle);
  }
  .ach-mobile-cat-bar .mica-dd-trigger { width: 100%; }

  /* Full-height native bottom sheet on mobile */
  .detail-sheet {
    top: calc(16px + var(--toy-safe-top));
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    padding-bottom: var(--toy-safe-bottom);
    border-radius: 20px 20px 0 0;
    transform: translateY(105%);
  }
  .detail-sheet.open {
    transform: translateY(0);
  }
  .detail-sheet.is-dragging {
    transition: none !important;
  }
  .showcase-strip {
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 3px 3px 4px;
  }
  .showcase-strip::-webkit-scrollbar { display: none; }
  .sheet-grabber {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 9px 0 3px;
    flex-shrink: 0;
    touch-action: none;
    cursor: grab;
    background: var(--surface-veil);
  }
  .sheet-grabber span {
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: var(--line-strong);
  }
  .mica-toast {
    bottom: calc(78px + var(--toy-safe-bottom));
    max-width: calc(100vw - 32px);
    text-align: center;
  }
  body:has(#backToTopBtn.visible) .mica-toast {
    bottom: calc(124px + var(--toy-safe-bottom));
  }
}

@media (max-width: 600px) {
  .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }
  .catalog-grid.catalog-grid--codex {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .entity-card { border-radius: var(--radius-md); }
  .card-meta { padding: 7px 7px 8px; }
  .catalog-grid.catalog-grid--codex .card-meta { padding: 8px 9px 9px; }
  .card-name { font-size: var(--fs-sm); }
  .catalog-grid.catalog-grid--codex .card-name { font-size: var(--fs-md); }
  .card-sub { font-size: var(--fs-2xs); }
  .catalog-grid.catalog-grid--codex .furn-bp-tag { font-size: var(--fs-2xs); }
  .card-el-badge { top: 5px; left: 5px; width: 20px; height: 20px; }
  .card-el-badge svg { width: 12px; height: 12px; }
  .card-weapon-corner { display: none; }
  .card-rarity-tag { top: 5px; left: 5px; font-size: var(--fs-2xs); padding: 1px 5px; }

  .detail-hero { flex-direction: column; gap: 12px; }
  .detail-portrait { width: 80px; height: 80px; border-radius: var(--radius-lg); }
  .sheet-topbar { padding: 8px 12px 10px; gap: 8px; }
  .sheet-nav-btns { gap: 5px; }
  .sheet-top-title { margin-left: 2px; font-size: var(--fs-xs); }
  .sheet-scroll { padding: 16px 16px 32px; gap: 16px; }
  .detail-tabs {
    overflow-x: auto;
    scrollbar-width: none;
    min-height: 38px;
    flex-shrink: 0;
    padding-right: 18px;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
  }
  .detail-tab { white-space: nowrap; padding: 8px 12px; flex-shrink: 0; }
  .sheet-icon-btn { height: 34px; min-width: 34px; }
  .sheet-back-btn { height: 34px; max-width: 112px; padding: 0 8px 0 5px; }
  .lv-pill { padding: 5px 10px; font-size: var(--fs-sm); }
  .media-dl-icon { width: 34px; height: 34px; }
  .media-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-stage.hero-stage { height: 200px; }
  .ach-namecard { width: 100%; height: 96px; }
  .ach-row { padding: 12px 12px; gap: 11px; }
  .ach-check { width: 24px; height: 24px; position: relative; }
  .ach-check::before { content: ""; position: absolute; inset: -8px; }
  .ach-side { flex-direction: column-reverse; align-items: flex-end; gap: 6px; }
  .ach-guide-btn { height: 30px; padding: 0 10px; }
  .ach-main .filter-strip .filter-sep { display: none; }
  .ach-main .filter-strip { gap: 6px; }
  .dict-entry { padding: 12px 14px; }
  .dict-search-input { height: 42px; }
  .dict-tag-bar:not(.expanded) {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 8px 18px 8px 10px;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
  }
  .dict-tag-bar:not(.expanded)::-webkit-scrollbar { display: none; }
  .dict-tag-bar:not(.expanded) .dict-tag-btn { flex-shrink: 0; }
}

/* ======================================================
 * Official Genshin Original Seven-Element Icon Mask
 * ====================================================== */
.gi-el-icon {
  display: inline-block;
  flex-shrink: 0;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.icon-filter-btn .gi-el-icon {
  opacity: 0.84;
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.icon-filter-btn:hover .gi-el-icon,
.icon-filter-btn.active .gi-el-icon {
  opacity: 1;
  transform: scale(1.06);
}

/* ======================================================
 * 祈愿分析页 (Wishes) — Restrained Prism Mica Analytics
 * ====================================================== */
.mica-primary-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent-solid);
  color: #FFFFFF;
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: var(--shadow-xs);
  transition: background-color 0.15s ease, transform 0.12s ease;
}
.mica-primary-btn svg { width: 15px; height: 15px; }
.mica-primary-btn:hover:not(:disabled) { background: var(--accent-solid-hover); }
.mica-primary-btn:disabled { opacity: 0.55; cursor: wait; }

.wish-onboard {
  padding: 28px 26px 24px;
  border-radius: var(--radius-xl);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.wish-onboard-head h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 600;
}
.wish-onboard-head p {
  margin: 0;
  font-size: var(--fs-md);
  color: var(--ink-tertiary);
}

.wish-methods-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.wish-method-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface-solid);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s var(--ease-out), border-color 0.15s ease, box-shadow 0.2s ease;
}
.wish-method-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
}
.wish-method-card h3 {
  margin: 0;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--ink-primary);
}
.wish-method-card p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--ink-tertiary);
}
.wish-method-card code {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  background: var(--surface-pill);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
}
.wish-method-badge {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-pill);
  color: var(--ink-secondary);
}
.wish-method-badge.primary {
  background: var(--accent-tint);
  color: var(--accent);
}
.wish-onboard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line-subtle);
  font-size: var(--fs-sm);
  color: var(--ink-tertiary);
  flex-wrap: wrap;
  gap: 10px;
}

/* Four-Column Parallel Banner Pull Bars (4-Pool Side-by-Side) */
.wish-cols-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}
.wish-col-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-sm);
  overflow: hidden;
  min-width: 0;
}
.wish-col-head {
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--line-subtle);
  background: var(--surface-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wish-col-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.wish-col-title {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wish-col-total {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--ink-primary);
  flex-shrink: 0;
}
.wish-col-dates {
  font-size: var(--fs-2xs);
  color: var(--ink-muted);
  margin-top: -5px;
}
.wish-col-summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 4px;
  border-top: 1px solid var(--line-subtle);
}
.wish-col-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: var(--ink-tertiary);
}
.wish-col-metric strong {
  font-weight: 600;
  white-space: nowrap;
}
.wish-col-metric strong.avg { color: var(--status-ok-ink); }
.wish-col-metric strong.r5 { color: var(--r5-ink); }
.wish-col-metric strong.r4 { color: var(--r4-ink); }
.wish-col-metric strong.r3 { color: var(--r3-ink); }

.wish-col-rank-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 2px;
  border-radius: var(--radius-sm);
  background: var(--surface-pill);
  border: 1px solid var(--line-subtle);
}
.wish-col-rank-btn {
  height: 24px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--ink-tertiary);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.wish-col-rank-btn:hover { color: var(--ink-primary); }
.wish-col-rank-btn.active {
  background: var(--mica-surface-solid);
  box-shadow: var(--shadow-xs);
}
.wish-col-rank-btn.active.r5 { color: var(--r5-ink); }
.wish-col-rank-btn.active.r4 { color: var(--r4-ink); }

.wish-col-bars {
  flex: 1;
  min-height: 180px;
  max-height: 490px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wish-cbar-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 3px 8px 3px 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-pill);
  overflow: hidden;
}
.wish-cbar-row.is-pity-now {
  background: var(--status-ok-bg);
}
.wish-cbar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: var(--radius-sm);
  pointer-events: none;
  transition: width 0.3s var(--ease-out);
}
.wish-cbar-fill.lucky { background: var(--wish-bar-lucky); }
.wish-cbar-fill.mid { background: var(--wish-bar-mid); }
.wish-cbar-fill.normal { background: var(--wish-bar-normal); }
.wish-cbar-fill.pity { background: var(--wish-bar-pity); }

.wish-cbar-thumb,
.wish-cbar-icon-ph {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.wish-cbar-thumb img.char-img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.wish-cbar-thumb img.weapon-img { width: 88%; height: 88%; object-fit: contain; }
.wish-cbar-name {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wish-cbar-tag {
  position: relative;
  z-index: 1;
  font-size: var(--fs-2xs);
  font-weight: 700;
  line-height: 1;
  padding: 2px 5px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}
.wish-cbar-tag.up {
  color: var(--r5-ink);
  background: var(--r5-pill-bg);
}
.wish-cbar-tag.lost {
  color: var(--status-err-ink);
  background: var(--status-err-bg);
}
.wish-cbar-tag.guar {
  color: var(--status-warn-ink);
  background: var(--status-warn-bg);
}
.wish-cbar-num {
  position: relative;
  z-index: 1;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-primary);
  flex-shrink: 0;
  min-width: 20px;
  text-align: right;
}
.wish-col-empty {
  padding: 28px 10px;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--ink-muted);
}

/* Deep Analytics Panel */
.wish-detail-panel {
  border-radius: var(--radius-lg);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-sm);
  overflow: hidden;
}
.wish-panel-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.wish-panel-title { margin: 0; font-size: var(--fs-base); font-weight: 600; color: var(--ink-primary); }

.wish-pity-badge {
  min-width: 30px;
  height: 24px;
  padding: 0 7px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.wish-pity-badge.lucky { background: var(--status-ok-bg); color: var(--status-ok-ink); }
.wish-pity-badge.normal { background: var(--accent-tint); color: var(--accent); }
.wish-pity-badge.pity { background: var(--status-pity-bg); color: var(--status-pity-ink); }

/* Frosted Import Modal */
.wish-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--scrim-modal);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: calc(16px + var(--toy-safe-top)) calc(16px + var(--toy-safe-right)) calc(16px + var(--toy-safe-bottom)) calc(16px + var(--toy-safe-left));
}
.wish-modal {
  width: min(560px, 100%);
  border-radius: var(--radius-xl);
  background: var(--mica-sheet);
  backdrop-filter: blur(32px) saturate(165%);
  border: 1px solid var(--surface-rim);
  box-shadow: var(--specular-top), var(--shadow-modal);
  overflow: hidden;
}
.wish-modal-body {
  padding: 16px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.wish-import-pane { display: flex; flex-direction: column; gap: 12px; }
.wish-steps {
  margin: 0;
  padding-left: 18px;
  font-size: var(--fs-md);
  line-height: 1.75;
  color: var(--ink-secondary);
}
.wish-dropzone {
  padding: 28px 18px;
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--line-strong);
  background: var(--surface-veil);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.wish-dropzone:hover,
.wish-dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.wish-dropzone strong { font-size: var(--fs-md); color: var(--ink-primary); }
.wish-dropzone span { font-size: var(--fs-sm); color: var(--ink-tertiary); }

.wish-url-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-default);
  background: var(--mica-surface-solid);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  resize: vertical;
  outline: none;
}
.wish-url-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.wish-code-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--surface-pill);
  border: 1px solid var(--line-subtle);
}
.wish-code-box code {
  font-size: var(--fs-xs);
  color: var(--ink-secondary);
  overflow-x: auto;
  white-space: nowrap;
  flex: 1;
}
.wish-status-box {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--accent-tint);
  color: var(--accent);
  font-size: var(--fs-sm);
}
.wish-error-box {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--status-err-bg);
  color: var(--status-err-ink);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

@media (max-width: 1240px) {
  .wish-cols-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .wish-methods-grid { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .mobile-bottom-nav { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 640px) {
  .wish-cols-grid { grid-template-columns: 1fr; }
}

/* ======================================================
 * Left Rail Bottom Profile Dock & Mobile More Popover
 * ====================================================== */
.nav-rail {
  gap: 12px;
}
.nav-scroll {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}
.nav-rail-bottom {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-rail-bottom .rail-footer {
  margin-top: 0;
  padding: 0 10px 2px;
  border-top: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}
.rail-meta .lang-switch { display: inline-grid; }
.rail-ver {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  padding-right: 4px;
  cursor: default;
}

.theme-toggle-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-subtle);
  background: var(--surface-pill);
  color: var(--ink-secondary);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.theme-toggle-btn.compact {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}
.theme-toggle-btn:hover {
  background: var(--mica-surface-solid);
  border-color: var(--line-default);
  color: var(--ink-primary);
}
.theme-toggle-btn svg {
  width: 15px;
  height: 15px;
}
[data-theme-toggle] .theme-ico-sun { display: none; }
[data-theme-toggle] .theme-ico-moon { display: block; }
:root[data-theme="dark"] [data-theme-toggle] .theme-ico-moon { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .theme-ico-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-theme-toggle] .theme-ico-moon { display: none; }
  :root:not([data-theme="light"]) [data-theme-toggle] .theme-ico-sun { display: block; }
}
.nav-profile-link {
  background: var(--surface-veil);
  border-color: var(--line-subtle);
}
.nav-profile-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}
.nav-profile-name {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--ink-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-profile-name[hidden] { display: none; }
.nav-profile-link.active .nav-profile-name { color: var(--accent); }

.mobile-top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.mob-profile-pill {
  height: 30px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface-solid);
  color: var(--ink-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  max-width: 128px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.mob-profile-pill svg { width: 14px; height: 14px; flex-shrink: 0; }
.mob-profile-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mob-profile-pill.active {
  border-color: var(--accent-border);
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: 600;
}

.mobile-more-popover {
  display: none;
  position: fixed;
  right: calc(12px + var(--toy-safe-right));
  bottom: calc(68px + var(--toy-safe-bottom));
  z-index: 45;
  width: 248px;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: var(--mica-sheet);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--surface-rim);
  box-shadow: var(--specular-top), var(--shadow-popover);
  flex-direction: column;
  gap: 6px;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transform-origin: bottom center;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.2s var(--ease-out);
}
.mob-group-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
@media (max-width: 920px) {
  .mobile-more-popover { display: flex; }
  .mobile-more-popover.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
}
.mob-more-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.mob-more-item svg { width: 17px; height: 17px; opacity: 0.8; flex-shrink: 0; }
.mob-more-item:hover { background: var(--surface-pill); color: var(--ink-primary); }
.mob-more-item.active {
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: 600;
}
.mob-more-item.active svg { opacity: 1; color: var(--accent); }

/* ======================================================
 * 圣遗物页 (Artifacts Catalog & 5-Piece Inspector)
 * ====================================================== */
.art-sets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.art-set-card {
  width: 100%;
  padding: 16px 17px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface);
  box-shadow: var(--specular-top), var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.2s ease;
}
.art-set-card:hover {
  background: var(--mica-surface-solid);
  border-color: var(--line-default);
  box-shadow: var(--specular-top), var(--shadow-md);
}
.art-set-head {
  display: flex;
  align-items: center;
  gap: 13px;
}
.art-set-thumb {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.art-set-thumb img {
  width: 86%;
  height: 86%;
  object-fit: contain;
  display: block;
}
.art-set-title-wrap { min-width: 0; flex: 1; }
.art-set-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.art-set-name {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--ink-primary);
}
.art-set-en {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.art-set-bonuses {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.art-bonus-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--fs-sm);
  line-height: 1.58;
  color: var(--ink-secondary);
}
.art-bonus-line > span:last-child {
  white-space: pre-line;
}
.art-bonus-line.detail {
  font-size: var(--fs-md);
  line-height: 1.68;
}
.art-pc-tag {
  flex-shrink: 0;
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-pill);
  color: var(--ink-secondary);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}
.art-pc-tag.p4 {
  background: var(--accent-tint);
  color: var(--accent);
}

.art-pieces-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.art-piece-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-lg);
  background: var(--mica-surface-solid);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--shadow-xs);
}
.art-piece-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.art-piece-icon img {
  width: 86%;
  height: 86%;
  object-fit: contain;
  display: block;
}

/* ======================================================
 * 七圣召唤卡牌页 (Genius Invokation TCG)
 * ====================================================== */
.tcg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 13px;
}
.tcg-card {
  padding: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface);
  box-shadow: var(--specular-top), var(--shadow-xs);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s var(--ease-out), border-color 0.16s ease, box-shadow 0.22s ease;
}
.tcg-card:hover {
  border-color: var(--line-default);
  box-shadow: var(--specular-top), var(--shadow-md);
}
.tcg-face-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 420 / 720;
  background: linear-gradient(160deg, var(--tcg-grad-a), var(--tcg-grad-b));
  overflow: hidden;
}
.tcg-face-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s var(--ease-out);
}
.tcg-card:hover .tcg-face-img {
  transform: scale(1.035);
}
.tcg-art-missing {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--ink-muted);
  font-size: var(--fs-sm);
  text-align: center;
}
.tcg-face-img[hidden], .tcg-art-missing[hidden] {
  display: none;
}
.tcg-badge-hp {
  position: absolute;
  top: 7px;
  left: 7px;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  background: rgba(180, 58, 36, 0.9);
  color: #FFFFFF;
  font-size: var(--fs-xs);
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(20, 24, 32, 0.26);
}
.tcg-badge-energy {
  position: absolute;
  left: 7px;
  bottom: 7px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--surface-veil-strong);
  backdrop-filter: blur(8px);
  color: var(--status-pity-ink);
  font-size: var(--fs-2xs);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(20, 24, 32, 0.16);
}
.tcg-badge-cost {
  position: absolute;
  top: 7px;
  left: 7px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-sm);
  background: var(--surface-veil-strong);
  backdrop-filter: blur(8px);
  color: var(--ink-primary);
  font-size: var(--fs-xs);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 2px 6px rgba(20, 24, 32, 0.18);
}
.tcg-el-corner {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-veil-strong);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(20, 24, 32, 0.16);
}
.tcg-dice-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.tcg-detail-face {
  position: relative;
  width: 118px;
  aspect-ratio: 420 / 720;
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
  cursor: zoom-in;
  border: 1px solid var(--line-subtle);
  box-shadow: var(--shadow-sm);
  background: var(--mica-surface-subtle);
}
.tcg-detail-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ======================================================
 * 我的 · 展柜查询页 (Profile & Showcase)
 * ====================================================== */
.profile-bind-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.profile-bind-grid.single {
  grid-template-columns: minmax(0, 520px);
}
.profile-bind-grid.single.in-modal {
  grid-template-columns: 1fr;
}
.profile-bind-card {
  padding: 22px 22px 20px;
  border-radius: var(--radius-xl);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}
.profile-bind-grid.in-modal .profile-bind-card {
  padding: 18px;
  background: var(--mica-surface-solid);
  box-shadow: var(--shadow-xs);
}
.profile-bind-card h3 {
  margin: 10px 0 6px;
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink-primary);
}
.profile-bind-card p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.62;
  color: var(--ink-tertiary);
}
.uid-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-banner {
  padding: 18px 20px;
  border-radius: var(--radius-xl);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.profile-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.profile-avatar img.char-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.profile-kpi-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.profile-kpi {
  padding: 8px 13px;
  border-radius: var(--radius-md);
  background: var(--mica-surface-solid);
  border: 1px solid var(--line-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 78px;
}
.profile-kpi span {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
}
.profile-kpi strong {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--ink-primary);
}

/* Showcase Stage Enter & Switch Animations */
@keyframes profileStageEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes buildBoardSwitch {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.profile-showcase-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.profile-showcase-stage.is-entering > .profile-banner {
  animation: profileStageEnter 0.28s var(--ease-out) both;
}
.profile-showcase-stage.is-entering > .showcase-strip {
  animation: profileStageEnter 0.32s 0.04s var(--ease-out) both;
}
.profile-showcase-stage.is-entering > .build-board {
  animation: profileStageEnter 0.36s 0.08s var(--ease-out) both;
}
.build-board.is-switching {
  animation: buildBoardSwitch 0.22s var(--ease-out) both;
}
@media (prefers-reduced-motion: reduce) {
  .profile-showcase-stage.is-entering > *,
  .build-board.is-switching {
    animation: none;
  }
}

.showcase-strip {
  display: flex;
  align-items: center;
  gap: 9px;
  overflow-x: auto;
  scroll-padding-inline: 4px;
  scrollbar-width: thin;
  padding: 3px 3px 8px;
}
.showcase-strip::-webkit-scrollbar {
  height: 5px;
}
.showcase-av-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 13px 7px 7px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  flex-shrink: 0;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.showcase-av-pill:hover {
  background: var(--mica-surface-solid);
  border-color: var(--line-default);
}
.showcase-av-pill.active {
  background: var(--mica-surface-solid);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint), var(--shadow-xs);
}
.showcase-av-img {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}
.showcase-av-img img.char-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.showcase-av-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-primary);
  white-space: nowrap;
}
.showcase-av-sub {
  font-size: var(--fs-xs);
  color: var(--ink-tertiary);
  margin-top: 2px;
}

.build-board {
  display: grid;
  grid-template-columns: 344px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.build-col-ident {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.build-char-card,
.build-stats-card {
  padding: 16px 17px;
  border-radius: var(--radius-lg);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-sm);
}
.build-char-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.build-char-top {
  display: flex;
  align-items: center;
  gap: 13px;
}
.build-weapon-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-top: 12px;
  border-top: 1px solid var(--line-subtle);
}
.build-stats-list {
  display: flex;
  flex-direction: column;
}
.build-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5.5px 0;
  border-bottom: 1px solid var(--line-subtle);
  font-size: var(--fs-md);
}
.build-stat-row:last-child { border-bottom: none; }
.build-stat-row span { color: var(--ink-secondary); }
.build-stat-row strong { color: var(--ink-primary); font-weight: 600; }

.cv-help-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: var(--fs-xs);
  font-weight: 600;
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface-subtle);
  color: var(--ink-secondary);
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}
.cv-help-btn:hover,
.cv-help-btn.active {
  border-color: var(--accent-border);
  background: var(--accent-tint);
  color: var(--accent);
}
.cv-help-mark {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: var(--line-subtle);
  font-size: 10px;
  line-height: 1;
}
.cv-help-btn.active .cv-help-mark {
  background: var(--accent);
  color: #fff;
}
.cv-help-note {
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--mica-surface-subtle);
  border: 1px solid var(--accent-border);
  font-size: var(--fs-xs);
  line-height: 1.55;
  color: var(--ink-secondary);
}
.food-card-badge {
  display: inline-block;
  margin-top: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

.build-artifacts-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}
.build-art-card {
  padding: 14px 15px;
  border-radius: var(--radius-lg);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 11px;
}
.build-art-head {
  display: flex;
  align-items: center;
  gap: 11px;
}
.build-art-subs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.build-sub-pill {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-pill);
  font-size: var(--fs-xs);
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.build-sub-pill strong {
  color: var(--ink-primary);
  font-weight: 600;
}
.build-sub-pill.crit {
  background: var(--accent-tint);
  color: var(--accent);
}
.build-sub-pill.crit strong {
  color: var(--accent);
}
.build-sub-pill.dim {
  color: var(--ink-muted);
}
.build-sub-pill.dim strong {
  color: var(--ink-muted);
  font-weight: 500;
}

/* Balanced 6th Cell: Artifact Total Score, Set Bonus & Weights */
.build-art-summary-card {
  background: var(--mica-surface);
  justify-content: space-between;
  gap: 10px;
}
.build-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.build-summary-eyebrow {
  font-size: var(--fs-xs);
  color: var(--ink-tertiary);
  font-weight: 600;
}
.build-summary-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 1px;
}
.build-summary-score strong {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--ink-primary);
}
.build-summary-score span {
  font-size: var(--fs-xs);
  color: var(--ink-tertiary);
}
.build-summary-sets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.build-summary-weights {
  padding-top: 8px;
  border-top: 1px solid var(--line-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.build-summary-rule-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--ink-tertiary);
}
.build-summary-rule-title span {
  color: var(--ink-muted);
}
.build-weight-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.build-weight-chip {
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--surface-pill);
  color: var(--ink-secondary);
  font-size: var(--fs-2xs);
  font-weight: 500;
}

@media (max-width: 1080px) {
  .art-sets-grid { grid-template-columns: 1fr; }
  .build-board { grid-template-columns: 1fr; }
  .profile-bind-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .tcg-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }
  .tcg-card { border-radius: var(--radius-md); }
  .tcg-badge-hp,
  .tcg-badge-cost { top: 5px; left: 5px; height: 20px; font-size: var(--fs-2xs); padding: 0 5px; }
  .tcg-el-corner { top: 5px; right: 5px; width: 20px; height: 20px; }
  .tcg-badge-energy { left: 5px; bottom: 5px; font-size: var(--fs-2xs); padding: 1px 5px; }
  .art-set-card { padding: 13px 14px; }
  .art-set-thumb { width: 46px; height: 46px; }
  .profile-banner { padding: 14px; }
  .profile-kpi { flex: 1 1 82px; padding: 7px 10px; }
  .uid-form { flex-direction: column; align-items: stretch; }
  .build-artifacts-col { grid-template-columns: 1fr; }
}

/* ======================================================
 * Global Command Palette (Ctrl + K) — Frosted Spotlight
 * ====================================================== */
.rail-cmd-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 38px;
  padding: 0 9px 0 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-subtle);
  background: var(--surface-veil);
  color: var(--ink-tertiary);
  font-size: var(--fs-md);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.rail-cmd-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.rail-cmd-btn kbd {
  margin-left: auto;
  font-size: var(--fs-2xs);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: var(--surface-pill);
  color: var(--ink-muted);
  border: 1px solid var(--line-subtle);
}
.rail-cmd-btn:hover {
  background: var(--mica-surface-solid);
  border-color: var(--line-default);
  color: var(--ink-primary);
}

.mob-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface-solid);
  color: var(--ink-secondary);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.mob-icon-btn svg { width: 15px; height: 15px; }

.cmd-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: var(--scrim-modal);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: min(11vh, 92px) 16px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}
.cmd-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.cmd-modal {
  width: min(620px, 100%);
  max-height: min(74vh, 580px);
  border-radius: var(--radius-xl);
  background: var(--surface-overlay);
  backdrop-filter: blur(36px) saturate(185%);
  -webkit-backdrop-filter: blur(36px) saturate(185%);
  border: 1px solid var(--surface-rim);
  box-shadow: var(--specular-top), var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(-8px) scale(0.985);
  transition: transform 0.2s var(--ease-out);
}
.cmd-backdrop.open .cmd-modal {
  transform: translateY(0) scale(1);
}
.cmd-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-subtle);
}
.cmd-search-ico {
  width: 18px;
  height: 18px;
  color: var(--ink-muted);
  flex-shrink: 0;
}
.cmd-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: var(--fs-base);
  color: var(--ink-primary);
}
.cmd-input::placeholder { color: var(--ink-muted); }
.cmd-kbd {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-pill);
  color: var(--ink-muted);
  border: 1px solid var(--line-subtle);
  flex-shrink: 0;
}
.cmd-recent-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line-subtle);
  background: var(--surface-muted);
  overflow-x: auto;
}
.cmd-results {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 8px 10px;
}
.cmd-group-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-muted);
  padding: 9px 10px 4px;
  letter-spacing: 0.02em;
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.12s ease;
}
.cmd-item.active,
.cmd-item:hover {
  background: var(--accent-tint);
}
.cmd-thumb {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-bottom: none;
}
.cmd-thumb img.char-img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cmd-thumb img.weapon-img { width: 86%; height: 86%; object-fit: contain; }
.cmd-tcg-thumb { background: var(--mica-surface-subtle); }
.cmd-icon-placeholder {
  background: var(--surface-pill);
  color: var(--ink-tertiary);
}
.cmd-icon-placeholder svg { width: 16px; height: 16px; }
.cmd-item-main { min-width: 0; flex: 1; }
.cmd-item-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-primary);
}
.cmd-item-sub {
  font-size: var(--fs-xs);
  color: var(--ink-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.cmd-copy-mini {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface-solid);
  color: var(--ink-secondary);
  font-size: var(--fs-xs);
  cursor: pointer;
  flex-shrink: 0;
}
.cmd-copy-mini:hover { border-color: var(--accent); color: var(--accent); }
.cmd-item-badge {
  font-size: var(--fs-xs);
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--surface-pill);
  color: var(--ink-tertiary);
  flex-shrink: 0;
}
.cmd-item.active .cmd-item-badge {
  background: var(--mica-surface-solid);
  color: var(--accent);
}
.cmd-empty {
  padding: 40px 18px;
  text-align: center;
}
.cmd-empty p { margin: 0 0 6px; font-size: var(--fs-base); color: var(--ink-primary); }
.cmd-empty span { font-size: var(--fs-sm); color: var(--ink-muted); }
.cmd-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--line-subtle);
  background: var(--surface-muted);
  font-size: var(--fs-xs);
  color: var(--ink-muted);
}
.cmd-footer kbd {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  padding: 1px 4px;
  border-radius: var(--radius-xs);
  background: var(--mica-surface-solid);
  border: 1px solid var(--line-subtle);
  color: var(--ink-secondary);
  margin: 0 2px;
}

/* ======================================================
 * Profile Cross-Links & Showcase Card PNG Export Modal
 * ====================================================== */
.build-action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.build-remove-av-btn {
  height: 34px;
  padding: 0 10px;
  gap: 5px;
  font-size: var(--fs-sm);
  flex-shrink: 0;
  color: var(--ink-secondary);
}
.build-remove-av-btn svg {
  width: 15px;
  height: 15px;
}
.build-remove-av-btn:hover {
  color: var(--danger, #c43e3e);
  border-color: rgba(196, 62, 62, 0.35);
}
.build-link-row {
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background-color 0.14s ease;
}
.build-link-row:hover {
  background: var(--accent-tint);
}
.build-set-link:hover {
  filter: brightness(0.95);
}

.card-export-modal {
  width: min(1040px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.card-export-stage {
  padding: 16px 20px;
  background: var(--stage-export-bg);
  overflow: auto;
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 0;
}
.card-export-preview {
  width: 100%;
  height: auto;
  max-height: 68vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 44px -16px rgba(20, 24, 32, 0.25);
  display: block;
}
.card-export-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--line-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .cmd-backdrop { padding: 14px 10px 14px; }
  .cmd-modal { max-height: 82vh; border-radius: var(--radius-lg); }
  .cmd-footer { display: none; }
  .card-export-stage { padding: 10px; }
  .card-export-foot { padding: 10px 14px; }
}

/* ======================================================
 * 原魔图鉴 & 提瓦特 6合1 百科 (Monsters, Codex & Mechanics)
 * ====================================================== */
.mon-resist-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.mon-resist-cell {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--surface-pill);
  border: 1px solid var(--line-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mon-resist-cell.high {
  background: var(--status-err-bg);
  border-color: var(--status-err-border);
}
.mon-resist-cell.high strong { color: var(--status-err-ink); }
.mon-resist-cell.low {
  background: var(--status-ok-bg);
  border-color: var(--status-ok-border);
}
.mon-resist-cell.low strong { color: var(--status-ok-ink); }
.mon-resist-lbl {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  color: var(--ink-tertiary);
}
.mon-resist-cell strong {
  font-size: var(--fs-base);
  color: var(--ink-primary);
}
.mon-drop-btn {
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}
.mon-drop-btn:hover {
  border-color: var(--accent-border);
  background: var(--mica-surface-solid);
}

.codex-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: var(--radius-lg);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-xs);
  overflow-x: auto;
  scrollbar-width: none;
}
.codex-tabs-bar::-webkit-scrollbar { display: none; }
.codex-tab-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.codex-tab-btn:hover { color: var(--ink-primary); background: var(--surface-veil); }
.codex-tab-btn.active {
  background: var(--mica-surface-solid);
  color: var(--accent);
  font-weight: 600;
  border-color: var(--line-subtle);
  box-shadow: var(--shadow-xs);
}

/* Namecard Wide Gallery */
.nc-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.nc-card {
  border-radius: var(--radius-lg);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-xs);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease, border-color 0.16s ease;
}
.nc-card:hover {
  border-color: var(--line-default);
  box-shadow: var(--specular-top), var(--shadow-md);
}
.nc-banner-wrap {
  aspect-ratio: 21 / 10;
  background: var(--stage-emblem-bg);
  overflow: hidden;
  cursor: zoom-in;
}
.nc-banner-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s var(--ease-out);
}
.nc-card:hover .nc-banner-wrap img { transform: scale(1.04); }
.nc-card-foot {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-veil-strong);
}

/* Books Library & Editorial Porcelain Reader */
.books-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.book-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface);
  box-shadow: var(--specular-top), var(--shadow-xs);
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s var(--ease-out), border-color 0.15s ease, background-color 0.15s ease;
}
.book-card:hover {
  background: var(--mica-surface-solid);
  border-color: var(--line-default);
}
.book-vol-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.book-reader-paper {
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: var(--surface-paper);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.book-reader-paper h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  color: var(--ink-primary);
}
.book-intro {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-pill);
  font-size: var(--fs-sm);
  color: var(--ink-tertiary);
  line-height: 1.65;
  white-space: pre-line;
}
.book-content {
  font-size: var(--fs-base);
  line-height: 1.9;
  color: var(--ink-primary);
  white-space: pre-line;
  word-break: break-word;
}

/* Reverse-Lookup Entity Pills */
.rev-entity-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.rev-entity-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface-solid);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-primary);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.14s ease, color 0.14s ease, background-color 0.14s ease;
}
.rev-entity-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-tint);
}
.rev-entity-pill .wish-five-avatar,
.wish-five-avatar.sm {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  padding: 0;
  aspect-ratio: 1 / 1;
}
.rev-entity-pill .wish-five-avatar img,
.wish-five-avatar.sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Serenitea Pot Furnishing Suites (Gift Sets) */
.suite-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.suite-mode-switch {
  height: 32px;
  padding: 2px;
}
.suite-mode-switch .seg-item {
  height: 26px;
  padding: 0 11px;
  font-size: var(--fs-sm);
}
.suite-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.suite-card {
  border-radius: var(--radius-lg);
  background: var(--mica-surface);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--specular-top), var(--shadow-xs);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease, border-color 0.16s ease, background-color 0.16s ease;
}
.suite-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-default);
  background: var(--mica-surface-solid);
  box-shadow: var(--specular-top), var(--shadow-md);
}
.suite-banner-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--stage-emblem-bg);
  overflow: hidden;
}
.suite-banner-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s var(--ease-out);
}
.suite-card:hover .suite-banner-wrap img {
  transform: scale(1.04);
}
.suite-badge {
  position: absolute;
  top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-primary);
  background: var(--mica-surface-solid);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--shadow-xs);
}
.suite-badge.top-left { left: 8px; }
.suite-badge.top-right { right: 8px; }
.suite-badge.is-gift {
  color: var(--accent);
  border-color: var(--accent-line);
}
.suite-card-body {
  padding: 11px 13px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  min-width: 0;
}
.suite-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--ink-secondary);
}
.suite-primogem-tag {
  color: var(--accent);
  font-weight: 600;
}
.suite-card-route {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suite-fav-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}
.suite-fav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--line-subtle);
  padding: 0;
}
.suite-fav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.suite-fav-more {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-secondary);
  padding: 0 5px;
}
.suite-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.suite-detail-banner {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: zoom-in;
  background: var(--stage-emblem-bg);
  border: 1px solid var(--line-subtle);
}
.suite-detail-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.suite-detail-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.suite-piece-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.suite-piece-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface);
  text-align: left;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}
.suite-piece-btn.is-link {
  cursor: pointer;
}
.suite-piece-btn.is-link:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.suite-piece-btn:disabled {
  opacity: 0.92;
  cursor: default;
}
.suite-piece-thumb {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  overflow: hidden;
}
.suite-piece-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.suite-piece-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.suite-piece-name {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suite-piece-src {
  font-size: 11px;
  color: var(--ink-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suite-piece-qty {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-secondary);
  flex-shrink: 0;
}
.codex-source-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 13px;
  border-radius: var(--radius-md);
  background: var(--surface-pill);
  border: 1px solid var(--line-subtle);
}
.codex-source-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.codex-source-k {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.codex-source-v {
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--ink-primary);
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.codex-source-note {
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--ink-secondary);
  padding-top: 6px;
  margin-top: 2px;
  border-top: 1px dashed var(--line-subtle);
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.codex-source-note-k {
  font-weight: 600;
  color: var(--ink-tertiary);
  flex-shrink: 0;
}
.furn-bp-tag {
  font-size: 11px;
  line-height: 1.35;
  color: var(--ink-tertiary);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-source-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 1px 7px;
  border-radius: 999px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suite-story-lines {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.suite-story-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.suite-story-role {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent);
}
.suite-story-text {
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--ink-primary);
}
.char-teapot-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-pill);
  border: 1px solid var(--line-subtle);
}
.char-teapot-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-secondary);
  flex-shrink: 0;
}
.char-teapot-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.char-teapot-pill {
  padding: 3px 10px 3px 4px;
}
.char-teapot-cat {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 1px 6px;
  border-radius: 999px;
}

/* Overworld Permanent NPC Shops */
.shop-goods-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.shop-good-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 13px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface);
  box-shadow: var(--specular-top), var(--shadow-xs);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s var(--ease-out), border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.18s ease;
}
.shop-good-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-default);
  background: var(--mica-surface-solid);
  box-shadow: var(--specular-top), var(--shadow-md);
}
.shop-good-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.shop-item-thumb {
  border-radius: var(--radius-md);
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.shop-no-icon {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--ink-secondary);
}
.shop-good-ident {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.shop-good-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.shop-cat-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--surface-pill);
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-subtle);
}
.shop-price-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-primary);
  background: var(--surface-pill);
  border: 1px solid var(--line-subtle);
  padding: 1px 7px;
  border-radius: 999px;
}
.shop-price-pill strong {
  font-weight: 700;
}
.shop-price-pill.is-discount {
  color: var(--accent);
  background: var(--accent-tint);
  border-color: var(--accent-line);
}
.shop-price-orig {
  color: var(--ink-muted);
  text-decoration: line-through;
  font-weight: 400;
}
.shop-good-offers {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line-subtle);
}
.shop-good-offer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--fs-xs);
}
.shop-offer-place {
  color: var(--ink-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.shop-offer-meta {
  color: var(--ink-muted);
  flex-shrink: 0;
}
.shop-offer-more {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 1px;
}
.shop-vendors-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.shop-vendor-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface);
  box-shadow: var(--specular-top), var(--shadow-xs);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s var(--ease-out), border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.18s ease;
}
.shop-vendor-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-default);
  background: var(--mica-surface-solid);
  box-shadow: var(--specular-top), var(--shadow-md);
}
.shop-vendor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.shop-vendor-sub {
  font-size: var(--fs-xs);
  color: var(--ink-secondary);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-vendor-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.shop-preview-chip {
  font-size: 11px;
  color: var(--ink-secondary);
  background: var(--surface-pill);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
}
.shop-preview-more {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  padding: 2px 4px;
}
.shop-vendor-foot {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--line-subtle);
  font-size: var(--fs-xs);
  color: var(--ink-muted);
}
.shop-offer-list,
.shop-shelf-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.shop-offer-item,
.shop-shelf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}
.shop-offer-item:hover,
.shop-shelf-row:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.shop-offer-left,
.shop-shelf-mid {
  min-width: 0;
  flex: 1;
}
.shop-offer-shop,
.shop-shelf-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-offer-npc {
  font-weight: 400;
  color: var(--ink-secondary);
}
.shop-offer-loc,
.shop-shelf-cat {
  font-size: var(--fs-xs);
  color: var(--ink-secondary);
  margin-top: 2px;
}
.shop-offer-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}
.shop-limit-chip {
  font-size: 11px;
  color: var(--ink-muted);
  background: var(--surface-pill);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
}

@media (max-width: 1080px) {
  .nc-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .books-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .suite-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-goods-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-vendors-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.nav-link {
  padding: 6.5px 10px;
}
.mobile-more-popover {
  width: min(156px, calc(100vw - 24px));
  padding: 8px;
  gap: 5px;
}
.mob-more-sec {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-muted);
  padding: 2px 6px;
}
.mob-more-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}
.mob-more-grid .mob-more-item {
  padding: 9px 12px;
  font-size: var(--fs-md);
  border-radius: var(--radius-md);
  background: var(--surface-pill);
  justify-content: center;
}
.mob-more-grid .mob-more-item.active {
  background: var(--accent-tint);
  color: var(--accent);
}
@media (max-width: 600px) {
  .nc-gallery-grid { grid-template-columns: 1fr; }
  .books-grid { grid-template-columns: 1fr; }
  .suite-grid { grid-template-columns: 1fr; }
  .suite-detail-hero { grid-template-columns: 1fr; }
  .suite-piece-grid { grid-template-columns: 1fr; }
  .shop-goods-grid { grid-template-columns: 1fr; }
  .shop-vendors-grid { grid-template-columns: 1fr; }
  .mon-resist-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-reader-paper { padding: 15px 15px; }
}

/* ======================================================
 * High-FPS Rendering & GPU Compositor Performance Layer
 * (Keep true backdrop-filter strictly on floating chrome;
 *  use off-screen content-visibility skipping on dense grids)
 * ====================================================== */
.entity-card,
.tcg-card,
.art-set-card,
.nc-card,
.book-card,
.suite-card,
.shop-good-card,
.shop-vendor-card,
.wish-pool-card,
.wish-detail-panel,
.build-char-card,
.build-stats-card,
.build-art-card,
.profile-bind-card,
.profile-banner,
.ach-list,
.dict-list-wrap,
.dict-tag-bar,
.filter-strip,
.home-wish-card,
.home-event-card,
.home-bday-card,
.home-domain-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: var(--mica-surface);
}

.entity-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 215px;
}
.tcg-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 290px;
}
.art-set-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 186px;
}
.nc-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 210px;
}
.book-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 76px;
}
.ach-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 74px;
}
.dict-entry {
  content-visibility: auto;
  contain-intrinsic-size: auto 92px;
}

/* ======================================================
 * Multi-Language Prism Mica Switcher (简 / EN / 日)
 * ====================================================== */
.lang-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-md);
  background: var(--surface-pill);
  border: 1px solid var(--line-subtle);
}
.lang-switch.compact {
  display: inline-grid;
  padding: 2px;
  border-radius: var(--radius-sm);
}
.lang-btn {
  height: 27px;
  padding: 0 7px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-tertiary);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.lang-switch.compact .lang-btn {
  height: 24px;
  padding: 0 6px;
  font-size: var(--fs-xs);
  border-radius: var(--radius-sm);
}
.lang-btn:hover {
  color: var(--ink-primary);
}
.lang-btn.active {
  background: var(--mica-surface-solid);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(20, 24, 32, 0.09);
}


/* ======================================================
 * Home Dashboard Information Feed (首页信息流)
 * ====================================================== */
.home-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.home-ver-pill {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--accent-tint);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}

.home-clock-pill {
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--mica-surface-subtle);
  border: 1px solid var(--line-subtle);
  color: var(--ink-tertiary);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

/* Home Sections */
.home-section {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.home-section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--ink-primary);
  letter-spacing: -0.01em;
}

.home-count-chip {
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--mica-surface-subtle);
  border: 1px solid var(--line-subtle);
  color: var(--ink-tertiary);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.home-ghost-btn {
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-default);
  background: var(--mica-surface);
  color: var(--ink-secondary);
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.14s ease, color 0.14s ease, background-color 0.14s ease;
}

.home-ghost-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--mica-surface-solid);
}

.home-empty-card {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line-default);
  background: var(--mica-surface);
  color: var(--ink-tertiary);
  font-size: var(--fs-sm);
}

.home-section-head > :not(h2):not(.home-count-chip):not(.home-domain-title-group) {
  margin-left: auto;
}

/* 活动描述拆成的标签 */
.home-sub-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.home-sub-tag {
  padding: 1px 8px;
  border-radius: var(--radius-sm);
  background: var(--mica-surface-subtle);
  color: var(--ink-secondary);
  font-size: var(--fs-xs);
  line-height: 1.6;
  white-space: nowrap;
}

/* Wish Banner Full-Width Stack */
.home-wish-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-wish-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 15px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.home-wish-card:hover {
  border-color: var(--line-default);
  box-shadow: var(--shadow-sm);
}

.home-wish-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--r5-bg-top), var(--r5-bg-bot));
  border: 1px solid rgba(197, 142, 46, 0.25);
  display: grid;
  place-items: center;
  padding: 5px;
}

.home-wish-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-wish-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-wish-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.home-wish-titles {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-wish-roster {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.home-avatar-pill {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--mica-surface-solid);
  box-shadow: 0 1px 3px rgba(20, 24, 32, 0.14);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), border-color 0.15s ease;
}

.home-avatar-pill.r5 {
  background: linear-gradient(180deg, var(--r5-bg-top), var(--r5-bg-bot));
}

.home-avatar-pill.r4 {
  background: linear-gradient(180deg, var(--r4-bg-top), var(--r4-bg-bot));
}

.home-avatar-pill:hover {
  transform: none;
  border-color: var(--accent);
}

.home-avatar-pill img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Standard Events 2-Column Grid */
.home-event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-event-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 15px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.home-event-card.is-clickable {
  cursor: pointer;
}

.home-event-card:hover {
  border-color: var(--line-default);
  box-shadow: var(--shadow-sm);
}

.home-event-card.is-clickable:hover {
  border-color: var(--accent-border);
}

.home-event-thumb {
  flex-shrink: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface-subtle);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.home-event-thumb.sq {
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: var(--radius-md);
}

.home-event-thumb.sq img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-event-thumb.wide {
  width: 84px;
  height: 48px;
  padding: 0;
  background: var(--ink-secondary);
}

.home-event-thumb.wide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-event-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-event-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.home-event-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.home-event-title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.35;
}

.home-event-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: var(--fs-sm);
  color: var(--ink-tertiary);
  line-height: 1.4;
}

.home-date-span {
  color: var(--ink-muted);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

/* Category & Countdown Pills */
.home-cat-pill.kind-flagship,
.home-cat-pill.kind-chronicled { border-color: rgba(197, 142, 46, 0.45); color: var(--r5-ink); }

.home-cat-pill {
  padding: 1px 7px;
  border-radius: var(--radius-xs);
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
  background: transparent;
  color: var(--ink-tertiary);
  border: 1px solid var(--line-default);
}


.home-cd-pill {
  flex-shrink: 0;
  padding: 2px 9px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.home-cd-pill.active {
  background: var(--mica-surface-subtle);
  color: var(--ink-secondary);
}

.home-cd-pill.urgent {
  background: var(--accent-2-tint);
  color: var(--accent-2);
}

.home-cd-pill.upcoming {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}

.home-progress-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--line-subtle);
}

.home-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  opacity: 0.7;
}

/* Character Birthdays */
.home-bday-today-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.home-bday-spotlight {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(197, 142, 46, 0.38);
  background: var(--mica-surface);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s ease;
}

.home-bday-spotlight:hover {
  box-shadow: var(--shadow-sm);
}

.home-bday-spot-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

.home-bday-spot-avatar.r5 { background: linear-gradient(180deg, var(--r5-bg-top), var(--r5-bg-bot)); }
.home-bday-spot-avatar.r4 { background: linear-gradient(180deg, var(--r4-bg-top), var(--r4-bg-bot)); }
.home-bday-spot-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.home-bday-spot-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-bday-today-tag {
  align-self: flex-start;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: rgba(197, 142, 46, 0.18);
  color: var(--r5-ink);
  font-size: var(--fs-2xs);
  font-weight: 700;
}

.home-bday-spot-info strong {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-base);
  color: var(--ink-primary);
}

.home-bday-spot-info small {
  font-size: var(--fs-xs);
  color: var(--ink-tertiary);
}

.home-bday-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

.home-bday-card {
  padding: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s var(--ease-out), border-color 0.15s ease, box-shadow 0.15s ease;
}

.home-bday-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-sm);
}

.home-bday-art {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  overflow: hidden;
}

.home-bday-art.r5 { background: linear-gradient(180deg, var(--r5-bg-top), var(--r5-bg-bot)); }
.home-bday-art.r4 { background: linear-gradient(180deg, var(--r4-bg-top), var(--r4-bg-bot)); }

.home-bday-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-bday-in {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 1px 5px;
  border-radius: 99px;
  background: var(--surface-veil-strong);
  backdrop-filter: blur(8px);
  color: var(--ink-primary);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(20, 24, 32, 0.12);
}

.home-bday-foot {
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--mica-surface);
}

.home-bday-name {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-bday-date {
  font-size: var(--fs-2xs);
  color: var(--ink-tertiary);
}

/* Today's Farmable Domains */
.home-domain-bar {
  align-items: center;
}

.home-domain-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-day-badge {
  padding: 2px 8px;
  border-radius: 99px;
  background: transparent;
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--accent-border);
}

.home-domain-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.home-domain-controls .segmented-ctrl {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.home-domain-controls .segmented-ctrl::-webkit-scrollbar {
  display: none;
}

.home-domain-controls .seg-item {
  white-space: nowrap;
  padding: 0 8px;
  font-size: var(--fs-xs);
}

.home-domain-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-domain-card {
  padding: 11px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-subtle);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.home-domain-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.home-domain-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  padding: 3px;
  background: var(--mica-surface-subtle);
  object-fit: contain;
}

.home-domain-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-domain-name {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-domain-region {
  font-size: var(--fs-xs);
  color: var(--ink-tertiary);
}

.home-domain-roster {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.home-dom-entity {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-subtle);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.home-dom-entity.r5 { background: linear-gradient(180deg, var(--r5-bg-top), var(--r5-bg-bot)); }
.home-dom-entity.r4 { background: linear-gradient(180deg, var(--r4-bg-top), var(--r4-bg-bot)); }
.home-dom-entity.r3 { background: linear-gradient(180deg, var(--r3-bg-top), var(--r3-bg-bot)); }

.home-dom-entity:hover {
  border-color: var(--accent);
}

.home-dom-entity img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-dom-more {
  height: 32px;
  padding: 0 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-subtle);
  background: var(--mica-surface-subtle);
  color: var(--ink-tertiary);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
}

.home-dom-more:hover {
  color: var(--accent);
  border-color: var(--accent-border);
}

.home-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.home-col {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.home-col-left .home-event-grid {
  grid-template-columns: 1fr;
}

.home-col-right .home-domain-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-col-right .home-bday-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 1199px) {
  .home-columns { grid-template-columns: 1fr; gap: 22px; }
  .home-bday-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .home-domain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .home-event-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .home-col-right .home-bday-grid,
  .home-bday-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .home-col-right .home-domain-grid,
  .home-domain-grid { grid-template-columns: 1fr; }
  .home-wish-card { padding: 11px 12px 14px; gap: 10px; align-items: flex-start; }
  .home-wish-thumb { width: 42px; height: 42px; }
  .home-wish-top { flex-direction: column; gap: 6px; }
  .home-avatar-pill { width: 36px; height: 36px; }
  .home-event-thumb.wide { width: 72px; height: 44px; }
  .home-event-thumb.sq { width: 44px; height: 44px; }
}


/* ======================================================
 * 角色卡片底部：按元素着浅色
 * ====================================================== */
.card-meta.el-pyro    { background: var(--el-bg-pyro); }
.card-meta.el-hydro   { background: var(--el-bg-hydro); }
.card-meta.el-anemo   { background: var(--el-bg-anemo); }
.card-meta.el-electro { background: var(--el-bg-electro); }
.card-meta.el-dendro  { background: var(--el-bg-dendro); }
.card-meta.el-cryo    { background: var(--el-bg-cryo); }
.card-meta.el-geo     { background: var(--el-bg-geo); }

/* 页内分段切换：滑动底板 + 内容浮现（js/tab-glider.js） */
.has-glider { isolation: isolate; }
.has-glider:not(.ach-cat-rail) { position: relative; }
.tab-glider {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-style: solid;
  box-sizing: border-box;
  pointer-events: none;
}
.tab-glider.is-underline {
  border: none;
  background: var(--accent);
  border-radius: var(--radius-xs);
  z-index: 2;
}
.tab-glider.is-moving {
  transition: transform 320ms var(--ease-out), width 320ms var(--ease-out), height 320ms var(--ease-out);
}
.has-glider > .seg-item,
.has-glider > .pill-filter-btn,
.has-glider > .detail-tab,
.has-glider > .wish-col-rank-btn,
.has-glider > .ach-cat-item,
.has-glider > .dict-tag-btn { position: relative; z-index: 1; }
.has-glider > .glide-target,
.has-glider > .glide-target:hover {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  transition: color 0.15s ease !important;
}
.has-glider > .detail-tab.glide-target::after { opacity: 0 !important; }
.tab-enter {
  animation: page-enter 380ms var(--ease-out) backwards;
  animation-delay: calc(var(--tab-enter-i, 0) * 40ms);
}
.tab-enter :is(.catalog-grid, .shop-goods-grid, .shop-vendors-grid, .suite-grid, .nc-gallery-grid, .books-grid, .art-sets-grid, .tcg-grid, .home-domain-grid, .media-grid, .mat-grid) > * {
  animation: page-card-enter 360ms var(--ease-out) backwards;
  animation-delay: calc(50ms + var(--enter-i, 24) * 12ms);
}
@media (prefers-reduced-motion: reduce) {
  .tab-glider.is-moving,
  .tab-enter,
  .tab-enter :is(.catalog-grid, .shop-goods-grid, .shop-vendors-grid, .suite-grid, .nc-gallery-grid, .books-grid, .art-sets-grid, .tcg-grid, .home-domain-grid, .media-grid, .mat-grid) > * {
    transition: none;
    animation: none;
  }
}

/* 书籍正文排版 */
.book-content .book-sec-title {
  margin: 4px 0 2px;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink-primary);
  line-height: 1.5;
  white-space: normal;
}
.book-content .book-center {
  text-align: center;
  color: var(--ink-secondary);
  font-weight: 600;
  margin: 2px 0;
}
.book-content .book-region-sep {
  border: none;
  border-top: 1px dashed var(--line-default);
  margin: 18px 0 14px;
}
.book-content .book-para + .book-para { margin-top: 6px; }

/* ======================================================
 * 侧栏「充电」按钮与 Toy 3 分钟强制关注弹窗
 * ====================================================== */
.nav-charge-link {
  background: linear-gradient(135deg, var(--charge-bg-a), var(--charge-bg-b));
  border-color: var(--charge-border);
  color: var(--charge-ink);
  font-weight: 600;
}
.nav-charge-link svg {
  color: var(--charge-icon);
}
.nav-charge-link:hover {
  background: linear-gradient(135deg, var(--charge-bg-hover-a), var(--charge-bg-hover-b));
  border-color: var(--charge-border-hover);
  color: var(--charge-ink-hover);
}
.nav-charge-text {
  flex: 1;
  min-width: 0;
}
.nav-charge-arrow {
  font-size: var(--fs-xs);
  color: var(--charge-arrow);
  opacity: 0.85;
}

.follow-dialog {
  width: min(408px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100% - 24px);
  margin: auto;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--surface-rim);
  border-radius: var(--radius-xl);
  background: var(--mica-sheet);
  backdrop-filter: blur(32px) saturate(165%);
  color: var(--ink-primary);
  box-shadow: var(--specular-top), var(--shadow-modal);
}
.follow-dialog::backdrop {
  background: var(--scrim-dialog);
  backdrop-filter: blur(4px);
}
.follow-dialog-body {
  padding: 24px 24px 18px;
}
.follow-dialog-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.follow-dialog-badge {
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.follow-dialog h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--ink-primary);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
}
.follow-dialog-status {
  margin: 8px 0 18px;
  color: var(--ink-secondary);
  font-size: var(--fs-sm);
  line-height: 1.65;
}
.follow-dialog-profile {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-default);
  border-radius: var(--radius-lg);
  background: var(--surface-veil);
}
.follow-dialog-profile img {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
}
.follow-dialog-author {
  display: grid;
  gap: 2px;
  align-content: center;
  font-size: var(--fs-xs);
  line-height: 1.4;
  color: var(--ink-tertiary);
  overflow-wrap: anywhere;
}
.follow-dialog-platform {
  color: var(--accent);
  font-weight: 600;
}
.follow-dialog-author strong {
  color: var(--ink-primary);
  font-size: 16px;
}
.follow-dialog-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.follow-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-default);
  background: var(--surface-veil);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
}
.follow-chip::before {
  content: '○';
  font-size: 11px;
  opacity: 0.7;
}
.follow-chip.is-done {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-tint);
  color: var(--accent);
}
.follow-chip.is-done::before {
  content: '✓';
  opacity: 1;
}
.follow-dialog-actions {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}
.follow-dialog-btn-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.follow-dialog-btn-row > [hidden] {
  display: none;
}
.follow-dialog-btn-row > :only-child,
.follow-dialog-btn-row > .follow-dialog-visit:first-child:has(+ [hidden]),
.follow-dialog-btn-row > [hidden] + .follow-dialog-visit {
  grid-column: 1 / -1;
}
.follow-dialog-visit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 32px 0 18px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent-solid);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.12s ease;
}
.follow-dialog-visit--video {
  background: #FB7299;
}
.follow-dialog-visit:hover:enabled {
  filter: brightness(1.06);
}
.follow-dialog-visit:active:enabled {
  transform: scale(0.99);
}
.follow-dialog-visit:disabled {
  opacity: 0.6;
  cursor: default;
}
.follow-dialog-arrow {
  position: absolute;
  right: 12px;
  font-size: 15px;
  line-height: 1;
}
.follow-dialog-retry {
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-secondary);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}
.follow-dialog-retry:hover:enabled {
  background: var(--surface-pill);
  color: var(--ink-primary);
}
.follow-dialog-retry:disabled {
  opacity: 0.55;
  cursor: default;
}

@media (max-width: 540px) {
  .follow-dialog {
    width: 100%;
    margin-bottom: 0;
    border-radius: 22px 22px 0 0;
  }
  .follow-dialog-body {
    padding: 22px 20px calc(16px + var(--toy-safe-bottom));
  }
}

/* ======================================================
 * 手机顶栏：Logo + 搜索 + 「更多」菜单（语言 / 深色模式 / 版本号）
 * ====================================================== */
@media (max-width: 920px) {
  /* 普通浏览器 / 非 Toy 顶带模式下合并为单行顶栏 */
  html:not([data-toy-top-band="1"]) .mobile-topbar {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding-top: calc(8px + var(--toy-safe-top));
    padding-bottom: 8px;
  }
  html:not([data-toy-top-band="1"]) .mobile-topbar-row { display: contents; }
  html:not([data-toy-top-band="1"]) .mobile-topbar .brand-lockup { order: 1; }
  html:not([data-toy-top-band="1"]) .mob-search-bar { order: 2; }
  html:not([data-toy-top-band="1"]) .mobile-toy-masthead {
    order: 3;
    width: auto;
    padding: 0;
    flex-shrink: 0;
    margin-left: auto;
  }
  html:not([data-toy-top-band="1"]) .toy-masthead-badge { display: none; }
  html:not([data-toy-top-band="1"]) .toy-masthead-charge { height: 30px; padding: 0 10px; }
  html:not([data-toy-top-band="1"]) .mobile-top-actions { order: 4; }

  .mobile-top-actions { position: relative; flex-shrink: 0; gap: 0; }
  .mob-menu-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--line-default);
    background: var(--surface-veil-strong);
    color: var(--ink-secondary);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s ease, color 0.15s ease;
  }
  .mob-menu-btn svg { width: 17px; height: 17px; }
  .mob-menu-btn:hover,
  .mob-menu-btn.active { border-color: var(--accent-border); color: var(--ink-primary); }
  .mob-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-lg);
    background: var(--mica-surface-solid);
    border: 1px solid var(--line-default);
    box-shadow: var(--shadow-popover);
  }
  .mob-menu-panel[hidden] { display: none; }
  .mob-menu-row { display: flex; align-items: center; gap: 10px; }
  .mob-menu-panel .lang-switch.compact .lang-btn { height: 30px; padding: 0 11px; font-size: var(--fs-sm); }
  .mob-menu-panel .theme-toggle-btn.compact { width: 34px; height: 34px; border-radius: var(--radius-md); }
  .mob-menu-panel .theme-toggle-btn svg { width: 16px; height: 16px; }
  .mob-menu-panel .mobile-ver { align-self: flex-end; }
  .mob-menu-panel .mobile-ver:empty { display: none; }

  /* 首页标题行：版本、时间标签放不下时换行，不再超出屏幕 */
  .page-title-wrap { flex-wrap: wrap; row-gap: 6px; min-width: 0; max-width: 100%; }
  .home-ver-pill,
  .home-clock-pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}

/* 窄屏：搜索收成图标按钮，靠右和「更多」并排 */
@media (max-width: 600px) {
  .mob-search-bar {
    flex: 0 0 36px;
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    height: 36px;
    padding: 0;
    gap: 0;
    margin-left: auto;
    justify-content: center;
    color: var(--ink-secondary);
  }
  .mob-search-bar svg { width: 17px; height: 17px; }
  .mob-search-bar span { display: none; }
  html:not([data-toy-top-band="1"]) .mobile-toy-masthead { order: 2; margin-left: auto; }
  html:not([data-toy-top-band="1"]) .mob-search-bar { order: 3; margin-left: 0; }
}

/* ======================================================
 * Floating Back-to-Top Button
 * ====================================================== */
.back-to-top-btn {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 40;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line-default);
  background: var(--mica-surface-solid);
  color: var(--ink-secondary);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.22s var(--ease-out), color 0.14s ease, border-color 0.14s ease;
}
.back-to-top-btn[hidden] { display: none; }
.back-to-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top-btn:hover {
  color: var(--accent);
  border-color: var(--accent-border);
}
.back-to-top-btn svg { width: 18px; height: 18px; }
@media (max-width: 920px) {
  .back-to-top-btn {
    right: 14px;
    bottom: calc(74px + var(--toy-safe-bottom, env(safe-area-inset-bottom, 0px)));
  }
}

@media (hover: none) and (pointer: coarse) {
  .entity-card:hover,
  .shop-good-card:hover,
  .shop-vendor-card:hover {
    transform: none;
  }
  .entity-card:active,
  .shop-good-card:active,
  .shop-vendor-card:active,
  .suite-card:active,
  .art-set-card:active,
  .book-card:active,
  .tcg-card:active,
  .mob-tab:active,
  .mob-more-item:active,
  .back-to-top-btn:active {
    transform: scale(0.98);
  }
}
