/* ============================================================
   桌面血糖鐘 · Landing Page · Candy Colorful Theme
   ============================================================ */

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Microsoft JhengHei", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #FFE0EC 0%, #FFD1F2 25%, #E9D6FF 55%, #C9E4FF 80%, #FFE8B0 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}

/* ---------- Design tokens ---------- */
:root {
  --primary: #FF4081;
  --primary-2: #B557F5;
  --accent-cyan: #21D4B4;
  --accent-yellow: #FFD83D;
  --accent-coral: #FF7A6A;
  --text: #2D1B4E;
  --text-muted: #6F5C99;
  --card-bg: #FFFFFF;
  --card-bg-soft: #FFFAF5;
  --shadow-sm: 0 4px 12px rgba(255, 64, 129, 0.10);
  --shadow-md: 0 10px 30px rgba(255, 64, 129, 0.18);
  --shadow-lg: 0 20px 60px rgba(181, 87, 245, 0.25);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
}

/* ---------- Typography ---------- */
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: 1.3rem; }
p { margin: 0.5em 0; color: var(--text); }
.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  background: #FFF0F5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--primary-2);
}

/* ---------- Layout primitives ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}
section { padding: 80px 24px; position: relative; z-index: 2; }
.section-title { text-align: center; margin-bottom: 8px; }
.section-subtitle { text-align: center; color: var(--text-muted); font-size: 1.05rem; margin-bottom: 48px; }

/* ---------- Background blobs ---------- */
.blobs {
  position: fixed; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 18s infinite alternate ease-in-out;
}
.blob-1 { width: 500px; height: 500px; background: #FF8FB1; top: -100px; left: -150px; animation-duration: 22s; }
.blob-2 { width: 400px; height: 400px; background: #C39BFF; top: 30%; right: -100px; animation-duration: 26s; animation-delay: -5s; }
.blob-3 { width: 600px; height: 600px; background: #7FDDC6; bottom: -200px; left: 20%; animation-duration: 30s; animation-delay: -10s; }
.blob-4 { width: 350px; height: 350px; background: #FFE066; top: 60%; left: -100px; animation-duration: 24s; animation-delay: -15s; }
@keyframes float {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, -40px) scale(1.1); }
  100% { transform: translate(-30px, 50px) scale(0.95); }
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}
.nav-logo:hover { text-decoration: none; }
.logo-icon { font-size: 1.4rem; }
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}
@media (max-width: 640px) {
  .nav { padding: 12px 16px; }
  .nav-links { gap: 14px; font-size: 0.9rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: none;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: white;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  text-decoration: none;
}
.btn-primary:active { transform: translateY(-1px) scale(1.01); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border: 2px solid rgba(45, 27, 78, 0.1);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover {
  background: white;
  transform: translateY(-2px);
  text-decoration: none;
}
.btn-icon { font-size: 1.2em; }
.btn-mini {
  padding: 8px 14px;
  border-radius: 100px;
  border: 2px solid var(--primary);
  background: white;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-mini:hover { background: var(--primary); color: white; transform: translateY(-2px); }
.btn-mini:active { transform: translateY(0); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 32px 100px;
  min-height: 80vh;
}
.hero-text h1 { margin-bottom: 24px; }
.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.hero-cta {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.hero-trust {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Desktop mockup */
.hero-art { position: relative; }
.desktop-mock {
  background: linear-gradient(135deg, #2A1A5E 0%, #6B2D8E 40%, #B8439C 75%, #FF7A4A 100%);
  border-radius: var(--radius-md);
  padding: 0;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  position: relative;
  transform: perspective(1000px) rotateY(-8deg) rotateX(2deg);
  transition: transform 0.5s;
}
.desktop-mock:hover {
  transform: perspective(1000px) rotateY(-3deg) rotateX(1deg);
}
.desktop-bar {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  height: 28px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
  color: white;
  font-size: 12px;
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.dot-spacer { flex: 1; }
.menubar-glucose {
  font-weight: 700;
  color: #6ee36b;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
  font-size: 13px;
  transition: color 0.5s;
}
.desktop-body {
  position: relative;
  height: calc(100% - 28px);
}
.widget-mock {
  position: absolute;
  top: 20px;
  right: 24px;
  color: white;
  text-shadow:
    0 0 5px rgba(0, 0, 0, 0.95),
    0 0 3px rgba(0, 0, 0, 0.95),
    0 1px 2px rgba(0, 0, 0, 0.95);
  text-align: right;
  line-height: 1;
}
.widget-value-line { font-weight: 700; font-size: 44px; }
.widget-value { transition: color 0.5s; color: #6ee36b; }
.widget-arrow {
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.5s, color 0.5s;
  color: #6ee36b;
}
.widget-meta {
  font-size: 13px;
  margin-top: 8px;
  opacity: 0.95;
  line-height: 1.3;
}
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 40px 16px 60px;
  }
  .hero-text { order: 1; }
  .hero-art { order: 2; max-width: 480px; margin: 0 auto; width: 100%; }
  .hero-cta { justify-content: center; }
  .hero-trust { justify-content: center; }
  .desktop-mock { transform: none; }
}

/* ---------- Why section ---------- */
.why {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  text-align: center;
}
.why h2 { margin-bottom: 48px; }
.why-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
}
.why-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.why-bad { border-top: 4px solid #FFB199; }
.why-good { border-top: 4px solid var(--accent-cyan); }
.why-emoji { font-size: 3rem; text-align: center; margin-bottom: 8px; }
.why-title {
  text-align: center;
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 16px;
  color: var(--text);
}
.why-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.why-card li {
  padding: 8px 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
  font-size: 0.95rem;
}
.why-card li:last-child { border-bottom: none; }
.vs {
  font-weight: 900;
  color: var(--primary);
  font-size: 1.5rem;
  text-shadow: 2px 2px 0 white;
}
@media (max-width: 720px) {
  .why-compare { grid-template-columns: 1fr; }
  .vs { transform: rotate(90deg); padding: 8px 0; }
}

/* ---------- Features grid ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.feature-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}
.feature-color::before { background: linear-gradient(90deg, #6ee36b, #f5d442, #ff5252); }
.feature-trend::before { background: linear-gradient(90deg, var(--accent-cyan), var(--primary)); }
.feature-alarm::before { background: linear-gradient(90deg, var(--accent-yellow), var(--accent-coral)); }
.feature-lang::before { background: linear-gradient(90deg, var(--primary-2), var(--accent-cyan)); }
.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}
.feature-icon { font-size: 2.5rem; margin-bottom: 12px; }
.feature-card h3 { margin-bottom: 12px; }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; margin: 12px 0 0; }
.feature-tip {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  margin-top: 8px;
  display: inline-block;
}

/* Feature: color demo */
.feature-mini-widget {
  background: #1a1a1a;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 12px 0;
  text-align: center;
  color: white;
  transition: background 0.4s;
}
.dv-value {
  font-size: 2.2rem;
  font-weight: 800;
  display: inline-block;
  transition: color 0.4s;
  color: #6ee36b;
}
.dv-unit { color: rgba(255, 255, 255, 0.6); font-size: 0.85rem; margin-left: 6px; }

/* Feature: trend svg */
.feature-svg {
  width: 100%;
  height: 90px;
  margin: 8px 0;
}
.feature-svg path { transition: stroke 0.4s; }

/* Feature: alarm buttons */
.alarm-buttons {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}

/* Feature: lang demo */
.lang-demo {
  background: linear-gradient(135deg, #FFE0EC 0%, #C9E4FF 100%);
  border-radius: var(--radius-sm);
  padding: 24px 16px;
  margin: 12px 0;
  text-align: center;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text);
  transition: background 0.4s;
}

/* ---------- Multi-user section ---------- */
.multi {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
}
.multi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.multi-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-cyan), var(--primary-2));
  color: white;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}
.multi-text h2 { margin-bottom: 16px; }
.multi-text > p { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 20px; }
.multi-list { list-style: none; padding: 0; margin: 0; }
.multi-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  font-size: 1rem;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.07);
}
.multi-list li:last-child { border-bottom: none; }
.multi-emoji { font-size: 1.4rem; flex-shrink: 0; }
.multi-art img {
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transform: perspective(1000px) rotateY(6deg) rotateX(2deg);
  transition: transform 0.5s;
}
.multi-art img:hover {
  transform: perspective(1000px) rotateY(2deg) rotateX(1deg);
}
.multi-caption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 12px;
}
@media (max-width: 860px) {
  .multi-grid { grid-template-columns: 1fr; gap: 32px; }
  .multi-art img { transform: none; }
}

/* ---------- How (steps) ---------- */
.steps {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 800px;
  margin: 0 auto;
}
.step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  align-items: start;
  background: white;
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s;
}
.step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.step-number {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
}
.step-content h3 { margin-bottom: 12px; }
.step-content p { color: var(--text-muted); }
.step-link {
  display: inline-block;
  margin-top: 8px;
  font-weight: 700;
  color: var(--primary);
}
.step-img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 600px) {
  .step { grid-template-columns: 1fr; padding: 20px; }
  .step-number { width: 48px; height: 48px; font-size: 1.3rem; }
}

/* ---------- Download cards ---------- */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}
.dl-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s;
  border: 3px solid transparent;
}
.dl-card.recommended {
  border-color: var(--accent-cyan);
  transform: scale(1.04);
  box-shadow: var(--shadow-md);
}
.dl-card.recommended::after {
  content: '✨ 為你的電腦推薦';
  display: inline-block;
  background: var(--accent-cyan);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
  margin-top: 12px;
}
.dl-card:hover {
  transform: translateY(-6px);
}
.dl-card.recommended:hover {
  transform: scale(1.04) translateY(-6px);
}
.dl-platform { font-size: 3rem; margin-bottom: 8px; }
.dl-name { font-weight: 700; font-size: 1.1rem; }
.dl-hint { color: var(--text-muted); font-size: 0.85rem; margin: 4px 0 20px; }
.dl-btn {
  width: 100%;
  justify-content: center;
}
.dl-size { font-size: 0.85rem; opacity: 0.85; font-weight: 500; }

.install-warnings {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: var(--radius-md);
  padding: 20px 28px;
  box-shadow: var(--shadow-sm);
}
.install-warnings summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--primary);
  padding: 8px 0;
}
.warnings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
}
.warnings-grid h4 { margin: 0 0 8px; font-size: 1rem; }
.warnings-grid p { font-size: 0.9rem; color: var(--text-muted); margin: 4px 0; }
.warnings-grid code { font-size: 0.8rem; }

/* ---------- FAQ ---------- */
.faq {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
}
.faq details {
  background: white;
  border-radius: var(--radius-md);
  margin: 12px auto;
  max-width: 800px;
  padding: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.3s;
}
.faq details[open] { box-shadow: var(--shadow-md); }
.faq summary {
  font-weight: 700;
  font-size: 1.05rem;
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  position: relative;
}
.faq summary::after {
  content: '+';
  position: absolute;
  right: 24px;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--primary);
  transition: transform 0.3s;
}
.faq details[open] summary::after {
  content: '−';
  transform: rotate(180deg);
}
.faq summary::-webkit-details-marker { display: none; }
.faq-body {
  padding: 0 24px 20px;
  color: var(--text-muted);
}
.faq-body p { margin: 8px 0; }

/* ---------- Footer ---------- */
.footer {
  background: linear-gradient(135deg, #2A1A5E 0%, #6B2D8E 100%);
  color: white;
  padding: 60px 24px 40px;
  position: relative;
  z-index: 2;
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.footer-brand p { color: rgba(255, 255, 255, 0.7); margin-top: 8px; font-size: 0.95rem; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.95rem;
}
.footer-links a:hover { color: white; text-decoration: underline; }
.footer-disclaimer {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 24px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
}
.footer-disclaimer strong { color: var(--accent-yellow); }

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 480px) {
  section { padding: 60px 16px; }
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.6rem; }
  .container { padding: 0 16px; }
  .nav-links a:nth-child(n+3) { display: none; }
}
