/* ============================================================
 * 万界楼 · 史上最强店主（试玩版）
 * style.css —— 明亮动漫风 · 古今混搭
 * ============================================================ */

:root {
  --bg: #f6f1e7;
  --card: #fffdf8;
  --ink: #3c2f21;
  --muted: #8b7a63;
  --gold: #c9a227;
  --gold-dark: #a07d14;
  --red: #c0392b;
  --green: #2e7d32;
  --blue: #3468c0;
  --line: #e6dcc8;
  --shadow: 0 2px 10px rgba(120, 90, 40, 0.12);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(1200px 500px at 50% -200px, #fdeecd, transparent),
    var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 14px 60px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.topbar h1 {
  font-size: 24px;
  letter-spacing: 1px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.eyebrow { color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 8px; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s, background 0.15s;
  box-shadow: var(--shadow);
}
.btn:hover:not(:disabled) { transform: translateY(-1px); background: #fff; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(135deg, #e8b93c, #c9a227);
  border-color: var(--gold-dark);
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.btn.primary:hover:not(:disabled) { background: linear-gradient(135deg, #f0c64e, #d4ac2c); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.small { padding: 5px 10px; font-size: 13px; white-space: nowrap; }

/* ---------- 资源条 ---------- */
.scorebar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  box-shadow: var(--shadow);
}
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat strong { font-size: 16px; color: var(--gold-dark); }

/* ---------- 标签页 ---------- */
.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 4px;
}
.tab {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  color: var(--muted);
}
.tab.active {
  background: linear-gradient(135deg, #e8b93c, #c9a227);
  color: #fff;
  border-color: var(--gold-dark);
  font-weight: 600;
}

/* ---------- 面板 ---------- */
.panel { display: none; }
.panel.active { display: block; }
.sec-title { margin: 18px 0 10px; font-size: 16px; }

/* ---------- 店铺横幅 ---------- */
.shop-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fff6dd, #fffdf8);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.shop-emoji { font-size: 44px; }
.shop-banner h2 { font-size: 19px; }
.shop-banner p { color: var(--muted); font-size: 13px; }

.lobby-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); }

/* ---------- 客户卡片 ---------- */
.queue { display: flex; flex-direction: column; gap: 10px; }
.customer {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  animation: pop 0.35s ease;
}
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.c-avatar {
  font-size: 34px;
  width: 58px; height: 58px;
  display: flex; align-items: center; justify-content: center;
  background: #fdf3d8;
  border-radius: 50%;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}
.c-info { flex: 1; min-width: 0; }
.c-info b { font-size: 16px; }
.c-world { display: block; font-size: 12px; color: var(--muted); }
.c-quote { font-size: 13px; color: #6b5a42; font-style: italic; margin: 2px 0; }
.c-need { font-size: 12px; }
.tagchip {
  display: inline-block;
  background: #eef3fb;
  color: var(--blue);
  border: 1px solid #c9d8f3;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 12px;
  margin-right: 4px;
}
.tagchip.story { background: #fdeeee; color: var(--red); border-color: #f2c9c5; }

.customer.order {
  border-left-color: var(--blue);
  background: linear-gradient(135deg, #f2f7ff, #fffdf8);
}
.customer.random {
  border-left-color: var(--green);
  background: linear-gradient(135deg, #f0faf0, #fffdf8);
}

/* ---------- 分类筛选与数量框 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
}
.chip.on {
  background: linear-gradient(135deg, #e8b93c, #c9a227);
  color: #fff;
  border-color: var(--gold-dark);
  font-weight: 600;
}
input.qty {
  width: 58px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  background: #fff;
}
select.shelfitem, select.shelfcat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 13px;
  max-width: 150px;
  background: #fff;
}
.goods.shelfnew { flex-wrap: wrap; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 10px;
  font-size: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

/* ---------- 商品网格 ---------- */
.grid { display: flex; flex-direction: column; gap: 8px; }
.goods {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
}
.goods.dim { opacity: 0.55; }
.g-emoji { font-size: 22px; width: 28px; text-align: center; }
.g-name { flex: 1; font-size: 14px; }
.g-name em.studied { font-style: normal; font-size: 12px; color: var(--green); }
.g-val { font-size: 13px; color: var(--gold-dark); white-space: nowrap; }
.g-acts { display: flex; gap: 6px; }

/* ---------- 修炼 / 位面 / 任务 ---------- */
.realm-box {
  background: linear-gradient(135deg, #fff6dd, #fffdf8);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 6px;
  box-shadow: var(--shadow);
}
.realm-box h3 { font-size: 16px; margin-bottom: 4px; }
.realm-box p { font-size: 13px; }
.muted { color: var(--muted); font-size: 13px; }

.world-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.world {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.world.locked { opacity: 0.65; background: #f3eee2; }
.w-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.w-emoji { font-size: 24px; }
.w-desc { font-size: 13px; color: #6b5a42; margin-bottom: 6px; }
.w-unlock { font-size: 12px; color: var(--muted); margin-bottom: 10px; }

.quests { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.quest {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
}
.quest.done { opacity: 0.72; }
.quest.done b { text-decoration: line-through; color: var(--muted); }
.q-badge { font-size: 18px; }
.quest b { font-size: 14px; }
.quest p { font-size: 12px; color: var(--muted); }
.villa { margin: 6px 0 12px; }
.villa .btn { margin-top: 8px; }

.logs { display: flex; flex-direction: column; gap: 4px; }
.logline {
  font-size: 12.5px;
  color: #6b5a42;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
}
.logline span { color: var(--gold-dark); margin-right: 8px; font-family: monospace; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(40, 28, 12, 0.5);
  display: none;
  align-items: center; justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal.open { display: flex; }
.modal-card {
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(60, 40, 10, 0.3);
  padding: 20px;
  width: min(620px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: pop 0.3s ease;
}
.modal-card h3 { font-size: 18px; }
.scroll { overflow-y: auto; }
.modal-acts { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.deal-info { font-size: 13px; }
.deal-price {
  background: #fdf3d8;
  border: 1px solid #eeda9e;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
}

/* ---------- 位面事件 ---------- */
.trip-event {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.trip-event h4 { font-size: 15px; margin-bottom: 4px; }
.trip-text { font-size: 13.5px; color: #5d4d37; margin-bottom: 10px; }
.trip-opts { display: flex; flex-direction: column; gap: 8px; }
.trip-opts .btn { text-align: left; }

/* ---------- 开场 / 结局 ---------- */
.modal-card.intro { text-align: center; align-items: center; }
.intro-emoji { font-size: 56px; }
.modal-card.intro p { font-size: 14.5px; text-align: left; }

/* ---------- 提示气泡 ---------- */
.toasts {
  position: fixed;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(480px, 92vw);
}
.toast {
  background: rgba(60, 47, 33, 0.92);
  color: #fff;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13.5px;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  text-align: center;
}
.toast.good { background: linear-gradient(135deg, #d4a017, #b8860b); }
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- 页脚 ---------- */
.footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 30px; }

@media (max-width: 560px) {
  .topbar h1 { font-size: 19px; }
  .customer { flex-wrap: wrap; }
  .customer .btn { margin-left: 74px; }
}
