/* ==========================================================================
   Jamo H700 售后服务 H5 — 极简高级感（森林绿 + 暖灰金 · Jamo 品牌色）
   ========================================================================== */

@font-face {
  font-family: 'Melanzane';
  src: url('fonts/Melanzane-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Melanzane';
  src: url('fonts/Melanzane.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Melanzane';
  src: url('fonts/Melanzane-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SHS';
  src: url('fonts/SHS-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #1A2931;
  --bg-soft: #22343C;
  --card: #2A3E47;
  --card-2: #314752;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);

  --text: #f4f1ea;          /* 暖白 */
  --text-dim: rgba(244, 241, 234, 0.56);
  --text-faint: rgba(244, 241, 234, 0.34);

  --accent: #968B6F;        /* 暖铜 / 琥珀金 */
  --accent-soft: rgba(150, 139, 111, 0.14);
  --accent-deep: #7E755D;

  --danger: #d07a63;        /* 柔和的暖红，仅用于错误提示 */
  --ok: #9cc0a6;            /* 柔和的灰绿，仅用于成功态 */

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --font-sans: "Melanzane", "SHS", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  --tabbar-h: 62px;
  --brand-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 细腻的径向晕影，营造质感而非渐变花哨 */
  background-image: radial-gradient(
    1200px 600px at 50% -10%,
    rgba(150, 139, 111, 0.06),
    rgba(0, 0, 0, 0) 60%
  );
  background-repeat: no-repeat;
}

/* --------------------------------------------------------------------------
   品牌区
   -------------------------------------------------------------------------- */
.brand {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--brand-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  padding-top: env(safe-area-inset-top, 0);
  background: rgba(26, 41, 49, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}

.brand-logo {
  height: 26px;
  width: auto;
  display: block;
  border-right: 1px solid var(--accent);
  padding-right: 14px;
}

.brand-sub {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   主内容区
   -------------------------------------------------------------------------- */
.stage {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--brand-h) + 20px) 18px
           calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0) + 28px + 22px);
}

.view { animation: fade-in 0.28s ease both; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.view-head { margin: 6px 4px 20px; }

.view-title {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 0.02em;
}

.view-desc {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   卡片
   -------------------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

/* --------------------------------------------------------------------------
   表单
   -------------------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 9px; }

.field-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.input {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder { color: var(--text-faint); }

.input:focus {
  border-color: var(--accent);
  background: #22343C;
}

.input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-hint {
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   按钮
   -------------------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 0.04em;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px 22px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, opacity 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:active { transform: scale(0.985); }

.btn-block { width: 100%; }

.btn-primary {
  background: var(--accent);
  color: #1A2931;
  font-weight: 500;
}

.btn-primary:hover { background: #A89A7C; }
.btn-primary:disabled { opacity: 0.55; cursor: default; }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

/* 按钮加载态 */
.btn.is-loading .btn-label { opacity: 0; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: rgba(0, 0, 0, 0.9);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-ghost.is-loading::after {
  border-color: var(--border-strong);
  border-top-color: var(--accent);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   查保修结果
   -------------------------------------------------------------------------- */
.result { margin-top: 16px; }

.result-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.result-model {
  font-size: 30px;
  font-weight: 300;
  letter-spacing: 0.06em;
}

.badge {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(150, 139, 111, 0.28);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.result-item {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.result-item dt {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.result-item dd {
  font-size: 16px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.result-remain {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-dim);
  text-align: center;
}

.result-remain.is-expired { color: var(--danger); }

/* --------------------------------------------------------------------------
   上传截图
   -------------------------------------------------------------------------- */
.upload {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.upload:hover,
.upload:focus-visible { border-color: var(--accent); }

.upload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 16px;
  color: var(--text-dim);
  text-align: center;
}

.upload-icon { color: var(--accent); opacity: 0.85; }

.upload-text { font-size: 14px; color: var(--text); }
.upload-sub { font-size: 11.5px; color: var(--text-faint); }

.upload-previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
}

.upload-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
}

.upload-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-thumb-remove {
  position: absolute;
  top: 5px; right: 5px;
  width: 22px; height: 22px;
  font-size: 14px;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
}

.upload-thumb-add {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  font-size: 28px;
  color: var(--accent);
  border: 1.5px dashed var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

/* --------------------------------------------------------------------------
   提交成功态
   -------------------------------------------------------------------------- */
.success {
  text-align: center;
  padding: 34px 24px;
}

.success-mark {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ok);
  border: 1px solid rgba(156, 192, 166, 0.35);
  border-radius: 50%;
}

.success-title {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.success-desc {
  margin: 10px auto 22px;
  max-width: 320px;
  font-size: 13px;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   视频列表
   -------------------------------------------------------------------------- */
.list { display: flex; flex-direction: column; gap: 12px; }

.video-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.video-item:hover { border-color: var(--border-strong); }
.video-item:active { transform: scale(0.99); }

.video-thumb {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-md);
}

.video-body { flex: 1; min-width: 0; }

.video-title {
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-meta {
  margin-top: 3px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.video-arrow { flex: 0 0 auto; color: var(--text-faint); }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

.empty.is-error { color: var(--text-dim); }

/* --------------------------------------------------------------------------
   客服
   -------------------------------------------------------------------------- */
.contact { text-align: center; padding: 30px 24px; }

.qr {
  width: 150px; height: 150px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  background: #22343C;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.qr-icon { opacity: 0.55; }

.contact-label { font-size: 16px; font-weight: 400; }

.contact-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-faint);
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 14px;
  padding: 18px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease;
}

.contact-row:hover { border-color: var(--border-strong); }

.contact-row-icon {
  width: 42px; height: 42px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-md);
}

.contact-row-body { display: flex; flex-direction: column; gap: 2px; }
.contact-row-title { font-size: 15px; }
.contact-row-sub { font-size: 12px; color: var(--text-faint); }

/* --------------------------------------------------------------------------
   在线客服聊天窗
   -------------------------------------------------------------------------- */

.chat {
  display: flex;
  flex-direction: column;
  height: 380px;
  padding: 0;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

.chat-msg { display: flex; max-width: 82%; }

.chat-msg-bot { align-self: flex-start; }
.chat-msg-user { align-self: flex-end; }

.chat-bubble {
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.55;
  border-radius: 16px;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-msg-bot .chat-bubble {
  background: var(--card-2);
  color: var(--text);
  border-top-left-radius: 6px;
}

.chat-msg-user .chat-bubble {
  background: var(--accent);
  color: #1A2931;
  border-top-right-radius: 6px;
}

.chat-status {
  min-height: 18px;
  padding: 0 16px 6px;
  font-size: 12px;
  color: var(--text-faint);
}

.chat-status:empty { display: none; }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
}

.chat-input { flex: 1; background: var(--bg-soft); }

.chat-send { flex: 0 0 auto; padding: 0 18px; }

/* 人工客服二维码 */
.contact-qr {
  width: 170px;
  height: 170px;
  margin: 0 auto 16px;
  display: block;
  border-radius: var(--radius-md);
  background: #fff;
}

/* --------------------------------------------------------------------------
   底部 Tab 导航
   -------------------------------------------------------------------------- */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0));
  padding-bottom: env(safe-area-inset-bottom, 0);
  display: flex;
  background: rgba(26, 41, 49, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  z-index: 20;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--text-faint);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.tab svg { opacity: 0.7; transition: opacity 0.18s ease; }

.tab.is-active { color: var(--accent); }
.tab.is-active svg { opacity: 1; }

/* --------------------------------------------------------------------------
   ICP 备案号（tabbar 上方固定窄条）
   -------------------------------------------------------------------------- */
.icp {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0));
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  background: var(--bg);
  z-index: 19;
}

.icp a { color: inherit; text-decoration: none; }

/* --------------------------------------------------------------------------
   轻提示 Toast
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0) + 20px);
  transform: translateX(-50%) translateY(10px);
  max-width: 86%;
  padding: 11px 18px;
  font-size: 13px;
  color: var(--text);
  background: rgba(42, 62, 71, 0.96);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 50;
  text-align: center;
}

.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.is-error { border-color: rgba(208, 122, 99, 0.5); }

/* --------------------------------------------------------------------------
   配件购买
   -------------------------------------------------------------------------- */
.parts-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.18s ease;
}

.parts-item:hover { border-color: var(--border-strong); }

.parts-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.parts-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.parts-body { flex: 1; min-width: 0; }

.parts-name {
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.parts-price {
  margin-top: 4px;
  font-size: 14px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.btn-sm {
  padding: 10px 16px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.parts-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 16px;
  background: var(--accent-soft);
  border: 1px solid rgba(150, 139, 111, 0.24);
  border-radius: var(--radius-md);
}

.parts-product-name { font-size: 15px; color: var(--text); }
.parts-product-price {
  font-size: 14px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

textarea.input {
  resize: vertical;
  min-height: 92px;
  line-height: 1.5;
}

.parts-qr { overflow: hidden; }

.parts-qr-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-faint);
}

.qr-fallback-text {
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 380px) {
  .view-title { font-size: 23px; }
  .result-model { font-size: 26px; }
}

@media (min-width: 600px) {
  .stage { padding-top: calc(var(--brand-h) + 32px); }
  .brand,
  .tabbar { justify-content: center; }
  .brand { max-width: none; }
}

/* --------------------------------------------------------------------------
   扫一扫
   -------------------------------------------------------------------------- */
.sn-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.sn-row .input { flex: 1; min-width: 0; }

.btn-scan {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 14px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(150, 139, 111, 0.28);
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn-scan:active { opacity: 0.8; }

.scan-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 16, 20, 0.94);
}

.scan-modal[hidden] { display: none; }

.scan-panel {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.scan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.scan-title { font-size: 16px; font-weight: 500; }

.scan-close {
  width: 30px;
  height: 30px;
  font-size: 24px;
  line-height: 1;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
}

.scan-reader {
  width: 100%;
  min-height: 240px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

.scan-reader video { width: 100%; display: block; }

.scan-tip {
  margin: 12px 0 16px;
  font-size: 12.5px;
  color: var(--text-dim);
  text-align: center;
}
