/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #4A7C9B;
  --primary-dark: #355E73;
  --primary-light: #7BA7C4;
  --accent: #E8C87A;
  --bg: #FDF8F0;
  --bg-card: #FFFFFF;
  --text: #3A3A3A;
  --text-light: #7A7A7A;
  --text-white: #FFFFFF;
  --border: #E8E0D4;
  --shadow: rgba(74, 124, 155, 0.1);
  --radius: 12px;
  --transition: 0.3s ease;
  --navbar-height: 70px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Serif SC', 'Georgia', 'SimSun', serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.8;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}

img {
  max-width: 100%;
  display: block;
}

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(253, 248, 240, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  padding: 0 40px;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.4s ease;
}

.navbar.scrolled {
  background: rgba(253, 248, 240, 0.95);
  border-bottom-color: var(--border);
  box-shadow: 0 2px 20px var(--shadow);
}

/* Home page: always light navbar, never transparent */
.home-page .navbar {
  background: rgba(253, 248, 240, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: transparent;
}

.home-page .navbar.scrolled {
  background: rgba(253, 248, 240, 0.95);
  border-bottom-color: var(--border);
  box-shadow: 0 2px 20px var(--shadow);
}

/* Always dark text on navbar (home or other pages) */
.home-page .nav-logo,
.home-page .nav-logo .logo-text {
  color: var(--primary-dark);
}

.home-page .nav-links a {
  color: var(--text);
}

.home-page .nav-links a:hover,
.home-page .nav-links a.active {
  color: var(--primary);
}

.home-page .nav-links a::after {
  background: var(--primary);
}

.home-page .nav-toggle span {
  background: var(--text);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 1px;
  transition: color var(--transition);
  position: relative;
}

.nav-logo .logo-wrapper {
  position: relative;
  height: 88px;
  width: 176px; /* fallback width, prevents layout shift */
  flex-shrink: 0;
}

.nav-logo .logo-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  height: 88px;
  width: auto;
  max-width: 400px;
  object-fit: contain;
}

.nav-logo .logo-dark {
  display: none;
}

[data-theme="dark"] .nav-logo .logo-light {
  display: none;
}

[data-theme="dark"] .nav-logo .logo-dark {
  display: block;
}

.nav-logo .logo-text {
  font-family: 'Noto Serif SC', serif;
  transition: color var(--transition);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-size: 1rem;
  color: var(--text);
  position: relative;
  padding: 4px 0;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: color var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

/* Nav right area (dark mode toggle + mobile menu) */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile Menu */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
  transition: all var(--transition);
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all var(--transition);
}

/* ===== Main Content ===== */
.main-content {
  margin-top: 0; /* Carousel handles its own full-height */
}

/* ===== Hero Carousel (Home Page) ===== */
.hero-carousel {
  position: relative;
  width: 100%;
  height: 70vh;
  margin-top: var(--navbar-height);
  overflow: hidden;
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel-slide {
  position: relative;
  min-width: 100%;
  height: 100%;
  overflow: hidden;
}

.slide-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}

.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.25) 50%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

.slide-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
  color: var(--text-white);
}

.slide-tag {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 6px 20px;
  border-radius: 24px;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease 0.2s;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.carousel-slide.active .slide-tag {
  opacity: 1;
  transform: translateY(0);
}

.slide-content h1 {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 16px;
  line-height: 1.3;
  max-width: 700px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease 0.35s;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.carousel-slide.active .slide-content h1 {
  opacity: 1;
  transform: translateY(0);
}

.slide-content p {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 28px;
  max-width: 500px;
  line-height: 1.8;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease 0.5s;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

.carousel-slide.active .slide-content p {
  opacity: 1;
  transform: translateY(0);
}

.slide-content .btn {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease 0.65s;
}

.carousel-slide.active .slide-content .btn {
  opacity: 1;
  transform: translateY(0);
}

/* White button variant */
.btn-white {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-white);
  border: 2px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
}

.btn-white:hover {
  background: var(--text-white);
  color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* Carousel Navigation Buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 52px;
  height: 52px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  color: var(--text-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  backdrop-filter: blur(4px);
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-50%) scale(1.05);
}

.carousel-prev {
  left: 30px;
}

.carousel-next {
  right: 30px;
}

/* Carousel Dots */
.carousel-dots {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 10px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 0.4s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.dot:hover {
  background: rgba(255, 255, 255, 0.6);
}

.dot.active {
  background: var(--text-white);
  border-color: var(--text-white);
  transform: scale(1.15);
}

/* Scroll Down Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  letter-spacing: 2px;
  animation: bounceDown 2s ease-in-out infinite;
}

@keyframes bounceDown {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 124, 155, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--text-white);
  transform: translateY(-2px);
}

/* ===== Section Styles ===== */
.section {
  padding: 80px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-header h2 {
  font-size: 2rem;
  color: var(--primary-dark);
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.section-header p {
  color: var(--text-light);
  font-size: 1.05rem;
  margin-top: 16px;
}

/* ===== Featured Works (Home) ===== */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.featured-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 16px var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(74, 124, 155, 0.15);
}

.featured-card .card-img {
  width: 100%;
  height: 240px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.featured-card .card-img[style*="background-image"] {
  transition: transform 0.5s ease;
}

.featured-card:hover .card-img[style*="background-image"] {
  transform: scale(1.05);
}

.featured-card .card-body {
  padding: 20px;
}

.featured-card .card-body h3 {
  font-size: 1.15rem;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.featured-card .card-body p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* ===== CTA Section ===== */
.cta-section {
  padding: 80px 40px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  text-align: center;
}

.cta-inner h2 {
  font-size: 1.8rem;
  color: var(--text-white);
  margin-bottom: 16px;
}

.cta-inner p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 24px;
  font-size: 1.05rem;
}

.cta-inner .btn-primary {
  background: var(--text-white);
  color: var(--primary-dark);
}

.cta-inner .btn-primary:hover {
  background: var(--accent);
  color: var(--text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ===== Masonry / Waterfall Layout ===== */
.masonry-container {
  column-count: 3;
  column-gap: 20px;
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 4px 16px var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  will-change: transform;
}

.masonry-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(74, 124, 155, 0.15);
}

.masonry-item img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.masonry-item .item-info {
  padding: 16px;
}

.masonry-item .item-info h3 {
  font-size: 1.05rem;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.masonry-item .item-info p {
  display: none; /* 隐藏占位符描述文字，但保留 DOM 供 Lightbox 读取 */
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* ===== About Page ===== */
.about-hero {
  padding: 100px 40px 60px;
  text-align: center;
  background: linear-gradient(135deg, #FDF8F0, #F0E6D3);
}

.about-hero h1 {
  font-size: 2.5rem;
  color: var(--primary-dark);
  margin-bottom: 16px;
}

.about-hero p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

.about-section {
  padding: 60px 40px;
  max-width: 900px;
  margin: 0 auto;
}

.about-section h2 {
  font-size: 1.6rem;
  color: var(--primary-dark);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.about-section p {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 2;
  margin-bottom: 16px;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 40px;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.value-card {
  background: var(--bg-card);
  padding: 32px 24px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 4px 16px var(--shadow);
  transition: transform var(--transition);
}

.value-card:hover {
  transform: translateY(-4px);
}

.value-card .icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: block;
}

.value-card h3 {
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.value-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* ===== Estimate Page ===== */
.estimate-hero {
  padding: 100px 40px 60px;
  text-align: center;
  background: linear-gradient(135deg, #FDF8F0, #F0E6D3);
}

.estimate-hero h1 {
  font-size: 2.5rem;
  color: var(--primary-dark);
  margin-bottom: 16px;
}

.estimate-hero p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

.estimate-form-wrapper {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 40px;
}

.estimate-form-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px var(--shadow);
  padding: 32px;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.estimate-form-card iframe {
  width: 100%;
  height: 600px;
  border: none;
  border-radius: 8px;
}

.estimate-placeholder {
  text-align: center;
  color: var(--text-light);
}

.estimate-placeholder .icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.estimate-placeholder p {
  font-size: 1rem;
}

/* ===== Footer ===== */
.footer {
  background: var(--primary-dark);
  color: var(--text-white);
  padding: 40px;
  text-align: center;
  margin-top: 0;
}

.footer p {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ===== Page transition ===== */
.page-enter {
  animation: fadeSlideIn 0.5s ease forwards;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Card Hover Image Zoom ===== */
.masonry-item > div:first-child:not(.lifewell-empty):not(.item-info) {
  overflow: hidden;
}

.masonry-item > div:first-child:not(.lifewell-empty):not(.item-info)[style*="background-image"] {
  transition: transform 0.5s ease;
}

.masonry-item:hover > div:first-child:not(.lifewell-empty):not(.item-info)[style*="background-image"] {
  transform: scale(1.05);
}

/* ===== Back to Top Button ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 900;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(74, 124, 155, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(74, 124, 155, 0.4);
}

/* ===== Dark Mode ===== */
[data-theme="dark"] {
  --primary: #7BA7C4;
  --primary-dark: #A8C8DE;
  --primary-light: #5A8FAD;
  --accent: #D4B56A;
  --bg: #1A1D23;
  --bg-card: #252830;
  --text: #E0DDD5;
  --text-light: #9A9A9A;
  --text-white: #FFFFFF;
  --border: #3A3D45;
  --shadow: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .navbar {
  background: rgba(26, 29, 35, 0.92);
}

[data-theme="dark"] .navbar.scrolled {
  background: rgba(26, 29, 35, 0.95);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .home-page .navbar {
  background: rgba(26, 29, 35, 0.92);
}

[data-theme="dark"] .home-page .navbar.scrolled {
  background: rgba(26, 29, 35, 0.95);
}

[data-theme="dark"] .about-hero,
[data-theme="dark"] .estimate-hero {
  background: linear-gradient(135deg, #1A1D23, #252830);
}

[data-theme="dark"] .footer {
  background: #14161B;
}

[data-theme="dark"] .nav-links {
  /* 桌面端不设背景，透明继承 navbar 的毛玻璃效果 */
}

[data-theme="dark"] .home-page .nav-links.open {
  background: rgba(25, 28, 34, 0.95);
}

[data-theme="dark"] .lifewell-empty {
  background: linear-gradient(135deg, #252830, #2A2D35);
}

[data-theme="dark"] .cta-section {
  background: linear-gradient(135deg, #1E2A35 0%, #2A3D50 100%);
}

[data-theme="dark"] .commission-status.open {
  background: rgba(76, 175, 80, 0.15);
}

[data-theme="dark"] .commission-status.queue {
  background: rgba(255, 152, 0, 0.15);
}

[data-theme="dark"] .commission-status.closed {
  background: rgba(244, 67, 54, 0.15);
}

/* Dark mode toggle button */
.dark-mode-toggle {
  background: none;
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.dark-mode-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(15deg);
}

/* Language toggle button (dropdown trigger) */
.lang-toggle {
  background: none;
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition);
  width: auto;
  height: auto;
}

.lang-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.05);
}

/* ===== Commission Status Badge ===== */
.commission-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 500;
  margin: 24px 0;
}

.commission-status .status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.commission-status.open {
  background: rgba(76, 175, 80, 0.1);
  color: #4CAF50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.commission-status.open .status-dot {
  background: #4CAF50;
  animation: pulse-dot 2s ease-in-out infinite;
}

.commission-status.queue {
  background: rgba(255, 152, 0, 0.1);
  color: #FF9800;
  border: 1px solid rgba(255, 152, 0, 0.3);
}

.commission-status.queue .status-dot {
  background: #FF9800;
  animation: pulse-dot 2s ease-in-out infinite;
}

.commission-status.closed {
  background: rgba(244, 67, 54, 0.1);
  color: #F44336;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.commission-status.closed .status-dot {
  background: #F44336;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* ===== Lightbox ===== */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-container {
  transform: scale(1);
}

.lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius);
}

/* 隐藏态：加载时/动画开始前不可见 */
.lightbox-image.hidden {
  opacity: 0;
}

/* 淡入动画：使用 @keyframes 确保始终从 opacity:0 开始 */
@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox-image.fade-in {
  animation: lbFadeIn 0.35s ease both;
}

.lightbox-info {
  text-align: center;
  color: #fff;
  margin-top: 20px;
  max-width: 600px;
}

.lightbox-info h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.lightbox-info p {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
}

.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  cursor: pointer;
  transition: color var(--transition);
  line-height: 1;
  font-family: inherit;
}

.lightbox-close:hover {
  color: #fff;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition);
  backdrop-filter: blur(4px);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
}

.lightbox-prev {
  left: -70px;
}

.lightbox-next {
  right: -70px;
}

.lightbox-counter {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  margin-top: 8px;
}

/* ===== Lifewell Detail Expand ===== */
.lifewell-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 16px;
}

.lifewell-detail.expanded {
  max-height: 500px;
  padding: 16px;
}

.lifewell-expand-hint {
  text-align: center;
  padding: 8px 0 4px;
  color: var(--primary);
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.lifewell-expand-hint:hover {
  opacity: 1;
}

.lifewell-expand-hint svg {
  transition: transform 0.3s ease;
}

.lifewell-expand-hint.expanded svg {
  transform: rotate(180deg);
}

/* ===== FAQ Page ===== */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: 0 2px 12px var(--shadow);
  overflow: hidden;
}

.faq-question {
  padding: 20px 24px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: background var(--transition);
}

.faq-question:hover {
  background: var(--bg);
}

.faq-question svg {
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: var(--primary);
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-item.open .faq-answer {
  max-height: 1000px;
  padding: 0 24px 20px;
}

.faq-answer p {
  color: var(--text-light);
  line-height: 1.8;
  font-size: 0.95rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .navbar {
    padding: 0 20px;
  }

  .nav-links {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background: rgba(253, 248, 240, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 24px 0;
    gap: 0;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition);
    border-bottom: 1px solid var(--border);
  }

  /* 暗黑模式移动端下拉菜单背景 */
  [data-theme="dark"] .nav-links {
    background: rgba(26, 29, 35, 0.98);
  }

  /* Home page mobile menu: dark bg when over carousel */
  .home-page .nav-links.open {
    background: rgba(53, 94, 115, 0.95);
  }

  .home-page .nav-links.open a {
    color: rgba(255, 255, 255, 0.85);
  }

  .home-page .nav-links.open a:hover,
  .home-page .nav-links.open a.active {
    color: var(--text-white);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
    padding: 12px 0;
  }

  .nav-toggle {
    display: flex;
  }

  /* 防止语言选择按钮被拉伸成竖条 */
  .lang-dropdown {
    align-self: center;
  }
  .lang-toggle {
    height: auto;
    max-height: 40px;
    white-space: nowrap;
    min-width: 80px;
  }

  /* Carousel responsive */
  .hero-carousel {
    height: 55vh;
  }

  .slide-content h1 {
    font-size: 1.6rem;
  }

  .slide-content p {
    font-size: 0.9rem;
    padding: 0 20px;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
  }

  .carousel-prev {
    left: 15px;
  }

  .carousel-next {
    right: 15px;
  }

  .carousel-btn svg {
    width: 18px;
    height: 18px;
  }

  .scroll-indicator {
    display: none;
  }

  .masonry-container {
    column-count: 2;
  }

  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding: 60px 20px;
  }

  /* Lightbox responsive */
  .lightbox-prev {
    left: -10px;
  }

  .lightbox-next {
    right: -10px;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
  }

  .lightbox-close {
    top: -45px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 480px) {
  .masonry-container {
    column-count: 1;
  }

  .values-grid {
    grid-template-columns: 1fr;
  }

  .slide-content h1 {
    font-size: 1.4rem;
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .lightbox-prev {
    left: 5px;
  }

  .lightbox-next {
    right: 5px;
  }
}

/* ===== Language Dropdown ===== */
.lang-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}


.lang-arrow {
  transition: transform 0.3s ease;
}

.lang-dropdown.open .lang-arrow {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px var(--shadow);
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s ease;
  z-index: 1001;
  overflow: hidden;
}

.lang-dropdown.open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-option:hover {
  background: var(--bg);
  color: var(--primary);
}

.lang-option.active {
  background: var(--primary);
  color: var(--text-white);
}

/* Dark mode for language dropdown */
[data-theme="dark"] .lang-menu {
  background: #2a2a2a;
  border-color: #444;
}

[data-theme="dark"] .lang-option {
  color: #e0e0e0;
}

[data-theme="dark"] .lang-option:hover {
  background: #3a3a3a;
  color: var(--primary-light);
}

[data-theme="dark"] .lang-option.active {
  background: var(--primary);
  color: #fff;
}
