/**
 * 公共组件 —— 逐条移植自小程序 app.wxss / contact-modal / 两个原型页。
 *
 * 【移植规则】WXML 的写法是 rpx，原型是 px，关系是 rpx ÷ 2 = px。
 * 这里一律用 px 并尽量换成令牌，不要再引入裸数值。
 */

/* ============================================================
   顶部蓝色头部
   ============================================================ */

.header {
  background: linear-gradient(135deg, var(--c-primary-hi) 0%, var(--c-primary) 100%);
  padding: 24px 20px 90px;
  color: #fff;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header-title {
  font-size: var(--fs-hero);
  font-weight: 700;
  letter-spacing: 1px;
}

.header-date {
  font-size: var(--fs-base);
  opacity: .9;
}

/* 玻璃条 */
.banner {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
}

.banner + .banner {
  margin-top: var(--sp-4);
}

.banner-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 17px;
  margin-right: var(--sp-4);
}

.banner-text {
  flex: 1;
  font-size: var(--fs-base);
  font-weight: 600;
  min-width: 0;
}

.banner-text .sub {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 400;
  opacity: .75;
  margin-top: 2px;
}

.banner-btn {
  border-radius: var(--r-pill);
  padding: 7px 16px;
  font-size: var(--fs-md);
  font-weight: 700;
  flex-shrink: 0;
  margin-left: var(--sp-3);
}

.btn-follow {
  background: #fff;
  color: var(--c-primary);
}

.btn-join {
  background: var(--c-green);
  color: #fff;
}

/* 当前地址 */
.location-row {
  display: flex;
  align-items: center;
  margin-top: var(--sp-7);
  font-size: var(--fs-base);
  color: #fff;
}

.location-row .loc-label {
  font-weight: 800;
  margin: 0 var(--sp-2) 0 var(--sp-1);
  flex-shrink: 0;
}

.location-row .loc-value {
  flex: 1;
  opacity: .92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.location-row .loc-edit {
  font-size: var(--fs-md);
  opacity: .9;
  flex-shrink: 0;
  margin-left: var(--sp-2);
}

/* 搜索栏 */
.search-bar {
  margin-top: var(--sp-5);
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: var(--r-pill);
  padding: 11px 16px;
  box-shadow: var(--sh-bar);
}

.search-bar .search-icon {
  font-size: var(--fs-lg);
  opacity: .55;
  margin-right: var(--sp-3);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  font-size: var(--fs-base);
  color: var(--c-text);
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
}

.search-bar input::placeholder {
  color: var(--c-primary-pale);
}

/* 搜索清除按钮 */
.search-clear {
  flex-shrink: 0;
  color: var(--c-primary-pale);
  font-size: var(--fs-lg);
  padding: 0 var(--sp-1);
}

/* 筛选栏 */
.filter-row {
  display: flex;
  margin-top: var(--sp-5);
  gap: var(--sp-4);
}

.filter-chip {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: var(--r-pill);
  padding: 8px 0;
  font-size: var(--fs-md);
  font-weight: 600;
  color: #fff;
  gap: 4px;
}

.filter-chip.is-active {
  background: rgba(255, 255, 255, .92);
  color: var(--c-primary);
  border-color: transparent;
}

.filter-chip .arrow {
  font-size: 10px;
  opacity: .8;
}

/* 下拉筛选面板 */
.filter-menu {
  margin-top: var(--sp-3);
  background: #fff;
  border-radius: var(--r-lg);
  padding: var(--sp-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  box-shadow: var(--sh-bar);
}

.filter-menu .opt {
  flex: 1 1 30%;
  text-align: center;
  padding: 8px 0;
  border-radius: var(--r-sm);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--c-text-seg);
  background: var(--c-fill-soft);
}

.filter-menu .opt.active {
  color: #fff;
  background: var(--c-primary);
}

/* ============================================================
   主体内容（上浮覆盖头部）
   ============================================================ */

.content {
  margin-top: -66px;
  padding: 0 var(--sp-6);
  position: relative;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px 14px;
}

.section-title {
  display: flex;
  align-items: center;
  font-size: var(--fs-h);
  font-weight: 800;
  color: #fff;
}

.section-title::before {
  content: '';
  width: 5px;
  height: 20px;
  border-radius: 3px;
  background: #fff;
  margin-right: var(--sp-3);
  flex-shrink: 0;
}

.city {
  font-size: var(--fs-md);
  color: var(--c-text-muted);
}

.city b {
  color: var(--c-primary);
  font-weight: 700;
}

/* ============================================================
   板块分段控件
   ============================================================ */

.board-seg {
  display: flex;
  margin: 0 2px 16px;
  background: #fff;
  border-radius: var(--r-lg);
  padding: 6px;
  box-shadow: var(--sh-card);
}

.board-seg .seg {
  flex: 1;
  text-align: center;
  padding: 11px 0;
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--c-text-seg);
  transition: all .15s ease;
}

.board-seg .seg .cnt {
  font-size: var(--fs-xs);
  font-weight: 600;
  opacity: .7;
  margin-left: 2px;
}

.board-seg .seg.active {
  color: #fff;
  background: var(--c-primary);
  box-shadow: var(--sh-seg);
}

.board-seg .seg.active.tutor {
  background: var(--c-green-deep);
  box-shadow: var(--sh-seg-tutor);
}

/* ============================================================
   订单卡片
   ============================================================ */

.card {
  background: #fff;
  border-radius: var(--r-xl);
  padding: 18px 16px;
  margin-bottom: 16px;
  box-shadow: var(--sh-card);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-5);
}

.order-no {
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-size: var(--fs-sm);
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--r-sm);
}

.price {
  color: var(--c-orange);
  font-size: var(--fs-price);
  font-weight: 800;
}

.card-title {
  font-size: var(--fs-title);
  font-weight: 800;
  color: var(--c-text-title);
  margin-bottom: var(--sp-5);
  line-height: 1.4;
}

.tag-tutor,
.tag-part {
  display: inline-block;
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-xs);
  margin-right: var(--sp-3);
  vertical-align: 2px;
}

.tag-tutor {
  background: var(--c-green);
}

.tag-part {
  background: var(--c-primary);
}

.info-row {
  display: flex;
  align-items: flex-start;
  font-size: var(--fs-base);
  color: var(--c-text-body);
  line-height: 1.55;
  margin-bottom: var(--sp-3);
}

.info-row .icon {
  flex-shrink: 0;
  font-size: var(--fs-lg);
  margin-right: 7px;
}

.info-row .txt {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.nav-link {
  color: var(--c-primary);
  font-size: var(--fs-base);
  margin-left: var(--sp-3);
  white-space: nowrap;
  flex-shrink: 0;
}

/* 按钮区 */
.card-actions {
  display: flex;
  margin-top: var(--sp-7);
}

.btn-copy {
  flex: 1;
  height: 46px;
  border-radius: var(--r-2xl);
  border: 1.5px solid var(--c-primary);
  background: #fff;
  color: var(--c-primary);
  font-size: var(--fs-lg);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-grab {
  flex: 1.6;
  height: 46px;
  border-radius: var(--r-2xl);
  background: var(--c-primary);
  color: #fff;
  font-size: var(--fs-lg);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--sp-5);
}

.btn-share {
  width: 52px;
  height: 46px;
  border-radius: var(--r-2xl);
  border: 1.5px solid var(--c-primary);
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-size: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--sp-5);
}

/* ============================================================
   加载 / 空态
   ============================================================ */

.loading-tip,
.empty-tip {
  text-align: center;
  padding: 80px 0;
  color: var(--c-text-faint);
  font-size: var(--fs-base);
}

.board-empty {
  text-align: center;
  color: #99a3b5;
  padding: 44px 0;
  font-size: var(--fs-base);
}

.board-empty .ico {
  font-size: 30px;
  display: block;
  margin-bottom: var(--sp-3);
}

/* 转圈 */
.spinner {
  width: 22px;
  height: 22px;
  margin: 0 auto var(--sp-3);
  border: 2px solid var(--c-primary-soft);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2s;
  }
}

/* ============================================================
   弹层：联系方式 / 海报 / 通用
   ============================================================ */

.mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .78);
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 var(--sp-6);
}

.mask.show {
  display: flex;
}

.panel {
  position: relative;
  width: 100%;
  max-width: 330px;
  background: #fff;
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--sh-modal);
}

.panel-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, .25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  color: #fff;
  z-index: 3;
}

/* 联系方式弹窗 */
.contact-banner {
  background: linear-gradient(135deg, var(--c-primary-hi) 0%, var(--c-primary) 100%);
  padding: 30px 20px 26px;
  text-align: center;
  color: #fff;
}

.contact-avatar {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  border: 3px solid rgba(255, 255, 255, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin: 0 auto var(--sp-5);
}

.contact-name {
  font-size: var(--fs-hero);
  font-weight: 800;
}

.contact-role {
  font-size: var(--fs-md);
  opacity: .9;
  margin-top: var(--sp-1);
}

.contact-tag {
  display: inline-block;
  margin-top: var(--sp-4);
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: var(--r-pill);
  padding: 4px 14px;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.contact-body {
  padding: 22px 20px 20px;
}

.contact-qr-card {
  background: var(--c-fill-soft);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--r-xl);
  padding: 18px;
  text-align: center;
}

.contact-qr {
  width: 200px;
  height: 240px;
  margin: 0 auto;
  border-radius: var(--r-2xl);
  background: #fff;
  box-shadow: 0 4px 14px rgba(30, 60, 140, .12);
  object-fit: contain;
}

.contact-qr-fallback {
  width: 200px;
  height: 240px;
  margin: 0 auto;
  border: 2px dashed #c9d6f2;
  border-radius: var(--r-2xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--c-primary-pale);
  font-size: var(--fs-sm);
  padding: 14px;
  line-height: 1.8;
}

.qr-caption {
  font-size: var(--fs-md);
  color: var(--c-text-body);
  margin-top: var(--sp-5);
  font-weight: 600;
}

.qr-note {
  display: inline-block;
  margin-top: var(--sp-4);
  background: var(--c-orange-soft);
  color: var(--c-orange);
  font-size: var(--fs-sm);
  font-weight: 700;
  border-radius: var(--r-pill);
  padding: 5px 14px;
}

.contact-phone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f3f7ff 0%, #eaf1ff 100%);
  border-radius: var(--r-xl);
  padding: 14px 16px;
  margin-top: var(--sp-7);
}

.phone-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-2xl);
  background: var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.phone-info {
  flex: 1;
  margin-left: var(--sp-5);
  min-width: 0;
}

.phone-label {
  font-size: var(--fs-xs);
  color: var(--c-primary-pale);
  letter-spacing: 1px;
}

/*
 * 【移植时改过的地方】原版是 40rpx（=20px）+ 1px 字距。
 * 那个尺寸在浏览器里放不下：号码那格只有 128px，而 "15817757704" 按 20px 粗体
 * 需要 147px —— 多出来的字会【画到右边的按钮上面】。
 * 小程序里 WXML 的 text 组件不会这样溢出，HTML 会，所以这里必须收一收。
 * 收到 18px + 0 字距（约 122px）后还剩 20px 余量，PingFang / 微软雅黑 都放得下。
 */
.phone-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--c-text-strong);
  white-space: nowrap;
}

.phone-btns {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: var(--sp-3);
}

.btn-call {
  background: linear-gradient(135deg, #23c06a 0%, #16a558 100%);
  color: #fff;
  border-radius: var(--r-md);
  padding: 8px 11px;
  font-size: var(--fs-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-copy-phone {
  background: #fff;
  color: var(--c-primary);
  border: 1.5px solid var(--c-primary);
  border-radius: var(--r-md);
  padding: 8px 11px;
  font-size: var(--fs-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.contact-foot {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--c-text-ghost);
  margin-top: var(--sp-6);
}

/* ============================================================
   对话框（替代 wx.showModal）
   ============================================================ */

.ui-modal {
  width: 100%;
  max-width: 292px;
  background: #fff;
  border-radius: var(--r-xl);
  padding: 22px 20px 16px;
  text-align: center;
  box-shadow: var(--sh-modal);
}

.ui-modal-t {
  font-size: 16px;
  font-weight: 800;
  color: var(--c-text-strong);
}

.ui-modal-c {
  font-size: var(--fs-base);
  color: var(--c-text-body);
  line-height: 1.6;
  margin-top: 10px;
  word-break: break-word;
}

.ui-modal-btns {
  display: flex;
  gap: var(--sp-4);
  margin-top: 20px;
}

.ui-modal-btn {
  flex: 1;
  height: 42px;
  border-radius: var(--r-md);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--c-text-seg);
  background: var(--c-fill-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ui-modal-btn.primary {
  background: var(--c-primary);
  color: #fff;
}

/* ============================================================
   大图预览（替代 wx.previewImage）
   ============================================================ */

.ui-lightbox {
  padding: 0 var(--sp-8);
}

.ui-lightbox-img {
  max-width: 100%;
  max-height: 84%;
  object-fit: contain;
  border-radius: var(--r-md);
}

/* ============================================================
   轻提示 toast（替代 wx.showToast）
   ============================================================ */

.toast {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 78%;
  background: rgba(0, 0, 0, .82);
  color: #fff;
  font-size: var(--fs-base);
  line-height: 1.5;
  padding: 12px 18px;
  border-radius: var(--r-md);
  z-index: var(--z-toast);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
  word-break: break-word;
}

.toast.show {
  opacity: 1;
}

/* 加载遮罩（替代 wx.showLoading） */
.loading-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .32);
  z-index: var(--z-toast);
  display: none;
  align-items: center;
  justify-content: center;
}

.loading-mask.show {
  display: flex;
}

.loading-box {
  background: rgba(0, 0, 0, .78);
  color: #fff;
  border-radius: var(--r-md);
  padding: 16px 20px;
  font-size: var(--fs-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 88px;
}

.loading-box .spinner {
  border-color: rgba(255, 255, 255, .3);
  border-top-color: #fff;
}

/* ============================================================
   通用按钮 / 表单（登录、简历页复用）
   ============================================================ */

.btn-primary {
  width: 100%;
  height: 48px;
  border-radius: var(--r-2xl);
  background: var(--c-primary);
  color: #fff;
  font-size: var(--fs-lg);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.btn-ghost {
  width: 100%;
  height: 48px;
  border-radius: var(--r-2xl);
  border: 1.5px solid var(--c-primary);
  background: #fff;
  color: var(--c-primary);
  font-size: var(--fs-lg);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.field {
  margin-bottom: var(--sp-6);
}

.field label {
  display: block;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--c-text-seg);
  margin-bottom: var(--sp-2);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid #e3e8f0;
  border-radius: var(--r-md);
  padding: 11px 12px;
  font-size: var(--fs-base);
  background: #fff;
  outline: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--c-primary);
}

.field textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.6;
}

.field .hint {
  font-size: var(--fs-xs);
  color: var(--c-text-ghost);
  margin-top: var(--sp-1);
}

.field .err {
  font-size: var(--fs-sm);
  color: #e5484d;
  margin-top: var(--sp-1);
}
