/* ============================================
   嘆嘆手作糖水铺｜探店打卡中心 - 样式表
   风格：日式复古 × 奶油风
   优化：移动端适配 + UI升级 + 性能精简
   ============================================ */

/* ---------- CSS 变量 ---------- */
:root {
  --cream: #FFF8F0;
  --cream-light: #FFFDF9;
  --beige: #F5E6D3;
  --wood: #DEB887;
  --coffee-light: #C8A882;
  --coffee: #A1887F;
  --coffee-dark: #8D6E63;
  --brown: #5D4037;
  --brown-deep: #4E342E;
  --pink: #F8E8E0;
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 22px;
  --radius-xl: 28px;
  --radius-full: 50px;
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- 重置 ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--cream);
  color: var(--brown);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

/* ---------- 容器 ---------- */
.app-container {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cream);
  position: relative;
  overflow-x: hidden;
}

.safe-area-bottom {
  height: var(--safe-bottom);
}

/* ---------- 通用段落 ---------- */
.section {
  padding: 32px 20px;
  position: relative;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--brown);
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: 1.5px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--coffee);
  text-align: center;
  margin-bottom: 16px;
}

.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 4px auto 24px;
  max-width: 160px;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--coffee-light), transparent);
}

.section-divider span {
  font-size: 10px;
  color: var(--coffee-light);
}

/* ============================================
   Hero Banner
   ============================================ */
.hero-section {
  position: relative;
  padding: 0;
}

.hero-bg {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: flex;
}

.hero-banner-grid {
  display: flex;
  width: 100%;
  height: 100%;
}

.hero-banner-img {
  width: 50%;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 248, 240, 0.1) 0%,
    rgba(255, 248, 240, 0.3) 40%,
    rgba(255, 248, 240, 0.88) 72%,
    var(--cream) 100%
  );
}

.hero-content {
  position: relative;
  margin-top: -60px;
  padding: 0 24px 24px;
  text-align: center;
  z-index: 2;
}

.hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--pink), var(--beige));
  color: var(--coffee-dark);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
  letter-spacing: 2px;
  border: 1px solid rgba(200, 168, 130, 0.25);
}

.hero-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--brown-deep);
  letter-spacing: 3px;
  margin-bottom: 6px;
  line-height: 1.3;
}

.hero-title-en {
  font-size: 10px;
  color: var(--coffee-light);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-weight: 400;
}

.hero-desc {
  font-size: 14px;
  color: var(--coffee);
  margin-bottom: 22px;
  line-height: 1.8;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 260px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--coffee-dark), var(--brown-deep));
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform 0.3s var(--ease-bounce), box-shadow 0.3s var(--ease-out);
  box-shadow: 0 4px 20px rgba(93, 64, 55, 0.25);
  letter-spacing: 2px;
  position: relative;
  overflow: hidden;
}

.hero-cta:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 2px 10px rgba(93, 64, 55, 0.2);
}

.hero-cta .cta-icon {
  font-size: 16px;
}

/* 产品缩略图 */
.hero-products {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: center;
}

.hero-product-thumb {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 12px rgba(93, 64, 55, 0.1);
  transition: transform 0.3s var(--ease-bounce);
  will-change: transform;
}

.hero-product-thumb:active {
  transform: scale(0.95);
}

.hero-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   平台选择
   ============================================ */
.platform-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.platform-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1.5px solid rgba(200, 168, 130, 0.25);
  border-radius: var(--radius-l);
  background: var(--cream-light);
  cursor: pointer;
  transition: transform 0.3s var(--ease-bounce), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  min-height: 68px;
}

.platform-btn:active {
  transform: scale(0.97);
  border-color: var(--coffee-light);
}

.platform-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-s);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.xhs-icon {
  background: linear-gradient(135deg, #FF2C44, #FF6B81);
  box-shadow: 0 2px 8px rgba(255, 44, 68, 0.25);
}

.dy-icon {
  background: linear-gradient(135deg, #1a1a1a, #333);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.dp-icon {
  background: linear-gradient(135deg, #FF9900, #FFB340);
  box-shadow: 0 2px 8px rgba(255, 153, 0, 0.25);
}

.platform-info {
  flex: 1;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.platform-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 2px;
}

.platform-hint {
  font-size: 12px;
  color: var(--coffee);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-arrow {
  font-size: 20px;
  color: var(--coffee-light);
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.platform-btn:active .platform-arrow {
  transform: translateX(3px);
}

/* 平台提示 */
.platform-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  padding: 10px 16px;
  background: var(--pink);
  border-radius: var(--radius-m);
  font-size: 12px;
  color: var(--coffee-dark);
  text-align: center;
  line-height: 1.5;
}

.tip-icon {
  flex-shrink: 0;
}

/* ============================================
   推荐文案
   ============================================ */
.copy-card {
  background: var(--cream-light);
  border: 1px solid rgba(200, 168, 130, 0.2);
  border-radius: var(--radius-l);
  padding: 18px;
  margin-bottom: 12px;
  position: relative;
  box-shadow: 0 1px 8px rgba(93, 64, 55, 0.04);
}

.copy-card-tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--pink), var(--beige));
  color: var(--coffee-dark);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.copy-card-text {
  font-size: 14px;
  line-height: 1.9;
  color: var(--brown);
  margin-bottom: 12px;
  white-space: pre-line;
}

.copy-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.hashtag {
  font-size: 11px;
  color: var(--coffee-dark);
  background: var(--beige);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--coffee-dark), var(--brown-deep));
  color: #fff;
  border: none;
  border-radius: var(--radius-m);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s var(--ease-bounce), box-shadow 0.3s var(--ease-out);
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  min-height: 46px;
}

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

.copy-btn.copied {
  background: linear-gradient(135deg, #66BB6A, #43A047);
}

.copy-btn .btn-icon {
  font-size: 16px;
}

/* ============================================
   拍摄参考
   ============================================ */
.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.photo-item {
  border-radius: var(--radius-l);
  overflow: hidden;
  position: relative;
  background: var(--beige);
  cursor: default;
}

.photo-item.large {
  grid-column: 1 / -1;
  aspect-ratio: 2 / 1;
}

.photo-item.small {
  aspect-ratio: 4 / 3;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  will-change: transform;
}

.photo-item-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 12px 10px;
  background: linear-gradient(transparent, rgba(78, 52, 46, 0.6));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.photo-item-tip {
  display: block;
  font-size: 10px;
  font-weight: 400;
  opacity: 0.85;
  margin-top: 2px;
}

/* ============================================
   发布流程
   ============================================ */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 32px;
}

.steps-list::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 26px;
  bottom: 26px;
  width: 2px;
  background: linear-gradient(180deg, var(--coffee-light), var(--beige), var(--coffee-light));
  border-radius: 1px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 0;
  position: relative;
}

.step-number {
  position: absolute;
  left: -32px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coffee-dark), var(--brown-deep));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(93, 64, 55, 0.2);
}

.step-content {
  flex: 1;
  background: var(--cream-light);
  border: 1px solid rgba(200, 168, 130, 0.15);
  border-radius: var(--radius-m);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 1px 6px rgba(93, 64, 55, 0.04);
}

.step-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 1px;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 3px;
}

.step-desc {
  font-size: 12px;
  color: var(--coffee);
  line-height: 1.6;
}

/* ============================================
   上传截图
   ============================================ */
.upload-area {
  background: var(--cream-light);
  border: 2px dashed rgba(200, 168, 130, 0.35);
  border-radius: var(--radius-l);
  padding: 28px 20px;
  text-align: center;
  transition: border-color 0.3s, background 0.3s;
  cursor: pointer;
  position: relative;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.upload-area:focus {
  outline: 2px solid var(--coffee-light);
  outline-offset: 2px;
}

.upload-area.has-file {
  border-color: var(--coffee-dark);
  border-style: solid;
}

.upload-icon {
  font-size: 36px;
  margin-bottom: 8px;
  display: block;
}

.upload-text {
  font-size: 15px;
  color: var(--coffee-dark);
  margin-bottom: 4px;
  font-weight: 500;
}

.upload-hint {
  font-size: 12px;
  color: var(--coffee-light);
}

.upload-preview {
  display: none;
  width: 100%;
}

.upload-preview.active {
  display: block;
}

.upload-preview img {
  max-height: 180px;
  border-radius: var(--radius-m);
  object-fit: contain;
  margin: 0 auto;
}

.file-name {
  font-size: 12px;
  color: var(--coffee);
  margin-top: 8px;
  word-break: break-all;
}

.change-file-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 16px;
  background: var(--beige);
  border: none;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--coffee-dark);
  cursor: pointer;
  transition: background 0.3s;
}

.change-file-btn:active {
  background: var(--wood);
}

.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  margin-top: 16px;
  background: linear-gradient(135deg, var(--coffee-dark), var(--brown-deep));
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s var(--ease-bounce), box-shadow 0.3s var(--ease-out);
  box-shadow: 0 4px 20px rgba(93, 64, 55, 0.25);
  letter-spacing: 2px;
  position: relative;
  overflow: hidden;
  min-height: 50px;
}

.submit-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.submit-btn:disabled {
  background: var(--coffee-light);
  color: var(--beige);
  cursor: not-allowed;
  box-shadow: none;
}

/* ============================================
   成功弹窗
   ============================================ */
.success-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(78, 52, 46, 0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.success-modal.active {
  display: flex;
  animation: fadeIn 0.25s ease;
}

.success-card {
  background: var(--cream-light);
  border-radius: var(--radius-xl);
  padding: 36px 24px 28px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.4s var(--ease-bounce);
  box-shadow: 0 20px 60px rgba(78, 52, 46, 0.15);
}

.success-icon {
  font-size: 52px;
  margin-bottom: 14px;
  display: block;
  animation: bounceIn 0.6s var(--ease-bounce);
}

.success-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--brown-deep);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.success-desc {
  font-size: 14px;
  color: var(--coffee);
  line-height: 1.7;
  margin-bottom: 20px;
}

.success-benefit {
  background: linear-gradient(135deg, var(--pink), var(--beige));
  border-radius: var(--radius-m);
  padding: 16px;
  margin-bottom: 22px;
  border: 1px solid rgba(200, 168, 130, 0.2);
}

.success-benefit-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--coffee-dark);
  margin-bottom: 6px;
}

.success-benefit-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--brown-deep);
  letter-spacing: 1px;
}

.success-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--coffee-dark), var(--brown-deep));
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s var(--ease-bounce);
  letter-spacing: 1px;
  min-height: 48px;
}

/* QR Code in success modal */
.success-qr-area {
  margin-bottom: 20px;
  padding-top: 4px;
}

.success-qr-hint {
  font-size: 12px;
  color: var(--coffee);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.success-qr-wrap {
  display: inline-block;
  background: #fff;
  border-radius: var(--radius-m);
  padding: 12px;
  box-shadow: 0 2px 12px rgba(78, 52, 46, 0.08);
  margin-bottom: 8px;
}

.success-qr-wrap canvas {
  display: block;
  width: 140px;
  height: 140px;
  border-radius: 4px;
}

.success-qr-desc {
  font-size: 11px;
  color: var(--coffee);
  opacity: 0.7;
}

.success-close-btn:active {
  transform: scale(0.97);
}

/* ============================================
   QR Code Section
   ============================================ */
.qr-section {
  text-align: center;
}
.qr-hint {
  font-size: 13px;
  color: var(--coffee);
  margin-bottom: 16px;
}
.qr-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: 22px;
  padding: 24px 28px 20px;
  box-shadow: 0 2px 16px rgba(141,110,99,0.08);
  border: 1px solid var(--light-wood);
}
.page-qr-canvas {
  width: 180px;
  height: 180px;
  border-radius: 10px;
}
.qr-url {
  font-size: 11px;
  color: var(--coffee);
  margin: 10px 0 14px;
  word-break: break-all;
  max-width: 220px;
  line-height: 1.4;
  opacity: 0.7;
}
.qr-save-btn {
  min-height: 40px;
  font-size: 14px;
  padding: 10px 28px;
  width: auto;
  margin: 0;
}

.download-source-btn {
  min-height: 40px;
  font-size: 14px;
  padding: 10px 28px;
  width: auto;
  margin: 0;
  background-color: #A1887F;
  color: #FFF;
}

.download-source-btn:active {
  transform: scale(0.97);
  background-color: #8D6E63;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  text-align: center;
  padding: 24px 20px 32px;
  border-top: 1px solid rgba(200, 168, 130, 0.15);
  margin-top: 8px;
}

.footer-deco {
  font-size: 8px;
  color: var(--coffee-light);
  letter-spacing: 8px;
  margin-bottom: 10px;
}

.footer-brand {
  font-size: 14px;
  font-weight: 600;
  color: var(--coffee-dark);
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.footer-text {
  font-size: 10px;
  color: var(--coffee-light);
  line-height: 1.7;
}

/* ============================================
   Toast
   ============================================ */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  background: rgba(78, 52, 46, 0.88);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-m);
  font-size: 14px;
  font-weight: 500;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease-bounce);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  text-align: center;
  max-width: 260px;
  line-height: 1.5;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ============================================
   动画关键帧
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.3); }
  60% { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

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

/* 滚动进入 */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  will-change: opacity, transform;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 涟漪 */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0);
  animation: rippleEffect 0.5s linear;
  pointer-events: none;
}

@keyframes rippleEffect {
  to { transform: scale(4); opacity: 0; }
}

/* 隐藏文件输入 */
.file-input-hidden {
  display: none;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 360px) {
  .hero-title {
    font-size: 22px;
    letter-spacing: 2px;
  }

  .hero-bg {
    aspect-ratio: 3 / 2.5;
  }

  .section {
    padding: 24px 16px;
  }

  .hero-content {
    padding: 0 18px 20px;
  }

  .hero-cta {
    max-width: 240px;
    padding: 13px 24px;
    font-size: 15px;
  }

  .hero-product-thumb {
    width: 60px;
    height: 60px;
  }

  .platform-btn {
    padding: 14px 14px;
    min-height: 62px;
  }

  .platform-icon {
    width: 40px;
    height: 40px;
  }

  .platform-name {
    font-size: 15px;
  }

  .copy-card {
    padding: 16px;
  }
}

@media (min-width: 421px) {
  .app-container {
    box-shadow: -1px 0 0 rgba(200, 168, 130, 0.12), 1px 0 0 rgba(200, 168, 130, 0.12);
  }
}

/* ============================================
   后台配置面板
   ============================================ */

/* 配置按钮（Footer 内） */
.config-toggle-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--coffee-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.config-toggle-btn:active {
  transform: scale(0.9);
  background: rgba(200, 168, 130, 0.12);
}

/* 遮罩层 */
.config-overlay {
  position: fixed;
  inset: 0;
  background: rgba(78, 52, 46, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--ease-out);
}

.config-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 配置面板主体 */
.config-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 420px;
  margin: 0 auto;
  max-height: 85vh;
  background: var(--cream-light);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 910;
  transform: translateY(100%);
  transition: transform 0.35s var(--ease-bounce);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.config-panel.active {
  transform: translateY(0);
}

/* 头部 */
.config-header {
  padding: 24px 20px 12px;
  flex-shrink: 0;
}

.config-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--brown);
  margin-bottom: 4px;
}

.config-desc {
  font-size: 13px;
  color: var(--coffee-light);
}

/* Tab 切换 */
.config-tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--beige);
  flex-shrink: 0;
}

.config-tab-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--coffee-light);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.config-tab-btn.active {
  color: var(--coffee-dark);
}

.config-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--coffee-dark);
  border-radius: 1px;
}

/* Tab 内容区 */
.config-tab-content {
  display: none;
  padding: 16px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.config-tab-content.active {
  display: block;
}

/* 表单字段 */
.config-field {
  margin-bottom: 14px;
}

.config-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 5px;
}

.config-field input,
.config-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--beige);
  border-radius: var(--radius-s);
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  color: var(--brown);
  line-height: 1.5;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.config-field input:focus,
.config-field textarea:focus {
  outline: none;
  border-color: var(--coffee);
}

.config-field textarea {
  resize: vertical;
  min-height: 80px;
}

/* 操作按钮 */
.config-actions {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  padding-bottom: calc(14px + var(--safe-bottom));
  border-top: 1px solid var(--beige);
  flex-shrink: 0;
}

.config-reset-btn,
.config-save-btn {
  flex: 1;
  padding: 12px 0;
  border: none;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s var(--ease-out);
}

.config-reset-btn {
  background: var(--beige);
  color: var(--brown);
}

.config-save-btn {
  background: var(--coffee-dark);
  color: #fff;
}

.config-reset-btn:active,
.config-save-btn:active {
  transform: scale(0.97);
}

/* 配置面板在小屏下的微调 */
@media (max-width: 360px) {
  .config-field input,
  .config-field textarea {
    font-size: 12px;
    padding: 8px 10px;
  }

  .config-tab-btn {
    font-size: 13px;
  }
}
