/* ==============================================================
   前台 + 后台 基础样式
   设计 token：css/tokens.css（单一事实源，--app-* 命名）
   字体：系统字体栈（规范 3.2，不加载远程字体）
   规范：docs/UI_GUIDELINES.adapted.md
   ============================================================== */

/* 字体：统一使用 tokens.css 的 --app-font 系统字体栈（规范 3.2：不加载远程字体）。
   原 `@font-face { font-family: 'Google Sans'; src: local(...) }` 别名已无人引用，于阶段 2c 移除。 */
/* --------------------------------------------------------------
   设计 token 已迁移到 css/tokens.css
   （单一事实源，--app-* 命名；本文件必须在 tokens.css 之后引入）。
   本文件只消费 token，不再定义任何设计变量。
   -------------------------------------------------------------- */

/* --------------------------------------------------------------
   旧 [data-theme="light"] 覆盖块已于阶段 2c 移除。
   它用字面色值另维护了一套 --bg-* / --text-* / --border-* / --shadow-* 覆盖，
   在 data-theme="light" 时会把配色退回迁移前状态 —— 违反规范 3.1
   「禁止页面单独维护另一套颜色」。现在明/暗都由 tokens.css 的 :root 统一提供，
   阶段 3 做深色主题时只需在 :root.dark 重映射同一批 token。
   -------------------------------------------------------------- */
/* ==============================================================
   RESET & BASE
   ============================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
*::selection { background: var(--app-primary); color: var(--app-on-action); }

html { scroll-behavior: smooth; }

body {
  font-family: var(--app-font-body);
  background: var(--app-canvas);
  color: var(--app-text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* Remove Spider-Verse decorations */
body::before, body::after { display: none; }
#web-canvas { display: none; }
.web-decoration { display: none; }

/* ==============================================================
   LAYOUT
   ============================================================== */
.page-container {
  max-width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 72px 16px 0;
  position: relative;
  z-index: 10;
}

/* ==============================================================
   TOP NAV — Clean Google header
   ============================================================== */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border-soft);
  transition: box-shadow var(--app-duration) ease;
}

.top-nav.scrolled {
  box-shadow: var(--app-shadow-xs);
}

.top-nav-inner {
  max-width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
}

.top-nav .nav-logo {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--app-surface-soft);

}

.top-nav .nav-logo::before { display: none; }
.top-nav .nav-logo:hover { box-shadow: none; }
.top-nav .nav-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.top-nav .nav-title {
  flex: 1;
  font-family: var(--app-font-display);
  font-size: var(--app-fs-xl);
  font-weight: 500;
  color: var(--app-text);
}

.top-nav .nav-actions { display: flex; align-items: center; gap: 8px; }

.top-nav .nav-btn{
  width: 40px; height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--app-text-subtle);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--app-duration-fast) ease, color var(--app-duration-fast) ease;
}

.top-nav .nav-btn::before { display: none; }

.top-nav .nav-btn:hover {
  background: var(--app-surface-soft);
  color: var(--app-text);
  box-shadow: none;
}

/* ==============================================================
   BUTTONS — Material Design
   ============================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--app-font-display);
  font-size: var(--app-fs-sm);
  font-weight: 500;
  padding: 10px 24px;
  text-decoration: none;
  border-radius: var(--app-radius);
  transition: all var(--app-duration) ease;
  border: 1px solid var(--app-border);
  cursor: pointer;
  white-space: nowrap;
  background: var(--app-surface);
  color: var(--app-action-primary);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  background: var(--app-primary-container);
  border-color: transparent;
  box-shadow: none;
}

.btn-primary {
  background: var(--app-action-primary);
  color: var(--app-on-action);
  border-color: transparent;
  box-shadow: none;
}

.btn-primary::before { display: none; }

.btn-primary:hover {
  background: var(--app-action-primary-hover);
  color: var(--app-on-action);
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.form-group .form-hint { font-size: var(--app-fs-xs); color: var(--app-text-muted); margin-top: 6px; font-family: var(--app-font-body); }

/* ==============================================================
   SEARCH BAR — Google-style
   ============================================================== */
.search-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-xs);
  transition: box-shadow var(--app-duration), border-color var(--app-duration), background var(--app-duration);
  position: relative;
}

.search-bar:focus-within {
  border-color: transparent;
  box-shadow: var(--app-focus-ring);
  background: var(--app-surface);
}

.search-bar .search-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--app-text-muted); }

.search-bar input {
  flex: 1; border: none; background: none; outline: none;
  font-size: var(--app-fs-md); color: var(--app-text); font-family: var(--app-font-body);
  line-height: 1.5;
}

.search-bar input::placeholder { color: var(--app-text-muted); font-style: normal; }

/* ==============================================================
   STATUS / BADGE
   ============================================================== */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: var(--app-radius-pill);
  font-size: var(--app-fs-xs); font-weight: 500;
  text-transform: none;
  font-family: var(--app-font-body);
  border: none;
  box-shadow: none;
}

.status-badge.active { background: var(--app-surface-success); color: var(--app-action-success); }
.status-badge.rented { background: var(--app-surface-danger); color: var(--app-action-danger); }
.status-badge.maintenance { background: var(--app-surface-warning); color: var(--app-action-warning); }

.status-badge::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ==============================================================
   TABLE — Clean data tables
   ============================================================== */
.game-table-wrapper { overflow-x: auto; }
.game-table { width: 100%; border-collapse: collapse; font-size: var(--app-fs-sm); }

.game-table th {
  text-align: left; padding: 12px 20px;
  font-size: var(--app-fs-xs); font-weight: 500;
 text-transform: none;
  color: var(--app-text-subtle);
  background: var(--app-surface-soft);
  border-bottom: 1px solid var(--app-border);
  font-family: var(--app-font-body);
}

.game-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--app-border-soft);
}

.game-table tr:last-child td { border-bottom: none; }
.game-table tr { transition: background var(--app-duration-fast); }
.game-table tbody tr:hover { background: var(--app-surface-soft); }

.game-table .game-name-text { display: flex; align-items: center; gap: 10px; }

.game-table .game-icon {
  width: 24px; height: 24px;
  display: inline-block; vertical-align: middle;
  border-radius: var(--app-radius-tag);
  filter: none;
  transition: none;
}

.game-table .game-icon:hover { transform: none; }

/* ==============================================================
   GAME LIST CARDS (mobile)
   紧凑清单：容器承担卡片外观（白底/边框/圆角），行与行之间
   只用 1px 分隔线 —— 不给每行独立卡片，把密度留给内容。
   行本身不可点击（纯展示），因此不受触控区 44px 约束。
   ============================================================== */
.game-list-cards { display: none; }

@media (max-width: 640px) {
  .game-table-wrapper { display: none; }
  .game-list-cards {
    display: flex; flex-direction: column;
    background: var(--app-surface);
    border: 1px solid var(--app-border-soft);
    border-radius: var(--app-radius);
    overflow: hidden;
  }
}

.game-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--app-border-soft);
  min-width: 0;
}

.game-list-item:last-child { border-bottom: none; }

.game-list-item .game-icon-sm {
  width: 22px; height: 22px;
  flex-shrink: 0;
  border-radius: var(--app-radius-xs);
  background: var(--app-surface-soft);
  display: inline-flex; align-items: center; justify-content: center;
  filter: none;
  transition: none;
}

.game-list-item .game-icon-sm:hover { transform: none; }
.game-list-item .game-info { flex: 1; min-width: 0; }
.game-list-item .game-info h4 {
  font-size: var(--app-fs-sm); font-weight: 500; line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.game-list-item .game-info span { font-size: var(--app-fs-xs); color: var(--app-text-muted); font-family: var(--app-font-body); }

/* ==============================================================
   BACK LINK
   ============================================================== */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--app-fs-sm); color: var(--app-link);
  text-decoration: none; cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--app-radius);
  background: transparent;
  border: none;
  font-weight: 500;
  transition: background var(--app-duration-fast);
}

.back-link:hover {
  transform: none;
  color: var(--app-link-hover);
  background: var(--app-primary-container);
  box-shadow: none;
}

/* ==============================================================
   EMPTY STATE
   ============================================================== */
.empty-state {
  text-align: center; padding: 64px 24px;
  color: var(--app-text-muted);
}

.empty-state .empty-icon{
 margin-bottom: 16px; display: inline-block;
  line-height: 1;
  filter: none;
}

.empty-state .empty-icon img {
  width: 64px; height: 64px;
  display: block; border-radius: var(--app-radius);
  border: 2px dashed var(--app-border);
  padding: 12px;
  margin: 0 auto 16px;
}

.empty-state h3 {
  font-family: var(--app-font-display);
  font-size: var(--app-fs-xl);
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--app-text);
  text-transform: none;
}

.empty-state p { font-size: var(--app-fs-sm); color: var(--app-text-muted); }

/* ==============================================================
   LOADING
   ============================================================== */
.loading-spinner { display: flex; align-items: center; justify-content: center; padding: 40px; }

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--app-border-soft);
  border-top-color: var(--app-action-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.sidebar-overlay.active { display: block; }

.sidebar-nav .nav-item.active {
  background: var(--app-primary-container);
  color: var(--app-status-primary);
  border-left-color: var(--app-status-primary);
  font-weight: 500;
}

.modal-overlay.active { display: flex; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==============================================================
   SKELETON
   ============================================================== */
.skeleton {
  background: var(--app-surface-soft);
  border-radius: var(--app-radius);
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}

/* 规范 3.3/6：禁止装饰性渐变与循环位移动画，改用不透明度脉冲表达「加载中」 */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

.skeleton-card {
  padding: 20px;
  background: var(--app-surface);
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius);
  margin-bottom: 12px;
  box-shadow: none;
}

.skeleton-icon { width: 40px; height: 40px; border-radius: var(--app-radius); margin-bottom: 12px; }
.skeleton-title { height: 16px; width: 60%; margin-bottom: 8px; }
.skeleton-text { height: 12px; width: 100%; margin-bottom: 6px; }
.skeleton-icon-sm { width: 32px; height: 32px; border-radius: var(--app-radius); flex-shrink: 0; }

.skeleton-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--app-surface);
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius);
  margin-bottom: 8px;
  box-shadow: none;
}

.skeleton-notice {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: var(--app-surface);
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius);
  margin-bottom: 10px;
  box-shadow: none;
}

.skeleton-dot {
  width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0;
}

/* ==============================================================
   PAGINATION
   ============================================================== */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 20px; flex-wrap: wrap;
}

.pagination-btn, .pagination-page {
  padding: 8px 16px; min-width: 36px;
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  color: var(--app-text-subtle);
  font-size: var(--app-fs-sm); font-weight: 500;
  cursor: pointer;
  box-shadow: none;
  transition: background var(--app-duration-fast), color var(--app-duration-fast), border-color var(--app-duration-fast);
}

.pagination-btn:hover:not(:disabled),
.pagination-page:hover:not(:disabled) {
  background: var(--app-surface-soft);
  color: var(--app-text);
  border-color: var(--app-border);
  transform: none;
  box-shadow: none;
}

.pagination-btn:disabled { opacity: .35; cursor: not-allowed; }
.pagination-page.active {
  background: var(--app-status-primary);
  color: var(--app-on-action);
  border-color: transparent;
}

.pagination-pages { display: flex; gap: 4px; }
.pagination-ellipsis {
  display: flex; align-items: center; padding: 0 8px;
  color: var(--app-text-muted); font-family: var(--app-font-body);
}

.pagination-info {
  font-size: var(--app-fs-xs); color: var(--app-text-muted);
  margin-left: 12px; font-family: var(--app-font-body);
}

/* ==============================================================
   SEARCH HIGHLIGHT
   ============================================================== */
.highlight {
  background: var(--app-surface-warning);
  color: var(--app-text);
  padding: 1px 4px;
  border-radius: var(--app-radius-xs);
  font-weight: 700;
}

/* ==============================================================
   PAGE TRANSITION
   ============================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-transition { animation: fadeInUp .3s cubic-bezier(.2,0,0,1) both; }

/* ==============================================================
   HOME — HERO (Google Search style)
   ============================================================== */
.home-header {
  position: relative;
  padding: 5rem 5vw 2.5rem;
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  z-index: 10;
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.home-header::before { display: none; }
.home-header::after { display: none; }

.home-logo {
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: var(--app-icon-2xl);
  border: none;
  position: relative;
  overflow: hidden;
  box-shadow: none;

}

.home-logo::before { display: none; }

.home-logo img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.home-logo:hover { transform: none; }

.home-title {
  font-family: var(--app-font-display);
  font-size: clamp(var(--app-fs-title), 5vw, var(--app-fs-display));
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  text-transform: none;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: var(--app-text);
  background-clip: unset;
  color: var(--app-text);
}

.home-title em {
  font-style: normal;
  display: inline;
  -webkit-text-fill-color: var(--app-primary);
  color: var(--app-primary);
}

.home-title .underline-sweep { position: relative; display: inline-block; }
.home-title .underline-sweep::after { display: none; }

.home-desc {
  color: var(--app-text-subtle);
  font-size: var(--app-fs-md);
  max-width: 460px;
  margin: 0 auto;
  font-family: var(--app-font-body);
  font-weight: 400;
  line-height: 1.6;
}

/* ==============================================================
   SEARCH AREA — Google-style centered search
   ============================================================== */
.search-area {
  max-width: 640px;
  margin: 0 auto 40px;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}

.search-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 0 auto 20px;
  background: var(--app-surface-soft);
  border: none;
  border-radius: var(--app-radius);
  padding: 4px;
  box-shadow: none;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

.search-tab {
  padding: 10px 24px;
  border: none; background: none;
  cursor: pointer;
  font-size: var(--app-fs-sm); font-weight: 500;
  color: var(--app-text-subtle);
  border-radius: var(--app-radius);
  transition: all var(--app-duration-fast);
  font-family: var(--app-font-body);
}

.search-tab:hover { color: var(--app-text); background: var(--app-overlay-hover); }

.search-tab.active {
  background: var(--app-surface);
  color: var(--app-status-primary);
  box-shadow: none;
}

/* ==============================================================
   HOME CONTENT
   ============================================================== */
.home-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 40px;
  position: relative; z-index: 10;
}

/* ==============================================================
   NOTICES
   ============================================================== */
.notices-block { margin-bottom: 32px; }

.notices-block .block-title {
  font-family: var(--app-font-display);
  font-size: var(--app-fs-lg);
  font-weight: 500;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
  color: var(--app-text);
  text-transform: none;
}

.notices-block .block-title .count {
  font-family: var(--app-font-body);
  font-size: var(--app-fs-xs); font-weight: 500;
  background: var(--app-status-primary);
  color: var(--app-on-action);
  padding: 2px 10px;
  border-radius: var(--app-radius-pill);
}

.notice-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 18px;
  background: var(--app-surface);
  border: 1px solid var(--app-border-soft);
  border-left: 4px solid var(--app-primary);
  border-radius: var(--app-radius);
  margin-bottom: 8px;
  font-size: var(--app-fs-sm);
  line-height: 1.6;
  color: var(--app-text);
  word-break: break-word;
  box-shadow: none;
  transition: border-color var(--app-duration-fast);
  position: relative;
}

.notice-row:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--app-border);
}

.notice-row .dot {
  width: 8px; height: 8px;
  background: var(--app-primary);
  margin-top: 7px; flex-shrink: 0;
  border-radius: 50%;
  box-shadow: none;
}

/* ==============================================================
   ACCOUNT GRID
   ============================================================== */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}

.acc-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius);
  padding: 24px;
  cursor: pointer;
  position: relative;
  box-shadow: none;
  overflow: hidden;
  transition: border-color var(--app-duration) ease;
}

.acc-card::before { display: none; }
.acc-card::after { display: none; }

.acc-card:hover {
  transform: none;
  border-color: var(--app-border);
  box-shadow: none;
}

.acc-card .acc-icon {
  width: 56px; height: 56px;
  border: none;
  border-radius: var(--app-radius);
  background: var(--app-primary-container);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--app-fs-display);
  margin-bottom: 16px;
  position: relative; z-index: 1;
  transform: none;
  transition: none;
  filter: none;
  overflow: hidden;
}

.acc-card:hover .acc-icon { transform: none; }

.acc-card .acc-icon img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: var(--app-radius);
  padding: 4px;
}

.acc-card h3 {
  font-family: var(--app-font-display);
  font-size: var(--app-fs-lg);
  font-weight: 500;
  margin-bottom: 4px;
  position: relative; z-index: 1;
  text-transform: none;
}

.acc-card .acc-platform {
  font-size: var(--app-fs-xs); color: var(--app-text-muted);
  margin-bottom: 10px;
  font-family: var(--app-font-body);
  text-transform: none;
  position: relative; z-index: 1;
}

.acc-card .acc-desc {
  font-size: var(--app-fs-sm); color: var(--app-text-subtle);
  margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.6;
  position: relative; z-index: 1;
}

.acc-card .acc-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--app-border-soft);
  position: relative; z-index: 1;
}

.acc-card .acc-games {
  font-size: var(--app-fs-sm); color: var(--app-text-subtle);
  font-weight: 500;
  font-family: var(--app-font-body);
}

.acc-card .acc-games strong {
  color: var(--app-status-primary);
  font-size: var(--app-fs-md);
  margin-right: 2px;
}

/* ==============================================================
   RESULT LIST (search)
   ============================================================== */
.result-group {
  margin-bottom: 28px;
  padding-left: 0;
}

.result-group-title {
  font-family: var(--app-font-body);
  font-size: var(--app-fs-xs); color: var(--app-text-muted);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
  font-weight: 500;
  text-transform: none;
}

.result-group-title strong {
  color: var(--app-text);
  font-family: var(--app-font-display);
  font-size: var(--app-fs-md);
  font-weight: 500;
  text-transform: none;
}

.result-list { display: flex; flex-direction: column; gap: 8px; }

.result-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: var(--app-surface);
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius);
  cursor: pointer;
  box-shadow: none;
  transition: border-color var(--app-duration-fast);
  position: relative;
}

.result-item:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--app-border);
}

.result-item .r-icon {
  width: 40px; height: 40px;
  border-radius: var(--app-radius);
  background: var(--app-primary-container);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-size: var(--app-icon-xl);
  transition: none;
}

.result-item:hover .r-icon { transform: none; }

.result-item .r-icon img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 4px;
}

.result-item .r-name {
  flex: 1; font-size: var(--app-fs-md); font-weight: 400;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--app-font-body);
}

.result-item .r-tag {
  font-size: var(--app-fs-xs); color: var(--app-status-primary);
  background: var(--app-primary-container);
  padding: 4px 12px;
  border-radius: var(--app-radius-pill);
  white-space: nowrap; flex-shrink: 0;
  font-weight: 500;
  font-family: var(--app-font-body);
}

/* ==============================================================
   HOME FOOTER
   ============================================================== */
.home-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 32px 24px 40px;
  color: var(--app-text-muted);
  font-size: var(--app-fs-sm);
  border-top: 1px solid var(--app-border-soft);
  margin-top: 32px;
  font-family: var(--app-font-body);
  position: relative; z-index: 10;
  background: transparent;
}

.home-footer .footer-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.home-footer .footer-copy { font-size: var(--app-fs-xs); opacity: .85; }
.home-footer .dot-sep { color: var(--app-border); margin: 0 8px; font-weight: 400; }

.home-footer::before { display: none; }

/* ==============================================================
   NOTICE POPOVER
   ============================================================== */
.notice-popover {
  position: fixed;
  top: 64px; right: 16px;
  width: min(400px, calc(100vw - 32px));
  background: var(--app-surface);
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-lg);
  z-index: 150;
  display: none;
  overflow: hidden;
  animation: fadeInUp .2s cubic-bezier(.2,0,0,1);
}

.notice-popover.active { display: block; }

.notice-popover-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--app-border-soft);
  background: var(--app-surface);
  color: var(--app-text);
}

.notice-popover-header strong {
  font-family: var(--app-font-display);
  font-size: var(--app-fs-md);
  font-weight: 500;
  text-transform: none;
}

.notice-popover-close {
  background: transparent; border: none;
  color: var(--app-text-subtle);
  font-size: var(--app-fs-xl); font-weight: 400;
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  transition: background var(--app-duration-fast);
}

.notice-popover-close:hover { transform: none; background: var(--app-surface-soft); }

.notice-popover-body {
  max-height: min(400px, calc(100vh - 140px));
  overflow-y: auto;
  padding: 12px;
}

.notice-popover-body .notice-row {
  font-size: var(--app-fs-sm); padding: 12px 14px; margin-bottom: 8px;
}

.notice-popover-overlay {
  position: fixed; inset: 0;
  background: var(--app-overlay-light);
  z-index: 140; display: none;
}

.notice-popover-overlay.active { display: block; }

/* ==============================================================
   TOAST
   ============================================================== */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 2000;
  display: flex; flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  background: var(--app-surface);
  color: var(--app-text);
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius);
  font-size: var(--app-fs-sm); font-weight: 400;
  box-shadow: var(--app-shadow-lg);
  animation: fadeInUp .2s cubic-bezier(.2,0,0,1);
  min-width: 160px;
  border-left: 4px solid var(--app-primary);
}

.toast.success { border-left-color: var(--app-success); }
.toast.error { border-left-color: var(--app-danger); }
.toast.info { border-left-color: var(--app-info); }

.toast-out { animation: toastOut .2s ease forwards; }

@keyframes toastOut {
  to { opacity: 0; transform: translateX(16px); }
}

/* ==============================================================
   ACCOUNT DETAIL
   ============================================================== */
.account-page { padding-top: 20px; padding-bottom: 40px; }

.account-page .nav-row {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 20px; flex-wrap: wrap;
}

.account-page .detail-header {
  display: flex; align-items: center; gap: 24px;
  padding: 28px;
  background: var(--app-surface);
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius);
  margin-bottom: 20px;
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

.account-page .detail-header::before { display: none; }
.account-page .detail-header::after { display: none; }

.account-page .detail-icon {
  width: 72px; height: 72px;
  border: none;
  border-radius: var(--app-radius);
  background: var(--app-primary-container);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transform: none;
  overflow: hidden;
  position: relative; z-index: 1;
  box-shadow: none;
  font-size: var(--app-icon-3xl);
}

.account-page .detail-icon img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: var(--app-radius);
  padding: 6px;
}

.account-page .detail-info { flex: 1; min-width: 0; position: relative; z-index: 1; }

.account-page .detail-info h1 {
  font-family: var(--app-font-display);
  font-size: var(--app-fs-title);
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.3;
  text-transform: none;
}

.account-page .detail-info .meta {
  font-size: var(--app-fs-sm); color: var(--app-text-subtle);
  font-family: var(--app-font-body);
  text-transform: none;
}

.account-page .detail-info .desc {
  margin-top: 8px; color: var(--app-text-subtle);
  font-size: var(--app-fs-sm); line-height: 1.6;
}

.account-page .toolbar {
  padding: 12px 16px;
  background: var(--app-surface);
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  box-shadow: none;
}

.account-page .toolbar .search-bar { flex: 1; min-width: 200px; }

.account-page .toolbar .game-count {
  font-size: var(--app-fs-sm); color: var(--app-text-subtle);
  white-space: nowrap; font-weight: 400;
  font-family: var(--app-font-body);
}

.account-page .game-table-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius);
  overflow: hidden;
  box-shadow: none;
}

/* ==============================================================
   NOTICE PAGE
   ============================================================== */
.notice-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px 40px;
  position: relative; z-index: 10;
}

.notice-page .nav-row { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }

.notice-page h1 {
  font-family: var(--app-font-display);
  font-size: clamp(var(--app-fs-title), 5vw, var(--app-fs-display));
  font-weight: 500; line-height: 1.3;
  margin-bottom: 8px;
  text-transform: none;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: var(--app-text);
  background-clip: unset;
  color: var(--app-text);
}

.notice-page .update-time {
  font-size: var(--app-fs-sm); color: var(--app-text-muted);
  margin-bottom: 24px;
  font-family: var(--app-font-body);
  text-transform: none;
}

.notice-content {
  background: var(--app-surface);
  border: 1px solid var(--app-border-soft);
  border-radius: var(--app-radius);
  padding: 28px 32px;
  line-height: 1.8;
  font-size: var(--app-fs-md);
  white-space: pre-wrap;
  color: var(--app-text);
  box-shadow: none;
  position: relative;
}

.notice-content::before { display: none; }
.notice-content p { margin-bottom: 12px; }

.step.active { color: var(--app-status-primary); font-weight: 600; }
.step.active::before { content: '●'; }
.step.active + .step-connector { background: var(--app-status-primary); }
.import-result-item.confirmed { border-left: 4px solid var(--app-success); }
.import-result-item.unconfirmed { border-left: 4px solid var(--app-warning); }
.flex { display: flex; }
.search-bar.search-bar-sm { max-width: 320px; }
.empty-state.empty-state-sm { padding: 40px 20px; }

@media (max-width: 640px) {
  .page-container { padding: 64px 12px 0; }
  body { font-size: var(--app-fs-md); }

  .top-nav-inner { padding: 8px 0; gap: 8px; }
  .top-nav .nav-logo { width: 32px; height: 32px; }
  .top-nav .nav-title { font-size: var(--app-fs-md); }
  .top-nav .nav-btn{ width: 36px; height: 36px; }

  .home-header { padding: 4rem 16px 28px; }
  .home-logo { width: 52px; height: 52px; }
  .home-title { font-size: var(--app-fs-title); }
  .home-desc { font-size: var(--app-fs-sm); }

  .search-bar { padding: 10px 16px; }
  .search-tabs { width: 100%; }
  .search-tab { flex: 1; text-align: center; padding: 10px 12px; font-size: var(--app-fs-sm); }

  .account-grid { grid-template-columns: 1fr; gap: 12px; }
  .acc-card { padding: 20px; }
  .acc-card .acc-icon { width: 48px; height: 48px; }
  .acc-card h3 { font-size: var(--app-fs-md); }

  .account-page .detail-header { padding: 20px; gap: 16px; flex-wrap: wrap; }
  .account-page .detail-icon { width: 56px; height: 56px; font-size: var(--app-fs-display); }
  .account-page .detail-info h1 { font-size: var(--app-fs-xl); }
  .account-page .toolbar { flex-wrap: wrap; padding: 12px 14px; }

  .account-page .game-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .game-table { min-width: 480px; }

  .notice-popover {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%;
    border-radius: var(--app-radius) var(--app-radius) 0 0;
  }
  .notice-popover-body { max-height: 60vh; }
  .notice-content { padding: 20px; font-size: var(--app-fs-sm); }

  .stat-card { padding: 18px; }
  .stat-card .stat-value { font-size: var(--app-fs-display); }

  .btn { padding: 8px 20px; font-size: var(--app-fs-sm); }

  .home-footer { padding: 24px 14px; }
}

@media (max-width: 480px) {
  .top-nav-inner { gap: 6px; }
  .top-nav .nav-logo { width: 30px; height: 30px; }
  .top-nav .nav-title { font-size: var(--app-fs-md); }
  .top-nav .nav-btn{ width: 34px; height: 34px; }

  .page-container { padding: 60px 10px 0; }
  .home-header { padding: 3.5rem 14px 22px; }
  .home-logo { width: 44px; height: 44px; }
  .home-title { font-size: var(--app-fs-xl); }

  .search-bar { padding: 10px 14px; gap: 8px; }
  .search-bar input { font-size: var(--app-fs-md); }
  .search-tab { padding: 8px 10px; font-size: var(--app-fs-xs); }

  .acc-card { padding: 18px; }
  .acc-card .acc-icon { width: 42px; height: 42px; }
  .acc-card h3 { font-size: var(--app-fs-md); }
  .acc-card .acc-games { font-size: var(--app-fs-xs); }

  .notice-row { padding: 12px 14px; font-size: var(--app-fs-sm); gap: 10px; }
  .notice-content { padding: 16px; font-size: var(--app-fs-sm); }

  .account-page .detail-header { padding: 18px; gap: 14px; }
  .account-page .detail-icon { width: 48px; height: 48px; font-size: var(--app-fs-title); }
  .account-page .detail-info h1 { font-size: var(--app-fs-lg); }
  .account-page .toolbar { padding: 10px 12px; gap: 8px; }

  .game-table th, .game-table td { padding: 10px 12px; font-size: var(--app-fs-sm); }
  .game-table .game-icon { width: 20px; height: 20px; }

  .stat-card { padding: 16px; }
  .stat-card .stat-value { font-size: var(--app-fs-title); }

  .btn { padding: 8px 16px; font-size: var(--app-fs-sm); }
  .btn-sm { padding: 5px 12px; font-size: var(--app-fs-xs); }
  .btn-lg { padding: 10px 22px; font-size: var(--app-fs-md); }

  .form-group input, .form-group textarea, .form-group select,
  .form-select, .account-select, .import-textarea {
    padding: 10px 12px; font-size: var(--app-fs-sm);
  }

  .pagination-btn, .pagination-page { padding: 6px 12px; min-width: 32px; font-size: var(--app-fs-xs); }

  .home-footer { font-size: var(--app-fs-xs); padding: 20px 12px; }
}

/* ==============================================================
   LANDSCAPE (横屏手机)
   ============================================================== */
@media (max-height: 480px) and (orientation: landscape) {
  .home-header { padding: 3.5rem 14px 16px; }
  .home-logo { width: 40px; height: 40px; }
  .home-title { font-size: var(--app-fs-xl); }
  .notice-popover { max-height: 70vh; }
  .notice-popover-body { max-height: 50vh; }
}

/* ==============================================================
   iPhone X+ safe area
   ============================================================== */
@supports (padding: max(0px)) {
  .top-nav-inner { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .page-container { padding-top: max(72px, env(safe-area-inset-top) + 56px); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .home-footer { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
}

/* ==============================================================
   REDUCED MOTION
   ============================================================== */
/* 规范 6：动效必须尊重 prefers-reduced-motion。
   实现方式 = 重映射时长 token + 显式关闭动画选择器，
   不依赖强制优先级标记（规范禁止 element-bridge 之外使用）。 */
@media (prefers-reduced-motion: reduce) {
  :root {
    --app-duration-fast: 0.01ms;
    --app-duration: 0.01ms;
    --app-duration-slow: 0.01ms;
    --app-transition: 0.01ms;
    --app-transition-slow: 0.01ms;
    --app-control-transition: 0.01ms;
  }

  /* 入场 / 装饰类动画：直接关闭 */
  .modal,
  .toast,
  .toast-out,
  .notice-popover,
  .page-transition,
  .fade-in-up,
  .stagger > *,
  .skeleton { animation: none; }

  /* 加载指示器保留但放慢，不完全失去反馈 */
  .spinner { animation-duration: 1.6s; }

  html { scroll-behavior: auto; }
}

/* ==============================================================
   ICONS —— Lucide SVG sprite
   --------------------------------------------------------------
   规范 3.4：功能图标统一 Lucide，默认 18px、线宽 1.9。
   图标定义见 images/icons.svg（35 个 symbol），用法：
     <svg class="icon" aria-hidden="true"><use href="images/icons.svg#i-search"/></svg>
   - stroke="currentColor" -> 颜色随文字，深浅色主题自动适配
   - 尺寸走 --app-icon-* token
   - pointer-events:none 让点击落在父元素（按钮/链接）上
   ============================================================== */
.icon {
  width: var(--app-icon-md);
  height: var(--app-icon-md);
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -0.16em;
  pointer-events: none;
}
.icon-xs  { width: var(--app-icon-xs);  height: var(--app-icon-xs); }
.icon-sm  { width: var(--app-icon-sm);  height: var(--app-icon-sm); }
.icon-lg  { width: var(--app-icon-lg);  height: var(--app-icon-lg); }
.icon-xl  { width: var(--app-icon-xl);  height: var(--app-icon-xl); }
.icon-3xl { width: var(--app-icon-3xl); height: var(--app-icon-3xl); }

/* 按钮内的图标：默认 18px，小按钮收到 16px */
.btn .icon      { width: var(--app-icon-md); height: var(--app-icon-md); }
.btn-sm .icon   { width: var(--app-icon-sm); height: var(--app-icon-sm); }
.back-link .icon { width: var(--app-icon-sm); height: var(--app-icon-sm); }
.pagination-btn .icon { width: var(--app-icon-sm); height: var(--app-icon-sm); }

/* 空状态 / 确认弹窗的插画位：36px 线形图标 */
.empty-state .empty-icon{
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px; line-height: 1; color: var(--app-text-muted);
}

/* ==============================================================
   DLC 徽标与可点击行（阶段：DLC 展示）
   ============================================================== */
.dlc-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: var(--app-radius-pill);
  background: var(--app-primary-hover);
  color: var(--app-on-action);
  font-size: var(--app-fs-xs);
  font-family: var(--app-font-body);
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}

.dlc-badge:hover { background: var(--app-primary-active); }

.game-list-item .dlc-badge { margin-left: auto; }

a.game-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

a.game-link:hover { color: var(--app-primary); }

.game-table td .game-link { justify-content: flex-start; }

/* ==============================================================
   ACCOUNT CARD v2 —— 文字优先：标题 / 标签 / 简介 / 统计
   去掉了 48-56px 的大图标，卡片不再被图标挤压文字
   ============================================================== */
.acc-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px;
}

.acc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.acc-head h3 {
  font-size: var(--app-fs-lg);
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.acc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.acc-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--app-radius-pill);
  background: var(--app-surface-soft);
  color: var(--app-text-muted);
  font-size: var(--app-fs-xs);
  font-family: var(--app-font-body);
  line-height: 1.6;
  white-space: nowrap;
}

.acc-tag-price {
  background: var(--app-primary-container);
  color: var(--app-primary);
  font-weight: 600;
}

.acc-tag-term {
  background: var(--app-surface-info);
  color: var(--app-text);
}

.acc-intro {
  color: var(--app-text-muted);
  font-size: var(--app-fs-sm);
  font-family: var(--app-font-body);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.acc-card .acc-bottom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
  font-size: var(--app-fs-xs);
  font-family: var(--app-font-body);
  color: var(--app-text-muted);
}

.acc-card .acc-dlc {
  color: var(--app-text-subtle);
}

.acc-card .acc-bottom .status-badge { margin-left: auto; }
.acc-card .acc-platform { margin-left: auto; }
.acc-card .acc-bottom .acc-platform + .status-badge { margin-left: 0; }
/* 图标收敛：列表行图标不再挤占文字空间 */
.game-table .game-icon { width: 18px; height: 18px; }
.game-list-item .game-icon-sm { width: 18px; height: 18px; }
.game-table .game-name-text { gap: 8px; }
/* ==============================================================
   TAG CHIP EDITOR —— 一个标签一个块，不再用逗号分隔
   ============================================================== */
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag-chips:empty { display: none; }

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--app-radius-pill);
  background: var(--app-primary-container);
  color: var(--app-primary);
  font-size: var(--app-fs-sm);
  line-height: 1.6;
}

.tag-chip button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font-size: var(--app-fs-sm);
  line-height: 1;
  padding: 0 0 0 2px;
  opacity: .75;
}

.tag-chip button:hover { opacity: 1; }

.tag-input-row { display: flex; gap: 8px; align-items: center; }
.tag-input-row input { flex: 1; min-width: 0; }

/* ==============================================================
   DLC 行内展开
   ============================================================== */
.dlc-toggle { cursor: pointer; user-select: none; }
.dlc-toggle:hover { color: var(--app-primary); }
.dlc-toggle .dlc-caret { display: inline-block; margin-left: 2px; transition: none; }
.dlc-toggle.open .dlc-caret { transform: rotate(180deg); }

.dlc-inline-row > td { padding: 4px 16px 12px 42px; background: var(--app-surface-soft); }

.dlc-inline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--app-fs-sm);
  font-family: var(--app-font-body);
  color: var(--app-text-muted);
}

.dlc-line { display: flex; gap: 8px; line-height: 1.6; }
.dlc-line .dlc-idx { color: var(--app-text-faint); min-width: 20px; text-align: right; }
.dlc-empty { color: var(--app-text-faint); font-size: var(--app-fs-sm); }

/* ==============================================================
   TAG COLORS —— 标签可选颜色
   ============================================================== */
.acc-tag.c-blue { background: var(--app-primary-container); color: var(--app-primary); }
.acc-tag.c-green { background: var(--app-surface-success); color: var(--app-text); }
.acc-tag.c-orange { background: var(--app-surface-warning); color: var(--app-text); }
.acc-tag.c-red { background: var(--app-surface-danger); color: var(--app-text); }
.acc-tag.c-cyan { background: var(--app-surface-info); color: var(--app-text); }
.acc-tag.c-gray { background: var(--app-surface-soft); color: var(--app-text-muted); }

/* 标签颜色：后台色板与色块 */
.tag-palette { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }

.tag-color {
  width: 20px; height: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  display: inline-block;
}

.tag-color.active { border-color: var(--app-text); }
.tag-palette-tip { font-size: var(--app-fs-xs); color: var(--app-text-faint); font-family: var(--app-font-body); }

.tag-color.c-blue { background: var(--app-primary-container); }
.tag-color.c-green { background: var(--app-surface-success); }
.tag-color.c-orange { background: var(--app-surface-warning); }
.tag-color.c-red { background: var(--app-surface-danger); }
.tag-color.c-cyan { background: var(--app-surface-info); }
.tag-color.c-gray { background: var(--app-surface-soft); }

.tag-chip.c-blue { background: var(--app-primary-container); color: var(--app-primary); }
.tag-chip.c-green { background: var(--app-surface-success); color: var(--app-text); }
.tag-chip.c-orange { background: var(--app-surface-warning); color: var(--app-text); }
.tag-chip.c-red { background: var(--app-surface-danger); color: var(--app-text); }
.tag-chip.c-cyan { background: var(--app-surface-info); color: var(--app-text); }
.tag-chip.c-gray { background: var(--app-surface-soft); color: var(--app-text-muted); }
.tag-chip { cursor: pointer; }

/* ==============================================================
   SEARCH RESULTS —— 信息优先：一屏尽量多显示，图标只做辅助
   ============================================================== */
.result-group { margin-bottom: 16px; }
.result-group-title { margin-bottom: 6px; gap: 6px; font-size: var(--app-fs-xs); }
.result-group-title strong { font-size: var(--app-fs-sm); }

.result-list { gap: 4px; }

.result-item {
  padding: 7px 12px;
  gap: 10px;
  min-height: 38px;
  border-radius: var(--app-radius-sm);
}

.result-item .r-icon {
  width: 16px; height: 16px;
  border-radius: var(--app-radius-xs);
  padding: 0;
}

.result-item .r-name {
  flex: 1;
  min-width: 0;
  font-size: var(--app-fs-sm);
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-item .r-tag {
  flex-shrink: 0;
  font-size: var(--app-fs-xs);
  color: var(--app-text-faint);
  max-width: 42%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 搜索结果再压缩：去掉账号药丸底、进一步降行高，一屏多显示 */
.result-list { gap: 3px; }
.result-item { padding: 5px 10px; min-height: 32px; gap: 8px; }
.result-item .r-name { font-size: var(--app-fs-sm); }
.result-item .r-tag {
  background: none;
  border: 0;
  padding: 0;
  color: var(--app-text-faint);
  font-size: var(--app-fs-xs);
  font-family: var(--app-font-body);
}
.result-group-title { margin-bottom: 5px; }
