/* ============================================================
   Peptilab - Independent Testing Services
   全局样式（复刻 pristinbio.com 视觉，青绿科技色）
   ============================================================ */

/* Orbitron 字体本地化（避免 CDN 加载慢/失败导致的字体降级） */
@font-face {
  font-family: 'Orbitron';
  font-style: normal;
  font-weight: 700;
  src: url('/static/fonts/orbitron-v35-latin-700.woff2') format('woff2');
  font-display: swap;
}

:root {
  --primary: #00796b;
  --primary-light: #09AD9D;
  --primary-dark: #005758;
  --text: #111827;
  --text-2: #0f172a;
  --text-3: #64748b;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-2: #e2e8f0;
  --bg: #f7f9fc;
  --bg-soft: #f8fafc;
  --white: #ffffff;
  --danger: #dc2626;
  --success: #16a34a;
}

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

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  padding-bottom: 40px;
  line-height: 1.5;
}

.font-display {
  font-family: "Orbitron", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.02em;
}

a { color: inherit; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* ============================== Header ============================== */

header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img {
  height: 56px;
  width: auto;
  display: block;
  object-fit: contain;
}

.search-bar-container {
  flex: 1;
  max-width: 520px;
  margin: 0 20px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 42px 10px 20px;
  border: 1px solid #d1d5db;
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  background: #f9fafb;
  transition: all 0.2s ease;
}

.search-input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.1);
}

.search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: #f3f4f6;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #374151;
  transition: background-color 0.2s ease, transform 0.1s ease;
  position: relative;
  text-decoration: none;
}

.icon-btn:hover { background-color: #e5e7eb; color: var(--text); }

.icon-btn.is-user-logged { color: var(--primary); }

.menu-toggle-btn { display: none; }

.header-nav {
  border-top: 1px solid #f3f4f6;
  padding: 12px 0;
  background: var(--white);
}

.main-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 64px;
}

.nav-link {
  position: relative;
  display: inline-block;
  text-decoration: none;
  color: #1D1D1B;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 4px 0;
  transition: color 0.3s ease;
  font-family: "Orbitron", -apple-system, sans-serif;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-light), var(--primary-dark));
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); transform-origin: bottom left; }

/* ============================== 通用组件 ============================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  color: #fff;
  background: #111111;
}

.btn-primary:hover { background: var(--primary); box-shadow: 0 4px 12px rgba(0, 121, 107, 0.3); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.card {
  background: var(--white);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 12px;
}

.text-muted { color: var(--text-3); }
.text-small { font-size: 13px; }

.page-hero {
  text-align: center;
  padding: 48px 0 24px;
}

.page-hero h1 {
  font-size: 32px;
  font-weight: 700;
  font-family: "Orbitron", sans-serif;
  margin-bottom: 8px;
  color: var(--text);
}

.page-hero p { color: var(--text-muted); font-size: 15px; }

/* ============================== 服务卡片（首页） ============================== */

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 300px));
  justify-content: center;
  gap: 24px;
  margin-top: 32px;
}

.service-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.service-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08); }

.service-card-img {
  width: 100%;
  height: 260px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #f1f5f9;
  padding: 12px;
  box-sizing: border-box;
}

.service-card-img img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }

.service-card-body { padding: 20px 20px 12px; }

.service-card-body .card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 8px;
}

.service-card-body .card-desc { font-size: 13px; color: var(--text-3); line-height: 1.5; }

.service-card-bottom {
  padding: 16px 20px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  margin-top: 12px;
  gap: 12px;
}

.card-price { font-weight: 700; color: var(--text-2); font-size: 18px; }

/* ============================== Stepper（服务流程） ============================== */

.stepper-container {
  max-width: 900px;
  margin: 36px auto;
  padding: 28px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stepper-header { margin-bottom: 28px; text-align: center; }

.stepper-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-2);
  margin: 0 0 6px;
  font-family: "Orbitron", sans-serif;
}

.stepper-header p { font-size: 13px; color: var(--text-3); }

.stepper-list {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
}

.stepper-item { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 8px; }

.stepper-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 50%;
  width: 100%;
  height: 2px;
  background-color: #cbd5e1;
  z-index: 1;
}

.stepper-node {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  z-index: 2;
  box-shadow: 0 0 0 4px #fff;
  font-family: "Orbitron", sans-serif;
}

.stepper-content { margin-top: 12px; }
.stepper-title { font-size: 14px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.stepper-desc { font-size: 12px; color: var(--text-3); line-height: 1.45; }

/* ============================== 联系方式区块 ============================== */

.contact-block {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

.contact-block .card { display: flex; flex-wrap: wrap; overflow: hidden; }

.contact-block-img {
  flex: 1;
  min-width: 300px;
  max-height: 550px;
  overflow: hidden;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-block-img img { width: 100%; height: 100%; object-fit: cover; }

.contact-block-body {
  flex: 1;
  min-width: 300px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  margin-top: 16px;
}

.contact-item img.qr { width: 88px; height: 88px; object-fit: contain; border-radius: 6px; border: 1px solid #cbd5e1; background: #fff; }

.contact-item .ci-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e6f4f1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.contact-item .ci-title { font-size: 15px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; }
.contact-item .ci-desc { font-size: 13px; color: var(--text-3); line-height: 1.4; }
.contact-item a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* ============================== 服务列表页（services） ============================== */

.service-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.service-row:last-child { border-bottom: none; }

.service-img-container { width: 96px; height: 96px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--bg-soft); border-radius: 8px; overflow: hidden; }
.service-img-container img { max-width: 100%; max-height: 100%; object-fit: contain; }

.service-info { flex: 1; }
.service-info h3 { font-size: 18px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.service-info p { font-size: 13px; color: var(--text-3); line-height: 1.5; }

.service-action { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.service-action .price { font-weight: 700; color: var(--text-2); font-size: 17px; }

/* ============================== About 页 ============================== */

.about-section { margin-top: 32px; }
.about-section .card { padding: 32px; }
.about-section h2 { font-size: 20px; font-weight: 700; color: var(--text-2); margin-bottom: 16px; }
.about-section p { font-size: 14px; color: #475569; line-height: 1.7; margin-bottom: 12px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 24px; }

.feature-card { padding: 24px; text-align: center; }
.feature-card .fc-icon { font-size: 30px; margin-bottom: 12px; }
.feature-card h4 { font-size: 16px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--text-3); line-height: 1.5; }

/* ============================== 表单 ============================== */

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.1); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ============================== Modal ============================== */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.modal-overlay.active { display: flex; }

.modal-card {
  background: #fff;
  width: 100%;
  max-width: 420px;
  padding: 28px;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header { font-size: 18px; font-weight: 700; margin-bottom: 20px; text-align: center; color: var(--text); }

.auth-tabs { display: flex; gap: 12px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.auth-tab { background: none; border: none; color: #6b7280; font-size: 14px; font-weight: 700; cursor: pointer; padding: 8px 12px; border-radius: 6px; }
.auth-tab.active { color: var(--primary); }

/* ============================== 提示 / 消息 ============================== */

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ============================== 下单页 ============================== */

.order-card { max-width: 900px; margin: 24px auto; padding: 28px 24px; }

.product-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  background: #fff;
}

.product-row-flex { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.product-row-flex > div { flex: 1; min-width: 140px; }

.product-qty-lot-wrapper { display: flex; gap: 12px; flex: 2 !important; }
.product-qty-lot-wrapper > div { flex: 1; min-width: 0; }

.product-row-footer { display: flex; justify-content: flex-end; align-items: center; margin-top: 8px; }
.delete-btn { background: none; border: none; color: var(--danger); font-size: 20px; cursor: pointer; padding: 4px 8px; }
.delete-btn:hover { color: #991b1b; }

.order-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.order-total { font-size: 16px; font-weight: 700; color: var(--text-2); }
.order-total .amount { font-size: 22px; color: var(--primary); }

/* 自定义下拉 */
.product-select-wrapper { position: relative; }
.custom-prod-dropdown {
  display: none;
  position: absolute;
  top: 100%; left: 0; right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  z-index: 999;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.custom-prod-dropdown.show { display: block; }
.custom-prod-dropdown li { padding: 8px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f1f5f9; text-align: left; }
.custom-prod-dropdown li:hover { background-color: #f0f9ff; color: var(--primary); }

/* ============================== 用户中心 ============================== */

.usercenter-wrap { max-width: 900px; margin: 24px auto; }

.profile-header { padding: 24px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

.avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
  font-family: "Orbitron", sans-serif;
  flex-shrink: 0;
}

.profile-meta h2 { font-size: 20px; font-weight: 700; color: var(--text-2); }
.profile-meta p { font-size: 13px; color: var(--text-3); margin-top: 2px; }

.profile-stats { display: flex; gap: 16px; margin-left: auto; flex-wrap: wrap; }
.stat-box { text-align: center; padding: 12px 20px; border-radius: 8px; background: var(--bg-soft); border: 1px solid var(--border-2); }
.stat-box .stat-num { font-size: 20px; font-weight: 700; color: var(--primary); }
.stat-box .stat-label { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.uc-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border); }
.uc-tab {
  background: none; border: none;
  padding: 12px 16px;
  font-size: 14px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent;
}
.uc-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.uc-panel { display: none; padding: 24px 0; }
.uc-panel.active { display: block; }

.order-list-item {
  padding: 20px;
  margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.order-list-item .oli-head { font-weight: 700; color: var(--text-2); font-size: 15px; }
.order-list-item .oli-sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.order-status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.order-status.in_progress { background: #fef9c3; color: #854d0e; }
.order-status.completed { background: #dcfce7; color: #166534; }
.order-status.cancelled { background: #f1f5f9; color: #64748b; }

.empty-hint { text-align: center; color: var(--text-3); padding: 40px 20px; font-size: 14px; }

/* ============================== 验证页 ============================== */

.verify-wrap { max-width: 720px; margin: 24px auto; }

.verify-form-card { padding: 28px; }
.verify-form-card .form-group { margin-bottom: 16px; }

.result-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.result-row:last-child { border-bottom: none; }
.result-row .rr-label { color: var(--text-3); font-weight: 600; }
.result-row .rr-value { color: var(--text-2); font-weight: 700; text-align: right; }

.badge-auth {
  display: inline-flex; align-items: center; gap: 6px;
  background: #dcfce7; color: #166534;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
}

/* ============================== 报告页 ============================== */

.report-wrap { max-width: 900px; margin: 24px auto; }
.report-card { padding: 32px; }
.report-head { text-align: center; margin-bottom: 24px; }
.report-head .brand { font-family: "Orbitron", sans-serif; font-size: 20px; font-weight: 700; color: var(--primary-dark); }
.report-head .coa-no { font-size: 14px; color: var(--text-3); margin-top: 6px; }
.report-section-title { font-size: 15px; font-weight: 700; color: var(--text-2); margin: 24px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--primary); }

.info-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.info-table td { padding: 8px 10px; border: 1px solid var(--border); }
.info-table td.k { width: 34%; background: var(--bg-soft); font-weight: 600; color: var(--text-2); }
.info-table td.v { color: var(--text-2); }

/* ============================== Footer ============================== */

footer {
  margin-top: 48px;
  padding: 32px 0 24px;
  border-top: 1px solid var(--border);
  background: #fff;
  text-align: center;
}

.footer-brand { font-family: "Orbitron", sans-serif; font-size: 15px; font-weight: 700; color: var(--primary-dark); letter-spacing: 1px; }
.footer-tag { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.footer-copy { font-size: 12px; color: #9ca3af; margin-top: 12px; }

/* ============================== 响应式 ============================== */

@media (max-width: 768px) {
  body { word-break: break-word; overflow-wrap: anywhere; }

  .logo-img { height: 44px; }
  .search-bar-container { margin: 0 10px; }
  .menu-toggle-btn { display: flex; }

  .header-nav { display: none; padding: 16px 0; }
  .header-nav.is-open { display: block; }
  .main-nav { flex-direction: column; gap: 16px; align-items: center; }
  .nav-link { font-size: 15px; padding: 8px 0; }

  .container { padding: 0 16px !important; }
  .page-hero h1 { font-size: 26px; }
  .service-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .service-img-container { width: 64px; height: 64px; }
  .service-action { width: 100%; align-items: stretch; }
  .profile-stats { margin-left: 0; width: 100%; justify-content: space-between; }
  .order-footer-bar { flex-direction: column; align-items: stretch; text-align: center; }
}

@media (max-width: 640px) {
  .stepper-list { flex-direction: column; align-items: flex-start; padding-left: 12px; }
  .stepper-item { flex-direction: row; align-items: flex-start; text-align: left; padding: 0 0 24px; width: 100%; }
  .stepper-item:last-child { padding-bottom: 0; }
  .stepper-item:not(:last-child)::after { top: 36px; left: 17px; width: 2px; height: calc(100% - 12px); }
  .stepper-node { flex-shrink: 0; }
  .stepper-content { margin-top: 0; margin-left: 16px; }
  .contact-block { padding: 0 12px 40px; }
  .product-row-flex { flex-direction: column; align-items: stretch; }
}
