/**
 * 全站移动端适配（首页 / 用户中心 / 管理后台）
 */

.tc-nav-toggle,
.tc-mobile-backdrop {
  display: none;
}

@media (max-width: 768px) {
  :root {
    --tc-sidebar-w: min(280px, 88vw);
    --tc-mobile-pad: 16px;
  }

  /* ---------- 顶栏 ---------- */
  .tc-header-inner {
    gap: 8px;
    padding: 0 var(--tc-mobile-pad);
  }

  .tc-logo {
    margin-right: 0;
    min-width: 0;
    flex: 1 1 auto;
  }

  .tc-logo-img {
    height: 26px;
    max-width: min(200px, 46vw);
  }

  .tc-header-spacer {
    display: none;
  }

  .tc-header-right {
    flex-shrink: 0;
    gap: 8px;
  }

  .tc-user-meta {
    display: none;
  }

  .tc-user-trigger {
    padding: 4px;
  }

  .tc-btn {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
  }

  .tc-nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    border: 1px solid var(--tc-border);
    border-radius: 8px;
    background: var(--tc-white);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .tc-nav-toggle__bar {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 1px;
    background: var(--tc-text-title);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .tc-layout--console.tc-sidebar-open .tc-nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .tc-layout--console.tc-sidebar-open .tc-nav-toggle__bar:nth-child(2) {
    opacity: 0;
  }

  .tc-layout--console.tc-sidebar-open .tc-nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* ---------- 侧栏抽屉（用户中心 / 后台） ---------- */
  .tc-mobile-backdrop {
    display: none;
  }

  .tc-layout--console.tc-sidebar-open .tc-mobile-backdrop {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    top: var(--tc-header-h);
    bottom: 0;
    z-index: 240;
    background: rgba(0, 0, 0, 0.45);
    -webkit-tap-highlight-color: transparent;
  }

  body.tc-scroll-lock {
    overflow: hidden;
    touch-action: none;
  }

  .tc-layout--console .tc-sidebar {
    width: var(--tc-sidebar-w);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: none;
    z-index: 250;
    -webkit-overflow-scrolling: touch;
  }

  .tc-layout--console.tc-sidebar-open .tc-sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.14);
  }

  .tc-layout--console .tc-main {
    margin-left: 0 !important;
    width: 100%;
    max-width: none;
    padding: 12px var(--tc-mobile-pad) calc(12px + var(--tc-footer-h));
    min-height: calc(100vh - var(--tc-header-h) - var(--tc-footer-h));
    min-height: calc(100dvh - var(--tc-header-h) - var(--tc-footer-h));
  }

  .tc-layout--console .tc-site-footer {
    left: 0;
    padding: 0 var(--tc-mobile-pad);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .tc-sidebar-menu a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  /* ---------- 主内容通用 ---------- */
  .tc-layout:not(.tc-layout--landing) .tc-main {
    padding-left: var(--tc-mobile-pad);
    padding-right: var(--tc-mobile-pad);
  }

  .tc-page-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .tc-page-head .tc-page-title {
    font-size: 18px;
    line-height: 1.35;
  }

  .tc-page-head .tc-page-desc {
    font-size: 12px;
  }

  .tc-panel__hd,
  .tc-panel__bd {
    padding-left: 14px;
    padding-right: 14px;
  }

  .tc-panel__hd {
    flex-wrap: wrap;
    gap: 8px;
  }

  .tc-panel__actions,
  .tc-toolbar {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .tc-panel__actions .tc-btn,
  .tc-toolbar .tc-btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .tc-data-table,
  .tc-table-wrap,
  table.tc-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tc-form-row,
  .tc-grid-3,
  .tc-grid-2,
  .tc-quick-grid,
  .tc-shop-grid {
    grid-template-columns: 1fr !important;
  }

  .tc-form-item .tc-input,
  .tc-form-item .tc-select,
  .tc-form-item textarea {
    width: 100%;
    max-width: none;
  }

  .tc-pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .tc-user-dropdown.is-open .tc-user-menu {
    position: fixed;
    top: calc(var(--tc-header-h) + 4px);
    right: var(--tc-mobile-pad);
    left: auto;
    min-width: 160px;
    max-width: calc(100vw - var(--tc-mobile-pad) * 2);
  }

  .tc-dialog__panel {
    width: calc(100vw - 32px);
    max-width: none;
    margin: 16px auto;
  }

  .tc-header {
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }

  /* ---------- 首页落地页 / 授权查询 ---------- */
  .tc-layout--landing .tc-header-inner,
  .tc-layout--license-query .tc-header-inner {
    flex-wrap: nowrap;
  }

  .lp-hero--cinema {
    min-height: auto;
    padding-top: 32px;
  }

  .lp-impact__headline {
    flex-wrap: wrap;
    justify-content: center;
  }

  .lp-showcase__tabs {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .lp-showcase__tab {
    flex-shrink: 0;
  }

  .lp-showcase__panels {
    min-height: 0;
  }

  .lp-showcase__panel {
    position: relative;
    grid-template-columns: 1fr;
  }

  .lp-footer__cta-inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .lp-footer__cta-actions {
    justify-content: center;
  }

  .lp-footer__cta-actions .lp-btn {
    width: 100%;
    max-width: 320px;
  }

  .lp-footer__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .lp-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  /* ---------- 工单 / 商城等 ---------- */
  .tc-ticket-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tc-ticket-actions .tc-btn {
    width: 100%;
  }

  .tc-shop-card,
  .tc-product-card {
    min-width: 0;
  }

  /* ---------- 安装向导 ---------- */
  .tc-setup-wrap {
    padding: 16px;
  }

  .tc-panel {
    border-radius: 10px;
  }
}

@media (max-width: 480px) {
  :root {
    --tc-mobile-pad: 12px;
  }

  .lp-hero__title {
    font-size: 26px;
  }

  .lp-impact__num {
    font-size: clamp(56px, 18vw, 88px);
  }

  .lp-marquee__item {
    font-size: 16px;
  }

  .tc-overview-card__hd {
    flex-wrap: wrap;
  }

  /* ---------- 用户中心首页 ---------- */
  .tc-main--overview {
    padding-left: var(--tc-mobile-pad);
    padding-right: var(--tc-mobile-pad);
  }

  .uc-home__row--triple > .uc-tile-card {
    border-radius: 6px;
  }

  .uc-profile-card,
  .uc-clock-card,
  .uc-home__row--bottom > .uc-pane-card {
    border-radius: 6px;
  }
}

@media (min-width: 769px) {
  .tc-nav-toggle {
    display: none !important;
  }

  .tc-mobile-backdrop {
    display: none !important;
  }
}
