/* ===== 基础 ===== */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #1f2d3d;
  background: #f4f6fb;
  line-height: 1.6;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
a { color: inherit; text-decoration: none; }

.section-title {
  font-size: 18px;
  margin: 28px 0 16px;
  padding-left: 12px;
  border-left: 4px solid #2f6fed;
}

/* ===== 版头（商务蓝 + 双模式） ===== */
.site-header {
  position: relative;
  width: 100%;
  height: calc(var(--h-img, 190px) * 0.8); /* 移动端：按设置值 80% 缩放，减少占用 */
  overflow: hidden;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-header.text-mode {
  height: calc(var(--h-text, 150px) * 0.8); /* 纯文字模式：比图片模式更矮 */
}
.header-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.header-placeholder {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
}
.header-caption {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  background: rgba(15, 23, 42, .30); /* 图片上压暗，保障文字可读 */
}
.site-header.text-mode .header-caption { background: transparent; }
.header-text {
  color: #fff;
  font-size: clamp(18px, 4vw, 26px);
  font-weight: 600;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  margin: 0;
  max-width: 90%;
}

/* ===== 功能模块九宫格 ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 移动端默认一行 2 个 */
  gap: 14px;
}
.cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 14px;
  padding: 18px 10px;
  box-shadow: 0 4px 16px rgba(31, 45, 61, .06);
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
.cell:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(47, 111, 237, .18);
}
.cell-img {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #4a7bf7, #6f5bf7);
  margin-bottom: 10px;
  overflow: hidden;
}
.placeholder-img {
  background: #eef1f6;
  color: #b5bcc9;
  border: 2px dashed #cfd6e2;
}
.cell-text {
  font-size: 15px;
  color: #2b3a4d;
  text-align: center;
}
.cell.placeholder {
  cursor: default;
  background: #fbfcfe;
}
.cell.placeholder .cell-text { color: #aab2c0; }

/* ===== 留言簿 ===== */
.gb-form {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(31, 45, 61, .06);
  display: grid;
  gap: 10px;
}
.gb-form input,
.gb-form textarea {
  width: 100%;
  border: 1px solid #dfe4ec;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
.gb-form textarea { min-height: 80px; }
.gb-form button {
  justify-self: start;
  background: #2f6fed;
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 26px;
  font-size: 15px;
  cursor: pointer;
}
.gb-form button:hover { background: #2257c4; }
.gb-form button:disabled { opacity: .6; cursor: not-allowed; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.gb-list { list-style: none; margin: 16px 0 0; padding: 0; }
.gb-item {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 10px rgba(31, 45, 61, .05);
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.gb-meta { display: flex; justify-content: space-between; font-size: 12px; color: #8a93a3; margin-bottom: 4px; }
.gb-nick { font-weight: 600; color: #2f6fed; }
.gb-content { margin: 0; font-size: 14px; color: #2b3a4d; white-space: pre-wrap; word-break: break-word; }
.gb-empty { color: #9aa3b2; font-size: 14px; padding: 8px 2px; }

/* ===== 底部备案 ===== */
.site-footer {
  margin-top: 36px;
  padding: 22px 0;
  background: #1f2d3d;
  color: #c4ccd8;
  text-align: center;
  font-size: 13px;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: #c4ccd8; }
.site-footer a:hover { color: #fff; }
.admin-link { margin-top: 10px; }
.admin-link a { color: #7e8aa0; font-size: 12px; }
.visit-stat { margin: 8px 0 0; color: #fbbf24; font-size: 13px; }

/* ===== PC 端：一行 4 个 ===== */
@media (min-width: 768px) {
  .site-header { height: var(--h-img, 190px); }
  .site-header.text-mode { height: var(--h-text, 150px); }
  .grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .cell-img { width: 88px; height: 88px; }
}
