/* ── 变量 ── */
:root {
  --bg: #0f1117;
  --bg-sidebar: #141820;
  --bg-card: #1a1f2e;
  --bg-elevated: #222838;
  --accent: #6c8cff;
  --accent-hover: #8aa4ff;
  --accent-soft: rgba(108, 140, 255, 0.15);
  --text: #e8eaef;
  --text-secondary: #9aa3b5;
  --text-muted: #6b7280;
  --border: #2a3142;
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-w: 88px;
  --topbar-h: 52px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }

.hidden { display: none !important; }

/* ── 布局 ── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0 0 12px;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: contain;
  background: var(--bg-elevated);
  padding: 4px;
}

.sidebar-brand-fallback {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-brand-name {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.25;
  word-break: break-all;
}

.sidebar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  font-size: 11px;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-item:hover { background: var(--bg-elevated); color: var(--text); }

.sidebar-item.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.sidebar-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.sidebar-item.active .sidebar-icon-text {
  color: #fff;
}

.sidebar-item.active .sidebar-icon:has(.sidebar-icon-text) {
  background: var(--accent);
}

.sidebar-icon-text {
  font-size: 14px;
  font-weight: 700;
}

.sidebar-loading {
  padding: 16px 8px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sidebar);
  flex-shrink: 0;
}

.back-btn {
  font-size: 14px;
  color: var(--accent);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.back-btn:hover { background: var(--accent-soft); }

.page-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}

.topbar-spacer { width: 72px; }

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ── 通用区块 ── */
.section { margin-bottom: 28px; }

.section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.section-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.welcome-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}

.welcome-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.game-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

/* ── 轮播 ── */
.carousel {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  width: 100%;
}

.carousel-slide {
  width: 100%;
  /* 宽屏横图：高度随容器宽度等比缩放，并限制上下界 */
  aspect-ratio: 21 / 6;
  max-height: clamp(200px, 32vw, 480px);
  min-height: 160px;
  position: relative;
  overflow: hidden;
  background: var(--bg-elevated);
}

.carousel-slide img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.carousel-slide::before {
  display: none;
}

.carousel-slide h3,
.carousel-slide p {
  position: relative;
  z-index: 1;
}

.carousel-slide h3 { font-size: 20px; margin-bottom: 8px; }
.carousel-slide p { font-size: 13px; color: var(--text-secondary); }

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px;
  background: var(--bg-elevated);
}

.carousel-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.carousel-btn:hover { background: var(--accent-soft); color: var(--accent); }

.carousel-dots { display: flex; gap: 6px; }

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.carousel-dot.active { background: var(--accent); }

/* ── Pill 按钮组 ── */
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all 0.15s;
}

.pill:hover { border-color: var(--accent); color: var(--text); }

.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.pill-static {
  cursor: default;
  pointer-events: none;
}

/* ── 价格表栏目 ── */
.price-section-panel {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0.04) 100%);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: calc(var(--radius) + 4px);
  padding: 20px 22px;
  box-shadow: 0 4px 24px rgba(59, 130, 246, 0.08);
}

.price-section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.price-section-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 2px solid rgba(59, 130, 246, 0.4);
  padding: 6px;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.25);
}

.price-section-logo-fallback {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.35);
}

.price-section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
  letter-spacing: 0.02em;
}

.price-section-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.price-section-empty {
  margin: 0;
}

.price-item-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.price-item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  min-width: 96px;
  max-width: 120px;
  background: #fff;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.price-item-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.price-item-icon {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.price-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.price-item-icon-fallback {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.price-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  text-align: center;
  line-height: 1.35;
  word-break: break-all;
}

.price-list-btn {
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.price-list-btn:hover {
  opacity: 0.95;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.price-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.price-modal {
  max-width: min(960px, 96vw);
  width: 100%;
}

.price-modal-body {
  padding: 16px;
  max-height: 85vh;
  overflow: auto;
}

.price-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* ── 价格表（旧 JSON 样式，后台仍可用） ── */
.poster-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

.poster-panel h3 { font-size: 16px; margin-bottom: 16px; }

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.price-table th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.price-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.price-table tr:last-child td { border-bottom: none; }

.price-table td:nth-child(2) { color: var(--accent); font-weight: 600; }

/* ── 资料卡网格 ── */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.profile-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.profile-card-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: var(--bg-elevated);
}

.profile-card-info { padding: 10px 12px; }

.profile-card-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }

.profile-card-meta { font-size: 12px; color: var(--text-secondary); }

/* ── 陪玩展示（首页左右分栏） ── */
.companion-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.companion-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.companion-column-title {
  font-size: 15px;
  font-weight: 600;
}

.companion-more-btn {
  font-size: 13px;
  color: var(--accent);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  white-space: nowrap;
}

.companion-more-btn:hover { background: var(--accent-soft); }

.companion-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.companion-section .profile-card-img {
  aspect-ratio: 1 / 1;
}

.companion-section .profile-card-info {
  padding: 6px 8px;
}

.companion-section .profile-card-name {
  font-size: 12px;
}

.companion-section .profile-card-meta {
  font-size: 11px;
}

.companion-section .companion-column-head {
  margin-bottom: 8px;
}

.companion-section .companion-column-title {
  font-size: 14px;
}

.companion-section .companion-more-btn {
  font-size: 12px;
}

.companion-split-full .companion-grid {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.companion-page .companion-grid {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.companion-page .profile-card-img {
  aspect-ratio: 1 / 1;
}

.companion-page .profile-card-info {
  padding: 6px 8px;
}

.companion-page .profile-card-name {
  font-size: 12px;
}

.companion-page .profile-card-meta {
  font-size: 11px;
}

.companion-page .companion-column-head {
  margin-bottom: 8px;
}

.companion-page .companion-column-title {
  font-size: 14px;
}

.companion-page .section-desc {
  margin-bottom: 12px;
}

.companion-empty {
  padding: 16px 0;
  font-size: 13px;
}

.companion-page .companion-column { max-width: 100%; }

.empty-tip { font-size: 14px; color: var(--text-muted); padding: 24px 0; }

/* ── 浮层 ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.25s ease;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  font-size: 14px;
  z-index: 2;
  transition: background 0.15s;
}

.modal-close:hover { background: var(--accent-soft); color: var(--accent); }

.modal-body { padding: 24px; }

.modal-layout {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.modal-photos { flex: 0 0 240px; min-width: 200px; }

.modal-photo-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 3/4;
  background: var(--bg-elevated);
}

.modal-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-photo-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.modal-photo-nav button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 16px;
}

.modal-photo-nav button:hover { border-color: var(--accent); color: var(--accent); }

.modal-info { flex: 1; min-width: 220px; }

.modal-name { font-size: 22px; font-weight: 700; margin-bottom: 4px; }

.modal-meta { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }

.modal-field { margin-bottom: 16px; }

.modal-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(108, 140, 255, 0.3);
}

.modal-bio { font-size: 14px; line-height: 1.6; color: var(--text-secondary); }

.modal-price { font-size: 14px; color: var(--accent); font-weight: 600; }

.voice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s;
}

.voice-card:hover { border-color: var(--accent); }

.voice-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.voice-play.playing { background: #e05a5a; }

.voice-text strong { display: block; font-size: 14px; margin-bottom: 2px; }
.voice-text span { font-size: 12px; color: var(--text-muted); }

/* ── 动画 ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 响应式 ── */
@media (max-width: 640px) {
  :root { --sidebar-w: 64px; }

  .sidebar-item { font-size: 10px; padding: 10px 4px; }
  .sidebar-icon { width: 32px; height: 32px; font-size: 12px; }

  .content { padding: 16px; }
  .carousel-slide {
    aspect-ratio: 16 / 7;
    max-height: clamp(140px, 38vw, 280px);
    min-height: 120px;
  }
  .companion-split { grid-template-columns: 1fr; gap: 20px; }
  .companion-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .companion-section .profile-card-name { font-size: 11px; }
  .companion-section .profile-card-meta { font-size: 10px; }
  .companion-page .companion-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
  .modal-layout { flex-direction: column; }
  .modal-photos { flex: none; width: 100%; }
}
