/* ===== Gardening Theme - Inspired by Colorlib Gardening ===== */
/* Colors: #00880F green, #305534 dark green, #EFF6F0 light bg */
/* Font: Barlow + 中文回退栈 */

/* 字体栈：英文首选 Barlow，中文按系统优先级回退（iOS/macOS → 安卓 → Windows → 思源/微信内置） */
:root {
  --green: #00880F;
  --green-dark: #305534;
  --green-muted: #66816A;
  --green-light: #EFF6F0;
  --text-dark: #301A22;
  --border-light: #C9D6CB;
  --card-bg: #fff;
  --header-top-bg: #fff;
  --font-stack: "Barlow", -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑",
    "Source Han Sans CN", "Noto Sans CJK SC", "WenQuanYi Micro Hei",
    "Heiti SC", sans-serif;
}

/* ===== 重置 & 基础（兼容微信 X5/TBS 内核） ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-overflow-scrolling: touch;
}
body {
  font-family: var(--font-stack);
  color: var(--text-dark);
  background: var(--green-light);
  min-height: 100vh;
  line-height: 1.6;
  font-weight: 400;
  font-size: 16px;
  word-break: break-word;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-stack);
  color: var(--green-dark);
  font-weight: 600;
  line-height: 1.3;
}
img { -webkit-touch-callout: none; max-width: 100%; }
a { -webkit-tap-highlight-color: rgba(0, 136, 15, 0.15); }

/* ===== 页头 ===== */
.page-header {
  background: #fff;
  color: var(--green-dark);
  box-shadow: 0 4px 18px rgba(48, 85, 52, 0.08);
}
.header-top-bar {
  background: var(--green-dark);
  color: #fff;
  font-size: 14px;
  padding: 10px 0;
  letter-spacing: 0.3px;
}
.header-top-bar span { opacity: 0.9; }
.header-main {
  padding: 18px 0;
}
.header-main h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--green-dark);
  letter-spacing: 1px;
  margin-bottom: 2px;
}
.header-main .subtitle {
  font-size: 14px;
  color: var(--green-muted);
  font-weight: 400;
  letter-spacing: 0.5px;
}
.header-art {
  height: 100px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}
.header-art img {
  height: 100%;
  width: auto;
  max-width: 200px;
  display: block;
  object-fit: contain;
}

/* Header 底部装饰条 */
.header-divider {
  height: 4px;
  background: linear-gradient(90deg, var(--green) 0%, var(--green-dark) 100%);
}

/* ===== 主体容器 ===== */
main.container {
  max-width: 1100px;
}

/* ===== 模块卡片 ===== */
.module-card {
  background: var(--card-bg);
  border-radius: 5px;
  padding: 32px 30px 36px;
  border: 1px solid var(--border-light);
  transition: box-shadow 0.3s ease;
}
.module-card:hover {
  box-shadow: 0 10px 30px rgba(48, 85, 52, 0.06);
}
.module-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--green-dark);
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 2px solid var(--green);
  position: relative;
}
.module-title::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--green);
}
.module-tip {
  font-size: 14px;
  color: var(--green-muted);
  margin-bottom: 16px;
  margin-top: -8px;
  font-weight: 400;
}

/* ===== 模块1：数据框 ===== */
.cs4-box {
  background: var(--green-light);
  border-radius: 5px;
  padding: 16px 18px;
  font-size: 15px;
  color: var(--text-dark);
  white-space: pre-line;
  word-break: break-all;
  border-left: 3px solid var(--green);
}
.sub-row {
  background: var(--green-light);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  font-size: 15px;
  color: var(--green-dark);
  transition: box-shadow 0.3s ease;
}
.sub-row:hover {
  box-shadow: 0 4px 12px rgba(0, 136, 15, 0.08);
}
.sub-row .fw-semibold {
  color: var(--green-dark);
  font-size: 15px;
}

/* 产品介绍文本框 */
.desc-box-wrap {
  padding: 16px;
  border-left: 3px solid var(--green);
}
.desc-box {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dark);
  white-space: pre-wrap;
  word-break: break-all;
  font-family: var(--font-stack);

  /* 只显示 4 行 */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.7em * 4 + 28px);
}
.desc-box:focus {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  max-height: 500px;
  overflow: auto;
}
.copy-tip {
  display: inline-block;
  font-size: 13px;
  color: var(--green);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.copy-tip.show { opacity: 1; }

/* ===== 主题按钮（Gardening Style） ===== */
.btn-theme {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 32px;
  border-radius: 35px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  background: var(--green);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(0, 136, 15, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  font-family: var(--font-stack);
  line-height: 1;
}
.btn-theme::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 102%;
  height: 102%;
  background: var(--green-dark);
  z-index: -1;
  border-radius: 35px;
  transform: scaleX(0);
  transform-origin: 0 0;
  transition: transform 0.5s cubic-bezier(0.5, 1.6, 0.4, 0.7);
}
.btn-theme:hover {
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 136, 15, 0.4);
}
.btn-theme:hover::before {
  transform: scaleX(1);
}

.btn-theme-sm {
  padding: 10px 22px;
  font-size: 14px;
  border-radius: 30px;
}
.btn-theme-sm::before {
  border-radius: 30px;
}

.btn-outline-theme {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 18px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--green);
  cursor: pointer;
  background: #fff;
  color: var(--green) !important;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  font-family: var(--font-stack);
}
.btn-outline-theme::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 102%;
  height: 102%;
  background: var(--green);
  z-index: -1;
  border-radius: 30px;
  transform: scaleX(0);
  transform-origin: 0 0;
  transition: transform 0.5s cubic-bezier(0.5, 1.6, 0.4, 0.7);
}
.btn-outline-theme:hover {
  color: #fff !important;
  border-color: var(--green);
}
.btn-outline-theme:hover::before {
  transform: scaleX(1);
}

/* ===== 网格卡片（模块2 / 3） ===== */
.grid-item {
  background: var(--green-light);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  height: 100%;
}
.grid-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(48, 85, 52, 0.1);
}
.grid-item .thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #e8f0e6 center / cover no-repeat;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-muted);
  font-size: 14px;
  text-align: center;
  padding: 12px;
  overflow: hidden;
}
.grid-item .thumb img,
.grid-item .thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.grid-item .info {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.grid-item .info .name {
  font-size: 15px;
  color: var(--green-dark);
  font-weight: 500;
  word-break: break-all;
}
.grid-item .info .actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* 模块3：视频标题与下载按钮同行 */
#grid-mov .grid-item .info {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
#grid-mov .grid-item .info .actions {
  margin-top: 0;
  flex-shrink: 0;
}
#grid-mov .grid-item .info .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 8px;
}

/* 占位卡片 */
.placeholder {
  border: 2px dashed var(--border-light);
  background: #f5f9f4;
  color: var(--green-muted);
}

/* ===== 模块4：文件列表 ===== */
.file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.file-list li {
  background: var(--green-light);
  border-radius: 5px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
}
.file-list li:hover {
  background: #e4f0e2;
  border-color: var(--green);
}
.file-list .file-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.file-list .file-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--green-dark);
  word-break: break-all;
}
.file-list .file-size {
  font-size: 12px;
  color: var(--green-muted);
}
.file-list .download-link {
  padding: 10px 22px;
  border-radius: 30px;
  background: var(--green);
  color: #fff !important;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 3px 10px rgba(0, 136, 15, 0.25);
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--font-stack);
  display: inline-block;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.file-list .download-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 102%;
  height: 102%;
  background: var(--green-dark);
  z-index: -1;
  border-radius: 30px;
  transform: scaleX(0);
  transform-origin: 0 0;
  transition: transform 0.5s cubic-bezier(0.5, 1.6, 0.4, 0.7);
}
.file-list .download-link:hover {
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 136, 15, 0.35);
}
.file-list .download-link:hover::before {
  transform: scaleX(1);
}
.file-list .placeholder-item {
  color: var(--green-muted);
  font-style: italic;
  background: #f5f9f4;
  border: 1px dashed var(--border-light);
}
.file-list .placeholder-item .file-name {
  font-style: normal;
  color: var(--green-dark);
}
.file-list .placeholder-item .actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ===== 图片放大层 ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(48, 85, 52, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox-img {
  max-width: 95vw;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  background: #fff;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--green-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}
.lightbox-close:hover {
  background: var(--green);
  color: #fff;
}

/* ===== 视频弹层 ===== */
.video-modal {
  position: fixed;
  inset: 0;
  background: rgba(48, 85, 52, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: 24px;
}
.video-modal[hidden] { display: none; }
.video-modal-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 95vw;
  max-height: 92vh;
}
.video-modal-inner video {
  max-width: 95vw;
  max-height: 80vh;
  background: #000;
  border-radius: 8px;
  width: 100%;
}
.video-modal-title {
  color: #fff;
  font-size: 16px;
  text-align: center;
  word-break: break-all;
  font-family: var(--font-stack);
}
.video-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--green-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  z-index: 1002;
  transition: all 0.3s ease;
}
.video-modal-close:hover {
  background: var(--green);
  color: #fff;
}

/* ===== 页脚 ===== */
.page-footer {
  text-align: center;
  padding: 30px 16px;
  color: var(--green-muted);
  font-size: 14px;
  border-top: 1px solid var(--border-light);
  background: #fff;
  margin-top: 20px;
}

/* ===== Bootstrap 容器宽度 ===== */
@media (min-width: 1200px) {
  .container {
    max-width: 1100px;
  }
}

/* ===== 移动端适配（兼容微信内置浏览器等窄屏场景） ===== */
@media (max-width: 768px) {
  .header-main { padding: 14px 0; }
  .header-main h1 { font-size: 22px; }
  .header-main .subtitle { font-size: 13px; }
  .header-art { height: 75px; }
  .header-art img { max-width: 140px; }
  .header-top-bar { font-size: 12px; padding: 8px 0; }
}
@media (max-width: 576px) {
  .header-main h1 { font-size: 18px; letter-spacing: 0.5px; }
  .header-main .subtitle { font-size: 12px; }
  .header-art { height: 60px; }
  .header-art img { max-width: 110px; }
  .module-card { padding: 20px 16px 24px; }
  .module-title { font-size: 18px; }
  .module-title::after { width: 40px; }
  .desc-box { font-size: 13px; }
  .btn-theme { padding: 12px 24px; font-size: 15px; }
  .btn-theme-sm { padding: 8px 16px; font-size: 13px; }
  .file-list li { flex-direction: column; align-items: stretch; gap: 10px; }
  .file-list .download-link { align-self: flex-start; }
}
/* 极窄屏（如微信内置浏览器折叠侧边栏后） */
@media (max-width: 420px) {
  .col-7 { flex: 0 0 58.333%; max-width: 58.333%; }
  .col-5 { flex: 0 0 41.667%; max-width: 41.667%; }
  .header-main h1 { font-size: 17px; letter-spacing: 0; }
  .header-main .subtitle { font-size: 11px; line-height: 1.5; }
  .header-art { height: 54px; }
  .header-art img { max-width: 90px; }
  .module-card { padding: 18px 14px 22px; }
  .module-title { font-size: 17px; padding-bottom: 10px; margin-bottom: 16px; }
  .cs4-box { padding: 12px 14px; font-size: 14px; }
  .sub-row { font-size: 13px; padding: 10px 12px !important; }
  .btn-theme { padding: 11px 20px; font-size: 14px; }
  .file-list li { padding: 10px 12px; }
  .file-list .file-name { font-size: 14px; }
}

/* ===== 按钮 / 表单兼容（消除 iOS/微信默认样式） ===== */
button, .btn, .btn-theme, .btn-outline-theme, .download-link {
  -webkit-appearance: none;
  appearance: none;
  -webkit-user-select: none;
  user-select: none;
}

/* 微信长按图片识别 */
.header-art img,
.grid-item .thumb img {
  pointer-events: auto;
  -webkit-user-drag: none;
}
