/*
Theme Name: 捷图产品站
Theme URI: https://example.com
Description: 北京捷图产品展示主题，参考 bjgrish 布局，支持产品分类与应用领域。
Version: 1.1
Author: 捷图
Text Domain: grish-theme
*/

:root {
  --color-primary: #0d7377;
  --color-primary-dark: #095456;
  --color-primary-light: #14a3a8;
  --color-text: #1a1a2e;
  --color-text-muted: #4a5568;
  --color-border: #e2e8f0;
  --color-bg: #f7fafc;
  --color-bg-dark: #1a1a2e;
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", sans-serif;
  --container: 1200px;
  --spacing: 1.5rem;
  --header-height: 64px;
  --topbar-height: 40px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ========== 顶部条 ========== */
.top-bar {
  background: var(--color-bg-dark);
  color: rgba(255,255,255,0.85);
  font-size: 0.8125rem;
  padding: 0.4rem 0;
}

.top-bar-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--spacing);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.top-bar-item a {
  color: rgba(255,255,255,0.9);
}

.top-bar-item a:hover {
  color: #fff;
  text-decoration: none;
}

.top-bar-label {
  color: rgba(255,255,255,0.6);
  margin-right: 0.25rem;
}

.top-bar-divider {
  color: rgba(255,255,255,0.3);
  margin: 0 0.25rem;
}

.top-bar-cta {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: var(--color-primary);
  color: #fff !important;
  border-radius: 4px;
  font-weight: 500;
}

.top-bar-cta:hover {
  background: var(--color-primary-light);
  text-decoration: none;
}

/* ========== 主导航 ========== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--spacing);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.site-title a {
  color: var(--color-text);
}

.site-title a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.site-nav .nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav .nav-list > li > a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--color-text);
  font-size: 0.9375rem;
}

.site-nav .nav-list > li > a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

/* 下拉菜单 */
.nav-has-dropdown {
  position: relative;
}

.nav-dropdown {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  position: absolute;
  top: 100%;
  left: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 50;
}

.nav-has-dropdown:hover .nav-dropdown,
.nav-has-dropdown:focus-within .nav-dropdown,
.site-nav.is-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown li {
  margin: 0;
}

.nav-dropdown a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--color-text);
  font-size: 0.9rem;
}

.nav-dropdown a:hover {
  background: var(--color-bg);
  color: var(--color-primary);
  text-decoration: none;
}

.nav-dropdown-all {
  border-top: 1px solid var(--color-border);
  margin-top: 0.25rem;
  padding-top: 0.25rem;
}

.nav-dropdown-all a {
  font-weight: 500;
  color: var(--color-primary);
}

/* 移动端菜单按钮 */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
}

.nav-toggle::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 20px;
  height: 2px;
  margin-top: -4px;
  background: var(--color-text);
  box-shadow: 0 4px 0 var(--color-text);
}

.nav-toggle[aria-expanded="true"]::before {
  box-shadow: none;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"]::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 20px;
  height: 2px;
  margin-top: -1px;
  background: var(--color-text);
  transform: rotate(-45deg);
}

/* ========== 主内容区 ========== */
.main-content {
  max-width: var(--container);
  margin: 0 auto;
  padding: 2rem var(--spacing);
  min-height: 60vh;
}

.page-title {
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
  color: var(--color-primary-dark);
}

.term-description {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  max-width: 800px;
}

/* ========== 首页 Hero ========== */
.front-page .hero {
  background: linear-gradient(135deg, var(--color-bg-dark) 0%, #16213e 100%);
  color: #fff;
  padding: 4rem 0;
  margin: 0 calc(-50vw + 50%);
  margin-bottom: 3rem;
}

.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--spacing);
  text-align: center;
}

.hero-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin: 0 0 0.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 1.1rem;
  opacity: 0.9;
  margin: 0 0 1.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: #fff !important;
  border-radius: 6px;
  font-weight: 600;
}

.hero-cta:hover {
  background: var(--color-primary-light);
  text-decoration: none;
}

/* ========== 首页区块 ========== */
.front-section {
  margin-bottom: 3rem;
}

.front-section-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

.front-section-title {
  font-size: 1.35rem;
  margin: 0 0 1.5rem;
  color: var(--color-text);
  font-weight: 600;
}

/* 产品类别卡片 */
.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.category-card {
  display: block;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.category-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 16px rgba(13, 115, 119, 0.12);
  text-decoration: none;
}

.category-card-name {
  display: block;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.category-card-desc {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.category-card-all {
  background: var(--color-bg);
  border-style: dashed;
}

/* 首页应用标签（大） */
.application-tags-large {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.application-tags-large .application-tag {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 0.95rem;
}

.application-tags-large .application-tag:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  text-decoration: none;
}

/* ========== 应用领域标签（列表/分类页） ========== */
.application-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.application-tags > span {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-right: 0.25rem;
}

.application-tags a {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: var(--color-bg);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--color-text);
}

.application-tags a:hover {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

/* ========== 产品网格 ========== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.product-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: rgba(13, 115, 119, 0.2);
}

.product-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.product-card a:hover {
  text-decoration: none;
}

.product-card-thumb {
  aspect-ratio: 4/3;
  background: var(--color-bg);
  object-fit: cover;
  width: 100%;
}

.product-card-body {
  padding: 1.25rem;
}

.product-card-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.product-card-model {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.product-card-excerpt {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== 产品详情页 ========== */
.single-product .entry-header {
  margin-bottom: 1.5rem;
}

.single-product .entry-title {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.product-model {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.single-product .entry-content {
  margin-bottom: 2rem;
}

.single-product .entry-content h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
}

.product-featured-image {
  margin-bottom: 1.5rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.product-featured-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* ========== CTA 区块 ========== */
.product-cta {
  background: linear-gradient(135deg, var(--color-bg) 0%, #e8f4f4 100%);
  border-radius: 12px;
  padding: 2.5rem;
  margin: 2rem 0;
  text-align: center;
  border: 1px solid var(--color-border);
}

.product-cta h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.product-cta p {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
}

.product-cta .button {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
}

.product-cta .button:hover {
  background: var(--color-primary-dark);
  color: #fff;
  text-decoration: none;
}

/* ========== 页脚 ========== */
.site-footer {
  margin-top: 3rem;
  background: var(--color-bg-dark);
  color: rgba(255,255,255,0.85);
}

.footer-cta {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  padding: 2.5rem var(--spacing);
  text-align: center;
}

.footer-cta-inner {
  max-width: var(--container);
  margin: 0 auto;
}

.footer-cta-title {
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
  color: #fff;
  font-weight: 600;
}

.footer-cta-desc {
  margin: 0 0 1rem;
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
}

.footer-cta-button {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: #fff;
  color: var(--color-primary) !important;
  border-radius: 6px;
  font-weight: 600;
}

.footer-cta-button:hover {
  background: var(--color-bg);
  text-decoration: none;
}

.footer-main {
  padding: 2.5rem var(--spacing) 2rem;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
}

.footer-brand .footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.footer-tagline {
  font-size: 0.9rem;
  margin: 0 0 1rem;
  color: rgba(255,255,255,0.8);
}

.footer-contact {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.footer-contact a {
  color: var(--color-primary-light);
}

.footer-brand p {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.7);
}

.footer-heading {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-bottom {
  padding: 1rem var(--spacing);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-copy {
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.6);
  text-align: center;
}

/* ========== 面包屑 ========== */
.breadcrumb {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.breadcrumb span {
  margin: 0 0.35rem;
}

/* ========== 相关产品 ========== */
.related-products {
  margin-top: 2rem;
}

.related-products h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .top-bar-left {
    flex-wrap: wrap;
    justify-content: center;
  }

  .top-bar .top-bar-right {
    width: 100%;
    text-align: center;
    margin-top: 0.25rem;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav .nav-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-top: 0.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  }

  .site-nav.is-open .nav-list {
    display: flex;
  }

  .nav-has-dropdown .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: var(--color-bg);
    margin-top: 0.5rem;
    margin-left: 1rem;
    display: none;
  }

  .site-nav.is-open .nav-has-dropdown.is-open .nav-dropdown {
    display: block;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .site-nav {
    position: relative;
  }

  .front-page .hero {
    padding: 3rem 0;
  }

  .category-cards {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand {
    text-align: left;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 1.5rem var(--spacing);
  }
}
