/* ==========================================================================
   官网测序页拼团服务样式
   ========================================================================== */

body.gb-noscroll {
  overflow: hidden !important;
}

/* 顶部筛选与登录状态条 */
.gb-bar {
  margin-bottom: 24px;
}

.gb-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(11, 37, 69, 0.04);
}

.gb-bar-cats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.gb-cat-btn {
  appearance: none;
  border: 1px solid transparent;
  background: var(--white);
  color: var(--slate);
  font-size: 14px;
  line-height: 1.4;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gb-cat-btn:hover {
  color: var(--navy);
  background: var(--teal-soft);
}

.gb-cat-btn.gb-cat-active {
  background: var(--teal-soft);
  color: var(--teal-ink);
  font-weight: 600;
  border-color: var(--teal);
}

.gb-bar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gb-user-info,
.gb-guest-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gb-user-name {
  font-size: 14px;
  color: var(--navy);
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gb-bar-warn {
  font-size: 12px;
  color: #c05621;
  background: #fffaf0;
  padding: 4px 8px;
  border-radius: var(--radius-s);
  border: 1px solid #feebc8;
}

.gb-btn-sm {
  padding: 6px 14px !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}

.gb-btn-text {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--mute);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.gb-btn-text:hover {
  color: var(--navy);
}

/* 列表与卡片 */
.gb-list {
  min-height: 200px;
}

.gb-loading,
.gb-no-match {
  text-align: center;
  color: var(--slate);
  padding: 48px 16px;
  font-size: 15px;
}

.gb-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 24px;
  box-sizing: border-box;
}

.gb-card-head {
  margin-bottom: 16px;
}

.gb-cat-pill {
  margin-bottom: 8px;
  display: inline-block;
}

.gb-card-title {
  margin: 8px 0 10px 0;
  font-size: 18px;
  line-height: 1.4;
  color: var(--navy);
}

.gb-spec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.gb-spec-pill {
  font-size: 11px;
  padding: 2px 8px;
  background: #f1f5f9;
  color: var(--slate);
}

.gb-card-body {
  flex: 1 1 auto;
  margin-bottom: 20px;
}

.gb-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}

.gb-price {
  font-size: 26px;
  font-weight: 700;
  color: var(--teal-ink);
  line-height: 1;
}

.gb-unit {
  font-size: 13px;
  color: var(--mute);
}

.gb-price-badge {
  font-size: 11px;
  color: #c05621;
  background: #fffaf0;
  border: 1px solid #feebc8;
  padding: 2px 6px;
  border-radius: var(--radius-s);
  margin-left: 4px;
}

.gb-tiers-line {
  font-size: 13px;
  line-height: 1.6;
  color: var(--slate);
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  margin-bottom: 14px;
  word-break: break-all;
}

.gb-tiers-line strong {
  color: var(--navy);
  font-weight: 700;
}

.gb-progress {
  position: relative;
  width: 100%;
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.gb-progress-bar {
  height: 100%;
  background: var(--teal);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.gb-progress-meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 10px;
}

.gb-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--mute);
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.gb-card-foot {
  margin-top: auto;
}

.gb-card-btn {
  width: 100%;
  text-align: center;
}

/* 弹层主体 */
.gb-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.gb-modal[hidden] {
  display: none !important;
}

.gb-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 37, 69, 0.6);
  backdrop-filter: blur(3px);
  z-index: 1001;
}

.gb-modal-dialog {
  position: relative;
  z-index: 1002;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(11, 37, 69, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gb-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  appearance: none;
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--mute);
  cursor: pointer;
  padding: 6px;
  z-index: 10;
  border-radius: var(--radius-s);
  transition: color 0.2s ease, background 0.2s ease;
}

.gb-modal-close:hover {
  color: var(--navy);
  background: #f1f5f9;
}

.gb-modal-content {
  padding: 32px;
  overflow-y: auto;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.gb-modal-title {
  margin: 0 0 16px 0;
  font-size: 22px;
  line-height: 1.35;
  color: var(--navy);
}

.gb-section-title {
  margin: 16px 0 8px 0;
  font-size: 15px;
  color: var(--navy);
  font-weight: 600;
}

.gb-detail-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--slate);
  margin: 12px 0 16px 0;
}

/* 阶梯表格 */
.gb-tiers-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 16px;
}

.gb-tiers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.gb-tiers-table th {
  background: #f8fafc;
  color: var(--slate);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.gb-tiers-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.gb-tiers-table tr.gb-tier-current td {
  background: var(--teal-soft);
  color: var(--teal-ink);
  font-weight: 600;
}

.gb-tier-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  background: var(--teal);
  color: var(--white);
  border-radius: var(--radius-s);
}

.gb-detail-progress {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 14px;
  margin-bottom: 20px;
}

/* 规则列表 */
.gb-rules-box {
  background: var(--teal-soft);
  border: 1px solid rgba(46, 169, 160, 0.25);
  border-radius: var(--radius-s);
  padding: 16px 18px;
  margin-bottom: 24px;
}

.gb-rules-title {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: var(--teal-ink);
  font-weight: 600;
}

.gb-rules-list {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--teal-ink);
  line-height: 1.8;
}

/* 表单与提示 */
.gb-form {
  margin-top: 16px;
}

.gb-form-title {
  margin: 0 0 16px 0;
  font-size: 17px;
  color: var(--navy);
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.gb-req {
  color: #e53e3e;
  font-weight: bold;
}

.gb-agree-group {
  margin: 18px 0;
}

.gb-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--slate);
  cursor: pointer;
}

.gb-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
  cursor: pointer;
}

.gb-form-submit {
  margin-top: 20px;
}

.gb-alert-danger {
  background: #fff5f5;
  color: #c53030;
  border: 1px solid #feb2b2;
  border-radius: var(--radius-s);
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.gb-login-prompt {
  text-align: center;
  padding: 24px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
}

.gb-login-prompt p {
  margin: 0 0 14px 0;
  font-size: 14px;
  color: var(--slate);
}

.gb-status-banner {
  text-align: center;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  color: var(--slate);
  font-size: 15px;
  font-weight: 500;
}

/* 成功面板 */
.gb-success-panel {
  text-align: center;
  padding: 20px 10px;
}

.gb-success-icon {
  width: 56px;
  height: 56px;
  line-height: 56px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 28px;
  font-weight: bold;
  border-radius: 50%;
  margin: 0 auto 16px auto;
}

.gb-success-title {
  margin: 0 0 10px 0;
  font-size: 20px;
  color: var(--navy);
}

.gb-success-meta {
  font-size: 14px;
  color: var(--slate);
  margin-bottom: 12px;
}

.gb-success-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--mute);
  max-width: 440px;
  margin: 0 auto 24px auto;
}

.gb-success-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* 登录/注册 Tabs */
.gb-auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  gap: 12px;
}

.gb-auth-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-size: 15px;
  color: var(--slate);
  cursor: pointer;
  margin-bottom: -1px;
  transition: all 0.2s ease;
}

.gb-auth-tab.gb-tab-active {
  color: var(--teal-ink);
  font-weight: 600;
  border-bottom-color: var(--teal);
}

.gb-input-btn-group {
  display: flex;
  gap: 8px;
}

.gb-input-btn-group input {
  flex: 1 1 auto;
}

.gb-input-btn-group button {
  white-space: nowrap;
  flex-shrink: 0;
}

.gb-auth-extra {
  margin-top: 10px;
  text-align: right;
}

.gb-link {
  font-size: 13px;
  color: var(--teal-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 我的订单 */
.gb-orders-wrap {
  width: 100%;
}

.gb-orders-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--slate);
}

.gb-orders-empty p {
  margin: 0 0 16px 0;
  font-size: 15px;
}

.gb-orders-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gb-order-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--white);
  padding: 20px;
  box-shadow: 0 2px 6px rgba(11, 37, 69, 0.03);
}

.gb-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.gb-order-title {
  margin: 0;
  font-size: 16px;
  color: var(--navy);
  line-height: 1.4;
}

.gb-status-pill {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.gb-status-pending {
  background: #fefcbf;
  color: #744210;
}

.gb-status-confirmed {
  background: var(--teal-soft);
  color: var(--teal-ink);
}

.gb-status-paid {
  background: #c6f6d5;
  color: #22543d;
}

.gb-status-failed,
.gb-status-cancelled {
  background: #edf2f7;
  color: var(--mute);
}

.gb-order-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}

.gb-order-meta-item {
  color: var(--slate);
}

.gb-meta-k {
  color: var(--mute);
}

.gb-meta-v {
  color: var(--navy);
  font-weight: 500;
}

.gb-order-sample-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
  margin: 12px 0;
}

.gb-order-sample-item {
  margin-bottom: 6px;
}

.gb-order-sample-item:last-child {
  margin-bottom: 0;
}

.gb-order-notice {
  font-size: 13px;
  color: var(--teal-ink);
  background: var(--teal-soft);
  padding: 8px 12px;
  border-radius: var(--radius-s);
  margin: 10px 0;
}

/* 履约进度条 */
.gb-fulfill-wrap {
  margin: 16px 0 10px 0;
  padding: 14px;
  background: #f8fafc;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
}

.gb-fulfill-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 12px;
}

.gb-fulfill-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow-x: auto;
  padding: 6px 0;
}

.gb-fulfill-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 64px;
  position: relative;
  z-index: 1;
}

.gb-fulfill-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--line-2);
  margin-bottom: 6px;
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px var(--line-2);
}

.gb-fulfill-line {
  flex: 1 1 auto;
  height: 2px;
  background: var(--line-2);
  margin: 0 -4px 18px -4px;
}

.gb-fulfill-text {
  font-size: 11px;
  color: var(--mute);
  white-space: nowrap;
}

.gb-fulfill-time {
  font-size: 10px;
  color: var(--mute);
  margin-top: 2px;
  white-space: nowrap;
}

.gb-fulfill-step.gb-fulfill-done .gb-fulfill-dot,
.gb-fulfill-step.gb-fulfill-active .gb-fulfill-dot {
  background: var(--teal);
  box-shadow: 0 0 0 1px var(--teal);
}

.gb-fulfill-step.gb-fulfill-active .gb-fulfill-text {
  color: var(--teal-ink);
  font-weight: 600;
}

.gb-fulfill-step.gb-fulfill-done .gb-fulfill-text {
  color: var(--slate);
}

.gb-order-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.gb-order-invoice-status {
  font-size: 12px;
  color: var(--mute);
}

/* 申请发票小表单 */
.gb-invoice-form {
  margin-top: 14px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
}

.gb-invoice-form-head {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 12px;
}

.gb-invoice-btns {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.gb-inv-err {
  margin-bottom: 10px;
}

/* 错误重试区 */
.gb-error-wrap {
  text-align: center;
  padding: 32px 16px;
}

.gb-error-wrap p {
  color: #c53030;
  margin-bottom: 16px;
  font-size: 15px;
}

.gb-modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* 手机端响应式适配 (320px - 430px) */
@media (max-width: 640px) {
  .gb-bar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  /* 分类排成一行、在栏内横滑，不撑宽页面（外面每层都要允许收缩，否则整行宽度会把页面撑开） */
  .gb-bar,
  .gb-bar-inner {
    min-width: 0;
    max-width: 100%;
  }

  .gb-bar-cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .gb-bar-cats::-webkit-scrollbar {
    display: none;
  }

  .gb-cat-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .gb-bar-user {
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }

  /* 有团的分类不到两个时不出筛选行：别留一行空白和一条分隔线 */
  .gb-bar-cats:empty {
    display: none;
  }

  .gb-bar-cats:empty + .gb-bar-user {
    border-top: 0;
    padding-top: 0;
  }

  .gb-modal {
    padding: 0;
  }

  .gb-modal-dialog {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .gb-modal-content {
    padding: 24px 16px;
  }

  .gb-order-meta-grid {
    grid-template-columns: 1fr;
  }

  .gb-fulfill-steps {
    justify-content: flex-start;
    gap: 8px;
  }

  .gb-fulfill-line {
    min-width: 16px;
  }
}
