/*
  Safe Assets 安資會計稅務
  Design: Structured Authority — Bauhaus meets Eastern business aesthetics
  Colors: #282D6A (deep navy), #0E95D3 (sky blue), #333333 (charcoal), #E05F03 (orange accent)
  Fonts: Noto Sans TC + Outfit
*/

/* ===== Reset & Base ===== */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
	

    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      line-height: 1.6;
      color: #333;
      background: #fff;
      overflow-x: hidden;
    }

    /* 中文字型加強：各平台原生中文字型 */
    .brand-zh, .section-title h2, .service-card-label, .accordion-header h3 {
      font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "SF Pro TC", "Helvetica Neue", Arial, sans-serif;
      font-weight: 600;
    }

    /* 英文字型加強 */
    .brand-en, .hero-badge, .service-card-label small, .updates-header, .footer h4 {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      font-weight: 500;
    }

    a { text-decoration: none; color: inherit; }


    /* header 與導航 */
    .main-header { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 100; }
    .main-header .container { display: flex; align-items: center; justify-content: space-between; padding: .6rem 0; }
    .logo-group { display: flex; align-items: center; gap: .75rem; }
    .logo-group img { width: 52px; height: 52px; }
    .logo-text .brand-zh { font-size: .95rem; font-weight: 700; color: #282D6A; }
    .logo-text .brand-en { font-size: .6rem; color: #666; letter-spacing: .3px; }
    .main-nav { display: flex; gap: 1.8rem; }
    .main-nav a { font-size: .95rem; font-weight: 500; color: #333; padding: .3rem 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
    .main-nav a:hover { color: #282D6A; border-bottom-color: #282D6A; }
	
	.mobile-toggle { display: none; background: none; border: none; cursor: pointer; }
.mobile-toggle svg { width: 28px; height: 28px; color: #282D6A; }
.mobile-nav { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.1); padding: 1rem 0; }
.mobile-nav.active { display: block !important; }  /* 新加這行 */
.mobile-nav a { display: block; padding: 1rem 1.5rem; font-size: 1.1rem; color: #333; border-bottom: 1px solid #eee; }


	/*
    .mobile-toggle { display: none; background: none; border: none; cursor: pointer; }
    .mobile-toggle svg { width: 28px; height: 28px; color: #282D6A; }
    .mobile-nav { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.1); padding: 1rem 0; }
    .mobile-nav a { display: block; padding: 1rem 1.5rem; font-size: 1.1rem; color: #333; border-bottom: 1px solid #eee; }  */

    /* HERO 修正 CLS：明確設定 aspect-ratio 與最小高度 */
    .hero { position: relative; width: 100%; background: #1a1d4a; aspect-ratio: 1920 / 1080; max-height: 1080px; overflow: hidden; }
    .hero picture, .hero img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
    .hero-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(40,45,106,.55), rgba(14,149,211,.35)); }
    .hero-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; text-align: center; padding: 2rem 1.5rem; color: #fff; }
    .hero-badge { background: rgba(255,255,255,.18); backdrop-filter: blur(6px); padding: .65rem 2rem; border-radius: 999px; font-size: 1.1rem; font-weight: 600; }



    /* 響應式 */
    @media (max-width: 768px) {
      .main-nav { display: none; }
      .mobile-toggle { display: block; }
      .hero { aspect-ratio: 16 / 9; } /* 更符合手機比例，但仍固定高度避免 CLS */
      .section-title h2 { font-size: 1.8rem; }
    }
	
	

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

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.25s ease;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', 'Noto Sans TC', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.3;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

    .top-bar { background: #282D6A; color: #fff; font-size: .85rem; padding: .45rem 0; }
    .top-bar .container { display: flex; justify-content: space-between; align-items: center; }
    .top-bar-left { display: flex; gap: 1.5rem; align-items: center; }
    .top-bar-left a { color: #fff; display: flex; align-items: center; gap: .4rem; transition: opacity .2s; }
    .top-bar-left a:hover { opacity: .8; }
    .top-bar-left svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ===== Main Header / Nav ===== */
.main-header {
  background: #fff;
  box-shadow: 0 2px 12px rgba(40,45,106,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.logo-group img {
  height: 52px;
  width: auto;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text .brand-en {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: #282D6A;
  letter-spacing: -0.02em;
  line-height: 1.2;
}



/* Desktop nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.main-nav a {
  position: relative;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.25s;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2.5px;
  background: #0E95D3;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.main-nav a:hover {
  color: #282D6A;
}

.main-nav a:hover::after {
  width: 70%;
}

/* Mobile Nav Active 狀態 */
.mobile-nav.active {
    display: block !important;  /* 強制顯示，蓋過任何隱藏 */
}

/* 額外 mobile 連結樣式（如果你加了） */
.mobile-extra-link {
    display: block;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    color: #282D6A;
    border-bottom: 1px solid #eee;
    background: #f8f8f8;  /* 區分一般連結 */
}

.whatsapp-link::before {
    content: "💬 ";  /* WhatsApp icon */
    margin-right: 0.5rem;
}

/* Mobile hamburger */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #282D6A;
}

.mobile-toggle svg {
  width: 26px;
  height: 26px;
}

.mobile-nav {
  display: none;
  background: #fff;
  border-top: 1px solid #eee;
}

.mobile-nav.active {
  display: block !important;
}

.mobile-nav a {
  display: block;
  padding: 0.85rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.2s, color 0.2s;
}

.mobile-nav a:hover {
  background: rgba(40,45,106,0.04);
  color: #282D6A;
}

/* ===== Hero Banner ===== */
.hero {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-content {
  position: absolute;
  bottom: 2.5rem;
  right: 2.5rem;
  text-align: right;
}

.hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, #E05F03, #e8780f);
  color: #fff;
  padding: 0.65rem 1.8rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 20px rgba(224,95,3,0.35);
}




    /* 淡入動畫 (初始隱藏，JS 加入 visible) */
    .fade-up { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
    .fade-up.visible { opacity: 1; transform: translateY(0); }
	
	
/* ===== Section Titles ===== */

    .section-title { text-align: left; margin-bottom: 3rem; }
    .section-title .bar { width: 60px; height: 4px; background: #282D6A; margin: 0 1rem; }
    .section-title h2 { font-size: 2.2rem; font-weight: 700; color: #282D6A; }
	

/* ===== Services + Updates Section ===== */
.services-section {
  padding: 3.5rem 0 3rem;
  background: #fff;
}

.services-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Service Card */
.service-card {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  aspect-ratio: 4 / 3;
}

.service-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.service-card:hover img {
  transform: scale(1.06);
}

.service-card-overlay {
  position: absolute;
  inset: 0;
/*   background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.05) 60%); */
}

.service-card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #E05F03;
  color: #fff;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Latest Updates */
.updates-panel {
  background: #fafafa;
  border-radius: 4px;
  border: 1px solid #eee;
  overflow: hidden;
}

.updates-header {
  background: #282D6A;
  color: #fff;
  padding: 0.75rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Outfit', 'Noto Sans TC', sans-serif;
}

.updates-list {
  padding: 0;
}

.update-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid #eee;
  font-size: 0.82rem;
  line-height: 1.5;
  transition: background 0.2s;
}

.update-item:last-child {
  border-bottom: none;
}

.update-item:hover {
  background: rgba(14,149,211,0.04);
}

.update-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid #282D6A;
  flex-shrink: 0;
  margin-top: 0.35rem;
}

.update-item.is-new .update-dot {
  background: #E05F03;
  border-color: #E05F03;
}

.update-new-tag {
  display: inline-block;
  background: #E05F03;
  color: #fff;
  font-size: 0.6rem;
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
  font-weight: 700;
  margin-right: 0.3rem;
  vertical-align: middle;
  line-height: 1.4;
}

/* ===== Icons / Awards Strip ===== */
.icons-strip {
  padding: 2.5rem 0;
  background: #fff;
  border-top: 1px solid #eee;
}

.icons-strip .container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.icons-strip img {
  height: 72px;
  width: auto;
  opacity: 0.9;
  transition: opacity 0.3s, transform 0.3s;
}

.icons-strip img:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* ===== About Section ===== */
.about-section {
  padding: 3.5rem 0;
  background: #f5f6fa;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-text h3 {
  font-size: 1.3rem;
  color: #282D6A;
  margin-bottom: 1rem;
}

.about-text p {
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.stat-box {
  background: #fff;
  padding: 1.25rem;
  border-radius: 6px;
  text-align: center;
  border-left: 3px solid #0E95D3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stat-box .num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #282D6A;
  line-height: 1.2;
}

.stat-box .label {
  font-size: 0.78rem;
  color: #777;
  margin-top: 0.25rem;
}

.about-image {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(40,45,106,0.12);
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 320px;
}

.about-image-accent {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 60px;
  height: 60px;
  border-top: 4px solid #E05F03;
  border-left: 4px solid #E05F03;
}

/* ===== Footer ===== */
.footer {
  background: #282D6A;
  color: #FFF;
  padding: 3rem 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}

.footer-brand img {
  height: 48px;
  margin-bottom: 1rem;
  filter: brightness(10);
}

.footer-brand p {
  font-size: 0.82rem;
  line-height: 1.7;
	
}

.footer h4 {
  color: #0E95D3;
  font-size: 1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer-services a {
  display: block;
  font-size: 0.82rem;
  padding: 0.3rem 0;

  transition: opacity 0.2s, padding-left 0.2s;
}

.footer-services a:hover {
  opacity: 1;
  color: #0E95D3;
  padding-left: 0.4rem;
}

.footer-contact table {
  font-size: 0.82rem;
  width: 100%;
}

.footer-contact td {
  padding: 0.3rem 0;
  vertical-align: top;
}

.footer-contact td:first-child {
  color: #0E95D3;
  white-space: nowrap;
  padding-right: 0.75rem;
  font-weight: 500;
  width: 70px;
}

.footer-contact td:last-child {
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  padding: 1rem 0;
  font-size: 0.75rem;
  opacity: 0.5;
}



/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .mobile-toggle { display: block; }

  .services-layout {
    grid-template-columns: 1fr;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .hero {
    height: 280px;
  }

  .hero-content {
    bottom: 1.25rem;
    right: 1.25rem;
  }

  .hero-badge {
    font-size: 0.85rem;
    padding: 0.5rem 1.2rem;
  }

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

  .service-card {
    aspect-ratio: 16 / 9;
  }

  .about-stats {
    grid-template-columns: 1fr 1fr;
  }

  .icons-strip .container {
    gap: 1.5rem;
  }

  .icons-strip img {
    height: 56px;
  }

  .logo-text { display: none; }

  .top-bar-left span { display: none; }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .section-title h2 {
    font-size: 1.2rem;
  }

  .about-stats {
    grid-template-columns: 1fr;
  }

  .icons-strip img {
    height: 48px;
  }
}

/* ===== Back to Top Button ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: #282D6A;
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  box-shadow: 0 4px 12px rgba(40,45,106,0.25);
  z-index: 90;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: #0E95D3;
  transform: translateY(-3px);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* ===== Print Styles ===== */
@media print {
  .top-bar, .main-header, .back-to-top, .mobile-toggle, .mobile-nav {
    display: none !important;
  }
  body {
    color: #000;
    background: #fff;
  }
  .hero { height: auto; }
  .service-card { break-inside: avoid; }
}


/* ===== FAQ Section ===== */
.faq-section {
  padding: 80px 0;
  background-color: #f8f9ff;
}

.faq-accordion {
  max-width: 900px;
  margin: 0 auto;
}

.accordion-item {
  margin-bottom: 16px;
  border: 1px solid #e0e0ff;
  border-radius: 8px;
  overflow: hidden;
  background: white;
  transition: all 0.3s ease;
}

.accordion-item:hover {
  box-shadow: 0 4px 20px rgba(40, 45, 106, 0.1);
}

.accordion-header {
  padding: 20px 24px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f0f2ff;
  transition: background 0.3s ease;
}

.accordion-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #282d6a;
  font-weight: 600;
}

.accordion-icon {
  font-size: 1.8rem;
  font-weight: bold;
  color: #0e95d3;
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
  transform: rotate(45deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  padding: 0 24px;
  background: white;
  transition: all 0.4s ease;
}

.accordion-item.active .accordion-content {
  max-height: 300px; /* 根據內容調整，或改用 JS 動態計算 */
  padding: 24px;
  border-top: 1px solid #e0e0ff;
}

.accordion-content p {
  margin: 0;
  line-height: 1.7;
  color: #444;
}


/* 桌面版預設 */
.brand-zh,
.brand-en {
  display: block;
}

.logo-text .brand-en {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: #282D6A;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.logo-text .brand-zh {
  font-size: 1.2rem;
  color: #0E95D3;
  font-weight: 500;
}

/* 手機版（768px 以下） */
@media only screen and (max-width: 768px) {
  /* 強制顯示 logo-text 區塊 */
  .logo-text {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    margin-left: 0.5rem;          /* logo 與文字間距 */
    text-align: left;
    max-width: none;              /* 移除寬度限制，讓文字可延伸 */
    white-space: nowrap;          /* 防止文字換行 */
    overflow: hidden;             /* 如果太長，隱藏溢出部分 */
  }

  /* 隱藏英文 */
  .brand-en {
    display: none !important;
  }

  /* 顯示並優化中文：強制一行顯示 */
  .brand-zh {
    display: block !important;
    font-size: 1rem;              /* 稍小一點，確保一行（原 1.1rem 可能太大） */
    line-height: 1.2;             /* 緊湊一點 */
    color: #282D6A;
    font-weight: 700;
    white-space: nowrap;          /* 核心：強制不換行 */
    overflow: hidden;             /* 隱藏溢出 */
    text-overflow: ellipsis;      /* 如果溢出，顯示 ... */
  }

  /* logo 群組調整 */
  .logo-group {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    flex-grow: 1;
    gap: 0.6rem;
    overflow: hidden;             /* 防止整體溢出 */
  }

  /* 縮小 logo 圖片，騰出更多文字空間 */
  .logo-group img {
    width: 42px !important;
    height: 42px !important;
  }
}

/* 超小螢幕微調 */
@media only screen and (max-width: 576px) {
  .brand-zh {
    font-size: 0.95rem;           /* 更小一點，適應小手機 */
  }
  .logo-group img {
    width: 38px !important;
    height: 38px !important;
  }
}

/* ===== 走馬燈整體容器 ===== */
.marquee-wrapper {
  overflow: hidden;
  width: 100%;
  margin: 1rem 0;
}

.marquee-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 3rem;
  animation: marquee 35s linear infinite;
  width: max-content;
  will-change: transform;
}

.marquee-item {
  flex: 0 0 auto;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.marquee-item:hover {
  transform: scale(1.12);
}

.yt-thumb {
  position: relative;
  width: 180px;
  height: 180px;
  box-sizing: border-box;
}

.yt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 6px;
}

.yt-play-overlay {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: all 0.2s ease;
}

.yt-play-overlay svg {
  width: 20px;
  height: 20px;
}

.marquee-item:hover .yt-play-overlay {
  background: rgba(200, 0, 0, 0.85);
  transform: scale(1.15);
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.marquee-wrapper:hover .marquee-track {
  animation-play-state: paused;
}

/* 手機版走馬燈調整 */
@media (max-width: 768px) {
  .marquee-track {
    gap: 2rem;
    animation-duration: 45s;
  }
  .yt-thumb {
    width: 80px;
    height: 80px;
  }
  .yt-play-overlay {
    width: 28px;
    height: 28px;
  }
  .yt-play-overlay svg {
    width: 18px;
    height: 18px;
  }
}