/* 布局框架 - 参考咸鱼之王竖屏布局 */
body {
  font-family: var(--font-main);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-darker);
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg-main);
  overflow: hidden;
}

/* === 顶部资源栏 === */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--grad-panel);
  border-bottom: 1px solid rgba(232,169,48,0.15);
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
  z-index: var(--z-topbar);
  backdrop-filter: blur(10px);
}

.top-bar__currency {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  transition: background var(--t-fast);
}

.top-bar__currency:active {
  background: rgba(0,0,0,0.5);
}

.top-bar__currency-value {
  font-weight: bold;
}

.top-bar__spacer { flex: 1; }

/* === 主内容区 === */
#screen-container {
  position: absolute;
  top: var(--topbar-h);
  left: 0; right: 0;
  bottom: var(--nav-h);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* === 快捷入口图标 === */
.main-quick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  background: var(--grad-card);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  transition: all var(--t-fast);
}

.main-quick:active {
  transform: scale(0.92);
  background: var(--bg-card-hover);
}

.main-quick span {
  font-size: 9px;
  color: var(--text-secondary);
  margin-top: 1px;
  line-height: 1;
}

/* === 侧边悬浮活动图标 === */
.side-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--t-fast);
  backdrop-filter: blur(4px);
  position: relative;
}

.side-icon:active {
  transform: scale(0.88);
  background: rgba(232,169,48,0.15);
  border-color: rgba(232,169,48,0.3);
}

.side-icon::after {
  content: attr(title);
  position: absolute;
  left: 100%;
  margin-left: 4px;
  background: rgba(0,0,0,0.8);
  color: var(--text-primary);
  font-size: 9px;
  padding: 2px 4px;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast);
}

.side-icon:hover::after {
  opacity: 1;
}

/* === 可展开战斗日志 === */
.main-log-toggle {
  padding: 2px 8px;
  cursor: pointer;
  text-align: center;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.03);
}

.main-log-toggle:active {
  background: rgba(0,0,0,0.4);
}

.main-log-panel {
  overflow: hidden;
  transition: max-height 0.2s ease;
  max-height: 200px;
}

.main-log-panel.collapsed {
  max-height: 0;
  border: none;
}

/* === 底部导航 === */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--grad-nav);
  border-top: 1px solid rgba(232,169,48,0.15);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: var(--z-nav);
  backdrop-filter: blur(10px);
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex: 1;
  height: 100%;
  color: var(--text-muted);
  font-size: var(--text-xs);
  transition: color var(--t-fast);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav__item.active {
  color: var(--color-primary-light);
}

.bottom-nav__item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--grad-gold);
  border-radius: 0 0 3px 3px;
  box-shadow: var(--shadow-glow-gold);
}

.bottom-nav__icon {
  font-size: 20px;
  line-height: 1;
}

.bottom-nav__label {
  font-size: 10px;
  line-height: 1;
}

/* === 屏幕 === */
.screen {
  display: none;
  width: 100%;
  min-height: 100%;
  padding: 10px;
  animation: fadeIn var(--t-base);
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === 工具类 === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.gap-2 { gap: 2px; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.p-8 { padding: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-gold { color: var(--text-gold); }
.text-red { color: var(--text-red); }
.text-green { color: var(--text-green); }
.text-blue { color: var(--text-blue); }
.text-muted { color: var(--text-muted); }
.hidden { display: none !important; }
.overflow-y-auto { overflow-y: auto; }
.full-w { width: 100%; }
