/* ============================================================
   SAISHI.CSS v3.1 - 赛事/文章/APP 页面专属样式
   ============================================================ */

:root {
  --color-primary: #128272;
  --color-primary-dark: #0b685d;
  --color-primary-darker: #074a40;
  --color-accent: #dfae4b;
  --color-accent-dark: #bc8c2e;
  --color-danger: #c14e3a;
  --color-text: #2a3233;
  --color-text-muted: #66716f;
  --color-bg: #f8f7f3;
  --color-bg-soft: #eff1ed;
  --color-bg-muted: #e3e7e1;
  --color-border: #c9d3cc;
  --color-border-soft: #dde4de;
  --gradient-hero: linear-gradient(135deg, #0b3432 0%, #0d635a 48%, #169681 100%);
  --gradient-icon: linear-gradient(160deg, #f0c864 0%, #cf9432 100%);
  --shadow-sm: 0 1px 2px rgba(18, 37, 35, 0.06), 0 1px 4px rgba(18, 37, 35, 0.06);
  --shadow-md: 0 2px 5px rgba(18, 37, 35, 0.05), 0 7px 16px -5px rgba(18, 37, 35, 0.12);
  --shadow-lg: 0 5px 12px -4px rgba(18, 37, 35, 0.09), 0 16px 34px -10px rgba(18, 37, 35, 0.18);
  --shadow-primary: 0 7px 18px -6px rgba(18, 130, 114, 0.36);
  --radius-md: 4px;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 260ms cubic-bezier(0.32, 0, 0.18, 1);
  --transition-slow: 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================
   1. Single Post (ArticleSection)
   ============================================ */
.single-post {
  overflow: hidden;
}

.single-post .post-meta {
  font-size: 0.9rem;
}

.single-post .post-meta i {
  color: var(--color-primary);
}

/* Post content typography */
.post-content {
  line-height: 1.8;
  font-size: 1.05rem;
  color: var(--color-text);
}

.post-content :is(h2, h3, h4) {
  margin-block: 2rem 1rem;
  font-weight: 700;
  color: var(--color-primary-darker);
  line-height: 1.4;
}

.post-content h2 {
  font-size: 1.75rem;
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--color-border);
}

.post-content h3 {
  font-size: 1.35rem;
}

.post-content :is(p, li) {
  margin-bottom: var(--space-sm);
}

.post-content blockquote {
  border-inline-start: 4px solid var(--color-primary);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-soft);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-block: var(--space-md);
  color: var(--color-text-muted);
  font-style: italic;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin-block: var(--space-sm);
  box-shadow: var(--shadow-sm);
}

.post-content a {
  color: var(--color-primary);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.post-content a:hover {
  color: var(--color-primary-dark);
}

.post-content ul,
.post-content ol {
  padding-inline-start: 1.5rem;
}

.post-content code {
  background: var(--color-bg-muted);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  color: var(--color-danger);
}

.post-content pre {
  background: var(--color-primary-darker);
  color: #f7faf8;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-block: var(--space-md);
}

.post-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-block: var(--space-md);
}

.post-content table th,
.post-content table td {
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-border);
  text-align: start;
}

.post-content table th {
  background: var(--color-bg-muted);
  font-weight: 600;
}

/* TOC */
.toc-box {
  border-inline-start: 3px solid var(--color-primary);
}

.toc-box ol {
  padding-inline-start: 1.2rem;
}

.toc-box ol li {
  margin: 0.4rem 0;
}

.toc-box ol li a {
  transition: all var(--transition-fast);
}

.toc-box ol li a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline !important;
  padding-inline-start: 4px;
}

/* Tags */
.post-tags .badge {
  background: var(--color-bg-muted) !important;
  color: #56636a !important;
  padding: 6px 12px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.post-tags .badge:hover {
  background: var(--color-primary) !important;
  color: #f7faf8 !important;
  transform: translateY(-1px);
}

/* Post nav */
.post-nav {
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.post-nav .btn {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   2. App Hero (AppHeroSection)
   ============================================ */
.app-hero-section {
  background: var(--gradient-hero);
  color: #f7faf8;
  position: relative;
  overflow: hidden;
}

.app-hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(4, 28, 26, 0.24);
  z-index: 0;
}

.app-hero-section > .container {
  position: relative;
  z-index: 1;
}

.app-hero-section h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
}

.app-hero-section img {
  transition: transform var(--transition-slow);
  filter: drop-shadow(0 16px 28px rgba(5, 28, 26, 0.35));
}

.app-hero-section img:hover {
  transform: translateY(-10px);
}

.text-white-50 {
  color: rgba(247, 250, 248, 0.72) !important;
}

/* ============================================
   3. App QR (AppQrSection)
   ============================================ */
.app-qr-section {
  background: var(--color-bg-soft);
}

.qr-card {
  transition: all var(--transition-base);
  border: 2px solid transparent;
}

.qr-card:hover {
  transform: scale(1.03);
  border-color: var(--color-accent);
  box-shadow: 0 8px 18px -6px rgba(12, 44, 43, 0.18), 0 2px 6px rgba(12, 44, 43, 0.06);
}

.qr-card img {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* ============================================
   4. App Install Steps (AppInstallSection)
   ============================================ */
.app-install-section {
  background: var(--color-bg-soft);
}

.app-install-section .badge.rounded-circle {
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
}

.app-install-section .bg-white {
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.app-install-section .bg-white:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.app-install-section .bg-white::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-icon);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--transition-base);
}

.app-install-section .bg-white:hover::before {
  transform: scaleY(1);
}

/* ============================================
   5. App Showcase (AppShowcaseSection)
   ============================================ */
.app-showcase-section {
  background: var(--color-bg);
}

.app-showcase-section img {
  transition: transform var(--transition-slow);
  filter: drop-shadow(0 10px 18px rgba(6, 32, 30, 0.18));
}

.app-showcase-section img:hover {
  transform: translateY(-5px) rotate(-1deg);
}

.app-showcase-section .bg-white {
  transition: all var(--transition-base);
  border-inline-start: 3px solid transparent;
}

.app-showcase-section .bg-white:hover {
  border-inline-start-color: var(--color-primary);
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

/* ============================================
   6. Contact Sections
   ============================================ */
.contact-channels-section {
  background: var(--color-bg);
}

.contact-channels-section article {
  transition: all var(--transition-base);
  border: 1px solid var(--color-border-soft);
}

.contact-channels-section article:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

.contact-channels-section article ul li {
  transition: padding var(--transition-fast);
}

.contact-channels-section article ul li:hover {
  padding-inline-start: 4px;
}

/* Contact Quick */
.contact-quick-section {
  background: var(--color-bg-soft);
}

.contact-quick-section .contact-card {
  transition: all var(--transition-base);
}

.contact-quick-section .contact-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.contact-quick-section .contact-card i {
  transition: transform var(--transition-base);
}

.contact-quick-section .contact-card:hover i {
  transform: scale(1.1) rotate(-5deg);
}

/* Contact Form */
.contact-form-section {
  background: var(--color-bg-soft);
}

.contact-form-section .form-control,
.contact-form-section .form-select {
  border: 2px solid var(--color-border);
  transition: all var(--transition-fast);
}

.contact-form-section .form-control:focus,
.contact-form-section .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(18, 130, 114, 0.12);
}

.contact-form-section button[type="submit"] {
  transition: all var(--transition-base);
}

.contact-form-section button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

/* Contact Commitments */
.contact-commitments-section {
  background: var(--color-bg-soft);
}

.contact-commitments-section .bg-white {
  transition: all var(--transition-base);
  text-align: center;
}

.contact-commitments-section .bg-white:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.contact-commitments-section .bg-white i {
  transition: transform var(--transition-base);
}

.contact-commitments-section .bg-white:hover i {
  transform: scale(1.15);
}

/* ============================================
   7. Login / Signup Forms
   ============================================ */
main:has(> .container > .bg-white > form) .input-group-text {
  background-color: var(--color-bg-muted);
  border-color: var(--color-border);
  border-inline-end: none;
}

main:has(> .container > .bg-white > form) .input-group .form-control {
  border-inline-start: none;
}

main:has(> .container > .bg-white > form) .input-group:focus-within .input-group-text {
  border-color: var(--color-primary);
  background-color: #e6f2ee;
}

main:has(> .container > .bg-white > form) .input-group:focus-within .form-control {
  border-color: var(--color-primary);
}

main:has(> .container > .bg-white > form) .form-check-input:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

main:has(> .container > .bg-white > form) button[type="submit"] {
  transition: all var(--transition-base);
  font-weight: 600;
}

main:has(> .container > .bg-white > form) button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

/* ============================================
   8. Icons
   ============================================ */
.icon-img {
  max-width: 32px;
  max-height: 32px;
  object-fit: contain;
}

.icon-emoji {
  display: inline-block;
  line-height: 1;
}

/* ============================================
   9. Hero Buttons
   ============================================ */
.hero-buttons .btn {
  transition: all var(--transition-base);
}

.hero-buttons .btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.hero-buttons .btn-warning {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-primary-darker);
  font-weight: 600;
}

.hero-buttons .btn-warning:hover {
  background-color: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
}

.hero-buttons .btn-outline-light:hover {
  background-color: rgba(247, 250, 248, 0.16);
  color: #f7faf8;
}

/* ============================================
   10. Custom Scrollbar
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-muted);
}

::-webkit-scrollbar-thumb {
  background: #a7afb5;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #a7afb5 var(--color-bg-muted);
}

/* ============================================
   11. Print Styles
   ============================================ */
@media print {
  :is(.header,
      .footer,
      .sidebar-widgets,
      .social-share,
      #back-to-top,
      .breadcrumb-nav,
      .notice-bar,
      .cta-banner-section,
      .post-nav,
      .related-posts,
      .author-box,
      .pagination,
      .navbar-toggler,
      .nav-item) {
    display: none !important;
  }

  body {
    background: #fdfdfb !important;
    color: #171b1f !important;
    font-size: 12pt;
  }

  .single-post {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .post-content {
    font-size: 11pt;
    line-height: 1.6;
  }

  a {
    text-decoration: underline;
    color: #171b1f !important;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #5f6b70;
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after,
  a[href^="mailto:"]::after,
  a[href^="tel:"]::after {
    content: "";
  }

  .post-content img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  :is(h1, h2, h3, h4) {
    page-break-after: avoid;
    color: #171b1f !important;
  }

  p, li {
    orphans: 3;
    widows: 3;
  }
}

/* ============================================
   12. Animations
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

.animate-fade-in {
  animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-pulse {
  animation: pulse 2.6s ease-in-out infinite;
}

/* ============================================
   13. Responsive
   ============================================ */
@media (max-width: 991.98px) {
  .post-content {
    font-size: 1rem;
  }

  .post-content h2 {
    font-size: 1.5rem;
  }

  .post-content h3 {
    font-size: 1.2rem;
  }
}

@media (max-width: 767.98px) {
  .single-post {
    padding: var(--space-md) !important;
  }

  .post-content {
    font-size: 0.95rem;
  }

  .post-content h2 {
    font-size: 1.35rem;
  }

  .post-nav {
    flex-direction: column;
  }

  .post-nav .btn {
    width: 100%;
  }

  .post-tags .badge {
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  .app-hero-section h1 {
    font-size: 1.75rem;
  }

  .app-install-section .badge.rounded-circle {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .toc-box {
    padding: var(--space-sm) !important;
  }

  .qr-card img {
    max-width: 140px !important;
  }
}

@media (max-width: 575.98px) {
    .app-hero-section .row .col-lg-7 {
        text-align: center;
        text-shadow: 0 1px 2px rgba(23, 18, 13, 0.06);
    }

    .app-hero-section .badge.bg-warning {
        font-size: 0.85rem;
        border-radius: 0.25rem;
        color: #4a2f00;
        background: linear-gradient(135deg, #ffdd66 0%, #f6b31c 100%) !important;
        box-shadow: 0 2px 6px -1px rgba(214, 158, 14, 0.35), 0 1px 3px rgba(120, 53, 15, 0.08);
        transition: box-shadow 0.18s cubic-bezier(0.2, 0.7, 0.3, 1);
    }

    .contact-channels-section article,
    .contact-quick-section .contact-card {
        padding: var(--space-md) !important;
        border-radius: 0.25rem;
        background-color: #fffdf8;
        box-shadow: 0 1px 2px rgba(23, 18, 13, 0.04), 0 2px 8px -1px rgba(23, 18, 13, 0.05);
        transition: box-shadow 0.2s ease;
    }
}