/* 护栏网 (www.sun022.cn) - 工程级护栏科普与选型平台样式表 */
:root {
  --brand-primary: #0f4c81;
  --brand-dark: #092d4d;
  --brand-cyan: #1b9ad1;
  --brand-accent: #e66f00;
  --brand-accent-dark: #c45d00;
  --brand-soft: #eef5fc;
  --brand-warm: #fff7ed;
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --line: #dbe4ee;
  --line-soft: #edf2f7;
  --bg-page: #f4f7fb;
  --bg-card: #ffffff;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 2px 8px rgba(15, 45, 77, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 45, 77, 0.08);
  --container: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-900);
  background-color: var(--bg-page);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: hidden;
}

a { color: var(--brand-primary); text-decoration: none; transition: color 0.18s ease; }
a:hover { color: var(--brand-accent); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; }

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

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 6px rgba(15, 45, 77, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.brand-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-primary);
  background: var(--brand-soft);
  border: 1px solid #cce0f5;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-700);
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--brand-primary);
  background: var(--brand-soft);
}

.header-search {
  display: flex;
  align-items: center;
  background: var(--bg-page);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 3px 4px 3px 12px;
  max-width: 220px;
}

.header-search input {
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--ink-900);
  width: 100%;
  min-width: 0;
}

.header-search button {
  border: 0;
  background: var(--brand-primary);
  color: #fff;
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.header-search button:hover { background: var(--brand-dark); }

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-900);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Announcement Banner (Right below nav on homepage) */
.announce-bar {
  background: linear-gradient(90deg, #0b3a63 0%, #0f4c81 55%, #165e9b 100%);
  color: #ffffff;
  border-bottom: 2px solid var(--brand-accent);
}

.announce-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  font-size: 14px;
}

.announce-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.announce-badge {
  background: var(--brand-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 4px;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.announce-text {
  font-weight: 600;
  color: #f8fafc;
}

.announce-meta {
  font-size: 12px;
  color: #cde3f7;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Hero Section */
.hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(27, 154, 209, 0.14), transparent 42%),
    radial-gradient(circle at 15% 85%, rgba(230, 111, 0, 0.08), transparent 40%),
    linear-gradient(180deg, #ffffff 0%, #eef5fc 100%);
  border-bottom: 1px solid var(--line);
  padding: 46px 0 42px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-primary);
  background: #ffffff;
  border: 1px solid #c7ddf2;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.25;
  color: var(--brand-dark);
  letter-spacing: -0.3px;
}

.hero h1 span { color: var(--brand-accent); }

.hero-desc {
  margin: 0 0 22px;
  font-size: 15.5px;
  color: var(--ink-700);
  max-width: 640px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); color: #fff; }

.btn-accent {
  background: var(--brand-accent);
  color: #fff;
}
.btn-accent:hover { background: var(--brand-accent-dark); color: #fff; }

.btn-outline {
  background: #fff;
  color: var(--brand-primary);
  border-color: #bfd6ec;
}
.btn-outline:hover { border-color: var(--brand-primary); background: var(--brand-soft); color: var(--brand-dark); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.stat-chip strong {
  display: block;
  font-size: 18px;
  color: var(--brand-primary);
  line-height: 1.2;
}

.stat-chip span {
  font-size: 12px;
  color: var(--ink-500);
}

.hero-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px;
}

.hero-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.hero-panel-head h2 {
  margin: 0;
  font-size: 16px;
  color: var(--brand-dark);
}

.badge-live {
  font-size: 11px;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: 99px;
}

/* Sections */
.section { padding: 44px 0; }
.section-alt { background: #ffffff; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-title {
  margin: 0 0 4px;
  font-size: 24px;
  color: var(--brand-dark);
  line-height: 1.3;
}

.section-sub {
  margin: 0;
  font-size: 14px;
  color: var(--ink-500);
}

/* Grids & Cards */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #b7d2ec;
}

.card-media {
  background: #f7fafd;
  border-bottom: 1px solid var(--line-soft);
  padding: 10px;
}

.card-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand-primary);
  background: var(--brand-soft);
  padding: 2px 9px;
  border-radius: 4px;
  margin-bottom: 8px;
  width: fit-content;
}

.pill-orange {
  color: #b45309;
  background: var(--brand-warm);
  border: 1px solid #fed7aa;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink-900);
}

.card p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--ink-700);
}

.spec-kv {
  list-style: none;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
}

.spec-kv li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  color: var(--ink-700);
}

.spec-kv li span:first-child { color: var(--ink-500); flex-shrink: 0; }
.spec-kv li strong { color: var(--ink-900); text-align: right; font-weight: 600; }

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 600px;
}

.spec-table th,
.spec-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.spec-table thead th {
  background: #f0f6fc;
  color: var(--brand-dark);
  font-weight: 700;
  white-space: nowrap;
}

.spec-table tbody tr:hover { background: #f9fcff; }
.spec-table tbody tr:last-child td { border-bottom: 0; }

/* Forms & Interactive Tools */
.tool-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field label { font-size: 13px; font-weight: 600; color: var(--ink-700); }
.form-field input,
.form-field select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink-900);
  background: #fff;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.12);
}

.calc-result {
  margin-top: 16px;
  background: #f0f6fc;
  border: 1px solid #c5dcf3;
  border-radius: var(--radius-md);
  padding: 16px;
}

.calc-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.metric-box span { display: block; font-size: 12px; color: var(--ink-500); }
.metric-box strong { display: block; font-size: 18px; color: var(--brand-primary); margin-top: 2px; }
.metric-box.accent strong { color: var(--brand-accent); }

/* Article Layout */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-500);
  margin-bottom: 18px;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  align-items: start;
}

.article-main {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 32px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.article-main h1 {
  margin: 0 0 12px;
  font-size: clamp(22px, 2.8vw, 30px);
  line-height: 1.32;
  color: var(--brand-dark);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--ink-500);
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.article-summary-box {
  background: var(--brand-soft);
  border-left: 4px solid var(--brand-primary);
  padding: 14px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 22px;
  font-size: 14.5px;
  color: var(--ink-700);
}

.article-prose h2 {
  font-size: 20px;
  color: var(--brand-dark);
  margin: 26px 0 12px;
  padding-left: 11px;
  border-left: 4px solid var(--brand-accent);
  line-height: 1.35;
}

.article-prose h3 {
  font-size: 16.5px;
  color: var(--brand-primary);
  margin: 18px 0 8px;
}

.article-prose p { margin: 0 0 14px; font-size: 15.5px; color: var(--ink-700); }
.article-prose ul, .article-prose ol { margin: 0 0 16px 20px; color: var(--ink-700); font-size: 15px; }
.article-prose li { margin-bottom: 7px; }

.article-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}

.article-prose th, .article-prose td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
}

.article-prose th { background: #f0f6fc; color: var(--brand-dark); font-weight: 700; }

.article-figure {
  margin: 20px 0;
  background: #f8fbfe;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.article-figure figcaption {
  font-size: 12.5px;
  color: var(--ink-500);
  margin-top: 8px;
}

.sidebar-stack { display: flex; flex-direction: column; gap: 18px; }

.side-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.side-card h3 {
  margin: 0 0 12px;
  font-size: 15.5px;
  color: var(--brand-dark);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.side-list { list-style: none; }
.side-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 14px;
  line-height: 1.45;
}
.side-list li:last-child { border-bottom: 0; padding-bottom: 0; }

/* Category Tabs */
.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.cat-tab {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-700);
}

.cat-tab:hover,
.cat-tab.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

/* FAQ Accordion */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.faq-q {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 0;
  padding: 15px 18px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--brand-dark);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-a {
  padding: 0 18px 16px;
  font-size: 14.5px;
  color: var(--ink-700);
  border-top: 1px solid var(--line-soft);
}
.faq-item.collapsed .faq-a { display: none; }

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 28px;
}
.pagination a, .pagination span {
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  color: var(--ink-700);
}
.pagination .current {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
  font-weight: 700;
}

/* Footer */
.site-footer {
  background: #0b243b;
  color: #cbd5e1;
  padding: 42px 0 24px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand img {
  height: 40px;
  background: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 13.5px;
  color: #94a3b8;
  margin: 0;
}

.footer-col h4 {
  margin: 0 0 12px;
  font-size: 15px;
  color: #ffffff;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 7px; font-size: 13.5px; }
.footer-col a { color: #cbd5e1; }
.footer-col a:hover { color: #fb923c; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 18px;
  font-size: 13px;
  color: #94a3b8;
}

.footer-bottom a { color: #e2e8f0; }
.footer-bottom a:hover { color: #fb923c; }

/* Page Header Banner (Subpages) */
.page-banner {
  background: linear-gradient(135deg, #0b355b 0%, #0f4c81 65%, #1665a3 100%);
  color: #fff;
  padding: 34px 0;
}

.page-banner h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 32px);
}

.page-banner p {
  margin: 0;
  color: #d6e7f7;
  font-size: 15px;
  max-width: 760px;
}

/* Responsive Breakpoints (Tested down to 375px) */
@media (max-width: 992px) {
  .hero-grid,
  .article-layout { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-search { display: none; }
}

@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; min-height: 62px; padding: 8px 0; }
  .brand-logo { height: 36px; }
  .brand-tag { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; }
  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0 6px;
    border-top: 1px solid var(--line-soft);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 10px 12px; }
  .announce-inner { flex-direction: column; align-items: flex-start; gap: 4px; }
  .announce-meta { display: none; }
  .hero { padding: 28px 0; }
  .hero-stats { grid-template-columns: 1fr; }
  .grid-3, .grid-2, .grid-4, .form-grid, .calc-metrics, .footer-grid { grid-template-columns: 1fr; }
  .article-main { padding: 20px 16px; }
  .tool-box { padding: 18px 14px; }
  .section { padding: 30px 0; }
}
