
/* ==========================================
   TELEGRAM - HOMEPAGE CSS | BLUE THEME
   Responsive: PC / Tablet / Mobile
   ========================================== */

/* VARIABLES */
:root {
  --tg-accent: #229ed9;
  --tg-accent-dark: #0c74a8;
  --tg-ink: #172c42;
  --tg-muted: #5e7185;
  --tg-border: #dbe8f3;
  --tg-soft: #e7f5ff;
}

/* GLOBAL */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--tg-ink);
  background: #f4f9fd;
  font-family: -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

.site-shell {
  min-height: 100vh;
}

/* HEADER */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--tg-border);
}

.header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  color: var(--tg-ink);
  text-decoration: none;
  white-space: nowrap;
}

.site-wordmark-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  background: var(--tg-accent);
  font-size: 28px;
}

.site-wordmark-domain {
  color: var(--tg-muted);
  font-size: 13px;
  font-weight: 500;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
}

.site-nav a {
  color: var(--tg-ink);
  font-size: 14px;
  text-decoration: none;
  font-weight: 600;
}

.site-nav a:hover,
.footer-column a:hover {
  color: var(--tg-accent);
}

/* MAIN LAYOUT */
.homepage-main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 36px 24px 56px;
}

.homepage-main > section {
  margin: 0 0 28px;
}

.download-panel,
.content-section {
  border-radius: 24px;
  padding: 44px;
  border: 1px solid var(--tg-border);
  box-shadow: 0 8px 30px rgba(22, 33, 49, 0.04);
}

.content-section {
  background: #fff;
}

/* BLOCK 1 - HERO */
.hero-panel {
  background: linear-gradient(
    120deg,
    #ecf7ff 0%,
    #fff 73%
  );
  display: grid;
  grid-template-columns:
    minmax(0, 1.6fr)
    minmax(250px, .85fr);
  gap: 30px;
  align-items: center;
}

.official-badge {
  display: inline-flex;
  width: fit-content;
  background: #d9efff;
  color: #096d9e;
  border-radius: 50px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 18px;
}

.hero-panel .homepage-title {
  font-size: clamp(40px, 6vw, 66px);
  letter-spacing: -.025em;
  line-height: 1.14;
  margin: 0 0 16px;
  color: var(--tg-ink);
}

.hero-subtitle {
  color: #254560;
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 16px;
}

.download-intro,
.section-heading p,
.feature-card p,
.version-system,
.install-step li,
.faq-answer p {
  font-size: 15.5px;
  line-height: 1.9;
}

.download-intro,
.section-heading p {
  color: var(--tg-muted);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.version-download-btn {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  background: var(--tg-accent-dark);
  color: white;
  padding: 14px 22px;
  min-height: 48px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition:
    background .2s ease,
    transform .2s ease;
}

.version-download-btn:hover {
  color: #fff;
  background: #075b8c;
  transform: translateY(-1px);
}

.hero-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid #9bd2f1;
  border-radius: 12px;
  color: #137bad;
  text-decoration: none;
  font-weight: 700;
}

.hero-secondary-btn:hover {
  background: #e6f5ff;
}

.hero-note {
  margin: 18px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: #71869a;
}

/* HERO ASIDE */
.hero-aside {
  border: 1px solid #c9e6f7;
  background: #fff;
  border-radius: 18px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-aside-caption {
  font-size: 14px;
  color: #166e9c;
  font-weight: 700;
  margin-bottom: 2px;
}

.hero-device {
  padding: 13px 16px;
  background: #f0f9ff;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
}

.hero-device span {
  display: inline-block;
  width: 24px;
  color: var(--tg-accent);
}

.hero-aside small {
  color: var(--tg-muted);
  line-height: 1.7;
}

/* SECTION HEADINGS */
.section-heading {
  max-width: 850px;
  margin: 0 0 26px;
}

.section-heading h2 {
  font-size: clamp(25px, 3.2vw, 34px);
  line-height: 1.3;
  color: var(--tg-ink);
  margin: 0 0 18px;
}

.section-heading p {
  margin: 0 0 12px;
}

/* BLOCK 2 - FEATURES */
.feature-grid,
.download-version-grid,
.install-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-card,
.download-version-card,
.install-step {
  border: 1px solid var(--tg-border);
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  min-width: 0;
}

.feature-card {
  background: #f8fbff;
}

.feature-card h3,
.download-version-card h3,
.install-step h3 {
  margin: 0 0 12px;
  color: var(--tg-ink);
  font-size: 18px;
  line-height: 1.5;
}

.feature-card p {
  color: var(--tg-muted);
  margin: 0;
}

.section-footnote {
  color: var(--tg-muted);
  font-size: 14px;
  line-height: 1.85;
  margin: 20px 0 0;
}

/* BLOCK 3 - DOWNLOAD */
.download-section {
  background: #f3faff;
}

.download-version-card {
  display: flex;
  flex-direction: column;
  background: #fff;
}

.download-version-icon {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f7ff;
  border-radius: 16px;
  margin-bottom: 16px;
}

.download-version-icon img {
  max-height: 48px;
  max-width: 48px;
  object-fit: contain;
}

.version-tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 10px;
  color: #147eae;
  background: #e4f3ff;
  border-radius: 50px;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 12px;
}

.version-system {
  margin: 0 0 12px;
  color: var(--tg-muted);
  flex: 1;
}

.version-meta {
  margin: 0 0 20px;
  font-size: 13px;
  color: #688096;
}

.version-actions {
  margin-top: auto;
}

.version-actions .version-download-btn {
  width: 100%;
  padding-inline: 14px;
  text-align: center;
}

.download-circle {
  font-size: 18px;
  line-height: 1;
}

.system-note {
  margin: 22px 0 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--tg-muted);
}

.system-note a,
.faq-answer a,
.footer-source-note a {
  color: #0872a8;
  text-underline-offset: 3px;
}

/* BLOCK 4 - INSTALL STEPS */
.install-step {
  background: #f7fbff;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--tg-soft);
  color: var(--tg-accent-dark);
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 16px;
}

.install-step ol {
  padding-left: 21px;
  margin: 10px 0 18px;
}

.install-step li {
  color: var(--tg-muted);
  padding-left: 3px;
  margin-bottom: 6px;
}

.text-link {
  font-size: 14px;
  font-weight: 700;
  color: var(--tg-accent-dark);
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

/* BLOCK 5 - FAQ */
.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--tg-border);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.55;
  padding: 19px 22px;
  color: var(--tg-ink);
}

.faq-item summary::marker {
  color: var(--tg-accent);
}

.faq-item[open] {
  border-color: #89c8ed;
}

.faq-answer {
  padding: 0 22px 18px;
}

.faq-answer p {
  color: var(--tg-muted);
  margin: 0;
}

/* FOOTER */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--tg-border);
}

.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 42px 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 50px;
}

.footer-brand-name {
  font-size: 21px;
  font-weight: 800;
  color: var(--tg-ink);
  margin: 0 0 12px;
}

.footer-brand p:not(.footer-brand-name),
.footer-column a {
  color: var(--tg-muted);
  font-size: 14px;
  line-height: 1.9;
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.footer-heading {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--tg-ink);
}

.footer-column a {
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid var(--tg-border);
}

.footer-bottom-inner {
  max-width: 1160px;
  margin: auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: #71869a;
  font-size: 12px;
}

/* TABLET */
@media (max-width: 900px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-aside {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-aside-caption,
  .hero-aside small {
    grid-column: 1 / -1;
  }

  .feature-grid,
  .download-version-grid,
  .install-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-inner {
    gap: 28px;
  }
}

/* MOBILE */
@media (max-width: 640px) {
  .header-inner {
    padding: 14px 18px;
    flex-direction: column;
    align-items: flex-start;
  }

  .site-wordmark {
    font-size: 20px;
  }

  .site-wordmark-domain {
    font-size: 12px;
  }

  .site-nav {
    gap: 14px;
  }

  .site-nav a {
    font-size: 13px;
  }

  .homepage-main {
    padding: 18px 14px 38px;
  }

  .download-panel,
  .content-section {
    padding: 25px 19px;
    border-radius: 18px;
  }

  .hero-panel .homepage-title {
    font-size: 42px;
  }

  .hero-subtitle {
    font-size: 17px;
  }

  .hero-aside {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .hero-aside-caption,
  .hero-aside small {
    grid-column: auto;
  }

  .feature-grid,
  .download-version-grid,
  .install-steps {
    grid-template-columns: 1fr;
  }

  .feature-card,
  .download-version-card,
  .install-step {
    padding: 21px;
  }

  .footer-inner {
    padding: 32px 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom-inner {
    padding: 16px 20px;
    flex-direction: column;
    gap: 5px;
  }
}

/* ACCESSIBILITY */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .version-download-btn {
    transition: none;
  }
}
