/* TAOQI Mobile App Shell — Native View Transitions, Ceramic 4-Tab Bar Polish, Official Social Sheet & TMA Adaptation */

@view-transition {
  navigation: auto;
}
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

/* Native JustNews mobile footer-bar: frosted ceramic App-tab polish + iOS/Android safe-area */
@media (max-width: 767px) {
  .footer-bar {
    height: auto !important;
    min-height: 54px;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    background: rgba(255, 255, 255, 0.92) !important;
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid rgba(33, 56, 75, 0.09);
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.05);
  }
  .footer-bar .fb-item {
    min-height: 52px;
  }
  .footer-bar .fb-item a {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease, color 0.15s ease;
  }
  .footer-bar .fb-item a:active {
    transform: scale(0.93);
  }
  .footer-bar .fb-item .fb-item-icon {
    font-size: 20px;
    line-height: 1;
  }
  .footer-bar .fb-item span {
    font-size: 11px;
    line-height: 1.2;
    font-weight: 500;
  }
  /* Active tab brand accent */
  .footer-bar .fb-item.tq-tab-active a,
  .footer-bar .fb-item.tq-tab-active span,
  .footer-bar .fb-item.tq-tab-active .wpcom-icon,
  .footer-bar .fb-item.tq-tab-active svg {
    color: var(--tq-accent, #8e24aa) !important;
    font-weight: 600;
  }
  .footer.width-footer-bar {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
}

/* Dark mode frosted ceramic bottom bar & active tab */
.style-for-dark .footer-bar {
  background: rgba(27, 32, 40, 0.92) !important;
}
.style-for-dark .footer-bar .fb-item.tq-tab-active a,
.style-for-dark .footer-bar .fb-item.tq-tab-active span,
.style-for-dark .footer-bar .fb-item.tq-tab-active .wpcom-icon,
.style-for-dark .footer-bar .fb-item.tq-tab-active svg {
  color: #d696ea !important;
}
@media (prefers-color-scheme: dark) {
  body.style-by-auto .footer-bar {
    background: rgba(27, 32, 40, 0.92) !important;
  }
  body.style-by-auto .footer-bar .fb-item.tq-tab-active a,
  body.style-by-auto .footer-bar .fb-item.tq-tab-active span,
  body.style-by-auto .footer-bar .fb-item.tq-tab-active .wpcom-icon,
  body.style-by-auto .footer-bar .fb-item.tq-tab-active svg {
    color: #d696ea !important;
  }
}

/* Official 4-platform Ceramic Bottom Sheet (#taoqi-social-sheet) */
.tq-sheet {
  position: fixed;
  inset: 0;
  z-index: 100020;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.tq-sheet.is-open,
.tq-sheet:target {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.tq-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.tq-sheet-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  background: var(--tq-surface, #ffffff);
  color: var(--tq-ink, #21384b);
  border-radius: 18px 18px 0 0;
  border-top: 1px solid var(--tq-border, rgba(33, 56, 75, 0.09));
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 32px rgba(15, 23, 42, 0.16);
  transform: translateY(24px);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.tq-sheet.is-open .tq-sheet-panel,
.tq-sheet:target .tq-sheet-panel {
  transform: translateY(0);
}
.tq-sheet-pill {
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: rgba(33, 56, 75, 0.18);
  margin: 0 auto 10px;
}
.tq-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.tq-sheet-head strong {
  font-size: 16px;
  font-weight: 600;
  color: inherit;
}
.tq-sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--tq-muted, #5b6d7c);
  background: rgba(33, 56, 75, 0.06);
  text-decoration: none !important;
}
.tq-soc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tq-soc-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--tq-bg, #f5f6f8);
  border: 1px solid var(--tq-border, rgba(33, 56, 75, 0.08));
  color: var(--tq-ink, #21384b) !important;
  text-decoration: none !important;
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.tq-soc-card:active {
  transform: scale(0.97);
}
.tq-soc-ico {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(142, 36, 170, 0.08);
  color: var(--tq-ink, #21384b);
}
.tq-soc-ico svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.tq-soc-xianyu .tq-soc-ico { background: rgba(255, 198, 0, 0.18); color: #b87800; }
.tq-soc-telegram .tq-soc-ico { background: rgba(34, 158, 217, 0.14); color: #1982b8; }
.tq-soc-whatsapp .tq-soc-ico { background: rgba(37, 211, 102, 0.14); color: #189647; }
.tq-shop-travel-esim .tq-soc-ico { background: rgba(34, 158, 217, 0.13); color: #1a73a8; }
.tq-shop-esim .tq-soc-ico { background: rgba(142, 36, 170, 0.11); color: #8e24aa; }
.tq-shop-charge .tq-soc-ico { background: rgba(212, 122, 99, 0.16); color: #b85842; }
.tq-shop-service .tq-soc-ico { background: rgba(33, 56, 75, 0.1); color: #21384b; }
.tq-soc-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tq-soc-meta strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: inherit;
}
.tq-soc-meta small {
  font-size: 11px;
  line-height: 1.3;
  color: var(--tq-muted, #5b6d7c);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tq-sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.tq-sheet-btn {
  flex: 1 1 0;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--tq-border, rgba(33, 56, 75, 0.12));
  background: var(--tq-bg, #f5f6f8);
  color: var(--tq-ink, #21384b);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  transition: transform 0.12s ease;
}
.tq-sheet-btn:active { transform: scale(0.97); }
.tq-sheet-btn-primary {
  border-color: transparent;
  background: var(--tq-accent, #8e24aa);
  color: #ffffff !important;
}
.tq-sheet-foot {
  margin-top: 12px;
  text-align: center;
}
.tq-sheet-foot-link {
  font-size: 12px;
  color: var(--tq-muted, #5b6d7c) !important;
  text-decoration: none !important;
}
.tq-ios-guide {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(142, 36, 170, 0.08);
  font-size: 12px;
  line-height: 1.6;
  color: var(--tq-ink, #21384b);
}
.tq-sheet-toast {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--tq-accent, #8e24aa);
  font-weight: 600;
}

/* Dark mode sheet styles (both manual .style-for-dark and auto body.style-by-auto) */
.style-for-dark .tq-sheet-panel {
  background: #1b2028;
  color: #e8eef5;
  border-top-color: rgba(255, 255, 255, 0.11);
}
.style-for-dark .tq-sheet-pill { background: rgba(255, 255, 255, 0.22); }
.style-for-dark .tq-sheet-close { background: rgba(255, 255, 255, 0.08); color: #b8c4d0; }
.style-for-dark .tq-soc-card,
.style-for-dark .tq-sheet-btn:not(.tq-sheet-btn-primary) {
  background: #232a35;
  border-color: rgba(255, 255, 255, 0.1);
  color: #e8eef5 !important;
}
.style-for-dark .tq-soc-meta small { color: #9aa8b8; }
.style-for-dark .tq-soc-ico { color: #e8eef5; }
.style-for-dark .tq-soc-xianyu .tq-soc-ico { color: #ffd24d; }
.style-for-dark .tq-soc-telegram .tq-soc-ico { color: #54bdf2; }
.style-for-dark .tq-soc-whatsapp .tq-soc-ico { color: #4ce384; }
.style-for-dark .tq-shop-travel-esim .tq-soc-ico { color: #5ec2f5; }
.style-for-dark .tq-shop-esim .tq-soc-ico { color: #d696ea; }
.style-for-dark .tq-shop-charge .tq-soc-ico { color: #f09d88; }
.style-for-dark .tq-shop-service .tq-soc-ico { color: #c4d3e3; }
.style-for-dark .tq-sheet-foot-link { color: #9aa8b8 !important; }
.style-for-dark .tq-ios-guide { background: rgba(185, 104, 209, 0.16); color: #e8eef5; }

@media (prefers-color-scheme: dark) {
  body.style-by-auto .tq-sheet-panel {
    background: #1b2028;
    color: #e8eef5;
    border-top-color: rgba(255, 255, 255, 0.11);
  }
  body.style-by-auto .tq-sheet-pill { background: rgba(255, 255, 255, 0.22); }
  body.style-by-auto .tq-sheet-close { background: rgba(255, 255, 255, 0.08); color: #b8c4d0; }
  body.style-by-auto .tq-soc-card,
  body.style-by-auto .tq-sheet-btn:not(.tq-sheet-btn-primary) {
    background: #232a35;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e8eef5 !important;
  }
  body.style-by-auto .tq-soc-meta small { color: #9aa8b8; }
  body.style-by-auto .tq-soc-ico { color: #e8eef5; }
  body.style-by-auto .tq-soc-xianyu .tq-soc-ico { color: #ffd24d; }
  body.style-by-auto .tq-soc-telegram .tq-soc-ico { color: #54bdf2; }
  body.style-by-auto .tq-soc-whatsapp .tq-soc-ico { color: #4ce384; }
  body.style-by-auto .tq-shop-travel-esim .tq-soc-ico { color: #5ec2f5; }
  body.style-by-auto .tq-shop-esim .tq-soc-ico { color: #d696ea; }
  body.style-by-auto .tq-shop-charge .tq-soc-ico { color: #f09d88; }
  body.style-by-auto .tq-shop-service .tq-soc-ico { color: #c4d3e3; }
  body.style-by-auto .tq-sheet-foot-link { color: #9aa8b8 !important; }
  body.style-by-auto .tq-ios-guide { background: rgba(185, 104, 209, 0.16); color: #e8eef5; }
}

/* Subtle WeChat in-app browser helper (only shown on commerce/account paths in WeChat) */
.tq-wx-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  z-index: 99980;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(33, 56, 75, 0.94);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.2);
}
.tq-wx-bar button {
  flex: 0 0 auto;
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
}

/* Telegram Mini App viewport polish */
html.tq-tma body {
  min-height: var(--tg-viewport-stable-height, 100dvh);
}
html.tq-tma .footer-bar {
  padding-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px)) !important;
}
