/* ========== 基础 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --border: #e5e7eb;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 12px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ========== 按钮 ========== */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); color: #fff; }
.btn-secondary { background: #eef2ff; color: var(--primary); }
.btn-secondary:hover { background: #e0e7ff; }
.btn-light { background: #fff; color: var(--primary); }
.btn-light:hover { background: #eff6ff; color: var(--primary-dark); }
.btn-outline { background: transparent; color: #fff; border: 2px solid #fff; }
.btn-outline:hover { background: #fff; color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ========== 头部导航 ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 16px;
}
.logo-text { font-size: 17px; font-weight: 600; color: var(--text); }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
}
.site-nav a:hover { background: var(--bg-alt); color: var(--primary); }
.site-nav a.active { color: var(--primary); font-weight: 600; background: #eef2ff; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text);
}

/* ========== Hero ========== */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 55%, #312e81 100%);
  color: #fff;
  padding: 110px 0;
  text-align: center;
}
.hero h1 { font-size: 44px; margin-bottom: 18px; letter-spacing: 2px; }
.hero p { font-size: 18px; color: #c7d2fe; max-width: 720px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; }

/* ========== 区块 ========== */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { text-align: center; font-size: 30px; margin-bottom: 44px; }
.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  background: var(--primary);
  margin: 12px auto 0;
  border-radius: 2px;
}
.section-more { text-align: center; margin-top: 40px; }
.block-title { font-size: 22px; margin-bottom: 18px; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  color: var(--text);
  display: block;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); color: var(--text); }
.card-center { text-align: center; }
.card-flat { box-shadow: none; border: 1px solid var(--border); }
.card-icon { font-size: 40px; margin-bottom: 14px; }
.card h3 { font-size: 18px; margin-bottom: 10px; }
.card p { color: var(--text-light); font-size: 14px; }

/* 页头横幅 */
.page-banner {
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
  color: #fff;
  padding: 56px 0;
}
.page-banner h1 { font-size: 32px; }

/* ========== 关于我们 ========== */
.about-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 48px; }
.rich-text p { margin-bottom: 14px; color: #4b5563; }
.side-card { background: var(--bg-alt); border-radius: var(--radius); padding: 28px; height: fit-content; }
.info-list dt { font-weight: 600; color: var(--text); margin-top: 14px; }
.info-list dt:first-child { margin-top: 0; }
.info-list dd { color: var(--text-light); margin-top: 2px; }

/* ========== 产品页 ========== */
.product-card { display: flex; gap: 20px; align-items: flex-start; }
.product-card .card-icon { font-size: 34px; margin-bottom: 0; }
.product-summary { color: var(--primary) !important; font-weight: 600; margin: 4px 0 8px; }
.product-desc { font-size: 14px; }

/* ========== 新闻 ========== */
.news-card .news-date { color: var(--primary); font-size: 13px; margin-bottom: 8px; }
.news-list { display: flex; flex-direction: column; gap: 16px; }
.news-item {
  display: flex;
  gap: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--text);
  transition: box-shadow 0.2s;
}
.news-item:hover { box-shadow: var(--shadow); }
.news-item-date {
  flex-shrink: 0;
  width: 76px;
  text-align: center;
  border-right: 1px solid var(--border);
  padding-right: 20px;
}
.news-item-date .day { display: block; font-size: 30px; font-weight: 700; color: var(--primary); }
.news-item-date .ym { font-size: 13px; color: var(--text-light); }
.news-item-body h3 { font-size: 18px; margin-bottom: 8px; }
.news-item-body p { color: var(--text-light); font-size: 14px; }

.article-container { max-width: 820px; }
.article-title { font-size: 28px; margin-bottom: 10px; }
.article-meta { color: var(--text-light); font-size: 14px; margin-bottom: 28px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.article-body { font-size: 16px; }
.article-back { margin-top: 40px; }

/* ========== 联系页 ========== */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; }

/* ========== 表单 ========== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}
.required { color: var(--danger); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }

.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }

.empty-tip { text-align: center; color: var(--text-light); padding: 40px 0; }

/* ========== CTA ========== */
.cta {
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
  color: #fff;
  text-align: center;
  padding: 64px 0;
}
.cta h2 { font-size: 26px; margin-bottom: 24px; }

/* ========== 页脚 ========== */
.site-footer { background: #111827; color: #9ca3af; margin-top: 0; }
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr;
  gap: 40px;
  padding: 48px 20px;
}
.footer-col h4 { color: #fff; font-size: 16px; margin-bottom: 14px; }
.footer-col p { font-size: 14px; margin-bottom: 6px; }
.footer-col a { color: #9ca3af; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1f2937; padding: 18px 0; text-align: center; font-size: 13px; }
.footer-bottom a { color: #9ca3af; margin-left: 8px; }
.footer-bottom a:hover { color: #fff; }

/* ========== 错误页 ========== */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.error-page h1 { font-size: 72px; color: var(--primary); }
.error-page p { color: var(--text-light); }

/* ========== 后台布局 ========== */
.admin-body { background: #f3f4f6; }
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px;
  background: #111827;
  color: #d1d5db;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.admin-brand {
  padding: 20px;
  font-weight: 700;
  color: #fff;
  font-size: 16px;
  border-bottom: 1px solid #1f2937;
}
.admin-nav { flex: 1; padding: 12px 0; }
.admin-nav a {
  display: block;
  padding: 12px 20px;
  color: #d1d5db;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.admin-nav a:hover { background: #1f2937; color: #fff; }
.admin-nav a.active { background: #1f2937; color: #fff; border-left-color: var(--primary-light); }
.admin-sidebar-foot { border-top: 1px solid #1f2937; padding: 12px 0; }
.admin-sidebar-foot a { display: block; padding: 10px 20px; color: #9ca3af; font-size: 13px; }
.admin-sidebar-foot a:hover { color: #fff; }

.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-topbar h1 { font-size: 20px; }
.admin-topbar span { color: var(--text-light); font-size: 14px; }
.admin-content { padding: 28px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-num { font-size: 34px; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--text-light); font-size: 14px; margin-top: 4px; }
.stat-warn .stat-num { color: var(--danger); }

.admin-panel { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.admin-panel h2 { font-size: 17px; margin-bottom: 16px; }
.quick-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.panel-head { display: flex; justify-content: flex-end; margin-bottom: 16px; }

.admin-table {
  width: 100%;
  background: #fff;
  border-radius: var(--radius);
  border-collapse: collapse;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.admin-table th, .admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
.admin-table th { background: #f9fafb; font-weight: 600; color: #374151; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .actions { display: flex; gap: 8px; }
.admin-table .actions form { display: inline; }
.row-unread { background: #fffbeb; }
.cell-icon { font-size: 22px; }
.cell-content { max-width: 300px; white-space: pre-wrap; word-break: break-word; }

.admin-form { background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); max-width: 860px; }

/* ========== 登录页 ========== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
}
.login-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 40px;
  width: 380px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.login-box h1 { font-size: 20px; text-align: center; margin-bottom: 24px; }
.login-back { text-align: center; margin-top: 18px; font-size: 13px; }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .admin-nav { display: flex; flex-wrap: wrap; }
  .admin-sidebar-foot { display: flex; border-top: none; }
  .admin-table { display: block; overflow-x: auto; }
}

@media (max-width: 640px) {
  .hero { padding: 72px 0; }
  .hero h1 { font-size: 30px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .news-item { flex-direction: column; gap: 12px; }
  .news-item-date { border-right: none; border-bottom: 1px solid var(--border); padding: 0 0 8px; width: auto; text-align: left; }
  .hero-actions { flex-direction: column; align-items: center; }
  .form-row { grid-template-columns: 1fr; }
  .logo-text { display: none; }
}
