/* ============================================
   Studio Site - 响应式样式表
   Responsive Stylesheet
   断点: 480 / 767 / 991 / 1199 / 1399px
   ============================================ */

/* ---------- Large Desktop (1400px+) ---------- */
@media (min-width: 1400px) {
  .container { max-width: 1320px; }
}

/* ---------- Desktop (1200px - 1399px) ---------- */
/* 一级菜单增至 11 项后横排在 ≤1399px 放不下（会挤压 logo 或裁掉下拉），
   故汉堡断点由 991 提前到 1399；≥1400px 容器 1320px 才用横排。 */
@media (max-width: 1399px) {
  .container { max-width: 1140px; }
  .hero-visual { width: 40%; }

  /* Navigation → Hamburger */
  .navbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(255,255,255,0.98); }
  .navbar-nav {
    display: none; position: fixed; top: 61px; left: 0; right: 0; bottom: 0;
    background: var(--color-white); flex-direction: column; align-items: stretch;
    padding: var(--space-xl); overflow-y: auto; z-index: var(--z-modal);
  }
  .navbar-nav.open { display: flex !important; }
  .navbar-toggle { display: flex; }
  .nav-item { display: block; }
  .nav-link { display: block; padding: var(--space-md); font-size: var(--text-base); color: var(--text-primary); white-space: normal; }
  .dropdown-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; padding-left: var(--space-xl); display: none;
  }
  .nav-item.dropdown.open .dropdown-menu { display: block; }
  /* 2026-11-21：箭头移到独立按钮，栏目文字点击直接跳栏目首页（原 preventDefault 只展开不跳转） */
  .nav-item.dropdown .nav-link::after { content: none; }
  .nav-item.dropdown { display: flex; flex-wrap: wrap; align-items: center; }
  .nav-item.dropdown .nav-link { flex: 1 1 auto; }
  .nav-item.dropdown .dropdown-toggle {
    display: flex; flex: 0 0 44px; height: 44px; align-items: center; justify-content: center;
    border: 0; background: transparent; color: var(--text-primary); cursor: pointer; font-family: inherit;
  }
  .nav-item.dropdown .dropdown-toggle::after { content: '\25BE'; font-size: 14px; transition: transform var(--transition-fast); }
  .nav-item.dropdown.open .dropdown-toggle::after { transform: rotate(180deg); }
  .nav-item.dropdown .dropdown-menu { flex: 1 1 100%; }
  .navbar-actions .btn { display: none; }
  /* 2026-11-21：登录态操作在手机端移到菜单里（顶部按钮被上面隐藏），否则退不出/进不了个人中心 */
  .nav-user-actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    margin-top: var(--space-lg); padding-top: var(--space-lg); border-top: 1px solid var(--color-gray-200, #eee);
  }
  .nav-user-actions .nav-user-name { font-size: 14px; color: var(--text-secondary, #666); margin-right: auto; }
  .nav-user-actions a { display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 16px; border: 1px solid var(--color-primary, #2e7d32); border-radius: var(--radius-md, 8px);
    color: var(--color-primary, #2e7d32); font-size: 14px; text-decoration: none; }
  .nav-user-actions a.nav-logout { color: #e74c3c; border-color: #e74c3c; }
}

/* ---------- Tablet Landscape (992px - 1199px) ---------- */
@media (max-width: 1199px) {
  :root { --text-5xl: 2.5rem; --text-4xl: 2rem; --text-3xl: 1.75rem; }
  .container { max-width: 960px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .value-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
  .footer-grid .footer-brand { grid-column: span 2; }
  .hero-visual { width: 35%; }
  .team-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Tablet Portrait (768px - 991px) ---------- */
@media (max-width: 991px) {
  :root { --section-padding: 3.5rem 0; --text-5xl: 2.25rem; --text-4xl: 1.75rem; --text-3xl: 1.5rem; }

  /* Navigation → Hamburger */
  .navbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(255,255,255,0.98); }
  .navbar-nav {
    display: none; position: fixed; top: 61px; left: 0; right: 0; bottom: 0;
    background: var(--color-white); flex-direction: column; align-items: stretch;
    padding: var(--space-xl); overflow-y: auto; z-index: var(--z-modal);
  }
  .navbar-nav.open { display: flex !important; }
  .navbar-toggle { display: flex; }
  .nav-item { display: block; }
  .nav-link { display: block; padding: var(--space-md); font-size: var(--text-base); color: var(--text-primary); white-space: normal; }
  .dropdown-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; padding-left: var(--space-xl); display: none;
  }
  .nav-item.dropdown.open .dropdown-menu { display: block; }
  /* 2026-11-21：箭头移到独立按钮，栏目文字点击直接跳栏目首页（原 preventDefault 只展开不跳转） */
  .nav-item.dropdown .nav-link::after { content: none; }
  .nav-item.dropdown { display: flex; flex-wrap: wrap; align-items: center; }
  .nav-item.dropdown .nav-link { flex: 1 1 auto; }
  .nav-item.dropdown .dropdown-toggle {
    display: flex; flex: 0 0 44px; height: 44px; align-items: center; justify-content: center;
    border: 0; background: transparent; color: var(--text-primary); cursor: pointer; font-family: inherit;
  }
  .nav-item.dropdown .dropdown-toggle::after { content: '\25BE'; font-size: 14px; transition: transform var(--transition-fast); }
  .nav-item.dropdown.open .dropdown-toggle::after { transform: rotate(180deg); }
  .nav-item.dropdown .dropdown-menu { flex: 1 1 100%; }
  .navbar-actions .btn { display: none; }
  /* 2026-11-21：登录态操作在手机端移到菜单里（顶部按钮被上面隐藏） */
  .nav-user-actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    margin-top: var(--space-lg); padding-top: var(--space-lg); border-top: 1px solid var(--color-gray-200, #eee);
  }
  .nav-user-actions .nav-user-name { font-size: 14px; color: var(--text-secondary, #666); margin-right: auto; }
  .nav-user-actions a { display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 16px; border: 1px solid var(--color-primary, #2e7d32); border-radius: var(--radius-md, 8px);
    color: var(--color-primary, #2e7d32); font-size: 14px; text-decoration: none; }
  .nav-user-actions a.nav-logout { color: #e74c3c; border-color: #e74c3c; }

  /* Hero */
  .hero { min-height: auto; padding: 8rem 0 3rem; }
  .hero-visual { display: none; }
  .hero-content { max-width: 100%; }
  .hero-stats { gap: var(--space-xl); }

  /* Grids */
  .grid-3, .service-grid, .testimonial-grid { grid-template-columns: repeat(2, 1fr); }
  .career-path-track { flex-wrap: wrap; gap: 24px; justify-content: center; }
  .career-path-track::before { display: none; }
  .career-step-arrow { display: none; }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-card.featured { transform: none; }
  .pricing-card.featured:hover { transform: translateY(-4px); }
  .steps { grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
  .steps::before { display: none; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid .footer-brand { grid-column: span 2; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }

  /* Dashboard */
  .dashboard-sidebar { transform: translateX(-100%); transition: transform var(--transition-base); z-index: var(--z-modal); }
  .dashboard-sidebar.active { transform: translateX(0); }
  .dashboard-main { margin-left: 0; }
  .dashboard-toggle { display: block; }
}

/* ---------- Mobile (max-width: 767px) ---------- */
@media (max-width: 767px) {
  :root {
    --section-padding: 2.5rem 0; --text-5xl: 1.875rem; --text-4xl: 1.5rem;
    --text-3xl: 1.25rem; --text-2xl: 1.125rem;
    --space-xl: 1.5rem; --space-2xl: 2rem; --space-3xl: 2.5rem; --space-4xl: 3rem;
  }
  .container { padding: 0 var(--space-md); }

  /* Navigation */
  .navbar .container { height: 60px; }
  .navbar-brand .logo-text { font-size: var(--text-lg); }

  /* Hero */
  .hero { padding: 6rem 0 2rem; }
  /* 2026-11-18（用户）：h1 必须大于 h2；原来与 section-header h2 同为 3xl 倒挂 */
  .hero h1 { font-size: var(--text-4xl); margin-bottom: var(--space-md); }
  .hero p { font-size: var(--text-base); margin-bottom: var(--space-lg); }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-stats { flex-wrap: wrap; gap: var(--space-lg); }
  .hero-stat-item { flex: 1; min-width: 100px; }
  .hero-stat-item .stat-number { font-size: var(--text-2xl); }

  /* 2026-11-21（用户反馈「文章详情页乱版」）：知识库文章/专题/电子书详情用内联
     display:flex;gap:40px + 280px sticky 侧栏，内联优先级高于媒体查询，手机端左栏被压到
     标题/正文一字一行。用属性选择器精确命中这 5 个模板的内联布局，覆盖为单栏堆叠；
     不改模板内联样式（影响面大），正文与侧栏内容全保留。 */
  .section > .container > div[style*="gap:40px"][style*="flex-start"] { display: block !important; }
  aside[style*="width:280px"] {
    width: auto !important; max-width: 100% !important;
    position: static !important; top: auto !important;
    max-height: none !important; overflow: visible !important;
    margin-top: 32px !important;
  }
  /* Grids → Single Column */
  .grid-2, .grid-3, .grid-4, .grid-5, .service-grid, .testimonial-grid, .pricing-grid, .value-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step-item .step-number { width: 48px; height: 48px; font-size: var(--text-lg); }
  /* 2026-11-21（用户截图反馈「移动端整块页脚不要显示」）：
     隐藏品牌 + 成长平台/会员服务/关于我们整块链接网格，只保留下方版权行。
     页脚来自 sites.footer_html（运营手填 HTML），结构同为 .footer-grid，CSS 全局命中即可；
     桌面端（>767px）仍完整显示。 */
  .footer { padding: var(--space-lg) 0; }
  .footer-grid { display: none !important; }
  .footer-bottom { flex-direction: column; text-align: center; padding-top: 0; border-top: none; }

  /* Page Header */
  .page-header { padding: 5rem 0 2rem; }
  /* 2026-11-18（用户）：原 page-header h1 与 section-header h2 同为 3xl(20px)，
     移动端标题层级倒挂。h1 提到 4xl(24px)、h2 降到 2xl(18px)。 */
  .page-header h1 { font-size: var(--text-4xl); }

  /* Section Header */
  .section-header { margin-bottom: var(--space-xl); }
  .section-header h2 { font-size: var(--text-2xl); }
  .section-header p { font-size: var(--text-base); }

  /* Cards */
  .card-body { padding: var(--space-lg); }

  /* FAQ */
  .faq-question { padding: var(--space-md) var(--space-lg); }
  .faq-answer-inner { padding: 0 var(--space-lg) var(--space-md); }

  /* CTA */
  .cta-section { padding: var(--space-2xl) 0; }
  .cta-actions { flex-direction: column; align-items: center; }
  .cta-actions .btn { width: 100%; max-width: 300px; }

  /* Forms */
  .form-control { padding: 0.625rem 0.875rem; }

  /* Team */
  .team-grid { grid-template-columns: 1fr; max-width: 320px; margin: 0 auto; }

  /* Tabs */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { padding: var(--space-sm) var(--space-md); font-size: var(--text-sm); }

  /* Search */
  .search-box input { padding: 0.75rem 1rem; padding-right: 3rem; font-size: var(--text-sm); }
  .search-box .search-btn { width: 36px; height: 36px; font-size: var(--text-base); }

  /* Back to top */
  .back-to-top { bottom: 1.5rem; right: 1.5rem; width: 40px; height: 40px; font-size: var(--text-base); }

  /* Chat widget */
  .chat-widget .chat-btn { width: 52px; height: 52px; font-size: 24px; }
}

/* ---------- Small Mobile (max-width: 480px) ---------- */
@media (max-width: 480px) {
  :root { --text-5xl: 1.625rem; --text-4xl: 1.375rem; --text-3xl: 1.125rem; }
  .hero-stats { flex-direction: column; gap: var(--space-md); }
  .hero-stat-item { display: flex; align-items: center; gap: var(--space-sm); }
  .hero-stat-item .stat-number { font-size: var(--text-xl); }
  .stat-item .stat-number { font-size: var(--text-2xl); }
  .pricing-card { padding: var(--space-lg); }
}

/* ---------- Print ---------- */
@media print {
  .navbar, .footer, .back-to-top, .chat-widget, .cta-section { display: none !important; }
  body { font-size: 12pt; line-height: 1.5; color: #000; background: #fff; }
  .container { max-width: 100%; padding: 0; }
  a { color: #000; text-decoration: underline; }
  .hero { min-height: auto; padding: 2rem 0; background: none; }
}
