/* 拼豆拼拼 · 多巴胺糖果像素主题
   设计基调：马卡龙撞色 + 拼豆点阵 + 大圆角 + 柔和糖果投影，移动端 375 基准 */

:root {
  /* 多巴胺色板 */
  --bean-peach: #FF8A65;
  --bean-mint: #4ECDC4;
  --bean-taro: #A78BFA;
  --bean-butter: #FFD166;
  --bean-sky: #5AA9E6;
  --bean-berry: #FF6FA5;

  /* 中性 */
  --bean-bg: #FFF9F2;
  --bean-surface: #FFFFFF;
  --bean-ink: #2B2140;
  --bean-ink-soft: #6B6382;
  --bean-line: #F0E4DA;
  --bean-mute: #B9AFC4;

  /* 语义 */
  --bean-success: #3FBF8F;
  --bean-warn: #F5A524;
  --bean-danger: #F2586B;

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-candy: 0 6px 18px rgba(167, 139, 250, 0.18);
  --shadow-soft: 0 2px 10px rgba(43, 33, 64, 0.06);
  --bean-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bean-bg);
  color: var(--bean-ink);
  font-family: var(--bean-font);
  font-size: 15px;
  line-height: 1.55;
}

body {
  /* 拼豆点阵底纹 */
  background-image: radial-gradient(var(--bean-line) 1.4px, transparent 1.5px);
  background-size: 18px 18px;
  padding-bottom: calc(68px + env(safe-area-inset-bottom));
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- 布局 ---------- */
.bean-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 24px;
}

.bean-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px calc(10px + env(safe-area-inset-top));
  background: linear-gradient(180deg, var(--bean-bg) 70%, rgba(255, 249, 242, 0));
}

.bean-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.bean-lang {
  border: 2px solid var(--bean-ink);
  background: var(--bean-butter);
  color: var(--bean-ink);
  font-weight: 800;
  font-size: 13px;
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
}

/* ---------- 卡片 ---------- */
.bean-card {
  background: var(--bean-surface);
  border: 2px solid var(--bean-line);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
}

.bean-card--candy {
  border-color: var(--bean-taro);
  box-shadow: var(--shadow-candy);
}

.bean-hero {
  background: linear-gradient(135deg, var(--bean-peach), var(--bean-taro) 60%, var(--bean-sky));
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-candy);
}

.bean-hero h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.bean-hero p {
  margin: 0;
  opacity: 0.92;
}

/* ---------- 按钮 ---------- */
.bean-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--bean-peach), var(--bean-berry));
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  font-family: var(--bean-font);
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(255, 111, 165, 0.32);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.bean-btn:active {
  transform: translateY(1px) scale(0.995);
}

.bean-btn:disabled {
  opacity: 0.5;
  box-shadow: none;
  cursor: not-allowed;
}

.bean-btn--ghost {
  background: var(--bean-surface);
  color: var(--bean-ink);
  border: 2px solid var(--bean-ink);
  box-shadow: none;
}

.bean-btn--mint {
  background: linear-gradient(135deg, var(--bean-mint), var(--bean-sky));
  box-shadow: 0 6px 14px rgba(78, 205, 196, 0.32);
}

.bean-btn--sm {
  min-height: 34px;
  width: auto;
  font-size: 13px;
  padding: 0 14px;
}

/* ---------- 拼豆元素 ---------- */
.bean-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 10px;
}

.bean-dot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bean-surface);
  border: 2px solid var(--bean-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--bean-ink-soft);
  cursor: pointer;
}

.bean-dot::after {
  /* 拼豆的孔洞 */
  content: "";
  width: 34%;
  height: 34%;
  border-radius: 50%;
  background: rgba(43, 33, 64, 0.12);
}

.bean-dot--taken {
  background: var(--bean-line);
  color: var(--bean-mute);
  cursor: not-allowed;
  opacity: 0.6;
}

.bean-dot--selected {
  background: var(--bean-butter);
  border-color: var(--bean-ink);
  color: var(--bean-ink);
  box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.35);
}

.bean-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid var(--bean-line);
  background: var(--bean-surface);
  color: var(--bean-ink-soft);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.bean-chip--active {
  border-color: var(--bean-ink);
  background: var(--bean-mint);
  color: var(--bean-ink);
}

.bean-chip--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bean-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: var(--bean-mint);
}

.bean-badge--warn {
  background: var(--bean-warn);
}

.bean-badge--danger {
  background: var(--bean-danger);
}

.bean-badge--soft {
  background: var(--bean-line);
  color: var(--bean-ink-soft);
}

/* ---------- 文字与结构 ---------- */
.bean-section-title {
  margin: 18px 0 10px;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bean-section-title::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bean-peach);
  box-shadow: -14px 0 0 var(--bean-butter), 14px 0 0 var(--bean-mint);
}

.bean-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bean-muted {
  color: var(--bean-ink-soft);
  font-size: 13px;
}

.bean-price {
  color: var(--bean-peach);
  font-weight: 800;
  font-size: 17px;
}

.bean-divider {
  height: 2px;
  background: var(--bean-line);
  border-radius: 2px;
  margin: 12px 0;
}

.bean-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.bean-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--bean-mute);
  font-size: 14px;
}

.bean-empty::before {
  content: "";
  display: block;
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--bean-butter), var(--bean-taro));
  opacity: 0.55;
}

/* ---------- 底部导航 ---------- */
.bean-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 2px solid var(--bean-line);
  backdrop-filter: blur(8px);
}

.bean-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--bean-mute);
}

.bean-tab--active {
  color: var(--bean-ink);
}

.bean-tab-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bean-line);
}

.bean-tab--active .bean-tab-icon {
  background: radial-gradient(circle at 35% 35%, var(--bean-peach), var(--bean-butter));
  box-shadow: 0 0 0 3px rgba(255, 138, 101, 0.2);
}

/* ---------- 表单 ---------- */
.bean-input,
.bean-select,
.bean-textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid var(--bean-line);
  border-radius: var(--radius-md);
  background: var(--bean-surface);
  color: var(--bean-ink);
  font-size: 15px;
  font-family: var(--bean-font);
}

.bean-input:focus,
.bean-select:focus,
.bean-textarea:focus {
  outline: none;
  border-color: var(--bean-taro);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}

.bean-label {
  display: block;
  margin: 10px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--bean-ink-soft);
}

/* ---------- 浮层 ---------- */
.bean-toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--bean-ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.bean-toast--show {
  opacity: 0.96;
}

.bean-bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 2px solid var(--bean-line);
}

.bean-bottombar .bean-btn {
  width: auto;
  flex: 1;
}

/* ---------- 响应式 ---------- */
@media (max-width: 480px) {
  .bean-page {
    padding: 0 12px 20px;
  }

  .bean-grid {
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
    gap: 8px;
  }
}

@media (min-width: 768px) {
  body {
    padding-bottom: 24px;
  }

  .bean-tabbar {
    position: static;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 999px;
    border: 2px solid var(--bean-line);
    margin-bottom: 24px;
  }
}
