:root {
  --primary-dark: #1a1a1a;
  --primary-gray: #333333;
  --accent-gold: #c19a6b;
  --accent-hover: #b0895c;
  --light-bg: #f9f9f9;
  --white: #ffffff;
  --text-gray: #aaaaaa;
  --border-radius: 4px;
  --transition: all 0.5s ease;
  --brand-red: rgb(237, 29, 35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  color: var(--primary-gray);
  background-color: var(--white);
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: 'Noto Serif SC', serif; }

a { text-decoration: none; color: inherit; transition: 0.3s ease; }

/* 本地字体 */
@font-face {
  font-family: 'Noto Serif SC';
  src: url('/static/fonts/NotoSerifSC/NotoSerifSC-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Serif SC';
  src: url('/static/fonts/NotoSerifSC/NotoSerifSC-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Serif SC';
  src: url('/static/fonts/NotoSerifSC/NotoSerifSC-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/Inter/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* 通用容器与 section */
.section { padding: 5rem 2rem; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

.section-header { text-align: center; margin-bottom: 1rem; }
.section-header h2 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
  position: relative;
  display: inline-block;
}
.section-header h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background-color: var(--accent-gold);
  margin: 10px auto 0;
}
.section-header span {
  display: block;
  font-size: 0.9rem;
  color: var(--accent-gold);
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Header/Nav（全站共用：首页+详情页） */
header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 1000;
  padding: 0 2rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
  transition: background-color 0.3s ease;
}

header.scrolled {
  background-color: rgba(26, 26, 26, 0.98);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  height: 90px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: 'Noto Serif SC', serif;
  letter-spacing: 1px;
  color: var(--white);
}
.logo .hong-red { color: var(--brand-red); }
.logo span.design-gold { color: var(--accent-gold); }

.nav-links { display: flex; gap: 3rem; }
.nav-links li { list-style: disc; display: list-item; color: #ffffff; }
.nav-links a {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  position: relative;
}
.nav-links a:hover { color: var(--accent-gold); }
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px; left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-gold);
  transition: 0.3s ease;
}
.nav-links a:hover::after { width: 100%; }

.mobile-toggle { display: none; font-size: 1.5rem; color: var(--white); cursor: pointer; }

/* 首页 Hero（仅首页用：详情页不会用到这些 class） */
.hero-logo-pattern {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 18px;
}
.hero-logo-pattern img {
  width: clamp(120px, 18vw, 220px);
  height: auto;
  object-fit: contain;
  display: block;
  opacity: 0.92;
}

.hero-carousel {
  position: relative;
  width: 100%;

  /* PC / 默认 */
  min-height: 620px;
  height: 100vh;

  /* 移动端视口兼容（关键） */
  height: 100svh;   /* 小视口高度：地址栏展开时 */
  height: 100dvh;   /* 动态视口高度：地址栏收起时 */

  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-slides {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
}
.slide {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  background-size: cover;
  background-position: center;
}
.slide.active { opacity: 1; }

.overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 900px;
  padding: 2rem;
  text-align: center;
  color: var(--white);
  margin-top: 60px;
}
.hero-content h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-shadow: 0 5px 15px rgba(0,0,0,0.3);
  letter-spacing: 2px;
  animation: fadeInUp 1s ease forwards;
}
.hero-content p {
  font-size: 1.25rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInUp 1s ease 0.3s forwards;
  opacity: 0;
}
.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  animation: fadeInUp 1s ease 0.6s forwards;
  opacity: 0;
}

.btn {
  display: inline-block;
  padding: 14px 35px;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-gold {
  background-color: var(--accent-gold);
  color: var(--white);
  border: 2px solid var(--accent-gold);
}
.btn-gold:hover { background-color: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-3px); }
.btn-outline { background-color: transparent; color: var(--white); border: 2px solid var(--white); }
.btn-outline:hover { background-color: var(--white); color: var(--primary-dark); transform: translateY(-3px); }

@keyframes fadeInUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* About（首页） */
.about-grid {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  align-items: center;
  text-align: center;
}
.about-text { max-width: 900px; }
.about-text p {
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.8;
  text-align: center;
}
.about-image { width: 100%; max-width: 1000px; }
.about-image img {
  width: 100%;         /* 图片宽度 100% */
  height: auto;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.12);
  flex-shrink: 0;
}

/* 手机端（≤768px）保持比例、宽度 100% */
@media (max-width: 768px) {
  .about-image {
    width: 100%;          /* 容器撑满屏幕 */
    max-width: none;      /* 去掉桌面端的大尺寸限制 */
  }
  .about-image img {
    width: 100%;          /* 图片宽度 100% */
    height: auto;         /* 高度自动，随宽度等比缩放 */
    max-width: none;      /* 去掉桌面端 900px 限制 */
    flex-shrink: 0;
    border-radius: 3px;
    box-shadow: 0 14px 36px rgba(0,0,0,.12);
  }
}

/* About 动画 */
#about .about-text p.reveal-left {
  opacity: 0;
  transform: translate3d(-200px, 0, 0);
  filter: blur(2px);
  will-change: transform, opacity, filter;
  transition:
    transform 2.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 1.1s ease,
    filter 1.2s ease;
}
#about.is-active .about-text p.reveal-left {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
}
#about .about-text p.reveal-left:nth-of-type(1) { transition-delay: 0.05s; }
#about .about-text p.reveal-left:nth-of-type(2) { transition-delay: 0.18s; }
#about .about-text p.reveal-left:nth-of-type(3) { transition-delay: 0.32s; }

/* Projects（首页） */
.projects-bg { background-color: #f5f5f5; }

.project-group-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 3px;
  margin: 1rem 0 2rem;
  text-transform: uppercase;
  color: #666;
  font-family: none;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

/* 让项目卡片可用作 <a> 或 <div>（你现在已经改成 <a> 了） */
.project-card {
  position: relative;
  display: block;
  height: 300px;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
  display: block;
}
.project-card:hover img { transform: scale(1.1); }

.project-overlay {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  padding: 1.5rem 2rem;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
  color: var(--white);
  z-index: 10;
}
.project-overlay h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--white);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.project-overlay p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  font-weight: 300;
}

/* Projects 动画（首页） */
#residential .project-card.reveal-up-residential,
#commercial .project-card.reveal-up-commercial {
  opacity: 0;
  transform: translate3d(0, 36px, 0);
  filter: blur(2px);
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.9s ease, filter 1.0s ease;
}

#residential.is-active .project-card.reveal-up-residential,
#commercial.is-active .project-card.reveal-up-commercial {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
}

/* Contact（首页） */
.contact-section { background-color: var(--primary-dark); color: var(--white); }
.contact-section h2 { color: var(--white); }
.contact-section .section-header p { color: rgba(255,255,255,0.6); margin-top: 0.5rem; }

.contact-wrapper {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  margin-top: 3rem;
  align-items: center;
}
.contact-info-list { padding-left: 2rem; }

.info-item { display: flex; align-items: flex-start; margin-bottom: 2.5rem; }
.info-icon {
  width: 50px;
  height: 50px;
  background: rgba(193, 154, 107, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  font-size: 1.2rem;
  margin-right: 1.5rem;
  flex-shrink: 0;
}
.info-content h4 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--accent-gold);
  font-family: 'Noto Serif SC', serif;
}
.info-content p { color: var(--text-gray); font-size: 0.95rem; line-height: 1.6; }


/* 微信二维码容器 */
.wechat-qr{
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.25rem;
}

/* 二维码图片 */
.wechat-qr-img{
  width: 132px;              /* 可按需要改：96~140都行 */
  height: 132px;
  border-radius: 12px;
  padding: 8px;
  background: rgba(255,255,255,0.06); /* 适配灰黑底的“柔和卡片” */
  border: 1px solid rgba(193, 154, 107, 0.25);
  box-shadow: 0 10px 22px rgba(0,0,0,0.25);
  object-fit: contain;
}

/* 右侧文字 */
.wechat-item{
  align-items: center;
}

.wechat-qr-text p{
  margin: 0;
}

.wechat-qr-tip{
  color: var(--text-gray);
  font-size: 0.95rem;
  line-height: 1.6;
}

.wechat-qr-id{
  margin-top: 0.35rem;
  color: rgba(193, 154, 107, 0.92); /* 更贴近金色主题 */
  font-size: 0.95rem;
}

/* 小屏适配：二维码和文字上下排列 */
@media (max-width: 520px){
  .wechat-qr{
    align-items: flex-start;
    flex-direction: column;
  }
  .wechat-qr-img{
    width: 120px;
    height: 120px;
  }
}

.simple-form {
  background: rgba(255, 255, 255, 0.03);
  padding: 3rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group { margin-bottom: 1.5rem; text-align: left; }
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  color: var(--white);
  border-radius: var(--border-radius);
  outline: none;
  transition: 0.3s;
  appearance: none;
}

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23c19a6b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right .7em top 50%;
  background-size: .65em auto;
}

select.form-control option { background-color: #333; color: #fff; }

.form-control:focus { border-color: var(--accent-gold); background: rgba(0, 0, 0, 0.4); }

.btn-submit {
  width: 100%;
  padding: 14px;
  background-color: var(--accent-gold);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s ease;
  font-size: 1rem;
  margin-top: 1rem;
}
.btn-submit:hover { background-color: var(--accent-hover); }

/* Footer（全站共用） */
footer {
  background-color: #111;
  color: #666;
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid #222;
}

/* 响应式（全站共用） */
@media (max-width: 768px) {
  .hero-logo-pattern { margin-bottom: 14px; }
  .hero-logo-pattern img { width: clamp(96px, 34vw, 160px); }

  .hero-content h1 { font-size: 2.2rem; }
  .hero-content p { font-size: 1rem; }

  .mobile-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 90px; left: 0;
    width: 100%;
    background: rgba(26,26,26,0.98);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    text-align: center;
  }
  .nav-links li { list-style: none; display: block; }
  .nav-links.active { display: flex; }

  .contact-wrapper { grid-template-columns: 1fr; gap: 3rem; }
  .contact-info-list { padding-left: 0; }

  .about-grid { gap: 2rem; }
  .about-text p { font-size: 1rem; }

  .form-row { flex-direction: column; gap: 0 !important; }
}

/* 平滑滚动（全站） */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 40px;
}

/* 尊重系统减少动画 */
@media (prefers-reduced-motion: reduce) {
  #about .about-text p.reveal-left,
  #residential .project-card.reveal-up-residential,
  #commercial .project-card.reveal-up-commercial {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}



/* =========================================================
   统一移动端兼容：768 → 720 → 520 → 360 → 超小屏
   原则：只追加、不覆盖；只调布局、不改视觉
   ========================================================= */

/* 768 已有，仅作“闸门”参考，以下所有断点均向下兼容 */
/* 720px：iPad Mini 竖屏、折叠屏半开等 —— 主要收紧横向间距 */
@media (max-width: 720px) {
  :root { --section-padding-y: 4rem; --section-padding-x: 1.5rem; }

  .section { padding: var(--section-padding-y) var(--section-padding-x); }
  .container { padding: 0 1.5rem; }

  .nav-container { height: 80px; }
  .nav-links { top: 80px; }

  .hero-content h1 { font-size: 2.4rem; }
  .hero-content p { font-size: 1.05rem; }

  .projects-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .project-card { height: 280px; }

  .contact-wrapper { gap: 3rem; }

  .logo {
    font-size: 1.25rem;   /* 原来 1.8rem → 立即压缩 */
    letter-spacing: 0.5px;
    white-space: nowrap;  /* 强制单行 */
  }

  .hero-carousel {
    min-height: 520px;
    max-height: 900px;
  }

  .slide {
    background-position: center 30%;
  }
}

/* 520px：主流手机竖屏 —— 强制单列 + 加大触控区 */
@media (max-width: 520px) {
  :root { --section-padding-y: 3.2rem; --section-padding-x: 1.25rem; }

  .section { padding: var(--section-padding-y) var(--section-padding-x); }
  .container { padding: 0 1.25rem; }

  /* 导航 */
  .nav-container { height: 70px; }
  .nav-links { top: 70px; padding: 1.5rem 0; gap: 1.25rem; }

  /* Hero */
  .hero-content { padding: 1.25rem; }
  .hero-content h1 { font-size: 1.6rem; letter-spacing: 1px; }
  .hero-content p { font-size: 0.98rem; }
  .hero-buttons { flex-direction: column; gap: 0.9rem; }
  .btn { width: 100%; }          /* 全宽按钮，更好点按 */

  /* 关于我们：图片已经 height:auto，这里再兜底 */
  .about-image { max-width: none; }
  .about-image img { max-width: none; height: auto; }

  /* 项目卡片：强制单列 & 加大字号 */
  .projects-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .project-card { height: 260px; }
  .project-overlay { padding: 1.25rem; }
  .project-overlay h3 { font-size: 1.25rem; }
  .project-overlay p { font-size: 1rem; }

  /* 联系表单：全宽 + 加大输入框 */
  .contact-wrapper { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-info-list { padding: 0; }
  .simple-form { padding: 2rem; }
  .form-control,
  .btn-submit { font-size: 16px; }   /* 防止 iOS 自动放大 */
}

/* 360px：极限小屏老机型 / 小程序 web-view */
@media (max-width: 360px) {
  .hero-content h1 { font-size: 1.7rem; }
  .section-header h2 { font-size: 1.9rem; }

  .btn { padding: 12px 20px; font-size: 0.95rem; }

  .project-card { height: 240px; }
  .project-overlay h3 { font-size: 1.15rem; }
  .project-overlay p { font-size: 0.9rem; }

  .logo {
    font-size: 1.15rem;
  }

  .hero-carousel {
    min-height: 460px;
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

  .hero-content p {
    font-size: 1.05rem;
  }
}

/* 超小屏（≤ 320px）：智能手表、迷你折叠外屏等 —— 极限压缩 */
@media (max-width: 320px) {
  :root { --section-padding-x: 1rem; }

  .logo { font-size: 1.5rem; }
  .hero-content h1 { font-size: 1.5rem; }
  .hero-content p { font-size: 0.9rem; }

  .section-header h2 { font-size: 1.7rem; }
  .section-header span { font-size: 0.8rem; }

  .project-card { height: 220px; }
  .simple-form { padding: 1.5rem; }
}

/* 通用“保险”：防止任何极端情况溢出 */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, svg, canvas { max-width: 100%; height: auto; display: block; }

/* 长单词/链接强制断行，避免撑破 */
p, a, li, h1, h2, h3, h4, span {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

/* 触控增强：去除 gray flash、增大点按反馈 */
@media (hover: none) and (pointer: coarse) {
  * { -webkit-tap-highlight-color: transparent; }
  .btn:active { transform: translateY(-1px) scale(0.98); }
  .project-card:active { transform: scale(0.97); }
}

/* 刘海/挖孔屏安全区（仅左右） */
@supports (padding: max(0px)) {
  header { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
}