/* ============================================================
 * Dujiao-Next 自定义样式
 * 部署位置: /var/www/custom.css
 * 通过 Nginx sub_filter 注入到前台页面 <head> 中
 * ============================================================ */

/* --- 预设 1: 全局字体缩小 --- */
html, body {
  font-size: 14px !important;
}
h1 { font-size: 1.4rem !important; }
h2 { font-size: 1.15rem !important; }
h3 { font-size: 1rem !important; }
p, span, div, label, a, li, td, th,
input, select, textarea, button {
  font-size: inherit !important;
}

/* --- 预设 2: 图片自适应 --- */
img {
  object-fit: contain !important;
}

/* --- 隐藏底部版权链接 --- */
footer p:has(a[href*="github.com/dujiao-next"]) {
  display: none !important;
}
footer div.space-y-1 p:nth-child(2) {
  display: none !important;
}

/* --- 产品描述：取消行数截断，完整显示 --- */
p.line-clamp-2.theme-text-secondary {
  white-space: pre-line !important;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
}

/* --- 预设 3: 产品详情页布局优化 --- */

/* 左列: 图片容器居中 */
.product-detail-page .grid.lg\:grid-cols-2 > div:first-child {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border: none !important;
}

/* 左列内层 div: 填满整列 */
.product-detail-page .grid.lg\:grid-cols-2 > div:first-child > div {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
}

/* 图片: 宽度拉满，去掉强制比例 */
.product-detail-page .grid.lg\:grid-cols-2 > div:first-child img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

/* 右列: 压缩 padding */
.product-detail-page .grid.lg\:grid-cols-2 > div:last-child {
  padding: 1.25rem 1.5rem !important;
}

/* 右列子元素: 统一间距 */
.product-detail-page .grid.lg\:grid-cols-2 > div:last-child > * {
  margin-bottom: 0.4rem !important;
  margin-top: 0 !important;
}

/* 标题间距 */
.product-detail-page h2,
.product-detail-page h3 {
  margin-top: 0.15rem !important;
  margin-bottom: 0.1rem !important;
}

/* 按钮紧凑 */
.product-detail-page button {
  padding: 0.5rem 1rem !important;
  min-height: auto !important;
}

/* 分割线 */
.product-detail-page hr,
.product-detail-page .border-t {
  margin: 0.2rem 0 !important;
}
