/* ========================================
   NAS 服務中心 — 自訂樣式
   ======================================== */

/* ===== 全域設定 ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  color: #e2e8f0;
  /* slate-200 */
}

/* ===== 背景裝飾層 ===== */
/* 在外層加上 overflow: hidden 以確保圓暈不會撐開整個畫面 */
.bg-decoration-wrapper {
  position: absolute;
  inset: 0;
  z-index: -10;
  overflow: hidden;
  min-height: 100%;
}

@keyframes pulse-slow {

  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}


/* ===== Hero Banner 主視覺 ===== */
.hero-banner__image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.4s ease;
}

.hero-banner__image-wrapper:hover {
  transform: translateY(-4px);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* 圖片本體 */
.hero-banner__image {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.hero-banner__image-wrapper:hover .hero-banner__image {
  transform: scale(1.03);
}

/* 漸層遮罩 — 由下方往上淡入，讓文字可讀 */
.hero-banner__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
      rgba(15, 23, 42, 0.85) 0%,
      rgba(15, 23, 42, 0.4) 40%,
      transparent 100%);
  pointer-events: none;
}

/* 疊加文字 */
.hero-banner__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 2rem;
}

.hero-banner__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 0.35rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hero-banner__subtitle {
  font-size: 0.9rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

/* ===== Hero Banner RWD ===== */
@media (max-width: 640px) {
  .hero-banner__image {
    height: 180px;
  }

  .hero-banner__content {
    padding: 1rem 1.25rem;
  }

  .hero-banner__title {
    font-size: 1.15rem;
  }

  .hero-banner__subtitle {
    font-size: 0.78rem;
  }
}

@media (min-width: 1024px) {
  .hero-banner__image {
    height: 340px;
  }
}

/* ===== Header Logo 點擊效果 ===== */
.header-logo {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.header-logo:hover {
  opacity: 0.8;
}

/* 品牌標題漸層文字 */
.header-brand-text {
  font-family: 'Dancing Script', 'Noto Sans TC', cursive;
  background: linear-gradient(135deg, #f43f5e, #ef4444, #fb923c);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

/* ===== 應用程式卡片（正方形佈局）===== */
.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 0.75rem;
  border-radius: 1rem;
  text-decoration: none;
  color: inherit;
  text-align: center;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  position: relative;

  /* 毛玻璃效果 */
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);

  /* 過渡動畫 */
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.app-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.app-card:active {
  transform: translateY(-2px);
}

/* 卡片圖示容器（放大以突出視覺重心） */
.app-card__icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;

  /* 預設漸層（會被 JS 的 inline style 覆蓋） */
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.app-card__icon svg {
  width: 32px;
  height: 32px;
  color: white;
  stroke-width: 2;
}

/* 卡片文字 */
.app-card__info {
  min-width: 0;
  /* 固定整體高度，讓標題+描述緊密排列但卡片對齊 */
  height: calc(0.9rem * 1.3 * 2 + 0.75rem * 1.4 * 2 + 0.25rem);
  overflow: hidden;
}

.app-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f1f5f9;
  /* slate-100 */
  margin: 0;
  line-height: 1.3;
}

.app-card__desc {
  font-size: 0.75rem;
  color: #94a3b8;
  /* slate-400 */
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* 固定高度為 2 行，確保所有卡片圖示對齊 */
  height: calc(0.75rem * 1.4 * 2);
}

/* App Store 下載按鈕（絕對定位在卡片底部，不影響圖示置中） */
.app-card__appstore {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  z-index: 10;
  transition: background 0.2s ease, color 0.2s ease;

  /* 絕對定位在卡片底部中央 */
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.app-card__appstore:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #93bbfd;
}

.app-card__appstore svg {
  width: 14px;
  height: 14px;
}

/* ===== 卡片進場動畫 ===== */
@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-card {
  animation: card-enter 0.4s ease-out both;
}

/* 動畫延遲時間已改由 JS 動態設定 (為了相容簡潔/專業模式的過濾) */

/* ===== RWD 微調 ===== */
@media (max-width: 640px) {
  .header-brand-text {
    font-size: 1.4rem !important;
  }

  .app-card {
    padding: 0.75rem 0.5rem;
  }

  .app-card__icon {
    width: 80px;
    height: 80px;
    border-radius: 1.25rem;
  }

  .app-card__icon svg {
    width: 44px;
    height: 44px;
  }

  .app-card__title {
    font-size: 0.9rem;
  }

  .app-card__info {
    height: calc(0.9rem * 1.3 * 2 + 0.65rem * 1.4 + 0.15rem);
  }

  .app-card__desc {
    font-size: 0.65rem;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    height: calc(0.65rem * 1.4);
  }

  .app-card__appstore {
    font-size: 0.8rem;
    padding: 0.2rem 0.75rem;
    gap: 0.4rem;
  }

  .app-card__appstore svg {
    width: 18px;
    height: 18px;
  }
}

/* ===== 視圖模式切換開關 (Simple / Pro) ===== */
.mode-toggle-wrapper {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mode-toggle-btn {
  appearance: none;
  background-color: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 999px;
  width: 44px;
  height: 24px;
  padding: 2px;
  cursor: pointer;
  position: relative;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

.mode-toggle-btn[aria-checked="true"] {
  background-color: #3b82f6;
  /* blue-500 */
}

.mode-toggle-thumb {
  background-color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mode-toggle-btn[aria-checked="true"] .mode-toggle-thumb {
  transform: translateX(20px);
}

/* 啟動狀態的文字顏色亮起 */
.mode-toggle-wrapper.is-pro #mode-label-pro {
  color: #f1f5f9;
  /* slate-100 */
}

.mode-toggle-wrapper.is-pro #mode-label-simple {
  color: #64748b;
  /* slate-500 */
}

.mode-toggle-wrapper:not(.is-pro) #mode-label-simple {
  color: #f1f5f9;
}

.mode-toggle-wrapper:not(.is-pro) #mode-label-pro {
  color: #64748b;
}

/* 簡潔/專業 卡片顯示切換邏輯 */
/* 在預設 (HTML 裡沒特別加什麼 class) 或是 .mode-simple 狀態下隱藏進階卡片 */
body.mode-simple .app-card.is-advanced {
  display: none !important;
}

/* 簡潔模式下的大螢幕排版優化 (僅限 Desktop) */
@media (min-width: 1024px) {
  body.mode-simple #app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    width: 100%;
  }

  body.mode-simple .app-card {
    flex-direction: row;
    justify-content: flex-start;
    aspect-ratio: auto;
    /* 取消正方形限制 */
    padding: 1.5rem 2rem;
    text-align: left;
    height: 120px;
    /* 固定高度讓排版整齊 */
  }

  body.mode-simple .app-card__icon {
    width: 72px;
    height: 72px;
    margin-right: 1.2rem;
  }

  body.mode-simple .app-card__info {
    height: auto;
    flex: 1;
    /* 佔據剩餘空間 */
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  body.mode-simple .app-card__title {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
  }

  body.mode-simple .app-card__desc {
    font-size: 0.85rem;
    height: auto;
  }

  body.mode-simple .app-card__appstore {
    position: static;
    transform: none;
    margin-top: 0;
    margin-left: auto;
    /* 增加按鈕的尺寸與 padding */
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  body.mode-simple .app-card__appstore svg {
    width: 18px;
    height: 18px;
  }
}

/* ===== 使用指南 — 手風琴 ===== */
.guide-item {
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.3s ease;
}

.guide-item.is-open {
  border-color: rgba(255, 255, 255, 0.12);
}

/* 標題列 */
.guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.875rem 1rem;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  font-size: inherit;
  transition: background 0.2s ease;
}

.guide-header:hover {
  background: rgba(255, 255, 255, 0.06);
}

.guide-header__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.guide-header__icon {
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guide-header__icon svg {
  width: 16px;
  height: 16px;
  color: white;
  stroke-width: 2;
}

.guide-header__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f1f5f9;
}

/* 展開箭頭 */
.guide-header__arrow {
  width: 18px;
  height: 18px;
  color: #64748b;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.guide-item.is-open .guide-header__arrow {
  transform: rotate(180deg);
  color: #94a3b8;
}

/* 展開內容 */
.guide-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.guide-item.is-open .guide-body {
  max-height: 3000px;
}

.guide-body__inner {
  padding: 0 1rem 1rem;
}

.guide-feature {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0 0 0.75rem;
}

.guide-steps-label {
  font-size: 0.82rem;
  color: #cbd5e1;
  margin: 0 0 0.5rem;
}

/* 步驟列表 */
.guide-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.guide-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* 步驟編號圓點 */
.guide-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* 步驟內容（含圖片）*/
.guide-step-content {
  flex: 1;
  min-width: 0;
}

.guide-step-img {
  display: block;
  width: 100%;
  max-width: 480px;
  margin-top: 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 多方法區塊 */
.guide-method {
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 0.5rem;
}

.guide-method:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.guide-method.is-recommended {
  padding-left: 0;
}

.guide-method-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.guide-method-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.25);
  letter-spacing: 0.03em;
}