/* 全局样式基线：移植自 app.wxss
 * 尺寸换算说明：小程序 750rpx = 100vw，本 Web 版按「1rpx ≈ 0.5px」等比缩放，
 * 并以 max-width 容器居中，兼顾手机与桌面浏览。
 */

:root {
  /* 主色：香槟金 */
  --c-gold: #c6a15b;
  --c-gold-light: #e3cea0;
  --c-gold-deep: #a8843f;
  /* 底色 */
  --c-bg: #fbf7f2;
  --c-bg-alt: #f4ece3;
  --c-card: #ffffff;
  /* 文字 */
  --c-text: #3e3227;
  --c-text-sub: #8a7a6a;
  --c-text-light: #b3a695;
  /* 点缀：豆沙红 */
  --c-accent: #c98b8b;
  --c-line: rgba(198, 161, 91, 0.24);
  /* 尺寸 */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --gap: 16px;
  --page-padding: 20px;
  /* 阴影 */
  --shadow-card: 0 4px 16px rgba(62, 50, 39, 0.06);
  --shadow-float: 0 6px 24px rgba(62, 50, 39, 0.12);
  /* 内容最大宽度（桌面端居中显示） */
  --app-max-width: 540px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background-color: #ece4da;
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.6;
  font-family: -apple-system, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* ============ 应用容器 ============ */
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: var(--app-max-width);
  margin: 0 auto;
  background-color: var(--c-bg);
  overflow-x: hidden;
}

.page-body {
  padding: 0 var(--page-padding) 30px;
}

/* ============ 顶部导航（替代自定义 navigation-bar） ============ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  height: calc(44px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) var(--page-padding) 0;
  background: rgba(251, 247, 242, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--c-line);
}

.navbar__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  color: var(--c-gold-deep);
  background: rgba(198, 161, 91, 0.1);
  cursor: pointer;
}

.navbar__title {
  flex: 1;
  font-size: 16px;
  letter-spacing: 3px;
  color: var(--c-text);
}

/* ============ 卡片 ============ */
.card {
  background-color: var(--c-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 20px;
  margin-bottom: var(--gap);
}

/* ============ 标题 ============ */
.section-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 28px 0 16px;
}

.section-title__cn {
  font-size: 20px;
  color: var(--c-text);
  letter-spacing: 4px;
  font-weight: 500;
}

.section-title__en {
  font-size: 10px;
  color: var(--c-gold);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 4px;
}

.section-title__line {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-gold), transparent);
  margin-top: 8px;
}

/* ============ 按钮 ============ */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--c-gold-light), var(--c-gold));
  color: #ffffff;
  font-size: 16px;
  letter-spacing: 2px;
  box-shadow: 0 4px 12px rgba(198, 161, 91, 0.32);
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.btn-primary:active {
  transform: scale(0.96);
  opacity: 0.88;
}

.btn-primary--disabled,
.btn-primary:disabled {
  background: #ddd5ca;
  box-shadow: none;
  color: #ffffff;
  cursor: not-allowed;
}

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border-radius: 24px;
  background: transparent;
  border: 1px solid var(--c-gold);
  color: var(--c-gold-deep);
  font-size: 16px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.btn-ghost:active {
  transform: scale(0.96);
  background-color: rgba(198, 161, 91, 0.08);
}

/* ============ 表单 ============ */
.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

.field__label {
  font-size: 13px;
  color: var(--c-text-sub);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.field__label--required::after {
  content: '*';
  color: var(--c-accent);
  margin-left: 4px;
}

.field__input,
.field__textarea {
  width: 100%;
  padding: 0 16px;
  height: 46px;
  background-color: var(--c-bg-alt);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--c-text);
  font-family: inherit;
  outline: none;
}

.field__input:focus,
.field__textarea:focus {
  border-color: var(--c-gold);
}

.field__textarea {
  min-height: 90px;
  padding: 12px 16px;
  line-height: 1.6;
  resize: vertical;
}

.field__input::placeholder,
.field__textarea::placeholder {
  color: var(--c-text-light);
}

/* ============ 分段选择 ============ */
.segment {
  display: flex;
  background-color: var(--c-bg-alt);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.segment__item {
  flex: 1;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--c-text-sub);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.segment__item--active {
  background-color: var(--c-card);
  color: var(--c-gold-deep);
  font-weight: 500;
  box-shadow: 0 1px 6px rgba(62, 50, 39, 0.08);
}

/* ============ 步进器 ============ */
.stepper {
  display: flex;
  align-items: center;
  align-self: flex-start;
  background-color: var(--c-bg-alt);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.stepper__btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--c-gold-deep);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.16s ease;
}

.stepper__btn:active {
  background-color: rgba(198, 161, 91, 0.14);
}

.stepper__btn--disabled {
  color: var(--c-text-light);
  cursor: not-allowed;
}

.stepper__value {
  min-width: 50px;
  text-align: center;
  font-size: 16px;
  color: var(--c-text);
  font-weight: 500;
}

/* ============ 分隔线 / 空状态 ============ */
.divider {
  height: 1px;
  background-color: var(--c-line);
  margin: 16px 0;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 0;
}

.empty__text {
  font-size: 13px;
  color: var(--c-text-light);
  letter-spacing: 1px;
}

/* ============ 动效 ============ */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes soft-zoom {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.anim-fade-in { animation: fade-in 0.6s ease both; }
.anim-fade-in-up { animation: fade-in-up 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.anim-soft-zoom { animation: soft-zoom 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) both; }

.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }
.delay-5 { animation-delay: 0.4s; }

/* ============ 工具类 ============ */
.text-center { text-align: center; }
.text-gold { color: var(--c-gold-deep); }
.text-sub { color: var(--c-text-sub); }
.text-sm { font-size: 12px; }
.text-serif { font-family: 'Songti SC', 'STSong', 'SimSun', serif; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
[hidden] { display: none !important; }

/* ============ 轻提示 toast ============ */
.w-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  max-width: 70vw;
  padding: 12px 20px;
  border-radius: 10px;
  background: rgba(40, 32, 26, 0.88);
  color: #fff;
  font-size: 14px;
  text-align: center;
  animation: fade-in 0.2s ease both;
}

/* ============ 加载遮罩 ============ */
.w-loading {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 26px;
  border-radius: 12px;
  background: rgba(40, 32, 26, 0.82);
  color: #fff;
  font-size: 13px;
}

.w-loading__spinner {
  width: 26px;
  height: 26px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: w-spin 0.8s linear infinite;
}

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

/* ============ 对话框（替代 wx.showModal） ============ */
.w-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 16, 12, 0.45);
  animation: fade-in 0.2s ease both;
}

.w-modal {
  width: 100%;
  max-width: 300px;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  animation: soft-zoom 0.2s ease both;
}

.w-modal__title {
  padding: 20px 20px 6px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
}

.w-modal__content {
  padding: 0 20px 18px;
  text-align: center;
  font-size: 14px;
  color: var(--c-text-sub);
  white-space: pre-wrap;
}

.w-modal__actions {
  display: flex;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.w-modal__btn {
  flex: 1;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--c-text-sub);
  font-family: inherit;
}

.w-modal__btn--primary {
  color: var(--c-gold-deep);
  font-weight: 500;
}

.w-modal__btn + .w-modal__btn {
  border-left: 1px solid rgba(0, 0, 0, 0.08);
}

/* ============ 图片预览（替代 wx.previewImage） ============ */
.w-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.w-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.w-lightbox__close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.w-lightbox__counter {
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  letter-spacing: 2px;
}
