/* ============================================================
   page-index.css — ホームページ（2026-02 優化版）
   改进项:
   1. 优化Hero动画 (减少scale, 缩短时长)
   2. 改进浮动卡片 (正常布局流, 减少hover位移)
   3. 提升移动端横滑体验
   4. 优化轮播控制
   5. 改进对比度和可读性
   ============================================================ */

/* ===== HERO SLIDER ===== */
.hero {
  position: relative; 
  width: 100%; 
  height: 100vh;
  min-height: 600px; 
  overflow: hidden; 
  background: var(--color-dark);
}

.hero-slides { 
  position: relative; 
  width: 100%; 
  height: 100%; 
}

.hero-slide {
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  opacity: 0; 
  transform: scale(1.08);
  transition: opacity 0.8s ease, transform 8s ease;
}

.hero-slide.active { 
  opacity: 1; 
  transform: scale(1);
}

.hero-slide img {
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  filter: brightness(0.65);
}

.hero-overlay {
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background: linear-gradient(135deg,
    rgba(26,23,20,0.5) 0%, 
    rgba(26,23,20,0.2) 50%, 
    rgba(26,23,20,0.45) 100%);
}

/* ===== HERO QUOTE TEXT OVERLAY ===== */
.hero-quote {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 94%;
  max-width: 1300px;
  opacity: 0;
  transition: opacity .8s .3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.hero-slide.active .hero-quote {
  opacity: 1;
}

/* hero-quote-group — 相对定位容器，中文为基准 */
.hero-quote-group {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: fit-content;
  gap: 0;
}

/* 金庸：绝对定位，悬挂在中文左侧，冒号右边对齐中文左边 */
.hero-quote-author {
  font-family: var(--font-jianhao);
  font-size: clamp(22px, 2.2vw, 34px);
  color: rgba(255,255,255,.8);
  letter-spacing: .1em;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  position: absolute;
  right: 100%;
  bottom: 100%;
  padding-right: 0.15em;
  text-shadow:
    0 0 20px rgba(255,255,255,.2),
    0 1px 4px rgba(0,0,0,.3);
}

/* Chinese quote — big */
.hero-quote-zh {
  font-family: var(--font-jianhao);
  font-size: clamp(36px, 4.6vw, 62px);
  color: #fff;
  letter-spacing: .1em;
  line-height: 1.55;
  text-align: left;
  margin: 0 -.1em 0 0;
  white-space: nowrap;
  text-shadow:
    0 0 40px rgba(255,255,255,.35),
    0 0 80px rgba(255,255,255,.15),
    0 2px 8px rgba(0,0,0,.4);
}

/* Two-line quotes */
.hero-quote-zh--two-line {
  white-space: normal;
}

.hero-quote-zh--large {
  font-size: clamp(42px, 5.4vw, 72px);
}

/* Japanese translation */
.hero-quote-ja {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 400;
  font-size: clamp(22px, 2.2vw, 34px);
  color: rgba(255,255,255,.9);
  letter-spacing: .08em;
  line-height: 1.6;
  text-align: center;
  align-self: stretch;
  margin: 0;
  text-shadow: 0 1px 6px rgba(0,0,0,.25);
}

/* hero3: light slide — 深色文字 */
.hero-quote--left {
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 94%;
  align-items: center;
}

/* Japanese translations — old wrap (kept for JS compat, hidden) */
.hero-ja-wrap { display: none; }


/* Light slide (hero3 white bg) overrides */
.hero-slide--light .hero-overlay {
  background: linear-gradient(135deg,
    rgba(255,255,255,.05) 0%,
    rgba(255,255,255,.25) 50%,
    rgba(255,255,255,.05) 100%);
}
.hero-slide--light img {
  filter: brightness(1) !important;
}
.hero-slide--light .hero-quote-zh {
  color: var(--color-dark);
  text-shadow:
    0 0 40px rgba(255,255,255,.5),
    0 0 80px rgba(255,255,255,.2);
}
.hero-slide--light .hero-quote-author {
  color: rgba(26,23,20,.9);
  text-shadow: none;
}
.hero-slide--light .hero-quote-ja {
  color: rgba(26,23,20,.85);
  text-shadow: none;
}

.hero-indicators {
  position: absolute; 
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex; 
  flex-direction: row;  /* 改回横向 */
  gap: var(--space-sm); 
  z-index: 200;
  align-items: center;
}

.hero-indicator {
  width: 10px; 
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer; 
  transition: all 0.3s ease;
  border: 2px solid rgba(255,255,255,0.5);
  padding: 0;
}

.hero-indicator:hover {
  background: rgba(255,255,255,0.6);
  transform: scale(1.15);
}

.hero-indicator.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  transform: scale(1.3);
}

.hero-indicator:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

/* 横スクロールヒント（モバイルのみ表示） */
.business-scroll-hint {
  display: none;
}

@media (max-width: 768px) {
  .business-scroll-hint {
    display: block;
    text-align: center;
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--color-accent);
    opacity: 0.75;
    margin-bottom: var(--space-sm);
    font-family: var(--font-body);
  }
}

/* ===== BUSINESS CARDS ===== */
.business-float {
  width: 100%;
  background: transparent;  /* 改为透明，让卡片浮在空中 */
  padding: 0 var(--space-md);
  position: relative;
  margin-top: -100px;  /* 向上跨越到hero底部 */
  margin-bottom: -40px;  /* 向下跨越到intro顶部 */
  z-index: 100;  /* 确保在hero之上 */
}

.business-float-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.bfloat-card {
  background: rgba(26, 20, 14, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 
    0 2px 8px rgba(0,0,0,0.1), 
    0 16px 32px rgba(0,0,0,0.15);
  border: 1px solid rgba(200,169,110,0.2);
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  min-height: 380px;
  text-decoration: none;
  color: rgba(245,240,230,0.95);
  transition: 
    transform 0.3s var(--transition),
    box-shadow 0.3s var(--transition),
    border-color 0.3s ease,
    background 0.3s ease;
  position: relative;
  will-change: transform;
}

/* タッチデバイスで hover が永続しないよう保護 */
@media (hover: hover) {
  .bfloat-card:hover {
    transform: translateY(-8px);
    background: rgba(26, 20, 14, 0.92);
    box-shadow: 
      0 4px 12px rgba(0,0,0,0.15), 
      0 24px 48px rgba(0,0,0,0.25);
    border-color: rgba(200,169,110,0.45);
  }

  .bfloat-card:hover .bfloat-icon { 
    opacity: 1; 
  }

  .bfloat-card:hover .bfloat-link { 
    opacity: 1; 
  }

  .bfloat-card:hover .bfloat-arrow { 
    transform: translateX(4px); 
  }
}

.bfloat-num {
  font-size: 1.8rem; 
  font-weight: 700;
  color: var(--color-accent);
  opacity: 0.9;
  line-height: 1; 
  margin-bottom: var(--space-sm);
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bfloat-icon {
  width: 24px; 
  height: 24px;
  opacity: 0.6;
  transition: opacity 0.25s ease;
  flex-shrink: 0;
}

.bfloat-card:hover .bfloat-icon { 
  opacity: 1; 
}

.bfloat-title {
  font-family: var(--font-heading);
  font-size: 1.25rem; 
  font-weight: 600;
  color: #f5f0e6;
  line-height: 1.4;
  margin: 0 0 var(--space-md) 0;
}

.bfloat-desc {
  font-size: 0.9rem; 
  line-height: 1.7;
  color: rgba(230,220,200,0.85);
  margin-bottom: var(--space-md);
  flex-grow: 1;
  display: -webkit-box; 
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical; 
  overflow: hidden;
}

.bfloat-link {
  font-size: 0.75rem; 
  font-weight: 600;
  color: var(--color-accent);
  letter-spacing: 0.1em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(200,169,110,0.25);
  padding-top: var(--space-sm);
  margin-top: auto;
  text-transform: uppercase;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.bfloat-card:hover .bfloat-link { 
  opacity: 1; 
}

.bfloat-arrow {
  font-size: 1rem;
  transition: transform 0.2s;
}


/* corner accent */
.bfloat-card::before {
  content: '';
  position: absolute; 
  top: 0; 
  left: 0;
  width: 20px; 
  height: 20px;
  border-top: 2px solid var(--color-accent);
  border-left: 2px solid var(--color-accent);
  opacity: 0.3;
  transition: opacity 0.25s ease, width 0.3s var(--transition), height 0.3s var(--transition);
}

.bfloat-card::after {
  content: '';
  position: absolute; 
  bottom: 0; 
  right: 0;
  width: 20px; 
  height: 20px;
  border-bottom: 2px solid var(--color-accent);
  border-right: 2px solid var(--color-accent);
  opacity: 0.3;
  transition: opacity 0.25s ease, width 0.3s var(--transition), height 0.3s var(--transition);
}

.bfloat-card:hover::before,
.bfloat-card:hover::after {
  opacity: 1;
  width: 32px;
  height: 32px;
}

/* ===== INTRO ===== */
.intro {
  padding-top: 110px;
  padding-bottom: var(--section-v);
  padding-left: var(--page-pad);
  padding-right: var(--page-pad);
  background: var(--color-offwhite); 
  position: relative;
}

.intro-inner {
  max-width: var(--page-max); 
  margin: 0 auto;
  display: grid; 
  grid-template-columns: 1fr minmax(0, 420px);
  gap: var(--space-3xl); 
  align-items: center;
}

.intro-text {
  font-size: var(--text-base); 
  line-height: 1.75;
  color: var(--color-text-light); 
  letter-spacing: 0.5px;
}

.intro-text + .intro-text { 
  margin-top: var(--space-md); 
}

.intro-link {
  display: inline-block; 
  margin-top: var(--space-lg);
  font-size: var(--text-xs); 
  font-weight: 600;
  color: var(--color-accent); 
  letter-spacing: 2px;
  text-decoration: none; 
  padding-bottom: 4px;
  border-bottom: 2px solid rgba(200,169,110,0.3);
  transition: border-color 0.25s ease, color 0.25s ease;
}

.intro-link:hover { 
  color: var(--color-accent-hover); 
  border-color: var(--color-accent); 
}

.intro-image { 
  position: relative;
  overflow: visible;
  height: auto;
  min-height: 380px;
  max-height: 550px;
  width: fit-content;
  flex-shrink: 0;
}

.intro-image img {
  height: auto;
  min-height: 380px;
  max-height: 550px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: brightness(0.9) saturate(0.95);
}

.intro-image::before {
  content: ''; 
  position: absolute; 
  top: -12px; 
  left: -12px;
  width: 60px; 
  height: 60px;
  border-top: 2px solid var(--color-accent);
  border-left: 2px solid var(--color-accent); 
  pointer-events: none;
}

.intro-image::after {
  content: ''; 
  position: absolute; 
  bottom: -12px; 
  right: -12px;
  width: 60px; 
  height: 60px;
  border-bottom: 2px solid var(--color-accent);
  border-right: 2px solid var(--color-accent); 
  pointer-events: none;
}

/* ===== CTA ===== */
.cta-section {
  padding: var(--section-v) var(--page-pad);
  background: var(--color-primary);
  position: relative; 
  overflow: hidden; 
  text-align: center;
}

.cta-section::before {
  content: '旭'; 
  position: absolute; 
  top: 50%; 
  left: 50%;
  transform: translate(-50%, -50%) rotate(-6deg);
  font-family: var(--font-display);
  font-size: 320px; 
  font-weight: 900;
  color: rgba(200,169,110, 0.03); 
  pointer-events: none; 
  white-space: nowrap;
}

.cta-section::after {
  content: ''; 
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(200,169,110,0.04) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 60%, rgba(200,169,110,0.02) 0%, transparent 50%);
  pointer-events: none;
}

.cta-inner { 
  position: relative; 
  z-index: 1; 
  max-width: 800px; 
  margin: 0 auto; 
}

.cta-section .section-label { 
  color: var(--color-accent-light); 
  margin-bottom: var(--space-lg); 
}

.cta-tagline {
  font-family: var(--font-display);
  font-size: var(--text-4xl); 
  font-weight: 700;
  color: var(--color-white); 
  letter-spacing: 5px; 
  line-height: 1.6; 
  margin-bottom: var(--space-lg);
}

.cta-sub {
  font-size: 15px; 
  line-height: 1.75;
  color: rgba(255,255,255,0.8);
  max-width: 560px; 
  margin: 0 auto var(--space-2xl); 
  letter-spacing: 0.5px;
}

.cta-buttons { 
  display: flex; 
  gap: var(--space-md); 
  justify-content: center; 
  flex-wrap: wrap; 
}

.cta-btn-primary {
  font-family: var(--font-body);
  font-size: var(--text-xs); 
  font-weight: 600;
  color: var(--color-dark); 
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  padding: 18px 48px; 
  text-decoration: none;
  letter-spacing: 2.5px; 
  display: inline-block;
  transition: all 0.25s ease;
}

.cta-btn-primary:hover {
  background: var(--color-accent-light); 
  color: var(--color-dark);
  border-color: var(--color-accent-light);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.cta-btn-secondary {
  font-family: var(--font-body);
  font-size: var(--text-xs); 
  font-weight: 600;
  color: rgba(255,255,255,0.9); 
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 18px 48px; 
  text-decoration: none;
  letter-spacing: 2.5px; 
  display: inline-block;
  transition: all 0.25s ease;
}

.cta-btn-secondary:hover {
  background: rgba(255,255,255,0.1); 
  color: var(--color-white);
  transform: translateY(-2px); 
  border-color: rgba(255,255,255,0.6);
}

/* ===== RESPONSIVE ===== */

/* ===== Tablet 820px~1024px ===== */
@media (max-width: 912px) {
  .intro-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .intro-image {
    order: -1;
    width: 100%;
    min-height: auto;
    max-height: 400px;
    overflow: hidden;
  }
  .intro-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    object-position: center top;
    min-height: auto;
    max-height: 400px;
  }
}

@media (max-width: 1024px) {
  .business-float-grid { 
    gap: var(--space-md); 
  }
  
  .bfloat-card { 
    padding: var(--space-lg) var(--space-md); 
    min-height: 340px; 
  }
  
  .bfloat-title { 
    font-size: 1.15rem; 
  }
  
  .intro-inner { 
    grid-template-columns: 1fr; 
    gap: var(--space-2xl); 
  }
  
  .intro-image { 
    order: -1;
    height: auto;
    width: 100%;
    overflow: hidden;
  }

  .intro-image img {
    height: auto;
    width: 100%;
    max-width: 100%;
  }
}

/* ===== 全部非桌面设备：金庸回正常流 ≤1199px ===== */
@media (max-width: 1199px) {
  .hero-quote {
    width: 78%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .hero-quote-group {
    position: static;
    width: 100%;
    align-items: flex-start;
  }
  .hero-quote-author {
    position: static;
    padding-right: 0;
  }
  .hero-quote {
    align-items: flex-start;
  }
  .hero-quote-ja {
    align-self: auto;
    text-align: left;
  }
}

/* ===== Surface Pro 7 / iPad Pro (1024px以下) ===== */
@media (max-width: 1024px) {
  .hero-quote {
    width: 80%;
    gap: 12px;
  }
  .hero-quote-author {
    font-size: clamp(16px, 2vw, 26px);
    margin: 0 0 4px 0;
  }
  .hero-quote-zh {
    white-space: normal;
    font-size: clamp(32px, 4.5vw, 52px);
    letter-spacing: .08em;
    text-align: left;
    width: 100%;
  }
  .hero-quote-zh--two-line {
    font-size: clamp(26px, 3.8vw, 44px);
  }
  .hero-quote-ja {
    font-size: clamp(15px, 2vw, 24px);
    text-align: left;
    line-height: 1.6;
  }
}

/* ===== iPad Air / Mini (820px以下) ===== */
@media (max-width: 820px) {
  .hero-quote {
    width: 82%;
    gap: 10px;
  }
  .hero-quote-author {
    font-size: clamp(13px, 2vw, 18px);
  }
  .hero-quote-zh {
    font-size: clamp(24px, 4vw, 34px);
  }
  .hero-quote-zh--two-line {
    font-size: clamp(20px, 3.5vw, 28px);
  }
  .hero-quote-ja {
    font-size: clamp(13px, 2vw, 18px);
  }
}

/* ===== スマホ共通 (768px以下) ===== */
@media (max-width: 768px) {
  .hero { 
    min-height: 500px; 
  }
  
  .hero-quote {
    width: 84%;
    top: 50%;
    gap: 8px;
  }

  .hero-quote-author {
    font-size: clamp(13px, 3.8vw, 18px);
    margin: 0 0 2px 0;
  }
  
  .hero-quote-zh {
    font-size: clamp(24px, 7vw, 34px);
    letter-spacing: .06em;
    width: 100%;
  }
  
  .hero-quote-zh--two-line {
    font-size: clamp(20px, 6vw, 28px);
  }

  .hero-quote-ja {
    font-size: clamp(12px, 3.5vw, 17px);
    line-height: 1.6;
  }

  .hero-quote--left {
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .hero-indicators { 
    bottom: 32px;
  }
  
  /* business cards: scroll */
  .business-float { 
    margin-top: -60px;
    margin-bottom: -40px;
    padding: 0; 
  }
  
  .business-float-grid {
    grid-template-columns: repeat(3, min(85vw, 320px));
    gap: var(--space-sm);
    max-width: none;
    padding: 0 var(--space-md);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(200,169,110,0.3) transparent;
  }
  
  .business-float-grid::-webkit-scrollbar { 
    height: 4px; 
  }
  
  .business-float-grid::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .business-float-grid::-webkit-scrollbar-thumb {
    background: rgba(200,169,110,0.3);
    border-radius: 2px;
  }
  
  /* scroll fade hint */
  .business-float::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(90deg, transparent, #faf8f3);
    pointer-events: none;
  }
  
  .bfloat-card {
    scroll-snap-align: start;
    min-height: auto;
    padding: var(--space-md) var(--space-sm) var(--space-sm);
    box-shadow: var(--shadow-sm);
  }
  
  .bfloat-num { 
    font-size: 1.5rem; 
    margin-bottom: var(--space-xs); 
  }
  
  .bfloat-title { 
    font-size: 1.05rem; 
    margin-bottom: var(--space-sm); 
  }
  
  .bfloat-desc { 
    -webkit-line-clamp: 3; 
    font-size: 0.85rem; 
  }
  
  .bfloat-title br { 
    display: none; 
  }
  
  /* Intro */
  .intro {
    padding-top: 80px;
  }
  
  .intro-inner { 
    gap: var(--space-lg); 
  }
  
  .intro-image { height: auto !important; width: 100%; overflow: visible !important; min-height: auto !important; max-height: none !important; }
  .intro-image img { height: auto !important; width: 100%; object-fit: contain !important; min-height: auto !important; max-height: none !important; }
  
  /* CTA */
  .cta-tagline {
    font-size: var(--text-2xl);
    letter-spacing: 3px;
  }
  
  .cta-sub {
    font-size: 14px;
    margin-bottom: var(--space-xl);
  }
  
  .cta-section::before {
    font-size: 200px;
  }
}

@media (max-width: 480px) {
  .business-float-grid {
    grid-template-columns: repeat(3, min(90vw, 300px));
  }
  
  .hero-title {
    font-size: 26px;
    letter-spacing: 2px;
  }
}

/* ===== ACCESSIBILITY ===== */
.hero-btn-primary:focus-visible,
.hero-btn-secondary:focus-visible,
.cta-btn-primary:focus-visible,
.cta-btn-secondary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

/* ===== PERFORMANCE ===== */
@supports not (backdrop-filter: blur(10px)) {
  .bfloat-card {
    background: rgba(26, 20, 14, 0.95);
  }
}

/* ===== NAV LIGHT THEME — hero3 (white/bright hero slide) ===== */
/* When NOT scrolled and on a light hero slide, switch nav text to dark */
.page-index .nav--light-hero:not(.scrolled) .nav-links a {
  color: rgba(26,23,20,0.82);
}
.page-index .nav--light-hero:not(.scrolled) .nav-links a:hover,
.page-index .nav--light-hero:not(.scrolled) .nav-links a.active {
  color: var(--color-dark);
}
.page-index .nav--light-hero:not(.scrolled) .nav-links a::after {
  background: var(--color-dark);
}
/* Dropdown items under light nav */
.page-index .nav--light-hero:not(.scrolled) .nav-dropdown a {
  color: rgba(26,23,20,0.85);
}
/* Keep scrolled state always dark bg / white text regardless */
.page-index .nav--light-hero.scrolled .nav-links a {
  color: rgba(255,255,255,0.85);
}

/* ===== FONT LOADING — prevent FOUT on hero quotes ===== */
.fonts-loading .hero-quote-zh,
.fonts-loading .hero-quote-author {
  opacity: 0;
  transition: none;
}
.hero-quote-zh,
.hero-quote-author {
  transition: opacity 0.3s ease;
}
