/**
 * 曙光小镇 - 游戏皮肤层（覆盖在 Bootstrap 之上）
 */
:root {
  --dz-green: #4caf50;
  --dz-green-dark: #2e7d32;
  --dz-gold: #ffb300;
  --dz-radius: 14px;
}

body {
  background: linear-gradient(180deg, #e8f5e9 0%, #f1f8e9 55%, #fffde7 100%) fixed;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
}

.game-title { font-weight: 800; letter-spacing: .5px; }

.topbar {
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #e0e0e0;
  padding: 0 12px;
}

/* ===== 导航改版：标签式页签 + 胶囊组 + 头像悬浮状态层 ===== */
.nav-inner {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-top: 6px;
}
.nav-brand { text-decoration: none; color: inherit; padding-bottom: 9px; }

.nav-tabs-zone { display: flex; align-items: flex-end; gap: 2px; }
.nav-tab {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid #e0e0e0;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  background: rgba(255, 255, 255, .5);
  color: #666;
  text-decoration: none;
  line-height: 1;
  margin-bottom: -1px; /* 上左右圆角、底边紧贴导航下缘 */
  transition: background .15s ease, color .15s ease;
}
.nav-tab .ico { font-size: 17px; }
.nav-tab .label {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition: max-width .18s ease, opacity .18s ease, padding .18s ease;
}
.nav-tab:hover, .nav-pill-group > a:hover, .nav-icon-btn:hover { background: #fff; color: #333; }
.nav-tab:hover .label, .nav-tab.active .label { max-width: 90px; opacity: 1; padding-left: 5px; }
.nav-tab.active {
  background: #fff;
  color: var(--dz-green-dark);
  font-weight: 600;
  box-shadow: inset 0 3px 0 var(--dz-green);
}

.nav-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-left: auto;
  padding-bottom: 7px;
}
.nav-pill-group {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e0e0e0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .5);
  overflow: hidden;
}
.nav-pill-group > a {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  color: #666;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.nav-pill-group > a .label {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition: max-width .18s ease, opacity .18s ease, padding .18s ease;
}
.nav-pill-group > a:hover .label { max-width: 60px; opacity: 1; padding-left: 4px; }
.nav-pill-group > a + a { border-left: 1px solid #eee; }
.nav-pill-group > a.pill-hot { color: #b8860b; }
.nav-icon-btn {
  border: 1px solid #e0e0e0;
  background: rgba(255, 255, 255, .5);
  border-radius: 10px;
  padding: 5px 9px;
  line-height: 1;
}

.user-zone { position: relative; }
.user-pop {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  width: 236px;
  padding-top: 6px; /* 悬浮桥面，防止鼠标移入时中断 hover */
  z-index: 1200;
}
.user-zone:hover .user-pop { display: block; }
.user-pop-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .12);
  padding: 12px;
}
.user-pop-avatar { font-size: 26px; }
.exp-bar-wide { width: 100%; height: 8px; background: #eee; border-radius: 999px; }

/* 帮助弹层 */
.help-card { width: min(92vw, 560px); }
.help-md h4 { font-size: 1.05rem; margin-top: .4rem; }
.help-md h5 { font-size: .95rem; margin-top: .8rem; }
.help-md h6 { font-size: .9rem; margin-top: .6rem; }
.help-md code { background: #f5f5f5; padding: 1px 5px; border-radius: 4px; }
.help-md ul { padding-left: 1.2rem; margin-bottom: .5rem; }
.help-md hr { opacity: .25; }

/* ===== 页面标题问号说明（移动端省空间） ===== */
.page-help { position: relative; display: inline-flex; margin-left: 3px; vertical-align: middle; }
.page-help-btn {
  width: 20px; height: 20px; padding: 0; line-height: 17px;
  border-radius: 50%;
  border: 1px solid #cfd8dc;
  background: #fff;
  color: #90a4ae;
  font-size: 13px; font-weight: 700;
}
.page-help-btn:hover, .page-help-btn.on { color: var(--dz-green-dark); border-color: var(--dz-green); }
.page-help-pop {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 1150;
  width: max-content;
  max-width: min(300px, 78vw);
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 400;
  color: #555;
  text-align: left;
  white-space: normal;
}

/* ===== 首页数据板 ===== */
.dash-card {
  display: block;
  background: #fff;
  border-radius: var(--dz-radius);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
  padding: 16px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: transform .15s ease, box-shadow .15s ease;
}
.dash-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(76, 175, 80, .18);
  color: inherit;
}
.dash-icon { font-size: 42px; line-height: 1.2; }
.dash-go { color: var(--dz-green); margin-top: 8px; font-weight: 600; }

.stat-chip {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 14px;
  white-space: nowrap;
}

.exp-bar { width: 70px; height: 8px; background: #eee; border-radius: 999px; }

/* 登录页 */
.page-welcome .welcome-card {
  max-width: 380px;
  border: none;
  border-radius: var(--dz-radius);
  box-shadow: 0 10px 30px rgba(76, 175, 80, .18);
}

/* 地块卡片 */
.slot-card {
  background: #fff;
  border: 2px solid transparent;
  border-radius: var(--dz-radius);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
  min-height: 175px;
  padding: 10px;
  text-align: center;
  transition: transform .15s ease;
}
.slot-card:hover { transform: translateY(-2px); }
.slot-no { font-size: 12px; text-align: left; }
.slot-ready { border-color: var(--dz-gold); animation: readyPulse 1.4s infinite; }
.slot-withered { filter: grayscale(.6); }

@keyframes readyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 179, 0, .35); }
  50%      { box-shadow: 0 0 0 9px rgba(255, 179, 0, 0); }
}

.slot-body { padding: 8px 4px 4px; }
.slot-body .emoji { font-size: 46px; line-height: 1.25; }
.slot-locked { opacity: .55; background: #f5f5f5; }
.land-emoji { opacity: .45; }

.progress-thin { height: 6px; border-radius: 999px; }

/* 图片图标（items.icon 配置为图片路径时渲染，尺寸跟随容器字号） */
.icon-img { width: 1em; height: 1em; object-fit: contain; vertical-align: -0.12em; }

/* 个人设置头像选择 */
.avatar-option { cursor: pointer; }
.avatar-face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 26px;
  border-radius: 12px;
  border: 2px solid #e0e0e0;
  background: #fff;
  transition: transform .1s, border-color .1s;
}
.avatar-option input:checked + .avatar-face,
.avatar-face.avatar-active {
  border-color: var(--dz-green);
  transform: scale(1.08);
}

/* 导航头像昵称 */
.avatar-chip { text-decoration: none; color: inherit; }
.avatar-chip:hover { border-color: var(--dz-green); }

/* ===== 餐厅顾客 ===== */
.customers-wrap { position: relative; }
.customer-card { animation: customerIn .35s ease both; }
@keyframes customerIn {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.customer-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #fff7e6;
  border: 2px solid #ffe0b2;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.customer-bubble {
  position: relative;
  background: #fff8e1;
  border-radius: 10px;
  padding: 6px 10px;
  animation: bob 2.5s ease-in-out infinite;
}
.customer-bubble::after {
  content: '';
  position: absolute;
  left: -11px; top: 50%;
  margin-top: -6px;
  border: 6px solid transparent;
  border-right-color: #fff8e1;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
.customer-card.urgent { border-color: #ffb300; }
.customer-card.urgent .customer-bubble {
  background: #ffebee;
  animation: bob 1.2s ease-in-out infinite, wiggle .5s linear infinite;
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25%      { transform: rotate(-1.2deg); }
  75%      { transform: rotate(1.2deg); }
}
/* 上菜成功飘字 */
.serve-fx {
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  font-weight: 800;
  color: var(--dz-gold);
  text-shadow: 0 1px 0 #fff, 0 2px 8px rgba(255,179,0,.5);
  pointer-events: none;
  z-index: 5;
  animation: floatUp 1.4s ease-out both;
  white-space: nowrap;
}
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, 10px) scale(.8); }
  20%  { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -52px) scale(1); }
}

/* 仓库出售 */
.sell-qty { width: 90px; }

/* 仓库弹层：关键字搜索 + 类目筛选 */
.inv-search { margin-bottom: 8px; }
.inv-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.inv-chip {
  border: 1px solid #e0e0e0;
  background: #fff;
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 13px;
  color: #666;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.inv-chip span:last-child { color: #aaa; font-size: 12px; margin-left: 2px; }
.inv-chip.on {
  background: var(--dz-green);
  border-color: var(--dz-green);
  color: #fff;
}
.inv-chip.on span:last-child { color: rgba(255, 255, 255, .75); }

/* 弹层 */
[x-cloak] { display: none !important; }

.picker-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
}

.picker {
  width: min(92vw, 460px);
  max-height: 80vh;
  overflow: auto;
  border: none;
  border-radius: var(--dz-radius);
}

.picker-item { padding: 10px 6px; border-bottom: 1px dashed #eee; }
.picker-item:last-child { border-bottom: none; }
.picker-item .emoji { font-size: 28px; line-height: 1; }

/* 提示气泡 */
.toast-box {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(33, 33, 33, .85);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  z-index: 2000;
  font-size: 14px;
  max-width: 80vw;
}
