/* ====== 磐小咖 H5 - 样式 ====== */

:root {
  --brand: #c8924b;
  --brand-dark: #a67a3b;
  --brand-light: #f5f0eb;
  --text: #2c2c2c;
  --text-light: #888;
  --bg: #f9f6f1;
  --white: #fff;
  --danger: #e74c3c;
  --success: #27ae60;
  --radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-tap-highlight-color: transparent;
}

/* ====== Page 切换 ====== */
.page { display: none; width: 100%; max-width: 400px; }
.page.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ====== Card ====== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.logo { font-size: 48px; margin-bottom: 8px; }

h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }

.sub { font-size: 14px; color: var(--text-light); margin-bottom: 8px; }
.desc { font-size: 14px; color: var(--text-light); margin: 12px 0; line-height: 1.6; }

.divider {
  height: 1px; background: #eee; margin: 20px 0;
}

/* ====== Icon Box ====== */
.icon-box {
  width: 72px; height: 72px; margin: 12px auto;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 32px; background: var(--brand-light);
}
.icon-box.large { width: 88px; height: 88px; font-size: 40px; }
.icon-box.success { background: #e8f5e9; }
.icon-box.cooldown { background: #fff8e1; }
.icon-box.fail { background: #fce4ec; }

.icon-emoji { line-height: 1; }

/* ====== 表单 ====== */
.form-group { margin: 16px 0; }

.form-group label {
  display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px;
  color: var(--text);
}

.input-room {
  width: 100%; padding: 14px 16px; border: 2px solid #e0d5c7;
  border-radius: var(--radius); font-size: 18px; text-align: center;
  outline: none; transition: border-color 0.2s; background: var(--white);
  letter-spacing: 2px;
}
.input-room:focus { border-color: var(--brand); }

/* ====== 按钮 ====== */
.btn {
  display: inline-block; padding: 12px 36px; border-radius: var(--radius);
  font-size: 16px; font-weight: 600; cursor: pointer; border: none;
  transition: all 0.2s; text-align: center;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-primary { background: var(--brand); color: var(--white); }
.btn-primary:active { background: var(--brand-dark); }

.btn-outline { background: var(--white); color: var(--brand); border: 1.5px solid var(--brand); }

.btn-lg { padding: 14px 48px; font-size: 18px; }
.btn-full { width: 100%; }

.btn-row { margin: 16px 0; }

/* ====== Loading ====== */
.loading-spinner {
  width: 36px; height: 36px; margin: 0 auto 16px;
  border: 3px solid var(--brand-light); border-top-color: var(--brand);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.loading-text { font-size: 14px; color: var(--text-light); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ====== 冷却倒计时 ====== */
.cooldown-box {
  background: var(--brand-light); border-radius: var(--radius);
  padding: 16px; margin: 12px 0;
}
.cooldown-box span { font-size: 16px; color: var(--brand); font-weight: 600; }

/* ====== 抖动 ====== */
.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}

/* ====== 企业微信二维码 ====== */
.qr-box {
  width: 180px; height: 180px; margin: 16px auto;
  border-radius: var(--radius); overflow: hidden;
  border: 3px solid var(--brand-light);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.qr-code { width: 100%; height: 100%; object-fit: cover; display: block; }

.qr-tip {
  font-size: 13px; color: var(--brand);
  margin-top: 8px; font-weight: 500;
}

/* ====== wx-open-launch-weapp 容器 ====== */
wx-open-launch-weapp {
  display: inline-block; width: 100%; margin-top: 8px;
}

/* ====== 后台管理页 ====== */
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.admin-header h2 { margin: 0; }

.admin-row {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.admin-row .input-room { flex: 1; font-size: 16px; padding: 10px 14px; }

.room-tags {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0;
}
.room-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand-light); color: var(--brand);
  padding: 6px 12px; border-radius: 20px; font-size: 14px;
  font-weight: 500;
}
.room-tag .del {
  cursor: pointer; font-size: 16px; line-height: 1;
  opacity: 0.6; transition: opacity 0.2s;
}
.room-tag .del:hover { opacity: 1; }

.empty-state { color: var(--text-light); font-size: 14px; padding: 20px 0; }

.btn-sm { padding: 8px 20px; font-size: 14px; }
.btn-block { width: 100%; }
