/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1a365d;
  --primary-light: #2a4a7f;
  --primary-dark: #0f2440;
  --accent: #3182ce;
  --bg: #f7f8fa;
  --white: #ffffff;
  --gray-100: #f1f3f5;
  --gray-200: #e2e6ea;
  --gray-500: #6c757d;
  --gray-700: #495057;
  --gray-900: #212529;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --transition: 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--gray-900);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary);
}

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

/* ===== Layout ===== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-content {
  min-height: calc(100vh - 160px);
  padding: 48px 0;
}

/* ===== Navigation ===== */
.site-nav {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo-wrapper {
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: 1fr 1fr;
}

.nav-brand {
  display: grid;
  grid-template-rows: 1fr 16px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  position: relative;
  height: 100%;
  padding: 5px 0;
  &::before {
    content: '';
    position: absolute;
    display: block;
    background: var(--logo-url) no-repeat center/contain;
    height: 56px;
    width: 48px;
    left: 0;
    bottom: 4px;
  }
}

.nav-logo {
  height: 60px;
  width: auto;
  grid-row: 1 / span 2;
}

.nav-logo-name {
  display: flex;
  flex-direction: column;
  line-height: 1;
  padding-left: 42px;

  &:first-of-type {
    justify-content: flex-end;
    font-size: 18px;
  }
  &:last-of-type {
    justify-content: flex-start;
    font-size: 11.5px;
  }
}

.nav-brand:hover {
  color: var(--primary-light);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--gray-700);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gray-700);
  margin: 5px 0;
  transition: all var(--transition);
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 80px 0 64px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hero .slogan {
  font-size: 1.2rem;
  color: var(--gray-500);
  margin-bottom: 24px;
  font-weight: 400;
}

.hero .intro {
  font-size: 1.05rem;
  color: var(--gray-700);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ===== Section ===== */
.section {
  padding: 48px 0;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* ===== Cards Grid ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  display: block;
}

.card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.card p {
  color: var(--gray-700);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ===== App Card (大卡片) ===== */
.app-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 28px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.app-card .app-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.app-card .app-icon-img {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  flex-shrink: 0;
  object-fit: cover;
}

.app-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.app-card h3 a {
  color: var(--primary);
  text-decoration: none;
}

.app-card h3 a:hover {
  color: var(--accent);
}

.app-card p {
  color: var(--gray-700);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ===== App Detail Page ===== */
.app-header {
  text-align: center;
  padding: 60px 0 40px;
}

.app-header-icon {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.app-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
}

.app-header .app-desc {
  font-size: 1.05rem;
  color: var(--gray-700);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.feature-card .feature-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}

.feature-card .feature-icon-img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  margin-bottom: 12px;
  object-fit: cover;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--gray-700);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ===== Screenshots Carousel ===== */
.screenshots-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.screenshots-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-200) transparent;
}

.screenshots-track::-webkit-scrollbar {
  height: 6px;
}

.screenshots-track::-webkit-scrollbar-track {
  background: transparent;
}

.screenshots-track::-webkit-scrollbar-thumb {
  background: var(--gray-200);
  border-radius: 3px;
}

.screenshot-img {
  flex-shrink: 0;
  height: 420px;
  width: auto;
  border-radius: 12px;
  box-shadow: var(--shadow);
  scroll-snap-align: start;
  transition: transform var(--transition);
}

.screenshot-img:hover {
  transform: scale(1.02);
}

.screenshots-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow);
  color: var(--primary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.screenshots-btn:hover {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-hover);
}

@media (max-width: 768px) {
  .screenshots-btn {
    display: none;
  }

  .screenshot-img {
    height: 320px;
  }
}

/* ===== Download Buttons ===== */
.download-section {
  text-align: center;
  padding: 40px 0;
}

.download-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--primary);
  color: var(--white);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
}

.btn-download:hover {
  background: var(--primary-light);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-download.disabled {
  background: var(--gray-200);
  color: var(--gray-500);
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== Legal Links ===== */
.legal-links {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-top: 16px;
}

.legal-links h2.legal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 0;
  margin-bottom: 16px;
}

.legal-links ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 0!important;
}

.legal-links a {
  color: var(--accent);
  font-weight: 500;
}

/* ===== Contact Page ===== */
.contact-header {
  text-align: center;
  padding: 60px 0 40px;
}

.contact-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
}

.contact-header p {
  color: var(--gray-700);
  font-size: 1.05rem;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 640px;
  margin: 0 auto;
}

.contact-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.contact-card .contact-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}

.contact-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.contact-card a {
  font-size: 0.95rem;
  color: var(--accent);
  word-break: break-all;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 32px 0;
  text-align: center;
  font-size: 0.88rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
}

.site-footer a:hover {
  color: var(--white);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  list-style: none;
  margin-bottom: 16px;
}

.footer-copy {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.5);
}

/* ===== Markdown Content (法律文件等) ===== */
.page-content h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.page-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 32px;
  margin-bottom: 12px;
}

.page-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-top: 24px;
  margin-bottom: 8px;
}

.page-content p {
  margin-bottom: 16px;
  color: var(--gray-700);
}

.page-content ul,
.page-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
  color: var(--gray-700);
}

.page-content li {
  margin-bottom: 6px;
}

.page-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 20px 0;
  background: var(--gray-100);
  border-radius: 0 8px 8px 0;
  color: var(--gray-500);
  font-size: 0.9rem;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.6s ease forwards;
}

.fade-in-delay-1 {
  animation-delay: 0.1s;
}

.fade-in-delay-2 {
  animation-delay: 0.2s;
}

.fade-in-delay-3 {
  animation-delay: 0.3s;
}

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

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 16px 24px;
    gap: 0;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 0;
    border-bottom: none;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero .slogan {
    font-size: 1rem;
  }

  .section {
    padding: 32px 0;
  }

  .section-title {
    font-size: 1.3rem;
    margin-bottom: 28px;
  }

  .app-card {
    flex-direction: column;
    padding: 28px 24px;
  }

  .app-header h1 {
    font-size: 1.7rem;
  }

  .contact-header h1 {
    font-size: 1.7rem;
  }
}