/* ============================================================
 *  中芳堂美业AI智能体系统 V4.0 — 响应式布局
 *  覆盖所有页面的移动端/平板适配
 * ============================================================ */

/* ---- 移动端导航（汉堡菜单） ---- */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex-direction: column; gap: 5px; z-index: 1001; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.3s; }
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a { color: var(--text); text-decoration: none; padding: 8px 14px; border-radius: 8px; font-size: 14px; transition: all 0.2s; white-space: nowrap; }
.nav-links a:hover { color: var(--cyan); background: rgba(0,229,255,0.08); }
.nav-links a.active { color: var(--cyan); font-weight: 600; }

.nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 998; }

/* ---- 平板 (≤1024px) ---- */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .brand-grid { grid-template-columns: 1fr; }
}

/* ---- 平板竖屏/手机横屏 (≤768px) ---- */
@media (max-width: 768px) {
  /* 导航 */
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: fixed; top: 0; right: -280px; width: 280px; height: 100vh;
    background: var(--bg); flex-direction: column; padding: 80px 24px 24px;
    z-index: 999; transition: right 0.3s; gap: 4px;
    box-shadow: -4px 0 20px rgba(0,0,0,0.4);
  }
  .nav-links.open { right: 0; display: flex; }
  .nav-links a { padding: 14px 16px; font-size: 16px; width: 100%; border-radius: 10px; }
  .nav-overlay.open { display: block; }

  /* Hero */
  .hero-section { padding: 40px 16px; min-height: auto; }
  .hero-title { font-size: 1.8rem; }
  .hero-subtitle { font-size: 1rem; }

  /* 通用网格 */
  .capability-grid, .services-grid, .team-grid, .blog-grid,
  .cases-grid, .franchise-grid, .package-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* 卡片 */
  .glass-card, .card { padding: 16px; }

  /* 侧边栏布局 */
  .sidebar { width: 100%; position: relative; }
  .main-content { margin-left: 0; }

  /* 品牌体验馆 */
  .brand-hero { height: 50vh; }
  .brand-hero-title { font-size: 2rem; }

  /* 管理后台 */
  .console-sidebar { width: 260px; transform: translateX(-100%); position: fixed; z-index: 100; }
  .console-sidebar.open { transform: translateX(0); }
  .console-main { margin-left: 0; padding: 16px; }

  /* 数据中台 */
  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .chart-panel { min-height: 300px; }
  .model-viewport { height: 300px; }

  /* 关于页时间线 */
  .timeline { padding-left: 20px; }
  .timeline-item { flex-direction: column; }

  /* 加盟页表格 */
  .invest-table { display: block; overflow-x: auto; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- 手机竖屏 (≤480px) ---- */
@media (max-width: 480px) {
  /* 导航 */
  .navbar-brand { font-size: 1rem; }

  /* Hero */
  .hero-title { font-size: 1.4rem; }
  .hero-subtitle { font-size: 0.85rem; }

  /* 网格 */
  .stats-grid { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr; }
  .date-grid { grid-template-columns: repeat(3, 1fr); }
  .time-grid { grid-template-columns: repeat(2, 1fr); }

  /* 卡片 */
  .kpi-card { padding: 12px; }
  .glass-card { padding: 12px; }

  /* 按钮 */
  .btn { padding: 10px 20px; font-size: 14px; }
  .btn-block { width: 100%; }

  /* 表单 */
  .form-input, .form-select, .form-textarea { font-size: 16px; } /* 防止iOS缩放 */

  /* 隐藏桌面端专属元素 */
  .hide-mobile { display: none !important; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; }
  .footer { text-align: center; padding: 30px 16px; }

  /* 体质检测 */
  .tizhi-options { grid-template-columns: 1fr; }
  .tizhi-result-card { padding: 16px; }

  /* 品牌体验馆 */
  .brand-hero { height: 40vh; }
  .brand-hero-title { font-size: 1.5rem; }
  .parallax-section { padding: 40px 16px; }
}

/* 桌面端显示专用 */
@media (min-width: 769px) {
  .show-mobile-only { display: none !important; }
}
