:root {
  /* 颜色变量 */
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --text-color: #2c3e50;
  --light-text: #7f8c8d;
  --border-color: #ddd;
  --bg-color: #f5f5f5;
  --tooltip-bg: #333;
  --tooltip-text: #fff;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 基础样式 */
body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 20px;
  background-color: var(--bg-color);
  color: var(--text-color);
  /* 禁止文本选择 */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h1 {
  text-align: center;
  color: var(--text-color);
  margin-bottom: 30px;
  position: relative;
  padding-bottom: 15px;
}

h1::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: var(--primary-color);
}

/* 搜索区域 */
.search-container {
  display: flex;
  margin-bottom: 10px;
  gap: 10px;
}

#search-input {
  flex: 1;
  padding: 12px 15px;
  font-size: 16px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  transition: all 0.3s;
}

#search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

#search-button, #reset-button {
  padding: 12px 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
}

#reset-button {
  background-color: var(--light-text);
}

#search-button:hover {
  background-color: #2980b9;
  transform: translateY(-1px);
}

#reset-button:hover {
  background-color: #95a5a6;
  transform: translateY(-1px);
}

/* 关键词推荐样式 */
.keyword-recommendations {
  margin: 0 0 25px;
  font-size: 14px;
  color: var(--light-text);
}

.keyword-recommendations span {
  margin-right: 10px;
}

.keyword-tag {
  display: inline-block;
  padding: 4px 12px;
  margin: 0 8px 8px 0;
  background-color: #f0f0f0;
  color: var(--text-color);
  border-radius: 15px;
  text-decoration: none;
  transition: all 0.3s;
  cursor: pointer;
}

.keyword-tag:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 商品容器 - 表格布局 */
.product-container {
  width: 100%;
  margin-bottom: 20px;
}

/* 表格样式 */
.product-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.product-table th, 
.product-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.product-table th {
  background-color: var(--primary-color);
  color: white;
  font-weight: bold;
  position: sticky;
  top: 0;
}

.product-table tr:nth-child(even) {
  background-color: rgba(0,0,0,0.02);
}

.product-table tr:hover {
  background-color: rgba(52, 152, 219, 0.1);
}

/* 商品名称单元格 */
.product-name {
  width: 40%;
  min-width: 300px;
  position: relative;
}

.shop-name {
  width: 15%;
  font-size: 14px;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-text {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  cursor: help;
  vertical-align: middle;
}

/* 其他单元格样式 */
.original-price {
  width: 10%;
  text-decoration: line-through;
  color: var(--light-text);
  white-space: nowrap;
}

.discount-price {
  width: 10%;
  color: var(--danger-color);
  font-weight: bold;
  white-space: nowrap;
}

.actions {
  width: 15%;
  display: flex;
  gap: 10px;
}

/* 卡片布局样式 */
.product-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

.product-card {
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
}

.card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-weight: bold;
  font-size: 16px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-shop {
  color: var(--light-text);
  font-size: 14px;
  margin-left: 10px;
}

.card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card-price {
  display: flex;
  align-items: center;
}

.card-original-price {
  text-decoration: line-through;
  color: var(--light-text);
  margin-right: 10px;
}

.card-discount-price {
  color: var(--danger-color);
  font-weight: bold;
}

.card-actions {
  display: flex;
  gap: 10px;
}

/* 操作按钮 */
.action-button {
  display: inline-block;
  padding: 8px 12px;
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 4px;
  text-align: center;
  transition: all 0.2s;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  flex: 1;
}

.action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.action-button:active {
  transform: translateY(0);
}

.coupon-button {
  background-color: var(--warning-color);
}

.coupon-button:hover {
  background-color: #e67e22;
}

.buy-button {
  background-color: var(--primary-color);
}

.buy-button:hover {
  background-color: #2980b9;
}

/* 全局悬浮提示框 */
.global-tooltip {
  position: fixed;
  background-color: var(--tooltip-bg);
  color: var(--tooltip-text);
  padding: 12px 15px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  max-width: 400px;
  pointer-events: none;
}

.global-tooltip::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 20px;
  border-width: 6px;
  border-style: solid;
  border-color: var(--tooltip-bg) transparent transparent transparent;
}

/* 无结果提示 */
.no-results {
  text-align: center;
  padding: 40px;
  color: var(--light-text);
  font-size: 18px;
}

/* 法律信息底部样式 */
.legal-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 13px;
  color: var(--light-text);
}

.legal-links {
  margin-bottom: 10px;
  line-height: 1.5;
}

.legal-links a {
  color: var(--light-text);
  text-decoration: none;
  transition: color 0.3s;
}

.legal-links a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

#google-analytics-notice {
  cursor: help;
  border-bottom: 1px dashed var(--light-text);
}

.copyright {
  margin-top: 15px;
}

/* 分页控件样式 */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-button {
  padding: 8px 12px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 40px;
  text-align: center;
}

.pagination-button:hover:not(:disabled) {
  background-color: #2980b9;
  transform: translateY(-1px);
}

.pagination-button:disabled {
  background-color: var(--light-text);
  cursor: not-allowed;
  opacity: 0.7;
}

.pagination-info {
  color: var(--light-text);
  font-size: 14px;
  margin: 0 15px;
}

/* 图片保护 */
img {
  pointer-events: none;
  -webkit-touch-callout: none;
}

/* 响应式设计 */
@media (min-width: 768px) {
  /* PC端 - 表格布局 */
  .product-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
  }
  
  .product-cards {
    display: none;
  }
  
  .product-table {
    display: table;
  }
}

@media (max-width: 767px) {
  /* 移动端 - 卡片布局 */
  body {
    padding: 10px;
  }
  
  h1 {
    font-size: 24px;
    margin-bottom: 20px;
  }
  
  .search-container {
    flex-direction: column;
  }
  
  #search-button, #reset-button {
    width: 100%;
  }
  
  .keyword-recommendations {
    margin: 0 0 15px;
    font-size: 13px;
  }
  
  .keyword-tag {
    padding: 3px 10px;
    margin: 0 5px 5px 0;
  }
  
  .product-table {
    display: none;
  }
  
  .product-cards {
    display: grid;
  }
  
  .card-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  
  .card-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .card-actions {
    width: 100%;
    justify-content: flex-start;
  }
  
  .action-button {
    padding: 6px 8px;
    font-size: 13px;
  }

  .legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  
  .legal-links a {
    white-space: nowrap;
  }
  
  /* 移动端分页调整 */
  .pagination-container {
    gap: 5px;
  }
  
  .pagination-button {
    padding: 6px 8px;
    min-width: 30px;
  }
}