/* ============================================================
   奇电锂能官网 - 样式
   主题：清洁能源（深蓝 + 能源绿），响应式，使用系统中文字体
   不依赖任何外部 CDN，符合国内访问与合规要求
   ============================================================ */
:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --primary: #0b3d91;
  --primary-dark: #07295f;
  --primary-soft: #e8eefb;
  --accent: #00b46e;
  --accent-2: #00bcd4;
  --text: #16203a;
  --muted: #5b6678;
  --border: #e4e9f1;
  --danger: #d93636;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(11, 61, 145, 0.08);
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "Source Han Sans SC",
    "Noto Sans CJK SC", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------- 顶部导航 ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--primary-dark);
}
.brand .logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center;
  color: #fff; font-weight: 800;
}
.brand-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
}
.footer-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  display: block;
}
.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  display: block;
  padding: 8px 14px;
  border-radius: 9px;
  color: var(--text);
  font-size: 15px;
}
.nav-links a:hover { background: var(--primary-soft); text-decoration: none; }
.nav-links a.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 22px; color: var(--primary-dark);
}

/* ---------------- 通用区块 ---------------- */
.section { padding: 64px 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: 30px; margin: 0 0 8px; color: var(--primary-dark); }
.section-head p { color: var(--muted); margin: 0; }

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { box-shadow: var(--shadow); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ghost { background: #fff; color: var(--primary); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.img-card { display: inline-block; width: 180px; margin: 0 12px 14px 0; vertical-align: top; border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: #fff; }
.img-card img { width: 100%; height: 120px; object-fit: cover; border-radius: 6px; background: #f4f6fa; }
.img-card .url { font-size: 12px; color: var(--muted); word-break: break-all; margin: 6px 0; }
.img-card .img-btns { display: flex; gap: 8px; }
.img-card .img-btns .btn { padding: 7px 12px; font-size: 13px; flex: 1; text-align: center; }

/* ---------------- 首页 Hero ---------------- */
.hero {
  position: relative;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(0,188,212,.25), transparent 60%),
    linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 90px 0 110px;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, #000, transparent);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: 42px; margin: 0 0 16px; line-height: 1.25; }
.hero .lead { font-size: 18px; max-width: 640px; color: #e8eefb; }
.hero .cta { margin-top: 28px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero .cta .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.hero .cta .btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin-top: 48px;
}
.stat {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.stat .num { font-size: 28px; font-weight: 800; }
.stat .label { font-size: 13px; color: #cfe0ff; }

/* ---------------- 卡片网格 ---------------- */
.grid { display: grid; gap: 22px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px; font-size: 19px; color: var(--primary-dark); }
.card p { color: var(--muted); margin: 0; font-size: 14px; }

/* 产品卡片 */
.product {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 0 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .2s ease;
}
.product:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(11,61,145,.14); }
.product .thumb {
  height: 140px;
  background: linear-gradient(135deg, var(--primary-soft), #e6f8f1);
  display: grid; place-items: center;
  color: var(--primary);
  font-weight: 800; font-size: 22px;
  letter-spacing: 1px;
}
.product .thumb { overflow: hidden; }
.product .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.product .body { padding: 0 18px; }
.product .model { font-size: 13px; color: var(--accent); font-weight: 600; }
.product .name { font-size: 18px; font-weight: 700; color: var(--primary-dark); margin: 4px 0; }
.product .tagline { font-size: 13px; color: var(--muted); }
.product .summary { font-size: 14px; color: #44506a; margin-top: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding: 0 18px; }
.tag {
  font-size: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 3px 10px; border-radius: 999px;
}
.specs { padding: 0 18px; margin-top: 12px; }
.specs table { width: 100%; border-collapse: collapse; font-size: 13px; }
.specs td { padding: 6px 4px; border-bottom: 1px dashed var(--border); }
.specs td:first-child { color: var(--muted); width: 42%; }

/* 分组标题 */
.group-title { margin: 38px 0 16px; font-size: 22px; color: var(--primary-dark); }
.group-summary { color: var(--muted); margin: -8px 0 18px; }

/* ---------------- 关于页 ---------------- */
.about-block { margin-bottom: 26px; }
.about-block h3 { color: var(--primary); margin: 0 0 6px; }
.certs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.cert {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 16px; font-size: 13px; color: var(--primary);
  box-shadow: var(--shadow);
}

/* ---------------- 下载列表 ---------------- */
.dl-item {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow);
}
.dl-item .ico {
  width: 46px; height: 46px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.dl-item .meta { flex: 1; }
.dl-item .meta .t { font-weight: 700; color: var(--primary-dark); }
.dl-item .meta .d { font-size: 13px; color: var(--muted); }
.dl-item .info { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }

/* ---------------- 联系 / 表单 ---------------- */
.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 30px; align-items: start; }
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.info-list .k { color: var(--primary); font-weight: 600; width: 76px; flex: none; }
.info-list .v { color: var(--text); }

.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--text); font-weight: 600; }
.field label .req { color: var(--danger); }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 12px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 10px; font-family: inherit;
  background: #fff; color: var(--text);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field textarea { resize: vertical; min-height: 110px; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.consent input { margin-top: 4px; }
.form-msg { font-size: 14px; margin-top: 10px; min-height: 20px; }
.form-msg.ok { color: var(--accent); }
.form-msg.err { color: var(--danger); }

/* ---------------- 隐私政策 ---------------- */
.prose { max-width: 820px; margin: 0 auto; }
.prose h3 { color: var(--primary); margin-top: 28px; }
.prose p, .prose li { color: #38445c; }

/* ---------------- 页脚 ---------------- */
.site-footer { background: var(--primary-dark); color: #cfe0ff; padding: 40px 0 24px; }
.site-footer a { color: #cfe0ff; }
.site-footer .fwrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.site-footer .flinks { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer .copy { width: 100%; border-top: 1px solid rgba(255,255,255,.14); margin-top: 18px; padding-top: 16px; font-size: 13px; color: #9fb6e6; }
.site-footer .beian { font-size: 12px; color: #9fb6e6; margin-top: 6px; }

/* ---------------- 管理员留言查看 ---------------- */
.msg-row { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.msg-row .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.msg-row .nm { font-weight: 700; color: var(--primary-dark); }
.msg-row .ct { margin-top: 6px; white-space: pre-wrap; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 8px 16px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-2, .grid.cols-3, .contact-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .dl-item { flex-wrap: wrap; }
  .dl-item .info { text-align: left; }
}

/* ---------------- 技术文章 ---------------- */
.article-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); color: var(--text);
  transition: transform .12s ease, box-shadow .2s ease;
}
.article-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 12px 30px rgba(11,61,145,.14); }
.a-cover { height: 150px; background-size: cover; background-position: center; background-color: var(--primary-soft); }
.a-cover-ph {
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary-soft), #e6f8f1);
  color: var(--primary); font-weight: 800; font-size: 34px;
}
.a-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.a-cat { font-size: 12px; color: var(--accent); font-weight: 600; }
.a-title { font-size: 18px; font-weight: 700; color: var(--primary-dark); line-height: 1.4; }
.a-summary { font-size: 14px; color: #44506a; }
.a-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.article-detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 34px; box-shadow: var(--shadow); }
.article-detail .a-cat { margin-bottom: 6px; }
.article-detail .a-title { font-size: 30px; line-height: 1.35; }
.article-detail .a-meta { margin-bottom: 14px; }
.article-detail .a-summary { font-size: 16px; color: #44506a; background: var(--primary-soft); border-left: 3px solid var(--primary); padding: 12px 14px; border-radius: 8px; margin: 14px 0; }

/* Markdown 正文排版 */
.markdown-body { font-size: 15px; color: #2a3550; line-height: 1.85; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { color: var(--primary-dark); margin: 26px 0 12px; line-height: 1.4; }
.markdown-body h1 { font-size: 24px; } .markdown-body h2 { font-size: 21px; } .markdown-body h3 { font-size: 18px; }
.markdown-body p { margin: 12px 0; }
.markdown-body ul, .markdown-body ol { padding-left: 22px; margin: 12px 0; }
.markdown-body li { margin: 6px 0; }
.markdown-body a { color: var(--primary); }
.markdown-body code { background: #eef2f9; padding: 2px 6px; border-radius: 6px; font-size: 13px; font-family: "SFMono-Regular", Consolas, monospace; color: #c0392b; }
.markdown-body pre { background: #0f1b33; color: #e6edf6; padding: 16px; border-radius: 10px; overflow: auto; margin: 14px 0; }
.markdown-body pre code { background: none; color: inherit; padding: 0; font-size: 13px; }
.markdown-body blockquote { margin: 14px 0; padding: 10px 16px; border-left: 4px solid var(--accent); background: #eafaf3; color: #2f6b54; border-radius: 8px; }
.markdown-body table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14px; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.markdown-body th { background: var(--primary-soft); color: var(--primary-dark); }
.markdown-body img { max-width: 100%; border-radius: 8px; margin: 12px 0; }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

/* ---------------- 后台标签页 ---------------- */
.tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.tab {
  padding: 10px 20px; border: 1px solid var(--border); background: #fff;
  border-radius: 999px; cursor: pointer; font-size: 15px; color: var(--text); font-weight: 600;
}
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.art-content { min-height: 260px; font-family: "SFMono-Regular", Consolas, monospace; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

