/* =========================================================================
   GreenerClean V2 — App 介紹 / 安裝教學頁面
   延用 theme.css 的品牌 token（綠 / 粉 / 白、圓角卡片、泡泡）。
   本檔只新增本頁專屬元件，不覆寫既有全站樣式。
   ========================================================================= */

.app-page {
  /* --brand-3 放喺淺綠底上只有 3.7:1，未夠 WCAG AA。
     文字用呢個加深版本（在 rgba(22,185,143,.10) 底上約 5.3:1）。 */
  --brand-ink: #0a6f61;
}

/* ===================== Hero（左文右機） ===================== */
.app-hero { text-align: left; padding: 150px 0 72px; }
.app-hero__grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: 56px; align-items: center; position: relative; z-index: 1;
}
.app-hero__copy { max-width: 640px; }
.app-hero h1 { margin: 20px 0 0; }
.app-hero p.app-hero__lead { margin: 18px 0 0; max-width: 560px; }
.app-hero .hero__actions { margin-top: 32px; }

.app-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.app-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--pill);
  border: 1px solid var(--border); background: rgba(255,255,255,0.82);
  font-size: 13px; font-weight: 700; color: var(--text-muted);
}
.app-badge svg { width: 15px; height: 15px; flex: none; color: var(--brand); }

/* ===================== 手機主畫面模型 ===================== */
.device-stage { display: flex; justify-content: center; position: relative; }
.device-stage .bubble { pointer-events: none; }

.device {
  width: 268px; flex: none; padding: 11px;
  border-radius: 46px; background: linear-gradient(150deg, #123c34, #06231d);
  box-shadow: 0 40px 90px rgba(6,56,47,0.28), 0 0 0 1px rgba(255,255,255,0.28) inset;
  position: relative; z-index: 1;
}
.device__screen {
  border-radius: 36px; overflow: hidden; aspect-ratio: 9 / 18.6;
  background:
    radial-gradient(420px 260px at 78% 4%, rgba(243,105,160,0.34), transparent 62%),
    radial-gradient(380px 240px at 12% 22%, rgba(66,200,216,0.32), transparent 60%),
    linear-gradient(180deg, #eafaf2 0%, #d6f2e6 100%);
  display: flex; flex-direction: column; position: relative;
}
.device__notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 22px; border-radius: var(--pill); background: #0b241e; z-index: 3;
}
.device__status {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px 0; font-size: 11px; font-weight: 800; color: var(--brand-deep);
}
.device__status-icons { display: flex; gap: 4px; align-items: center; }
.device__status-icons i {
  display: block; width: 4px; border-radius: 2px; background: var(--brand-deep); opacity: 0.75;
}
.device__status-icons i:nth-child(1) { height: 6px; }
.device__status-icons i:nth-child(2) { height: 9px; }
.device__status-icons i:nth-child(3) { height: 12px; }
.device__status-icons i:nth-child(4) { width: 16px; height: 8px; border-radius: 3px; opacity: 0.5; }

.device__grid {
  flex: 1; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px 12px; align-content: start; padding: 26px 18px 0;
}
.device__app { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.device__app span {
  font-size: 8.5px; font-weight: 700; color: rgba(6,56,47,0.72);
  text-align: center; line-height: 1.2;
}
.device__tile {
  width: 100%; aspect-ratio: 1; border-radius: 14px;
  background: rgba(255,255,255,0.62); border: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 4px 10px rgba(6,56,47,0.08);
}
.device__app--gc .device__tile {
  background: url("../img/app-icon-192.png") center / cover no-repeat;
  border-color: rgba(255,255,255,0.9);
  box-shadow: 0 10px 22px rgba(12,143,125,0.42);
}
.device__app--gc span { color: var(--brand-deep); font-weight: 800; }
.device__app--gc { position: relative; }
.device__app--gc::before {
  content: ""; position: absolute; inset: -8px -6px 12px -6px;
  border: 2px dashed var(--brand-2); border-radius: 20px; opacity: 0.9;
}
.device__dock {
  margin: 0 14px 16px; padding: 10px; border-radius: 22px;
  background: rgba(255,255,255,0.56); border: 1px solid rgba(255,255,255,0.7);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.device__dock i { display: block; aspect-ratio: 1; border-radius: 12px; background: rgba(255,255,255,0.72); }

/* ===================== 安裝面板 ===================== */
.install-panel {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 32px; align-items: center;
  padding: 40px; border-radius: 32px; border: 1px solid var(--border-hover);
  background:
    radial-gradient(620px 260px at 12% 0%, rgba(22,185,143,0.12), transparent 62%),
    radial-gradient(520px 240px at 92% 100%, rgba(243,105,160,0.12), transparent 60%),
    var(--bg-card);
}
.install-panel h2 { font-size: clamp(24px, 3vw, 34px); margin-bottom: 12px; }
.install-panel p { color: var(--text-muted); font-size: 15.5px; }
.install-panel__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.install-panel__side { display: grid; gap: 12px; }

.install-state {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: rgba(239,251,243,0.72);
  font-size: 14px; font-weight: 650; color: var(--text-muted); line-height: 1.55;
}
.install-state svg { width: 20px; height: 20px; flex: none; color: var(--brand); margin-top: 1px; }
.install-state--ok { border-color: var(--border-hover); background: rgba(22,185,143,0.10); color: var(--brand-ink); }
.install-state--ok svg { color: var(--brand-ink); }

.btn[hidden] { display: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ===================== 平台分頁 ===================== */
.platform-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 8px;
  border: 1px solid var(--border); border-radius: var(--pill);
  background: var(--bg-card); width: fit-content; margin-bottom: 32px;
}
.platform-tab {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border: 1px solid transparent;
  border-radius: var(--pill); background: none; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 700; color: var(--text-muted);
  transition: all 0.3s var(--ease);
}
.platform-tab svg { width: 17px; height: 17px; flex: none; }
.platform-tab:hover { color: var(--text); background: var(--bg-2); }
.platform-tab[aria-selected="true"] {
  color: #ffffff; background: linear-gradient(135deg, var(--brand), var(--brand-3));
  box-shadow: 0 10px 26px var(--brand-glow);
}

.platform-panel[hidden] { display: none; }
.platform-panel__grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: start; }

/* ===================== 安裝步驟 ===================== */
.install-steps { display: grid; gap: 14px; counter-reset: install; }
.install-step {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 16px; align-items: center;
  padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.install-step:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.install-step__num {
  counter-increment: install; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #ffffff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
}
.install-step__num::before { content: counter(install); }
.install-step__title { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.install-step__desc { color: var(--text-muted); font-size: 14.5px; line-height: 1.6; }
.install-step__glyph {
  width: 46px; height: 46px; flex: none; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-hover); background: rgba(22,185,143,0.08); color: var(--brand-3);
}
.install-step__glyph svg { width: 22px; height: 22px; }

.ui-label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; margin: 0 2px; border-radius: 8px;
  border: 1px solid var(--border-hover); background: rgba(22,185,143,0.10);
  font-weight: 800; color: var(--brand-ink); font-size: 13.5px; white-space: nowrap;
}

/* ===================== 平台示意圖 ===================== */
.install-visual {
  position: sticky; top: 110px;
  padding: 22px; border-radius: 28px; border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(239,251,243,0.9));
  box-shadow: 0 24px 60px rgba(6,56,47,0.10);
}
.install-visual__caption {
  margin-top: 16px; font-size: 13px; font-weight: 700; color: var(--text-muted); text-align: center;
}
.mock {
  border-radius: 20px; overflow: hidden; border: 1px solid var(--border);
  background: #ffffff;
}
.mock__chrome {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--bg-2); border-bottom: 1px solid var(--border);
}
.mock__dots { display: flex; gap: 5px; }
.mock__dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(18,52,45,0.16); }
.mock__url {
  flex: 1; min-width: 0; padding: 7px 12px; border-radius: var(--pill);
  background: #ffffff; border: 1px solid var(--border);
  font-size: 11.5px; font-weight: 700; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mock__btn {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-3); background: rgba(22,185,143,0.12); border: 1px solid var(--border-hover);
}
.mock__btn svg { width: 18px; height: 18px; }
.mock__btn--target { position: relative; }
.mock__btn--target::after {
  content: ""; position: absolute; inset: -7px; border-radius: 16px;
  border: 2px solid var(--brand-2); animation: gc-pulse 2.2s var(--ease) infinite;
}
@keyframes gc-pulse {
  0%   { transform: scale(0.9); opacity: 0.9; }
  70%  { transform: scale(1.14); opacity: 0; }
  100% { transform: scale(1.14); opacity: 0; }
}
.mock__body { padding: 16px; display: grid; gap: 10px; }
.mock__line { height: 10px; border-radius: 6px; background: rgba(18,52,45,0.09); }
.mock__line--title { height: 15px; width: 62%; background: rgba(22,185,143,0.24); }
.mock__line--short { width: 44%; }
.mock__sheet {
  margin: 12px; padding: 14px; border-radius: 18px;
  border: 1px solid var(--border); background: var(--bg-2); display: grid; gap: 8px;
}
.mock__sheet-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 12px; background: #ffffff;
  font-size: 12.5px; font-weight: 700; color: var(--text-muted);
}
.mock__sheet-row svg { width: 16px; height: 16px; flex: none; color: var(--text-dim); }
.mock__sheet-row--target {
  color: var(--brand-ink); border: 1px solid var(--border-hover);
  background: rgba(22,185,143,0.10); box-shadow: 0 8px 22px var(--brand-glow);
}
.mock__sheet-row--target svg { color: var(--brand-ink); }
.mock__toolbar {
  display: flex; align-items: center; justify-content: space-around;
  padding: 12px; border-top: 1px solid var(--border); background: var(--bg-2); color: var(--text-dim);
}
.mock__toolbar svg { width: 18px; height: 18px; }

/* ===================== 功能導覽 ===================== */
.app-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.app-feature {
  display: flex; gap: 16px; padding: 26px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.app-feature:hover { border-color: var(--border-hover); transform: translateY(-4px); }
.app-feature__icon {
  width: 46px; height: 46px; flex: none; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(22,185,143,0.14), rgba(243,105,160,0.12));
  color: var(--brand-3);
}
.app-feature__icon svg { width: 22px; height: 22px; }
.app-feature h3 { font-size: 17px; margin-bottom: 6px; }
.app-feature p { color: var(--text-muted); font-size: 14.5px; line-height: 1.6; }

/* ===================== 焦點狀態（鍵盤操作） ===================== */
.app-page a:focus-visible,
.app-page button:focus-visible,
.app-page summary:focus-visible {
  outline: 3px solid var(--brand-2); outline-offset: 3px; border-radius: 12px;
}

/* ===================== 響應式 ===================== */
@media (max-width: 1024px) {
  .app-hero { padding: 130px 0 56px; }
  .app-hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .app-hero__copy { max-width: none; }
  .install-panel { grid-template-columns: 1fr; padding: 32px; }
  .platform-panel__grid { grid-template-columns: 1fr; gap: 28px; }
  .install-visual { position: static; max-width: 460px; margin: 0 auto; }
  .app-feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .app-hero { padding: 108px 0 44px; text-align: center; }
  .app-hero .eyebrow { justify-content: center; }
  .app-hero p.app-hero__lead { margin-left: auto; margin-right: auto; }
  .app-badges { justify-content: center; }
  .app-hero .hero__actions { align-items: stretch; }
  .device { width: 232px; }
  .install-panel { padding: 24px; border-radius: 24px; }
  .install-panel__actions .btn { width: 100%; justify-content: center; }
  .platform-tabs { width: 100%; border-radius: 22px; }
  .platform-tab { flex: 1 1 auto; justify-content: center; padding: 10px 12px; font-size: 14px; }
  .install-step { grid-template-columns: 34px minmax(0, 1fr); padding: 18px; gap: 12px; }
  .install-step__glyph { display: none; }
  .app-feature-grid { grid-template-columns: 1fr; }
  .install-visual { padding: 16px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .mock__btn--target::after { animation: none; opacity: 0.9; transform: none; }
}
