/* ===== 全局重置 & 基础 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #FF7214;
  --primary-light: #FFF3E8;
  --primary-dark: #E5600A;
  --bg: #F5F6FA;
  --card-bg: #FFFFFF;
  --text-main: #1A1D29;
  --text-sub: #6B7280;
  --text-hint: #9CA3AF;
  --border: #E8E9EE;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(255,114,20,0.15);
  --header-h: 56px;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* ===== 顶部导航 ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 4px;
  margin-left: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}

.back-btn:active {
  opacity: 0.5;
}

.header-title {
  font-size: 17px;
  font-weight: 600;
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 28px;
}

/* ===== 页面通用 ===== */
.page {
  min-height: calc(100vh - var(--header-h));
  padding-bottom: 40px;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 首页 Banner ===== */
.home-banner {
  background: linear-gradient(135deg, #FF7214 0%, #FFAA14 100%);
  padding: 36px 24px 32px;
  text-align: center;
  color: #fff;
  border-radius: 0 0 24px 24px;
}

.banner-icon {
  font-size: 44px;
  margin-bottom: 12px;
}

.home-banner h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.home-banner p {
  font-size: 13px;
  opacity: 0.9;
}

/* ===== 搜索框 ===== */
.search-box {
  position: relative;
  margin: 20px 16px 16px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-hint);
}

.search-box input {
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 0 16px 0 42px;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text-main);
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-box input::placeholder {
  color: var(--text-hint);
}

/* ===== 产品列表 ===== */
.product-list {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  border: none;
  text-align: left;
  width: 100%;
  font-family: inherit;
  overflow: hidden;
}

.product-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-lg);
}

.product-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-tagline {
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-arrow {
  color: var(--text-hint);
  flex-shrink: 0;
}

/* ===== 联系客服 ===== */
.contact-bar {
  text-align: center;
  padding: 32px 16px 16px;
  color: var(--text-sub);
  font-size: 13px;
}

.contact-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  padding: 0;
}

/* ===== 客服二维码弹窗 ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  animation: modalUp 0.25s ease;
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  color: var(--text-sub);
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.modal-close:active {
  background: var(--border);
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 18px;
}

.modal-qr {
  width: 100%;
  max-width: 260px;
  border-radius: var(--radius-sm);
  display: block;
  margin: 0 auto;
}

/* ===== 产品详情页 ===== */
.page-detail {
  padding-top: 12px;
}

.product-info-card {
  background: var(--card-bg);
  margin: 0 16px 16px;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow);
}

.product-info-card img {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}

.product-detail-text {
  flex: 1;
  min-width: 0;
}

.product-detail-text h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.4;
}

.product-detail-text p {
  font-size: 13px;
  color: var(--text-sub);
}

/* ===== 问题分类 ===== */
.category-section {
  margin-bottom: 16px;
}

.category-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-title::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--primary);
  border-radius: 2px;
}

.question-list {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.question-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
  border: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
  transition: transform 0.15s;
}

.question-card:active {
  transform: scale(0.98);
}

.question-title {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.question-arrow {
  color: var(--text-hint);
  flex-shrink: 0;
}

.video-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-right: 4px;
}

/* ===== 答案页 ===== */
.page-answer {
  padding-top: 12px;
}

.answer-content {
  background: var(--card-bg);
  margin: 0 16px;
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--shadow);
}

.answer-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.5;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.answer-text {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.8;
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.answer-text:empty {
  display: none;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.no-video {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-sub);
}

.no-video-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-sub);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
}

/* ===== 返回顶部或其他小工具 ===== */
.floating-tip {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 20px;
  z-index: 99;
}

/* ===== 隐藏类 ===== */
.hidden {
  display: none !important;
}

/* ===== 响应式微调 ===== */
@media (max-width: 360px) {
  .home-banner {
    padding: 28px 20px 24px;
  }
  .home-banner h2 {
    font-size: 20px;
  }
  .product-thumb {
    width: 56px;
    height: 56px;
  }
  .product-info-card img {
    width: 64px;
    height: 64px;
  }
}
