/* ==========================================================================
   《北海道迷情酒坊》- Otaru Midnight Jazz Kissa · Bespoke Bar System
   Aesthetic: Obsidian Lacquer, Smoked Walnut, Patina Bronze Gold & Otaru Snow
   Anti-Slop Craftsmanship: Shippori Mincho Serif, JetBrains Mono, Tactile Depth
   ========================================================================== */

:root {
  /* 基础色盘：黑曜石、烟熏胡桃木、纯铜金、小樽雪白 */
  --bg-deep: #07080b;
  --bg-surface: #0c0d12;
  --bg-card: rgba(18, 17, 23, 0.82);
  --bg-card-hover: rgba(28, 25, 34, 0.92);
  --bg-wood: #14110f;
  --bg-wood-light: #211c18;

  /* 贵金属与光芒 */
  --brass-gold: #d4af37;
  --brass-light: #f3d982;
  --brass-dim: #997b24;
  --amber-warm: #e2b170;
  --amber-glow: rgba(226, 177, 112, 0.28);
  --candle-light: #f59e0b;
  --vermilion: #c93b2b;
  --vermilion-dim: #8c2317;

  /* 边框与阴影 */
  --border-subtle: rgba(212, 175, 55, 0.14);
  --border-medium: rgba(212, 175, 55, 0.26);
  --border-glow: rgba(212, 175, 55, 0.42);
  --shadow-warm: 0 12px 36px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.18);

  /* 文字层次：和纸温润米白，杜绝冷白刺眼 */
  --text-main: #f5f2eb;
  --text-muted: #b5afa4;
  --text-dim: #787267;
  --text-gold: #e5c158;

  /* 字体族 */
  --font-serif-title: "Shippori Mincho", "Cinzel", "Noto Serif SC", "Songti SC", "Source Han Serif SC", serif;
  --font-serif-body: "Noto Serif SC", "Songti SC", "Hiragino Mincho ProN", serif;
  --font-display-en: "Cinzel", "Cormorant Garamond", "Times New Roman", serif;
  --font-mono-data: "JetBrains Mono", "SF Mono", "Fira Code", Consolas, monospace;

  /* 几何规范 */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-serif-body);
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.05) 0%, transparent 55%),
    radial-gradient(circle at 10% 30%, rgba(226, 177, 112, 0.03) 0%, transparent 45%),
    radial-gradient(circle at 90% 75%, rgba(140, 35, 23, 0.03) 0%, transparent 50%),
    linear-gradient(180deg, #07080b 0%, #0a0b10 100%);
  background-attachment: fixed;
}

/* 典雅小樽暗调滚动条 */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #07080b;
}
::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.22);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.45);
}

/* ==========================================
 * 顶部吧台顶栏 (App Header)
 * ========================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 9, 13, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo-glow {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: radial-gradient(circle at 35% 35%, #2a221b, #120e0b);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 12px rgba(0, 0, 0, 0.5);
  position: relative;
}

.brand-logo-glow::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 0 16px var(--amber-glow);
  pointer-events: none;
  opacity: 0.6;
}

.brand-title {
  font-family: var(--font-serif-title);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-main);
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-subtitle {
  font-family: var(--font-display-en);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--brass-dim);
  text-transform: uppercase;
  margin-top: 2px;
}

/* 天气与北国雪夜氛围指示牌 */
.weather-status-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(20, 18, 24, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 16px;
  font-family: var(--font-mono-data);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.weather-snow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e6ded1;
  box-shadow: 0 0 8px rgba(230, 222, 209, 0.85);
  animation: pulseSnow 2.8s infinite ease-in-out;
}

@keyframes pulseSnow {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 12px rgba(230, 222, 209, 1); }
}

/* 顶栏控制按钮 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-header-icon {
  background: rgba(24, 21, 28, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: var(--font-serif-body);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.btn-header-icon:hover {
  background: rgba(36, 31, 42, 0.85);
  border-color: var(--border-medium);
  color: var(--text-main);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.btn-header-icon.active {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--brass-gold);
  color: var(--brass-light);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.22);
}

/* ==========================================
 * 导航标签栏 (Navigation Tabs)
 * ========================================== */
.app-nav {
  display: flex;
  justify-content: center;
  background: rgba(10, 11, 16, 0.75);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  padding: 14px 24px;
  font-family: var(--font-serif-title);
  font-size: 14px;
  letter-spacing: 1.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
  position: relative;
}

.nav-tab-btn:hover {
  color: var(--text-muted);
}

.nav-tab-btn.active {
  color: var(--brass-light);
  border-bottom-color: var(--brass-gold);
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.35);
}

/* ==========================================
 * 主内容容器 (Main Content)
 * ========================================== */
.main-content {
  max-width: 1560px;
  margin: 0 auto;
  padding: 24px;
}

.view-section {
  display: none;
  animation: fadeInView 0.3s ease-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeInView {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 和纸质感暗调卡片 (Glass Panel) */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-warm);
  position: relative;
}

.glass-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  pointer-events: none;
}

/* ==========================================
 * 自由调酒工坊网格 (Workbench Grid)
 * ========================================== */
.workbench-grid {
  display: grid;
  grid-template-columns: 360px minmax(440px, 500px) 380px;
  justify-content: center;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1366px) {
  .workbench-grid {
    grid-template-columns: 320px minmax(380px, 440px) 340px;
    gap: 16px;
  }
}

@media (max-width: 1024px) {
  .workbench-grid {
    grid-template-columns: 1fr;
  }
}

.workbench-grid > .glass-panel {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.35) rgba(10, 11, 16, 0.5);
}

.workbench-grid > .glass-panel::-webkit-scrollbar {
  width: 6px;
}

.workbench-grid > .glass-panel::-webkit-scrollbar-track {
  background: rgba(10, 11, 16, 0.5);
  border-radius: 3px;
}

.workbench-grid > .glass-panel::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.35);
  border-radius: 3px;
}

.workbench-grid > .glass-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.6);
}

/* 选择器行 (Selector Row for Glasses & Ice) */
.selector-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.pill-btn {
  background: rgba(18, 16, 22, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 6px 11px;
  font-family: var(--font-serif-body);
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.pill-btn:hover {
  color: var(--text-main);
  border-color: var(--border-medium);
}

.pill-btn.active {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--brass-gold);
  color: var(--brass-light);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

/* 调酒技法选择按钮 (Technique Group) */
.technique-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.technique-btn {
  background: rgba(16, 14, 20, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.technique-btn:hover {
  border-color: var(--border-medium);
}

.technique-btn.active {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--brass-gold);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}

.technique-title {
  font-family: var(--font-serif-title);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
}

.technique-btn.active .technique-title {
  color: var(--brass-light);
}

.technique-desc {
  font-size: 9px;
  color: var(--text-dim);
  line-height: 1.3;
  display: none;
}

/* 原料类别选项卡 (Category Tabs) */
.category-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 2px;
}

.category-tab-btn {
  background: rgba(22, 20, 26, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 6px 11px;
  border-radius: var(--radius-xs);
  font-family: var(--font-serif-body);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.category-tab-btn:hover {
  color: var(--text-muted);
  border-color: var(--border-medium);
}

.category-tab-btn.active {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--brass-gold);
  color: var(--brass-light);
}

/* 搜索框 */
.search-input-wrap {
  position: relative;
  margin-bottom: 12px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--brass-dim);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: rgba(12, 11, 16, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 12px 8px 30px;
  color: var(--text-main);
  font-family: var(--font-serif-body);
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: var(--brass-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.search-input::placeholder {
  color: var(--text-dim);
}

/* 原料列表滚动区 */
.ingredients-scroll-list {
  max-height: clamp(260px, calc(100vh - 500px), 440px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

/* 单个原料卡片 */
.ingredient-card {
  background: rgba(16, 14, 20, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.ingredient-card:hover {
  background: rgba(26, 22, 30, 0.9);
  border-color: var(--border-medium);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.ing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.ing-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ing-color-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
  display: inline-block;
}

.ing-liquid-vial {
  position: relative;
  width: 14px;
  height: 22px;
  border-radius: 6px 6px 7px 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5), inset 0 0 3px rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  vertical-align: middle;
}

.ing-liquid-vial .vial-liquid {
  width: 100%;
  height: 82%;
  border-radius: 0 0 5px 5px;
  position: relative;
  display: block;
}

.ing-liquid-vial .vial-liquid::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  filter: blur(0.5px);
}

.ing-liquid-vial .vial-glare {
  position: absolute;
  top: 1px;
  left: 1.5px;
  width: 3px;
  height: 16px;
  border-radius: 3px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.15) 80%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}

.ing-name {
  font-family: var(--font-serif-title);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.ing-origin-badge {
  font-size: 10px;
  color: var(--brass-dim);
  background: rgba(212, 175, 55, 0.08);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--font-mono-data);
}

.ing-abv {
  font-family: var(--font-mono-data);
  font-size: 11px;
  color: var(--brass-light);
}

.ing-notes {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
}

.ing-quick-add-row {
  display: flex;
  gap: 6px;
}

.quick-ml-btn {
  flex: 1;
  background: rgba(22, 19, 26, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-family: var(--font-mono-data);
  font-size: 11px;
  padding: 5px 0;
  cursor: pointer;
  transition: all 0.18s ease;
}

.quick-ml-btn:hover {
  background: rgba(212, 175, 55, 0.14);
  border-color: var(--brass-gold);
  color: var(--brass-light);
}

/* ==========================================
 * 中栏：3D 调酒舞台 (Stage Panel)
 * ========================================== */
.stage-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.canvas-container {
  width: 100%;
  max-width: 500px;
  aspect-ratio: 4 / 5;
  position: relative;
  background: #06080e;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0;
  box-shadow: var(--shadow-warm), inset 0 0 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0 auto;
}

#cocktailCanvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  display: block;
  cursor: grab;
  object-fit: contain;
  margin: 0 auto;
}

#cocktailCanvas:active {
  cursor: grabbing;
}

.capacity-gauge-pill {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(12, 11, 16, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--font-mono-data);
  font-size: 11px;
  color: var(--text-muted);
  pointer-events: none;
}

.gauge-bar-mini {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d4af37, #f59e0b);
  transition: width 0.3s ease;
}

/* 舞台操作工具栏 */
.stage-action-bar {
  width: 100%;
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.btn-action-primary,
.btn-action-secondary {
  border-radius: var(--radius-xs);
  padding: 10px 6px;
  font-family: var(--font-serif-title);
  font-size: 12px;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  border: 1px solid var(--border-subtle);
}

.btn-action-primary {
  background: linear-gradient(135deg, rgba(38, 30, 20, 0.9), rgba(20, 17, 14, 0.95));
  color: var(--brass-light);
  border-color: var(--border-medium);
}

.btn-action-primary:hover {
  border-color: var(--brass-gold);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.28);
  transform: translateY(-1px);
}

.btn-action-secondary {
  background: rgba(18, 16, 22, 0.85);
  color: var(--text-muted);
}

.btn-action-secondary:hover {
  background: rgba(28, 24, 34, 0.95);
  border-color: var(--border-medium);
  color: var(--text-main);
}

.btn-action-secondary#btnClearGlass:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
}

.btn-action-secondary#btnExportPolaroid:hover {
  border-color: var(--brass-gold);
  color: var(--brass-light);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.25);
}

/* ==========================================
 * 右栏：指标、雷达与调酒师寄语
 * ========================================== */
.cocktail-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.stat-pill {
  background: rgba(12, 11, 16, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-family: var(--font-mono-data);
  font-size: 15px;
  font-weight: 600;
  color: var(--brass-light);
}

.stat-label {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

.radar-container {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

/* 已倒入液体列表 */
.poured-list-box {
  background: rgba(12, 11, 16, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px;
  max-height: 130px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.empty-poured-tip {
  color: var(--text-dim);
  font-size: 11px;
  text-align: center;
  padding: 14px 0;
}

.poured-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  background: rgba(24, 21, 28, 0.6);
  border-radius: var(--radius-xs);
  font-size: 12px;
}

.poured-item-name {
  color: var(--text-main);
}

.poured-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.poured-item-ml {
  font-family: var(--font-mono-data);
  color: var(--brass-light);
  font-size: 11px;
}

.btn-del-poured {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 0 4px;
}

.btn-del-poured:hover {
  color: #ef4444;
}

/* 调酒师感官评语卡片 */
.bartender-commentary-card {
  background: linear-gradient(135deg, rgba(24, 20, 16, 0.9), rgba(14, 13, 18, 0.95));
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  position: relative;
}

.bartender-avatar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.bartender-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #221c16;
  border: 1px solid var(--brass-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.bartender-name {
  font-family: var(--font-serif-title);
  font-size: 12px;
  font-weight: 600;
  color: var(--brass-light);
}

.bartender-title {
  font-size: 10px;
  color: var(--text-dim);
}

.bartender-quote {
  font-family: var(--font-serif-body);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

/* ==========================================
 * 微醺心绪特调 (Alchemist Tab)
 * ========================================== */
.alchemist-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .alchemist-container {
    grid-template-columns: 1fr;
  }
}

.preset-moods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.mood-card {
  background: rgba(18, 16, 22, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 10px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.mood-card:hover {
  border-color: var(--border-medium);
  background: rgba(28, 24, 34, 0.85);
}

.mood-card.active {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--brass-gold);
  color: var(--brass-light);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.mood-card-icon {
  font-size: 18px;
  margin-bottom: 4px;
}

.mood-card-title {
  font-family: var(--font-serif-title);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.mood-card.active .mood-card-title {
  color: var(--brass-light);
}

.mood-card-desc {
  font-size: 10px;
  color: var(--text-dim);
}

.prompt-textarea {
  width: 100%;
  height: 80px;
  background: rgba(10, 9, 14, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  color: var(--text-main);
  font-family: var(--font-serif-body);
  font-size: 12px;
  line-height: 1.6;
  outline: none;
  resize: vertical;
  margin-bottom: 16px;
}

.prompt-textarea:focus {
  border-color: var(--brass-gold);
}

.btn-alchemist-generate {
  width: 100%;
  background: linear-gradient(135deg, rgba(46, 36, 22, 0.9), rgba(22, 18, 14, 0.95));
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  padding: 12px;
  color: var(--brass-light);
  font-family: var(--font-serif-title);
  font-size: 13px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-alchemist-generate:hover {
  border-color: var(--brass-gold);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.alchemist-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-warm);
}

.result-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.result-title {
  font-family: var(--font-serif-title);
  font-size: 20px;
  font-weight: 700;
  color: var(--brass-light);
  margin-bottom: 4px;
}

.result-en {
  font-family: var(--font-display-en);
  font-size: 11px;
  color: var(--brass-dim);
  letter-spacing: 1px;
}

.result-quote {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-style: italic;
}

.result-recipe-box {
  background: rgba(12, 11, 16, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 14px;
  margin-bottom: 16px;
}

.result-recipe-title {
  font-family: var(--font-serif-title);
  font-size: 12px;
  color: var(--brass-dim);
  margin-bottom: 8px;
}

.result-ing-tag {
  display: inline-block;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 4px 8px;
  font-family: var(--font-mono-data);
  font-size: 11px;
  color: var(--text-main);
  margin-right: 6px;
  margin-bottom: 6px;
}

.btn-pour-to-workbench {
  width: 100%;
  background: linear-gradient(135deg, rgba(38, 30, 20, 0.9), rgba(20, 17, 14, 0.95));
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  padding: 12px;
  color: var(--brass-light);
  font-family: var(--font-serif-title);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-pour-to-workbench:hover {
  border-color: var(--brass-gold);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.25);
}

/* ==========================================
 * 深夜酒单图鉴 (Master Menu Codex)
 * ========================================== */
.menu-filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.menu-filter-btn {
  background: rgba(18, 16, 22, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 6px 12px;
  font-family: var(--font-serif-body);
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.menu-filter-btn:hover {
  color: var(--text-muted);
}

.menu-filter-btn.active {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--brass-gold);
  color: var(--brass-light);
}

.cocktail-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.menu-cocktail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.22s ease;
}

.menu-cocktail-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-warm), 0 0 16px rgba(212, 175, 55, 0.12);
}

.menu-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.menu-cocktail-name {
  font-family: var(--font-serif-title);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.menu-abv-tag {
  font-family: var(--font-mono-data);
  font-size: 11px;
  color: var(--brass-light);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 3px;
}

.menu-cocktail-en {
  font-family: var(--font-display-en);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--brass-dim);
  margin-bottom: 10px;
}

.menu-card-story {
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.menu-card-ingredients {
  font-family: var(--font-mono-data);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.menu-card-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.btn-menu-mix {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--brass-light);
  padding: 6px 14px;
  font-family: var(--font-serif-body);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-menu-mix:hover {
  background: rgba(212, 175, 55, 0.22);
  border-color: var(--brass-gold);
}

/* ==========================================
 * 私人典藏酒柜 (Private Cabinet)
 * ========================================== */
.cabinet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.cabinet-empty-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-dim);
  font-family: var(--font-serif-title);
  font-size: 15px;
}

/* ==========================================
 * 拍立得预览模态框 (Polaroid Modal)
 * ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  display: none;
  pointer-events: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  pointer-events: auto;
}

.modal-content {
  background: #0d0c11;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 24px;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85);
  position: relative;
}

.modal-content::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: inherit;
  pointer-events: none;
}

.polaroid-img-preview {
  width: 100%;
  max-width: 380px;
  border-radius: var(--radius-xs);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85);
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}


/* ==========================================================================
   Mobile & Touchscreen Responsive Enhancements (iOS & Android)
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  body {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .app-header {
    padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top));
    gap: 8px;
  }

  .brand-title {
    font-size: 15px;
  }

  .brand-subtitle {
    display: none; /* 移动端隐藏过长副标题保持精简 */
  }

  .header-actions {
    gap: 6px;
  }

  .btn-icon-label {
    display: none; /* 移动端仅保留图标按钮保持紧凑 */
  }

  .btn-version-switcher {
    padding: 4px 8px;
    font-size: 11px;
  }

  .app-main {
    padding: 10px 10px 24px;
  }

  .workbench-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .workbench-grid > .glass-panel {
    max-height: none; /* 移动端单列自适应平铺，避免局部滚动冲突 */
    overflow-y: visible;
  }

  .canvas-container {
    max-width: 100%;
    aspect-ratio: 1 / 1; /* 移动端画幅调整为 1:1 正方形黄金视角 */
    touch-action: pan-y; /* 允许页面正常纵向滑动，横向拖拽旋转3D酒杯 */
  }

  .modal-content {
    width: 94vw;
    max-width: 440px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 18px 14px;
    margin: auto;
  }

  .polaroid-img-preview {
    max-width: 100%;
    max-height: 48vh;
    object-fit: contain;
  }

  .modal-actions {
    flex-direction: column;
    gap: 8px;
  }

  .modal-actions button,
  .btn-action,
  .btn-pour,
  .technique-btn {
    min-height: 44px; /* 符合苹果 iOS 人机交互指南 44px 手指点按最小高度 */
  }
}

@media (max-width: 480px) {
  .brand-title {
    font-size: 14px;
  }

  .cabinet-tabs {
    gap: 4px;
  }

  .cabinet-tab {
    padding: 6px 8px;
    font-size: 11px;
  }

  .spirit-grid {
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 6px;
  }

  .spirit-card {
    padding: 8px 4px;
  }

  .spirit-card-name {
    font-size: 11px;
  }
}
