/* ==================== 基础重置 ==================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

body {
  font-family: -apple-system, 'PingFang SC', 'Helvetica Neue', system-ui, sans-serif;
  background: #f5f5f5;
  color: #333;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}

img, video {
  -webkit-touch-callout: none;
  user-select: none;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input { font: inherit; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ==================== 布局 ==================== */
.page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.page-center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.text-center { text-align: center; }

/* ==================== 加载动画 ==================== */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #ff5000;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

.spinner-white {
  border-color: rgba(255,255,255,0.3);
  border-top-color: #fff;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  color: #999;
  font-size: 13px;
  text-align: center;
}

/* ==================== 主布局（商品详情页风格） ==================== */
.app-shell {
  min-height: 100vh;
  background: #f5f5f5;
  padding-bottom: 70px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, #ff6034 0%, #ee0a24 100%);
  padding-top: env(safe-area-inset-top);
}

.header-inner {
  max-width: 512px;
  margin: 0 auto;
  padding: 0 16px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255,255,255,0.5);
}

.header-name {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-logout {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
  transition: color 0.2s;
}

.header-logout:hover { color: #fff; }

.app-main {
  max-width: 512px;
  margin: 0 auto;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ==================== 登录页 ==================== */
.login-card {
  width: 100%;
  max-width: 384px;
  margin: 0 16px;
  padding: 32px 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
  text-align: center;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: #999;
  margin-bottom: 32px;
}

.login-body { padding: 24px 0; }

.login-icon-wrap {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #f0fdf4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wechat-icon { width: 32px; height: 32px; color: #07c160; }

.btn-wechat {
  width: 100%;
  padding: 12px 24px;
  background: #07c160;
  color: #fff;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-wechat:active { background: #06ad56; }

.btn-green {
  padding: 8px 24px;
  background: #ff5000;
  color: #fff;
  border-radius: 20px;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-green:hover { background: #e04600; }

.login-error {
  color: #ee0a24;
  font-size: 12px;
  margin-top: 8px;
  min-height: 18px;
}

.login-loading-text { color: #666; font-size: 14px; margin-top: 16px; }
.login-hint-title { font-size: 16px; font-weight: 500; color: #333; margin-bottom: 8px; }
.login-hint-text { font-size: 14px; color: #999; line-height: 1.6; }

/* ==================== 回调页 ==================== */
.callback-text { color: #666; font-size: 15px; }
.error-text { color: #ee0a24; font-size: 18px; margin-bottom: 8px; }
.error-detail { color: #999; font-size: 14px; margin-bottom: 16px; }

/* ==================== 首页 ==================== */
.home-emoji { font-size: 48px; margin-bottom: 16px; }
.home-title { font-size: 20px; font-weight: 700; color: #333; margin-bottom: 8px; }
.home-hint { font-size: 14px; color: #999; }

/* ==================== 分享落地页 ==================== */
.share-landing {
  min-height: 100vh;
  background: linear-gradient(135deg, #ff6034 0%, #ee0a24 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.redirecting { text-align: center; color: #fff; }
.redirecting p { font-size: 15px; opacity: 0.9; }

/* ==================== 视频播放页（商品主图区） ==================== */
.video-container {
  background: #000;
  overflow: hidden;
  margin: 0;
}

.video-wrapper { position: relative; }

.video-el {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.live-video { pointer-events: none; }

.live-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #fff;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: #ee0a24;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9999px;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.live-hint-text { font-size: 11px; color: #999; }

.live-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  cursor: pointer;
  z-index: 10;
}

.live-play-btn {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,80,0,0.8);
  border: none;
  border-radius: 50%;
  color: #fff;
  transition: transform 0.2s, background 0.2s;
}

.live-play-btn:active {
  transform: scale(0.92);
  background: rgba(255,80,0,1);
}

.live-overlay-text { color: #fff; font-size: 13px; margin-top: 10px; font-weight: 500; }

.live-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(0,0,0,0.85);
}

.live-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 4px;
}

.live-btn:active { background: rgba(255,255,255,0.15); }

.live-spacer { flex: 1; }

.live-start-time { font-size: 13px; color: #ff5000; margin-top: 6px; font-weight: 500; }

/* ==================== 商品信息卡片 ==================== */
.info-card {
  background: #fff;
  padding: 16px;
  margin-top: 10px;
}

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.product-price {
  font-size: 22px;
  font-weight: 700;
  color: #ff5000;
}

.product-price-label {
  font-size: 12px;
  color: #ff5000;
}

.product-origin-price {
  font-size: 13px;
  color: #c8c8c8;
  text-decoration: line-through;
}

.product-tag {
  display: inline-block;
  padding: 2px 6px;
  background: linear-gradient(135deg, #ff6034 0%, #ee0a24 100%);
  color: #fff;
  font-size: 10px;
  border-radius: 2px;
  margin-right: 6px;
  font-weight: 500;
  vertical-align: middle;
}

.product-tag-outline {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid #ff5000;
  color: #ff5000;
  font-size: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.video-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  line-height: 1.5;
}

.video-desc {
  font-size: 13px;
  color: #999;
  margin-top: 8px;
  line-height: 1.6;
}

/* 商品信息行 */
.product-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid #f5f5f5;
  margin-top: 12px;
}

.product-meta-item {
  text-align: center;
  flex: 1;
}

.product-meta-value {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.product-meta-label {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.product-meta-divider {
  width: 1px;
  height: 24px;
  background: #eee;
}

/* ==================== 评论区（商品评价风格） ==================== */
.section-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 0;
}

.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.review-count {
  font-size: 12px;
  color: #999;
}

.review-tabs {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
}

.review-tab {
  padding: 4px 12px;
  background: #f5f5f5;
  color: #666;
  font-size: 12px;
  border-radius: 14px;
  white-space: nowrap;
  transition: all 0.2s;
}

.review-tab-active {
  background: #fff3ef;
  color: #ff5000;
  font-weight: 500;
}

/* 评论输入（底部固定） */
.comment-input-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: #fff;
  border-top: 1px solid #eee;
  padding: 8px 16px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-input-row { display: flex; gap: 8px; margin-bottom: 16px; }

.comment-input {
  flex: 1;
  padding: 8px 14px;
  background: #f5f5f5;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  color: #333;
  outline: none;
  transition: background 0.2s;
}

.comment-input::placeholder { color: #bbb; }
.comment-input:focus { background: #f0f0f0; }

.btn-send {
  padding: 8px 20px;
  background: linear-gradient(135deg, #ff6034 0%, #ee0a24 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: 20px;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.btn-send:active { opacity: 0.85; }

.comment-submitted {
  padding: 10px 16px;
  background: #fff7ed;
  color: #c87400;
  font-size: 12px;
  border-bottom: 1px solid #fef0cd;
}

.comments-empty {
  text-align: center;
  padding: 40px 0;
  color: #ccc;
  font-size: 13px;
}

.comments-list {
  display: flex;
  flex-direction: column;
}

/* 单条评价卡片 */
.comment-item {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #f7f7f7;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9a56, #ff6034);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.comment-body { flex: 1; min-width: 0; }

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.comment-name {
  font-size: 13px;
  font-weight: 500;
  color: #333;
}

.comment-time {
  font-size: 11px;
  color: #ccc;
}

.comment-stars {
  display: flex;
  gap: 2px;
  margin-bottom: 4px;
}

.comment-star {
  color: #ff5000;
  font-size: 12px;
}

.comment-content {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  word-break: break-all;
}
