/* ===== Design Tokens ===== */
:root {
  --paper:     #FDFBF6;
  --paper-2:   #FFFFFF;
  --ink:       #232A38;
  --ink-2:     #5B6373;
  --ink-3:     #9AA1AC;
  --line:      #EDE7D8;
  --line-soft: #F3EFE4;
  --brand:      #2A4C78;
  --brand-deep: #1E3A5F;
  --brand-bg:   #EBF1F8;
  --seal:      #D6432F;
  --seal-hv:   #B93520;
  --seal-bg:   #FDEEEB;
  --gold:    #B4832E;
  --gold-bg: #FBF2DE;
  --ok:      #2F8A5B;
  --ok-bg:   #E9F6EF;
  --warn:    #B4832E;
  --warn-bg: #FBF2DE;
  --bad:     #D6432F;
  --bad-bg:  #FDEEEB;
  --fs-xs: 11px; --fs-sm: 12px; --fs: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 19px; --fs-2xl: 23px;
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:20px; --s6:24px; --s8:32px;
  --r-sm:6px; --r:12px; --r-lg:18px;
  --max-w:468px;
  --font-display: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-body: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', Menlo, monospace;
}

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

body {
  font-family: var(--font-body);
  color: var(--ink); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background: var(--paper);
  padding-top: 49px;
}
::selection { background: var(--gold-bg); color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ===== Nav ===== */
.nav {
  display: flex; align-items: center; gap: var(--s3);
  padding: 12px var(--s4);
  background: rgba(247,245,240,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
}
.brand { display: flex; align-items: center; line-height: 1; }
.brand-cn { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--ink); letter-spacing: 1px; }
.nav-links { display: flex; gap: 2px; margin-left: auto; }
.lang-sw {
  font-size: 10px; font-family: var(--font-mono);
  padding: 4px 6px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--paper-2);
  color: var(--ink-2); cursor: pointer; outline: none; letter-spacing: .2px; margin-left: 4px;
}
.nav-link {
  padding: 6px 13px; border: 1px solid transparent; background: none;
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--ink-3); cursor: pointer;
  border-radius: 20px; font-family: var(--font-body); letter-spacing: .3px;
  transition: all .18s;
}
.nav-link.active { color: var(--brand-deep); border-bottom: 2px solid var(--brand-deep); border-radius: 0; background: none; }

/* Nav Auth */
.nav-login-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--paper-2); color: var(--ink-2);
  font-size: var(--fs-xs); font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: all .18s; letter-spacing: .2px;
}
.nav-login-btn:hover { border-color: var(--brand); color: var(--brand); }
.nav-login-btn svg { flex-shrink: 0; }
.nav-user { display: flex; align-items: center; gap: 6px; }
.nav-logout {
  padding: 3px 8px; border: 1px solid var(--line);
  background: none; border-radius: 12px;
  font-size: 10px; color: var(--ink-3); cursor: pointer;
  font-family: var(--font-body);
  transition: all .15s;
}
.nav-logout:hover { border-color: var(--seal); color: var(--seal); }

/* ===== View ===== */
.view { display: block; max-width: var(--max-w); margin: auto; padding: var(--s5) var(--s4) 80px; }

/* ===== Search ===== */
.search-wrap {
  display: flex; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  margin-bottom: var(--s2);
  box-shadow: 0 4px 24px rgba(42,76,120,.10);
}
.search-wrap input {
  flex:1; border:none; padding: 16px var(--s4);
  font-size: var(--fs-md); font-family: var(--font-body);
  background: transparent; outline: none; color: var(--ink);
}
.search-wrap input::placeholder { color: var(--ink-3); }
.search-wrap button {
  width: 96px; border:none; background: var(--brand-deep); color:#F7F5F0;
  font-size: var(--fs); font-weight: 700; cursor: pointer;
  font-family: var(--font-body); letter-spacing: .5px;
}
.search-hint { text-align:center; font-size:var(--fs-xs); color:var(--ink-3); margin-bottom: var(--s6); font-family: var(--font-mono); letter-spacing: .2px; }

/* ===== Card ===== */
.card {
  position: relative; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s6); box-shadow: 0 1px 3px rgba(27,35,51,.05);
}


/* ===== Image Gallery: thumbnails left + main right ===== */
.img-area { display: flex; gap: 6px; align-items: flex-start; }
.thumb-col { display: flex; flex-direction: column; gap: 3px; flex-shrink: 0; }
.thumb-col img {
  width: 44px; height: 44px; object-fit: cover;
  border-radius: 4px; border: 2px solid transparent;
  cursor: pointer; background: #FAFAFA;
  transition: border-color .15s;
}
.thumb-col img:hover { border-color: var(--ink-3); }
.thumb-col img.active { border-color: var(--brand); }
.thumb-video {
  width: 44px; height: 26px; border-radius: 4px;
  background: var(--ink-2); color: #FFF;
  font-size: 8px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 1px;
  border: none; font-family: var(--font-body); letter-spacing: .3px;
  transition: background .15s;
}
.thumb-video:hover { background: var(--ink); }

.main-img-wrap { flex: 1; min-width: 0; margin-left: 4px; }
.prod-img {
  width: 100%; aspect-ratio: 1/1; max-height: 320px;
  border-radius: 12px; object-fit: contain; background: #FFF;
  border: 1px solid var(--line);
}

/* ===== Product Header ===== */
.prod-title {
  font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700;
  color: var(--ink); line-height: 1.35; letter-spacing: -.1px; margin-top: var(--s4);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
}
.prod-price { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--seal); margin-top: var(--s2); }
.prod-price em { font-size: var(--fs-sm); font-weight: 400; color: var(--ink-3); font-style: normal; font-family: var(--font-body); }
.price-local { font-size: 14px; font-weight: 600; color: var(--ink-2); font-style: normal; font-family: var(--font-body); white-space: nowrap; }
.price-link { font-size: var(--fs-xs); font-weight: 500; color: var(--brand); text-decoration: none; margin-left: 6px; font-family: var(--font-body); white-space: nowrap; }
.price-link:hover { text-decoration: underline; }

/* MOQ inline in price row */
.price-moq { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 400; font-family: var(--font-body); }
.price-moq strong { color: var(--ink); font-weight: 700; font-family: var(--font-mono); }

/* Badge row */
.badge-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s3);
}
.badge-sm {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; letter-spacing: .3px; font-family: var(--font-body);
}
.badge-sm.green { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); }
.badge-sm.blue  { background: var(--brand-bg); color: var(--brand); border: 1px solid var(--brand); }
.badge-sm.gold  { background: var(--gold-bg); color: var(--gold); border: 1px solid var(--gold); }

/* Trust bar — lighter */
.trust-bar {
  position: relative; margin-top: var(--s3); padding: var(--s2) var(--s4);
  background: #F8F7F3; border-left: 3px solid var(--ok);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: var(--fs); font-weight: 600;
  color: var(--ink); display: flex; flex-wrap: wrap; gap: 6px 16px;
  align-items: center;
}
.trust-bar span { white-space: nowrap; }

/* 数据完整度星级 */
.tier-stars {
  margin-left: auto; white-space: nowrap; flex-shrink: 0;
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--gold); letter-spacing: 1px;
}


/* ===== Tabs ===== */
.tabs { display: flex; gap: 4px; margin-top: var(--s6); border-bottom: 1px solid var(--line); }
.tab {
  flex: 1; min-height: 44px; line-height: 44px; padding: 0; text-align: center;
  font-size: var(--fs); font-weight: 600;
  color: var(--ink-3); cursor: pointer;
  border: 1px solid transparent; border-bottom: none; background: none;
  border-radius: 8px 8px 0 0; font-family: var(--font-body); letter-spacing: .3px;
  transition: color .2s, background .2s; position: relative; top: 1px;
}
.tab.active { color: var(--brand); font-weight: 700; background: var(--paper); border-color: var(--line); border-bottom: 1px solid var(--paper); }

/* ===== Panel ===== */
.panel { display: none !important; background: var(--paper); padding: var(--s5) var(--s4) var(--s4); border-radius: 0 0 var(--r-sm) var(--r-sm); border: 1px solid var(--line); border-top: none; }
.panel.active { display: block !important; }

/* ===== Verdict ===== */
.verdict {
  margin-bottom: var(--s5); padding: var(--s3) var(--s4); border-radius: var(--r-sm);
  font-size: var(--fs); font-weight: 600; line-height: 1.55;
  display: flex; align-items: flex-start; gap: var(--s3); border-left: 3px solid;
}
.verdict.g { background: var(--ok-bg); color: #1F5C3F; border-left-color: var(--ok); }
.verdict.g .vi { background: var(--ok); }
.verdict .vi {
  width: 8px; height: 8px; flex-shrink: 0; margin-top: 6px;
  transform: rotate(45deg); border-radius: 2px;
}

/* ===== Field Row ===== */
.row { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px dotted var(--line); }
.row:last-child { border: none; }
.row-tag {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  padding: 3px 7px; border-radius: 4px; border: 1px solid;
  white-space: nowrap; flex-shrink: 0; margin-top: 2px;
  letter-spacing: .5px; width: 34px;
}
.row-tag.g { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.row-body { flex:1; min-width:0; }
.row-label { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; margin-bottom:2px; text-transform: uppercase; letter-spacing:.4px; font-family: var(--font-mono); }
.row-value { font-size: var(--fs-md); font-weight: 700; color: var(--ink); font-family: var(--font-display); }
.row-explain { font-size: var(--fs-xs); color: var(--ink-2); margin-top: 3px; line-height: 1.6; }
.row-explain a { color: var(--brand); font-weight: 600; text-decoration: none; border-bottom: 1px dotted var(--brand); }

/* 高亮行 —— 工厂 Tab 核心评估区 */
.row-highlight {
  border-left: 3px solid var(--sapphire, #2A4C78);
  padding-left: var(--s2); background: #F4F7FA; border-radius: 0 6px 6px 0;
}

/* 折叠展开 */
.detail-toggle {
  display: block; width: 100%; padding: var(--s3) 0;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2);
  background: none; border: none; cursor: pointer;
  text-align: left; font-family: var(--font-body);
}
.detail-toggle:hover { color: var(--ink); }
.detail-collapse { border-top: 1px dotted var(--line); margin-top: var(--s2); }

/* ===== Section label ===== */
.sec {
  font-size: var(--fs-xs); color: var(--ink-3); font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; font-family: var(--font-mono);
  margin: var(--s5) 0 var(--s1); display: flex; align-items: center; gap: var(--s2);
}
.sec::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.sec:first-child { margin-top: 0; }

/* ===== Spec tags ===== */
.prod-specs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2); }
.spec-tag { display: inline-block; padding: 3px 10px; font-size: 11px; font-weight: 600; color: var(--brand); background: var(--brand-bg); border: 1px solid rgba(42,76,120,.15); border-radius: 20px; font-family: var(--font-body); letter-spacing: .2px; }

/* ===== SKU row ===== */
.sku-imgs { display: flex; gap: 6px; margin-top: var(--s2); flex-wrap: wrap; }
.sku-imgs img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #FAFAFA; }

/* ===== Qty price table ===== */
.qp-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin-top: var(--s2); }
.qp-table th, .qp-table td { padding: 6px var(--s2); text-align: left; border-bottom: 1px dotted var(--line); }
.qp-table th { font-size: 10px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; font-family: var(--font-mono); }
.qp-table td { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--ink); }

/* ===== Certification ===== */
.cert-badge { font-size: var(--fs-sm); font-weight: 700; color: var(--brand); background: var(--brand-bg); padding: 2px 10px; border-radius: 4px; border: 1px solid var(--brand); }


/* ===== Cost Estimator ===== */
.cost-form { display: flex; gap: var(--s3); margin-bottom: var(--s3); }
.cf-field { flex:1; }
.cf-field label { display:block; font-size:var(--fs-xs); color:var(--ink-3); margin-bottom:var(--s1); font-weight:600; text-transform:uppercase; letter-spacing:.4px; font-family: var(--font-mono); }
.cf-field select {
  width:100%; padding:9px var(--s3); border:1px solid var(--line); border-radius:var(--r-sm);
  font-size:var(--fs); font-family:var(--font-body); background:var(--paper-2); color:var(--ink); outline:none;
}
.qty-ctl { display:flex; align-items:center; gap:0; border:1px solid var(--line); border-radius:var(--r-sm); overflow:hidden; }
.qty-ctl button {
  width:36px; height:36px; border:none; background:var(--paper); font-size:var(--fs-lg); font-weight:700;
  cursor:pointer; color:var(--ink); font-family:var(--font-mono); transition:background .15s;
}
.qty-ctl button:hover { background:var(--brand-bg); color:var(--brand); }
.qty-ctl span { flex:1; text-align:center; font-family:var(--font-mono); font-size:var(--fs-md); font-weight:700; }

/* Cost rows */
.cs-row { display:flex; align-items:baseline; gap:8px; padding:7px 0; font-size:var(--fs); color:var(--ink-2); }
.cs-row span:first-child { white-space:nowrap; }
.cs-row span:last-child { white-space:nowrap; font-family:var(--font-mono); font-weight:600; color:var(--ink); }
.cs-row::after { content:''; flex:1; border-bottom:1px dotted var(--line); transform:translateY(-4px); }
.cs-row.total { font-size:var(--fs-md); font-weight:700; color:var(--ink); border-top:1px solid var(--line); padding-top:var(--s3); margin-top:var(--s1); }
.cs-row.total::after { border-bottom:none; }
.cs-row.total span:last-child { font-family:var(--font-mono); font-size:var(--fs-lg); font-weight:700; color:var(--seal); }

/* 费用行 */
.cost-phase { font-size:var(--fs-sm); font-weight:700; color:var(--ink); margin:var(--s3) 0 var(--s1); }
.cs-row.phase-sub { font-size:var(--fs-sm); font-weight:600; }
.cs-row.phase-sub::after { border-bottom:none; }
.cs-row.phase-sub span:last-child { font-weight:700; }
.ship-meta { font-size:var(--fs-xs); color:var(--ink-3); font-weight:400; margin-left:4px; white-space:nowrap; }


/* 数量/目的国等高 */
.cf-field select,
.qty-ctl button,
.qty-ctl span { height:44px; display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box; }

/* 承诺 */
.sample-promise { font-size:var(--fs-sm); color:var(--ink); margin-bottom:var(--s1); }

.info-btn { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; margin-left:4px; border:1px solid var(--ink-3); border-radius:50%; background:none; color:var(--ink-3); font-size:11px; font-weight:700; font-family:var(--font-mono); cursor:pointer; padding:0; line-height:1; transition:all .15s; }
.info-btn:hover, .info-btn.active { background:var(--brand); color:#FFF; border-color:var(--brand); }
.steps-detail { margin-top:var(--s3); padding:var(--s3) var(--s4); background:var(--paper-2); border:1px solid var(--line); border-radius:var(--r-sm); }
.steps-detail-title { font-size:var(--fs-sm); font-weight:700; color:var(--ink); margin-bottom:var(--s2); }
.steps-detail-list { margin:0; padding:0 0 0 var(--s4); font-size:var(--fs-sm); color:var(--ink-2); line-height:1.8; }
.steps-detail-list li { margin-bottom:2px; }
.steps-detail-note { font-size:var(--fs-xs); color:var(--warn); font-weight:600; margin-top:var(--s2); line-height:1.6; }

/* CTA */
.btn { display:block; width:100%; padding:15px; background:var(--seal); color:#FFF; border:1px solid var(--seal); border-radius:var(--r); font-size:var(--fs-lg); font-weight:700; cursor:pointer; text-align:center; font-family:var(--font-display); letter-spacing:.2px; box-shadow:0 6px 16px rgba(214,67,47,.28); }

/* ===== Warn ===== */
.warn {
  font-size: var(--fs-sm); color: #7A5A1E; background: var(--gold-bg);
  border: 1px solid #EFDDAF; padding: 11px var(--s3); border-radius: var(--r-sm);
  margin-top: var(--s5); font-weight: 500; line-height: 1.55;
}

/* ===== Save Bar ===== */
.save-bar {
  display: flex; align-items: center; gap: var(--s2);
  margin-top: var(--s3); padding: 0;
}
.save-btn {
  flex: 1; padding: 10px 0; border-radius: 20px;
  font-size: var(--fs); font-weight: 600; cursor: pointer;
  font-family: var(--font-body); letter-spacing: .3px;
  text-align: center; transition: all .18s;
}
/* 保存 — 主操作 */
.save-btn:not(.share-action) {
  background: var(--brand-deep); color: #fff; border: none;
}
.save-btn:not(.share-action):hover { opacity: .88; }
.save-btn:not(.share-action):disabled { opacity: .55; cursor: not-allowed; }
/* 分享 — 次操作 */
.save-btn.share-action {
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--line);
}
.save-btn.share-action:hover { border-color: var(--brand); color: var(--brand); }
/* 已保存 */
.save-btn.saved { opacity: 1; cursor: default; }


/* ===== Share Overlay & Sheet ===== */
.share-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.45); backdrop-filter: blur(3px);
  align-items: flex-end; justify-content: center;
}
.share-overlay.show { display: flex; }
.share-sheet {
  position: relative;
  background: var(--paper-2); border-radius: 18px 18px 0 0;
  width: 100%; max-width: 500px; padding: var(--s6) var(--s5) var(--s8);
  animation: sheetUp .25s ease;
  max-height: 90vh; overflow-y: auto;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.share-sheet-title {
  font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700;
  color: var(--ink); margin-bottom: var(--s4); text-align: center;
}
.share-preview-img {
  width: 100%; border-radius: 10px; border: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(0,0,0,.08); margin-bottom: var(--s5);
  display: block;
}
.share-sheet-actions { display: flex; gap: var(--s3); }
.share-sheet-btn {
  flex: 1; padding: 14px; border-radius: var(--r); font-size: var(--fs-md);
  font-weight: 700; cursor: pointer; font-family: var(--font-body);
  text-align: center; border: none; letter-spacing: .3px; transition: all .15s;
}
.share-sheet-btn.save { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.share-sheet-btn.share { background: var(--brand-deep); color: #FFF; }
.share-sheet-btn.save:hover { border-color: var(--brand); }
.share-sheet-btn.share:hover { background: var(--brand); }
.share-sheet-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; font-size: 24px; cursor: pointer;
  color: var(--ink-3); padding: 4px; line-height: 1;
}

/* ===== Modal (统一弹窗：确认/提示) ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,.45); backdrop-filter: blur(3px);
  align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-dialog {
  background: var(--paper-2); border-radius: 14px;
  width: calc(100vw - 48px); max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  animation: modalIn .2s ease;
  overflow: hidden;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.92) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { padding: var(--s5) var(--s5) 0; }
.modal-title { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; color: var(--ink); margin: 0; }
.modal-body { padding: var(--s3) var(--s5); }
.modal-msg { font-size: var(--fs-md); color: var(--ink-2); line-height: 1.5; margin: 0; }
.modal-footer { display: flex; gap: var(--s3); padding: var(--s4) var(--s5) var(--s5); }
.modal-btn {
  flex: 1; padding: 12px; border-radius: var(--r); font-size: var(--fs-md);
  font-weight: 600; cursor: pointer; font-family: var(--font-body);
  text-align: center; border: none; letter-spacing: .3px; transition: all .15s;
}
.modal-btn-cancel { background: var(--paper); color: var(--ink-2); border: 1px solid var(--line); }
.modal-btn-cancel:hover { border-color: var(--ink-3); color: var(--ink); }
.modal-btn-primary { background: var(--brand-deep); color: #FFF; }
.modal-btn-primary:hover { background: var(--brand); }
.modal-btn-danger { background: var(--seal, #D6432F); color: #FFF; }
.modal-btn-danger:hover { background: #C0392B; }

/* ===== App Footer ===== */
.app-footer {
  padding: var(--s6) var(--s4) var(--s5);
  border-top: 1px solid var(--line);
  text-align: center;
  max-width: var(--max-w); margin: 0 auto;
}
.app-footer-brand {
  margin-bottom: var(--s4);
}
.app-footer-logo {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-lg); font-weight: 700;
  color: var(--ink); letter-spacing: 1px;
}
.app-footer-desc {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs); color: var(--ink-3);
  margin-top: var(--s1);
}
.app-footer-links {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: var(--s3); margin-bottom: var(--s3);
}
.app-footer-links a,
.app-footer-links span {
  font-family: var(--font-body);
  font-size: var(--fs-xs); color: var(--ink-2);
  text-decoration: none;
}
.app-footer-links a:hover { color: var(--brand); }
.app-footer-contact {
  font-family: var(--font-mono);
  font-size: var(--fs-xs); color: var(--ink-3);
  margin-bottom: var(--s3);
  display: flex; justify-content: center; gap: var(--s4);
  flex-wrap: wrap;
}
.app-footer-copy {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--ink-3);
}

/* ===== WhatsApp Float ===== */
.wa-float {
  position: fixed; bottom: 24px; right: 20px; z-index: 999;
  width: 52px; height: 52px; border-radius: 50%;
  background: #25D366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,.35);
  transition: transform .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.wa-float:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(37,211,102,.45); }
.wa-float:active { transform: scale(.95); }

/* ===== Responsive ===== */
@media (max-width: 380px) {
  .nav { padding: 10px var(--s2); gap: 4px; }
  .nav-links { gap: 0; }
  .nav-link { padding: 4px 9px; font-size: 10px; }
  .lang-sw { font-size: 9px; padding: 3px 4px; }
  .nav-login-btn { padding: 5px 8px; min-width: 32px; justify-content: center; }
  .nav-login-btn span { display: none; }
}
@media (min-width: 500px) {
  .view { max-width: 500px; }
  .prod-title { font-size: var(--fs-xl); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; max-width: var(--max-w); width: calc(100% - 32px);
}
.toast {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 12px var(--s4); border-radius: var(--r);
  font-size: var(--fs-sm); font-weight: 500; line-height: 1.5;
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  animation: toastIn .3s ease;
}
.toast--error   { background: var(--seal-bg);   border: 1px solid var(--seal);   color: var(--seal); }
.toast--success { background: var(--ok-bg);     border: 1px solid var(--ok);     color: var(--ok); }
.toast--warning { background: var(--warn-bg);   border: 1px solid var(--warn);   color: #7A5A1E; }
.toast--info    { background: var(--brand-bg);  border: 1px solid var(--brand);  color: var(--brand); }
.toast-icon  { flex-shrink: 0; font-size: 16px; line-height: 1.2; }
.toast-msg   { flex: 1; word-break: break-word; }

/* sticky：重要消息不自动消失 */
.toast--sticky {
  padding-right: 44px; position: relative;
}
.toast-close {
  position: absolute; top: 8px; right: 0;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; font-size: 20px;
  color: inherit; opacity: .6; cursor: pointer;
  line-height: 1;
}
.toast-close:hover { opacity: 1; }

@keyframes toastIn  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }


/* ===== History Page ===== */
.history-list { padding: 0 var(--s4); }

.history-item {
  display: flex; align-items: center;
  border-bottom: 1px solid var(--line-soft);
  min-height: 64px;
}
.hi-link {
  display: flex; align-items: center; gap: 12px;
  flex: 1; min-width: 0;
  padding: 12px 0;
  text-decoration: none; color: inherit;
  transition: opacity .15s;
}
.hi-link:active { opacity: .6; }

.hi-del {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border: none; background: none;
  font-size: 22px; color: var(--ink-3);
  cursor: pointer;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
  line-height: 1;
}
.hi-del:hover { color: var(--red, #D6432F); background: var(--line-soft); }

.hi-thumb {
  width: 48px; height: 48px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
  background: var(--line);
}
.hi-thumb-empty { background: var(--line-soft); }

.hi-body { flex: 1; min-width: 0; overflow: hidden; }

.hi-title {
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3; margin-bottom: 4px;
}

.hi-meta { display: flex; align-items: center; gap: 10px; }

.hi-price {
  font-family: 'JetBrains Mono','SF Mono',Menlo,monospace;
  font-size: var(--fs-xs); font-weight: 600; color: var(--seal);
  white-space: nowrap;
}

.hi-time { font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; }

.hi-price-local { font-size: 10px; color: var(--ink-3); font-family: var(--font-body); }

.hi-tag {
  font-size: 10px; font-weight: 600; white-space: nowrap;
  padding: 1px 6px; border-radius: 4px;
  background: var(--brand-bg); color: var(--brand); border: 1px solid rgba(42,76,120,.15);
}

/* Empty state */
.history-empty {
  text-align: center; padding: 60px var(--s4);
}

.history-empty-icon { font-size: 48px; margin-bottom: 16px; opacity: .6; }

.history-empty-title {
  font-size: var(--fs-lg); font-weight: 700; color: var(--ink);
  margin-bottom: 8px;
}

.history-empty-desc {
  font-size: var(--fs-sm); color: var(--ink-3);
  line-height: 1.5;
}

/* ===== Progress — 微信风格（共用，report + index 页） ===== */
.progress-card {
  max-width: 360px; margin: var(--s6) auto 0; padding: var(--s8) var(--s5) var(--s6);
  text-align: center; background: var(--paper-2);
  border-radius: var(--r-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
}
/* 旋转圈 — border spinner，兼容所有浏览器 */
.progress-ring {
  width: 44px; height: 44px; margin: 0 auto var(--s4);
  border: 3px solid var(--line-soft);
  border-top-color: var(--ok);
  border-radius: 50%;
  animation: ringSpin .8s linear infinite;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
/* 完成态 — 绿色实心 ✓ */
.progress-ring.done {
  animation: none;
  border-color: var(--ok);
  background: var(--ok);
}
.progress-ring.done::after {
  content: '✓'; color: #FFF; font-size: 22px; font-weight: 700;
  line-height: 1;
}
@keyframes ringSpin { to { transform: rotate(360deg); } }

/* 副标题 — 降级为辅助说明 */
.progress-title {
  font-size: var(--fs-xs); font-weight: 400; color: var(--ink-3);
  margin-bottom: 0; margin-top: var(--s2);
}

/* 进度条 */
.progress-bar-track {
  width: 100%; height: 4px; background: var(--line-soft);
  border-radius: 2px; overflow: hidden;
}
.progress-bar-fill {
  width: 0%; height: 100%; background: var(--ok);
  border-radius: 2px;
  transition: width .6s ease;
}

/* 当前状态文案 — 品牌蓝，主视觉 */
.progress-status {
  margin-top: var(--s4);
  font-size: var(--fs-lg); font-weight: 600; color: var(--brand);
  min-height: 24px;
}

/* 底部提示 */
.progress-hint {
  margin-top: var(--s3);
  font-size: var(--fs-xs); color: var(--ink-3);
  min-height: 16px;
}

