/* ===== 威海市威湾木门 - 门户网站样式 ===== */
:root {
  --primary: #8B6914;
  --primary-dark: #6B4F0E;
  --primary-light: #C49A2A;
  --accent: #C49A2A;
  --dark: #1a1a1a;
  --dark-soft: #2c2c2c;
  --text: #333;
  --text-light: #666;
  --text-muted: #999;
  --bg: #ffffff;
  --bg-warm: #faf8f5;
  --bg-alt: #f5f0e8;
  --border: #e8e0d0;
  --shadow: 0 2px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: Georgia, "Noto Serif SC", "Source Han Serif SC", serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ===== 导航栏 ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: var(--transition);
}
.navbar.scrolled {
  box-shadow: 0 2px 30px rgba(0,0,0,0.1);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 72px;
}
.nav-brand {
  display: flex; align-items: center; gap: 12px;
  font-size: 1.3rem; font-weight: 700; color: var(--dark);
}
.nav-brand svg { width: 36px; height: 36px; fill: var(--primary); }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
  color: var(--text); font-size: 0.95rem; font-weight: 500;
  position: relative; padding: 4px 0;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px;
  background: var(--primary); transition: width 0.3s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a:hover { color: var(--primary); }
.nav-mobile-btn {
  display: none; background: none; border: none; cursor: pointer;
  width: 32px; height: 32px; position: relative;
}
.nav-mobile-btn span {
  display: block; width: 24px; height: 2px; background: var(--dark);
  position: absolute; left: 4px; transition: var(--transition);
}
.nav-mobile-btn span:nth-child(1) { top: 8px; }
.nav-mobile-btn span:nth-child(2) { top: 15px; }
.nav-mobile-btn span:nth-child(3) { top: 22px; }

/* ===== 英雄区 ===== */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #533483 75%, #1a1a2e 100%);
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(139,105,20,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(196,154,42,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(139,105,20,0.08) 0%, transparent 50%);
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C49A2A' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}
.hero-content {
  position: relative; z-index: 2; text-align: center;
  padding: 0 24px; max-width: 800px;
}
.hero-badge {
  display: inline-block; padding: 6px 20px; margin-bottom: 24px;
  border: 1px solid rgba(196,154,42,0.4); border-radius: 50px;
  color: var(--primary-light); font-size: 0.85rem; letter-spacing: 2px;
  backdrop-filter: blur(10px); background: rgba(196,154,42,0.08);
}
.hero h1 {
  font-family: var(--font-serif); font-size: 3.5rem; font-weight: 700;
  color: #fff; line-height: 1.2; margin-bottom: 20px;
  text-shadow: 0 2px 40px rgba(0,0,0,0.3);
}
.hero h1 span { color: var(--primary-light); }
.hero-sub {
  font-size: 1.2rem; color: rgba(255,255,255,0.7); margin-bottom: 40px;
  line-height: 1.8;
}
.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; border-radius: 50px; font-size: 1rem;
  font-weight: 600; cursor: pointer; transition: var(--transition);
  border: none; text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; box-shadow: 0 4px 20px rgba(139,105,20,0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139,105,20,0.5);
  color: #fff;
}
.btn-outline {
  background: transparent; color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
.hero-scroll {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
  z-index: 2; color: rgba(255,255,255,0.5); animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
  60% { transform: translateX(-50%) translateY(-5px); }
}

/* ===== 通用区块 ===== */
.section {
  padding: 100px 24px;
}
.section-alt { background: var(--bg-warm); }
.section-header {
  text-align: center; max-width: 700px; margin: 0 auto 60px;
}
.section-header h2 {
  font-family: var(--font-serif); font-size: 2.2rem; font-weight: 700;
  color: var(--dark); margin-bottom: 12px;
}
.section-header p {
  font-size: 1.05rem; color: var(--text-light); line-height: 1.8;
}
.section-header .divider {
  width: 60px; height: 3px; margin: 20px auto 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
}
.container { max-width: 1200px; margin: 0 auto; }

/* ===== 关于我们 ===== */
.about-content {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}
.about-text { font-size: 1.05rem; line-height: 2; color: var(--text-light); }
.about-text p { margin-bottom: 16px; }
.about-visual {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-alt);
}
.about-visual::before { display: none; }
.about-visual-inner { display: none; }
.about-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px;
}
.stat-item { text-align: center; }
.stat-num {
  font-family: var(--font-serif); font-size: 2.5rem; font-weight: 700;
  color: var(--primary); line-height: 1;
}
.stat-label { font-size: 0.9rem; color: var(--text-muted); margin-top: 4px; }

/* ===== 产品分类卡片 ===== */
.product-section {
  padding: 100px 24px;
}
.product-section:nth-child(even) { background: var(--bg-warm); }
.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px; max-width: 1200px; margin: 0 auto;
}
.product-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: var(--transition);
  border: 1px solid var(--border);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.product-card-img {
  height: 200px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #f5f0e8, #e8dcc8);
}
.product-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.product-card:hover .product-card-img img { transform: scale(1.05); }
.product-card-img .placeholder-icon {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.product-card-img .placeholder-icon svg {
  width: 64px; height: 64px; fill: var(--primary); opacity: 0.2;
}
.product-card-body { padding: 24px; }
.product-card-body h3 {
  font-size: 1.15rem; font-weight: 700; color: var(--dark);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.product-card-body h3 svg { width: 20px; height: 20px; fill: var(--primary); flex-shrink: 0; }
.product-card-body p {
  font-size: 0.95rem; color: var(--text-light); line-height: 1.8;
}

/* ===== 分类头部 ===== */
.category-header {
  text-align: center; margin-bottom: 48px;
}
.category-icon {
  width: 64px; height: 64px; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(139,105,20,0.3);
}
.category-icon svg { width: 32px; height: 32px; fill: #fff; }
.category-header h2 {
  font-family: var(--font-serif); font-size: 2rem; font-weight: 700;
  color: var(--dark); margin-bottom: 8px;
}
.category-header p { color: var(--text-light); font-size: 1rem; }

/* ===== 页脚 ===== */
.footer {
  background: var(--dark); color: rgba(255,255,255,0.7); padding: 60px 24px 30px;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px;
}
.footer h4 {
  color: #fff; font-size: 1.1rem; margin-bottom: 16px; font-weight: 600;
}
.footer p, .footer li { font-size: 0.9rem; line-height: 2; }
.footer ul { list-style: none; }
.footer a { color: rgba(255,255,255,0.6); }
.footer a:hover { color: var(--primary-light); }
.footer-bottom {
  max-width: 1200px; margin: 40px auto 0; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.4);
}

/* ===== 回到顶部 ===== */
.back-to-top {
  position: fixed; bottom: 30px; right: 30px; z-index: 999;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(139,105,20,0.4);
  opacity: 0; transform: translateY(20px);
  transition: var(--transition); pointer-events: none;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }
.back-to-top svg { width: 20px; height: 20px; fill: #fff; }

/* ===== 加载动画 ===== */
.loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease;
}
.loading-screen.fade-out { opacity: 0; pointer-events: none; }
.loading-spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 淡入动画 ===== */
.fade-in {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ===== 响应式 ===== */
@media (max-width: 968px) {
  .about-content { grid-template-columns: 1fr; gap: 40px; }
  .about-visual { padding: 8px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero h1 { font-size: 2.5rem; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-mobile-btn { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: 72px; left: 0; right: 0; background: #fff;
    padding: 20px 24px; gap: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  }
  .hero h1 { font-size: 2rem; }
  .hero-sub { font-size: 1rem; }
  .section { padding: 60px 16px; }
  .product-section { padding: 60px 16px; }
  .section-header h2 { font-size: 1.8rem; }
  .product-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .stat-num { font-size: 1.8rem; }
}

/* ===== 子页面通用 ===== */
.sub-hero {
  padding: 140px 24px 60px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  text-align: center; color: #fff; position: relative;
}
.sub-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(139,105,20,0.12) 0%, transparent 70%);
}
.sub-hero h1 {
  font-family: var(--font-serif); font-size: 2.5rem; font-weight: 700;
  position: relative; z-index: 1; margin-bottom: 12px;
}
.sub-hero p {
  font-size: 1.1rem; color: rgba(255,255,255,0.7);
  position: relative; z-index: 1; max-width: 600px; margin: 0 auto;
}

/* ===== 首页导航卡片 ===== */
.nav-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px; max-width: 1200px; margin: 0 auto;
}
.nav-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: var(--transition);
  border: 1px solid var(--border); text-decoration: none; color: var(--text);
  display: block;
}
.nav-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.nav-card-icon {
  height: 160px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f5f0e8, #e8dcc8);
  position: relative; overflow: hidden;
  background-size: cover; background-position: center;
}
.nav-card-icon-overlay {
  position: relative; z-index: 1;
  width: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.85); border-radius: 50%;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.nav-card-icon-overlay svg { width: 32px; height: 32px; fill: var(--primary); }
.nav-card-icon::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.1), rgba(0,0,0,0.25));
  z-index: 0;
}
.nav-card-body { padding: 20px; }
.nav-card-body h3 {
  font-size: 1.15rem; font-weight: 700; color: var(--dark); margin-bottom: 8px;
}
.nav-card-body p {
  font-size: 0.9rem; color: var(--text-light); line-height: 1.7;
}
.nav-card-arrow {
  position: absolute; bottom: 16px; right: 16px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-alt); display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.nav-card:hover .nav-card-arrow { background: var(--primary); }
.nav-card-arrow svg { width: 14px; height: 14px; fill: var(--text-light); }
.nav-card:hover .nav-card-arrow svg { fill: #fff; }

/* ===== 门型卡片 ===== */
.door-type-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px; max-width: 1200px; margin: 0 auto;
}
.door-type-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: var(--transition);
  border: 1px solid var(--border);
}
.door-type-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-lg);
}
.door-type-visual {
  aspect-ratio: 1 / 1; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #2c1810, #4a2c17, #6b4423);
  display: flex; align-items: center; justify-content: center;
}
.door-type-visual img {
  width: 100%; height: 100%; object-fit: cover;
}
.door-type-visual .door-type-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.door-type-visual .door-type-placeholder svg {
  width: 80px; height: 80px; fill: rgba(196,154,42,0.25);
}
.door-type-body { padding: 24px; }
.door-type-body h3 {
  font-size: 1.2rem; font-weight: 700; color: var(--dark); margin-bottom: 10px;
}
.door-type-body .desc {
  font-size: 0.95rem; color: var(--text-light); line-height: 1.8; margin-bottom: 16px;
}
.door-type-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.door-type-tags .tag {
  padding: 4px 12px; border-radius: 20px; font-size: 0.8rem;
  background: var(--bg-alt); color: var(--primary); font-weight: 500;
}
.door-type-scenarios { display: flex; flex-wrap: wrap; gap: 6px; }
.door-type-scenarios .scenario {
  padding: 3px 10px; border-radius: 12px; font-size: 0.75rem;
  border: 1px solid var(--border); color: var(--text-muted);
}

/* ===== 图册 ===== */
.gallery-categories {
  max-width: 1200px; margin: 0 auto;
}
.gallery-cat {
  margin-bottom: 48px;
}
.gallery-cat-title {
  font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700;
  color: var(--dark); margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 2px solid var(--border); display: flex; align-items: center; gap: 10px;
}
.gallery-cat-title::before {
  content: ''; width: 4px; height: 24px; background: var(--primary); border-radius: 2px;
}
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.gallery-item {
  border-radius: var(--radius-sm); overflow: hidden;
  aspect-ratio: 4/3; position: relative; cursor: pointer;
  background: linear-gradient(135deg, #f5f0e8, #e8dcc8);
  transition: var(--transition);
}
.gallery-item:hover { transform: scale(1.02); }
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
}
.gallery-item .gallery-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px; color: var(--text-muted); font-size: 0.85rem;
}
.gallery-item .gallery-placeholder svg {
  width: 40px; height: 40px; fill: var(--primary); opacity: 0.2;
}
.gallery-empty {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}

/* ===== 图片预览弹窗 ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.9); display: none; align-items: center; justify-content: center;
  cursor: pointer;
}
.lightbox.show { display: flex; }
.lightbox img {
  max-width: 90vw; max-height: 90vh; border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
