:root {
  --bg-warm: #F6F1EB;
  --panel-bg: #FFFFFF;
  --coffee-dark: #382823;
  --coffee-mid: #70584D;
  --coffee-light: #C4B5A6;
  --caramel-gold: #D48138;
  --accent-pink: #E2725B;
  --tray-bg: #FAF6F1;
  --border-subtle: #E8DFD5;
  --radius-lg: 22px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  background: var(--bg-warm);
  color: var(--coffee-dark);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Avenir Next", "PingFang SC", sans-serif;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: calc(env(safe-area-inset-top, 12px) + 6px);
  padding-bottom: calc(env(safe-area-inset-bottom, 16px) + 8px);
  padding-left: 14px;
  padding-right: 14px;
  overflow-x: hidden;
}

/* 顶部导航与状态栏 */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px 10px;
}

.nav-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pill-badge {
  background: #EAE1D5;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  color: var(--coffee-mid);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pill-badge.tips-gold {
  background: #FFF;
  color: var(--caramel-gold);
  box-shadow: 0 2px 6px rgba(56, 40, 35, 0.06);
}

.icon-pill-btn {
  background: #FFF;
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  color: var(--coffee-mid);
  cursor: pointer;
  transition: transform 0.1s;
}
.icon-pill-btn:active {
  transform: scale(0.94);
}

/* 顾客舞台与对话 */
.guest-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 4px;
}

.bubble-card {
  background: var(--panel-bg);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 26px rgba(56, 40, 35, 0.07);
  border: 1.5px solid var(--border-subtle);
  position: relative;
  animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bubble-card::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 9px 9px 0;
  border-style: solid;
  border-color: var(--panel-bg) transparent;
  display: block;
  width: 0;
}

.bubble-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.guest-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--coffee-light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sound-controls {
  display: flex;
  gap: 5px;
}

.sound-pill {
  background: #F4ECE3;
  border: none;
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  color: var(--coffee-mid);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: transform 0.1s;
}
.sound-pill:active {
  transform: scale(0.92);
  background: #E8DDD2;
}

.dialogue-speech {
  font-size: 16px;
  font-weight: 750;
  line-height: 1.45;
  color: var(--coffee-dark);
  margin-bottom: 6px;
}

.clue-wrap {
  margin-top: 4px;
}

.clue-toggle-btn {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--caramel-gold);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 0;
}

.clue-drawer {
  background: var(--tray-bg);
  border-left: 3px solid var(--caramel-gold);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--coffee-mid);
  line-height: 1.5;
  margin-top: 6px;
  display: none;
}

/* 动物动效角色舞台 */
.characters-row {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin: 10px 0 6px;
}

.guest-avatar {
  font-size: 52px;
  animation: floatMotion 3.2s ease-in-out infinite;
}

.capy-avatar {
  font-size: 44px;
}

/* 调饮操作台面板 */
.prep-counter {
  background: var(--panel-bg);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  box-shadow: 0 12px 32px rgba(56, 40, 35, 0.08);
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
}

.tray-wrap {
  background: var(--tray-bg);
  border: 1.5px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  margin-bottom: 12px;
}

.tray-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.tray-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--coffee-light);
  letter-spacing: 0.5px;
}

.btn-text-clear {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--coffee-mid);
  cursor: pointer;
}

.cup-slots {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.slots-placeholder {
  font-size: 12px;
  color: var(--coffee-light);
  font-weight: 500;
}

.slot-item {
  background: #FFF;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  color: var(--coffee-dark);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: popIn 0.18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.slot-item .remove-cross {
  color: var(--coffee-light);
  font-size: 11px;
  margin-left: 2px;
}

/* 配料分类横向标签栏 */
.cat-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.cat-bar::-webkit-scrollbar { display: none; }

.cat-btn {
  background: #F4EFEA;
  border: none;
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--coffee-mid);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-btn.active {
  background: var(--coffee-dark);
  color: #FFF;
}

/* 配料九宫格 */
.ingredients-matrix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  min-height: 142px;
}

.ing-tile {
  background: #FDFBF9;
  border: 1.5px solid #EFEAE3;
  border-radius: var(--radius-md);
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.1s;
}

.ing-tile:active {
  transform: scale(0.92);
  background: #ECE4D9;
}

.tile-icon { font-size: 22px; }
.tile-name { font-size: 12px; font-weight: 750; color: var(--coffee-dark); }
.tile-sub { font-size: 10px; color: var(--coffee-light); text-transform: uppercase; letter-spacing: 0.3px; }

/* 底部出杯按键 */
.action-footer {
  margin-top: 12px;
}

.btn-serve-magic {
  width: 100%;
  background: linear-gradient(180deg, #4A3730 0%, #291D18 100%);
  color: #FFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(41, 29, 24, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.08s;
}

.btn-serve-magic:active {
  transform: scale(0.97);
}

/* 通用全屏模态弹层 */
.overlay-modal {
  position: fixed;
  inset: 0;
  background: rgba(41, 29, 24, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-card {
  background: #FFF;
  border-radius: 26px;
  padding: 24px 20px;
  width: 100%;
  max-width: 330px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-stamp { font-size: 50px; margin-bottom: 6px; }
.modal-title { font-size: 20px; font-weight: 800; margin-bottom: 3px; color: var(--coffee-dark); }
.modal-rating { font-size: 14px; margin-bottom: 6px; }
.modal-quote { font-size: 13px; font-weight: 700; color: var(--caramel-gold); margin-bottom: 12px; }

.knowledge-box {
  background: var(--tray-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 12px;
  color: var(--coffee-mid);
  line-height: 1.6;
  text-align: left;
  margin-bottom: 16px;
}

.btn-next-customer {
  width: 100%;
  background: var(--coffee-dark);
  color: #FFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.btn-next-customer:active {
  transform: scale(0.97);
}

/* 图鉴弹层专属 */
.book-modal-card {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.book-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.btn-close-book {
  background: none;
  border: none;
  font-size: 18px;
  font-weight: 800;
  color: var(--coffee-mid);
  cursor: pointer;
}
.book-subtitle {
  font-size: 11px;
  color: var(--coffee-light);
  text-align: left;
  margin-bottom: 12px;
}
.recipes-grid {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding-right: 4px;
}
.recipe-row {
  background: var(--tray-bg);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-subtle);
}
.recipe-row.locked {
  opacity: 0.45;
  filter: grayscale(1);
}
.recipe-name {
  font-size: 13px;
  font-weight: 750;
  color: var(--coffee-dark);
}
.recipe-tags {
  font-size: 11px;
  color: var(--coffee-mid);
  margin-top: 2px;
}

/* 动效 */
@keyframes floatMotion {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
