﻿:root {
  /* ========== 颜色变量 ========== */
  --primary: #1a73e8;
  --primary-hover: #1557b0;
  --bg: #f5f7fa;
  --card-bg: #fff;
  --text: #333;
  --text-secondary: #666;
  --text-light: #999;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 12px;
  --gap: 20px;
  --header-h: 60px;
  --max-w: 1200px;

  /* ========== 字号变量（详情页文本在此统一调整）========== */
  --detail-title-size: 24px;        /* 产品英文名大标题 */
  --detail-cnname-size: 16px;       /* 产品中文名 */
  --detail-version-size: 14px;      /* 版本号 */
  --detail-section-title-size: 16px; /* 区块标题：产品卖点/使用说明/下载地址/选择套餐 */
  --detail-body-size: 15px;         /* 正文内容：卖点说明、使用说明、权益文本 */
  --detail-downbtn-size: 14px;      /* 下载按钮文字 */
  --buy-card-name-size: 14px;       /* 套餐名称：月度会员/年度会员 */
  --buy-card-price-size: 28px;      /* 套餐价格数字 */
  --buy-card-unit-size: 14px;       /* 套餐价格单位：/月 /年 /永久 */
  --buy-card-right-size: 13px;      /* 套餐权益说明文字 */
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card-bg);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gap);
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.brand {
  font-size: 22px;
  font-weight: 900;
  font-style: italic;
  color: #000;
  letter-spacing: -0.5px;
  user-select: none;
}

.search-box {
  position: relative;
  width: 320px;
}

.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--bg);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

.search-box::before {
  content: "🔍";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.5;
}

/* Main */
.main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--gap);
}

/* Skeleton */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.skeleton-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  height: 200px;
}

.skeleton {
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: pulse 1.5s infinite;
  border-radius: 4px;
}

@keyframes pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-icon { width: 64px; height: 64px; border-radius: 12px; margin-bottom: 16px; }
.skeleton-title { width: 60%; height: 18px; margin-bottom: 10px; }
.skeleton-text { width: 80%; height: 14px; margin-bottom: 8px; }
.skeleton-time { width: 40%; height: 12px; }

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

/* Product Card */
.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

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

.icon-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 24px;
}

.product-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.product-remark {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-time {
  font-size: 12px;
  color: var(--text-light);
  margin-top: auto;
}

/* Error & Empty */
.error-box, .empty-box {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.error-box button, .empty-box button {
  margin-top: 16px;
  padding: 8px 24px;
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.error-box button:hover, .empty-box button:hover {
  background: var(--primary-hover);
}

/* Detail Page */
.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.2s;
}

.back-btn:hover { background: var(--bg); }

.detail-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: var(--gap);
}

.detail-head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.detail-icon {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}

.detail-title {
  font-size: var(--detail-title-size);
  font-weight: 800;
  margin-bottom: 4px;
}

.detail-version {
  font-size: var(--detail-version-size);
  color: var(--text-light);
  margin-bottom: 8px;
}

.detail-cnname {
  font-size: var(--detail-cnname-size);
  color: var(--text-secondary);
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section h3 {
  font-size: var(--detail-section-title-size);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  padding-left: 10px;
  border-left: 3px solid var(--primary);
}

.detail-section pre {
  white-space: pre-line;
  font-family: inherit;
  font-size: var(--detail-body-size);
  color: var(--text-secondary);
  line-height: 1.7;
  background: var(--bg);
  padding: 14px;
  border-radius: 8px;
}

/* Download Buttons */
.down-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: var(--detail-downbtn-size);
  font-weight: 600;
  transition: background 0.2s;
  margin-right: 10px;
  margin-bottom: 10px;
}

.down-btn:hover { background: var(--primary-hover); }

/* Buy Section */
.buy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 0;
}

.buy-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--card-bg);
}

.buy-card:hover, .buy-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

.buy-card.active {
  background: rgba(26,115,232,0.03);
}

.buy-card h4 {
  font-size: var(--buy-card-name-size);
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.buy-card .price {
  font-size: var(--buy-card-price-size);
  font-weight: 800;
  color: var(--primary);
}

.buy-card .price span {
  font-size: var(--buy-card-unit-size);
  font-weight: 400;
  color: var(--text-light);
}

.buy-card .right {
  font-size: var(--buy-card-right-size);
  color: var(--text-light);
  margin-top: 8px;
  line-height: 1.4;
  white-space: pre-line;
}

.buy-btn {
  width: 100%;
  padding: 14px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}

.buy-btn:hover { background: var(--primary-hover); }

.buy-btn:disabled {
  background: var(--text-light);
  cursor: not-allowed;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

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

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  animation: modalIn 0.25s ease;
}

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

.modal h3 {
  font-size: 18px;
  margin-bottom: 16px;
}

.modal-row {
  margin-bottom: 14px;
}

.modal-row label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.modal-row input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.modal-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions button {
  flex: 1;
  height: 42px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
}

.modal-actions .cancel {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.modal-actions .confirm {
  background: var(--primary);
  color: #fff;
}

/* Responsive */
@media (max-width: 1024px) {
  .product-grid, .skeleton-grid, .buy-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .product-grid, .skeleton-grid, .buy-grid { grid-template-columns: 1fr; }
  .search-box { width: 180px; }
  .brand { font-size: 18px; }
  .detail-head { flex-direction: column; align-items: center; text-align: center; }
  .buy-grid { grid-template-columns: 1fr; }
}

/* ===== 首页 Header 布局调整 ===== */
.header-left { display: flex; align-items: center; gap: 10px; flex: 1; }
.header-center { flex: 0 1 320px; display: flex; justify-content: center; }
.header-right { flex: 1; display: flex; justify-content: flex-end; align-items: center; }
.order-query-btn {
  color: var(--primary); font-size: 14px; text-decoration: none;
  padding: 6px 12px; border-radius: 6px; transition: background 0.2s;
  white-space: nowrap;
}
.order-query-btn:hover { background: rgba(26,115,232,0.08); }

/* ===== 订单查询页专用 ===== */
.page-main { max-width: 600px; margin: 60px auto; padding: 0 var(--gap); }
.query-box { display: flex; gap: 10px; margin-bottom: 30px; }
.query-box input {
  flex: 1; height: 44px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 15px; outline: none; background: var(--card-bg);
}
.query-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,115,232,0.1); }
.query-box button {
  height: 44px; padding: 0 24px;
  background: var(--primary); color: #fff; border: none;
  border-radius: var(--radius); font-size: 15px; cursor: pointer;
}
.query-box button:disabled { opacity: 0.6; cursor: not-allowed; }
.msg-box { text-align: center; padding: 40px; color: var(--text-light); }
.msg-box.error { color: #f56c6c; }
.order-list { display: flex; flex-direction: column; gap: var(--gap); }
.order-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.order-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.order-id { font-family: monospace; font-size: 13px; color: var(--text-secondary); }
.pay-status {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 500;
}
.status-0 { background: #fef0f0; color: #f56c6c; }
.status-1 { background: #f0f9eb; color: #67c23a; }
.status-2 { background: #f4f4f5; color: #909399; }
.info-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.info-row:not(:last-child) { border-bottom: 1px dashed var(--border); }
.info-label { color: var(--text-light); }
.info-value { color: var(--text); word-break: break-all; text-align: right; }
.info-value.price { color: #f56c6c; font-weight: 700; font-size: 16px; }
.info-value.code { font-family: monospace; background: var(--bg); padding: 2px 8px; border-radius: 4px; font-size: 13px; }
@media (max-width: 640px) {
  .page-main { margin-top: 30px; }
  .query-box { flex-direction: column; }
  .query-box button { width: 100%; }
  .info-row { flex-direction: column; gap: 2px; }
  .info-value { text-align: left; }
}

/* 支付中弹窗样式补充 */
#payingModal .modal {
  padding: 32px 24px;
}

#payingModal h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

/* 备案信息 */
.site-footer {
  text-align: center;
  padding: 20px 16px 24px;
  font-size: 14px;
  color: #aaa;
  line-height: 1.6;
}

.site-footer a {
  color: #aaa;
  text-decoration: none;
  margin-left: 8px;
}

.site-footer a:hover {
  color: #888;
}

.main {
  min-height: calc(100vh - 120px);
}

/* ==========================================
   头像缩放与气泡提示参数配置
   ========================================== */
:root {
  --avatar-default-size: 32px;      /* 默认头像尺寸 */
  --avatar-hover-scale: 5;          /* 悬停放大倍数 (改成5倍) */
  --avatar-border-radius: 6px;       /* 头像圆角大小 */

  --bubble-font-size: 18px;          /* 气泡字号大小 */
  --bubble-bg-color: #ff69b4;        /* 气泡背景颜色 */
  --bubble-text-color: #ffffff;      /* 气泡文字颜色 */

  --bubble-offset-x: 2px;            /* 气泡距图片右侧的距离 (2-3px) */
  --bubble-offset-y: 2px;            /* 气泡距图片底部的距离 (2-3px) */
}

/* 头像容器 */
.avatar-container {
  position: relative;
  display: inline-block;
  width: var(--avatar-default-size);
  height: var(--avatar-default-size);
  cursor: pointer;
  z-index: 100;                      /* 提升层级，防止被下方内容遮挡 */
}

/* 头像图片 */
.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: var(--avatar-border-radius);
  object-fit: cover;
  transition: transform 0.3s ease;
  transform-origin: top center;       /* 设置基准点为顶部居中：保持上方不动，仅向下放大 */
}

/* 鼠标悬停放大 */
.avatar-container:hover .avatar-img {
  transform: scale(var(--avatar-hover-scale));
}

/* 右下角外部气泡 */
.bubble-tooltip {
  position: absolute;
  /* 算上5倍放大后的右下角坐标位置 (公式: 放大倍数*100% + 偏移量) */
  top: calc(var(--avatar-hover-scale) * 80% + var(--bubble-offset-y));
  left: calc(var(--avatar-hover-scale) * 80% + var(--bubble-offset-x));

  font-size: var(--bubble-font-size);
  background-color: var(--bubble-bg-color);
  color: var(--bubble-text-color);
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
  pointer-events: none;

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease;
  transform: scale(0.8);
  z-index: 101;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* 鼠标悬停显示气泡 */
.avatar-container:hover .bubble-tooltip {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

/* ========== 烟花雨全屏效果 ========== */
#fireworksCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;   /* 点击穿透，不影响产品/链接点击 */
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: transparent;
}

#fireworksCanvas.active {
  opacity: 1;
  // background: rgba(0, 0, 0, 0.1);  /* 50% 黑背景，烟花更清晰 */
  background: rgba(0, 0, 0, 0);  /* 50% 黑背景，烟花更清晰 */
}


