/**
 * Responsive Stylesheet - 灵动任务官网响应式布局
 * 项目：intelligentoffice.cn
 * 版本：1.0.0
 *
 * 策略：Mobile-first（移动优先）
 * 断点：
 *   - 默认：< 768px（移动端）
 *   - md：>= 768px（平板）
 *   - lg：>= 1200px（桌面）
 *
 * 使用方法：在 main.css 之后引入此文件
 */

/* ========================================
 * 移动端基础样式（Mobile-first，默认）
 * 适用于 < 768px 的设备
 * ======================================== */

/* 基础字号 - 移动端 14px */
html {
  font-size: 14px;
}

/* 容器 - 移动端内边距较小 */
.container {
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}

/* 全宽按钮 - 移动端默认全宽 */
.btn--responsive {
  width: 100%;
}

/* ========================================
 * 响应式网格系统 (Grid System)
 * ======================================== */

/* 行容器 */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: calc(var(--spacing-md) * -0.5);
  margin-right: calc(var(--spacing-md) * -0.5);
}

/* 无间距行 */
.row--no-gutters {
  margin-left: 0;
  margin-right: 0;
}

.row--no-gutters > [class*="col"] {
  padding-left: 0;
  padding-right: 0;
}

/* 列基础样式 */
[class*="col"] {
  position: relative;
  width: 100%;
  padding-left: calc(var(--spacing-md) * 0.5);
  padding-right: calc(var(--spacing-md) * 0.5);
}

/* 移动端列宽 - 默认全宽 */
.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* 自动列宽 */
.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }

/* ========================================
 * 导航栏响应式 (Navbar Responsive)
 * ======================================== */

/* 移动端导航样式（默认） */
.navbar__container {
  height: 56px;
}

/* 移动端导航链接动画 */
.navbar__mobile-menu {
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
}

.navbar__mobile-menu--open {
  transform: translateX(0);
}

/* 移动端导航内按钮全宽 */
.navbar__mobile-menu .btn {
  width: 100%;
  justify-content: center;
}

/* ========================================
 * Section 响应式
 * ======================================== */

/* 移动端 Section 内边距 */
.section {
  padding: var(--spacing-2xl) 0;
}

.section--hero {
  padding: var(--spacing-2xl) 0 var(--spacing-2xl);
}

/* ========================================
 * 显示/隐藏工具类 (Visibility Utilities)
 * ======================================== */

/* 移动端显示/隐藏（默认状态） */
.hide-mobile {
  display: none !important;
}

.show-mobile {
  display: block !important;
}

.show-mobile-flex {
  display: flex !important;
}

.show-mobile-inline {
  display: inline !important;
}

.show-mobile-inline-block {
  display: inline-block !important;
}

/* 平板显示/隐藏（默认隐藏，在平板断点显示） */
.show-tablet {
  display: none !important;
}

.show-tablet-flex {
  display: none !important;
}

/* 桌面显示/隐藏（默认隐藏，在桌面断点显示） */
.show-desktop {
  display: none !important;
}

.show-desktop-flex {
  display: none !important;
}

/* ========================================
 * 平板断点样式 (Tablet - >= 768px)
 * ======================================== */

@media (min-width: 768px) {
  /* 字号调整 - 平板 15px */
  html {
    font-size: 15px;
  }

  /* 容器内边距增大 */
  .container {
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
  }

  /* 按钮恢复自动宽度 */
  .btn--responsive {
    width: auto;
  }

  /* 导航栏高度 */
  .navbar__container {
    height: 64px;
  }

  /* Section 内边距增大 */
  .section {
    padding: var(--spacing-3xl) 0;
  }

  .section--hero {
    padding: var(--spacing-3xl) 0 var(--spacing-3xl);
  }

  /* 平板列宽 */
  .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-md-9 { flex: 0 0 75%; max-width: 75%; }
  .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
  .col-md { flex: 1 0 0%; }
  .col-md-auto { flex: 0 0 auto; width: auto; }

  /* 平板偏移 */
  .offset-md-0 { margin-left: 0; }
  .offset-md-1 { margin-left: 8.333333%; }
  .offset-md-2 { margin-left: 16.666667%; }
  .offset-md-3 { margin-left: 25%; }
  .offset-md-4 { margin-left: 33.333333%; }
  .offset-md-5 { margin-left: 41.666667%; }
  .offset-md-6 { margin-left: 50%; }

  /* 平板 Grid 布局 */
  .grid-md-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-md-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-md-cols-4 { grid-template-columns: repeat(4, 1fr); }

  /* 显示/隐藏 - 平板 */
  .hide-mobile {
    display: block !important;
  }

  .hide-mobile-flex {
    display: flex !important;
  }

  .show-mobile {
    display: none !important;
  }

  .show-mobile-flex {
    display: none !important;
  }

  .show-mobile-inline {
    display: none !important;
  }

  .show-mobile-inline-block {
    display: none !important;
  }

  .hide-tablet {
    display: none !important;
  }

  .show-tablet {
    display: block !important;
  }

  .show-tablet-flex {
    display: flex !important;
  }

  /* 平板文本对齐 */
  .text-md-left { text-align: left; }
  .text-md-center { text-align: center; }
  .text-md-right { text-align: right; }

  /* 平板 Flex 工具 */
  .flex-md-row { flex-direction: row; }
  .flex-md-col { flex-direction: column; }
  .items-md-center { align-items: center; }
  .items-md-start { align-items: flex-start; }
  .items-md-end { align-items: flex-end; }
  .justify-md-center { justify-content: center; }
  .justify-md-between { justify-content: space-between; }
  .justify-md-start { justify-content: flex-start; }
  .justify-md-end { justify-content: flex-end; }

  /* 平板间距 */
  .gap-md-sm { gap: var(--spacing-sm); }
  .gap-md-md { gap: var(--spacing-md); }
  .gap-md-lg { gap: var(--spacing-lg); }
  .gap-md-xl { gap: var(--spacing-xl); }
}

/* ========================================
 * 桌面断点样式 (Desktop - >= 1200px)
 * ======================================== */

@media (min-width: 1200px) {
  /* 字号调整 - 桌面 16px */
  html {
    font-size: 16px;
  }

  /* 容器内边距增大，最大宽度限制 */
  .container {
    padding-left: var(--spacing-xl);
    padding-right: var(--spacing-xl);
  }

  /* 导航栏更大的间距 */
  .navbar__nav {
    gap: var(--spacing-2xl);
  }

  /* Section 内边距增大 */
  .section {
    padding: var(--spacing-4xl) 0;
  }

  .section--hero {
    padding: var(--spacing-4xl) 0 var(--spacing-4xl);
  }

  /* 桌面列宽 */
  .col-lg-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-lg-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
  .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
  .col-lg-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
  .col-lg-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-lg-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
  .col-lg { flex: 1 0 0%; }
  .col-lg-auto { flex: 0 0 auto; width: auto; }

  /* 桌面偏移 */
  .offset-lg-0 { margin-left: 0; }
  .offset-lg-1 { margin-left: 8.333333%; }
  .offset-lg-2 { margin-left: 16.666667%; }
  .offset-lg-3 { margin-left: 25%; }
  .offset-lg-4 { margin-left: 33.333333%; }
  .offset-lg-5 { margin-left: 41.666667%; }
  .offset-lg-6 { margin-left: 50%; }

  /* 桌面 Grid 布局 */
  .grid-lg-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-lg-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-lg-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-lg-cols-5 { grid-template-columns: repeat(5, 1fr); }
  .grid-lg-cols-6 { grid-template-columns: repeat(6, 1fr); }

  /* 显示/隐藏 - 桌面 */
  .hide-desktop {
    display: none !important;
  }

  .show-desktop {
    display: block !important;
  }

  .show-desktop-flex {
    display: flex !important;
  }

  .show-tablet {
    display: none !important;
  }

  .show-tablet-flex {
    display: none !important;
  }

  /* 桌面专用显示（仅在桌面显示，平板隐藏） */
  .show-desktop-only {
    display: block !important;
  }

  .show-desktop-only-flex {
    display: flex !important;
  }

  /* 桌面文本对齐 */
  .text-lg-left { text-align: left; }
  .text-lg-center { text-align: center; }
  .text-lg-right { text-align: right; }

  /* 桌面 Flex 工具 */
  .flex-lg-row { flex-direction: row; }
  .flex-lg-col { flex-direction: column; }
  .items-lg-center { align-items: center; }
  .items-lg-start { align-items: flex-start; }
  .items-lg-end { align-items: flex-end; }
  .justify-lg-center { justify-content: center; }
  .justify-lg-between { justify-content: space-between; }
  .justify-lg-start { justify-content: flex-start; }
  .justify-lg-end { justify-content: flex-end; }

  /* 桌面间距 */
  .gap-lg-sm { gap: var(--spacing-sm); }
  .gap-lg-md { gap: var(--spacing-md); }
  .gap-lg-lg { gap: var(--spacing-lg); }
  .gap-lg-xl { gap: var(--spacing-xl); }
  .gap-lg-2xl { gap: var(--spacing-2xl); }
}

/* ========================================
 * 响应式排序 (Order)
 * ======================================== */

/* 移动端排序 */
.order-first { order: -1; }
.order-last { order: 13; }
.order-0 { order: 0; }
.order-1 { order: 1; }
.order-2 { order: 2; }
.order-3 { order: 3; }

/* 平板排序 */
@media (min-width: 768px) {
  .order-md-first { order: -1; }
  .order-md-last { order: 13; }
  .order-md-0 { order: 0; }
  .order-md-1 { order: 1; }
  .order-md-2 { order: 2; }
  .order-md-3 { order: 3; }
}

/* 桌面排序 */
@media (min-width: 1200px) {
  .order-lg-first { order: -1; }
  .order-lg-last { order: 13; }
  .order-lg-0 { order: 0; }
  .order-lg-1 { order: 1; }
  .order-lg-2 { order: 2; }
  .order-lg-3 { order: 3; }
}

/* ========================================
 * 响应式间距 (Responsive Spacing)
 * ======================================== */

/* 平板间距 */
@media (min-width: 768px) {
  .mt-md-0 { margin-top: 0; }
  .mt-md-md { margin-top: var(--spacing-md); }
  .mt-md-lg { margin-top: var(--spacing-lg); }
  .mt-md-xl { margin-top: var(--spacing-xl); }
  .mt-md-2xl { margin-top: var(--spacing-2xl); }

  .mb-md-0 { margin-bottom: 0; }
  .mb-md-md { margin-bottom: var(--spacing-md); }
  .mb-md-lg { margin-bottom: var(--spacing-lg); }
  .mb-md-xl { margin-bottom: var(--spacing-xl); }
  .mb-md-2xl { margin-bottom: var(--spacing-2xl); }

  .pt-md-0 { padding-top: 0; }
  .pt-md-md { padding-top: var(--spacing-md); }
  .pt-md-lg { padding-top: var(--spacing-lg); }
  .pt-md-xl { padding-top: var(--spacing-xl); }
  .pt-md-2xl { padding-top: var(--spacing-2xl); }

  .pb-md-0 { padding-bottom: 0; }
  .pb-md-md { padding-bottom: var(--spacing-md); }
  .pb-md-lg { padding-bottom: var(--spacing-lg); }
  .pb-md-xl { padding-bottom: var(--spacing-xl); }
  .pb-md-2xl { padding-bottom: var(--spacing-2xl); }
}

/* 桌面间距 */
@media (min-width: 1200px) {
  .mt-lg-0 { margin-top: 0; }
  .mt-lg-md { margin-top: var(--spacing-md); }
  .mt-lg-lg { margin-top: var(--spacing-lg); }
  .mt-lg-xl { margin-top: var(--spacing-xl); }
  .mt-lg-2xl { margin-top: var(--spacing-2xl); }
  .mt-lg-3xl { margin-top: var(--spacing-3xl); }

  .mb-lg-0 { margin-bottom: 0; }
  .mb-lg-md { margin-bottom: var(--spacing-md); }
  .mb-lg-lg { margin-bottom: var(--spacing-lg); }
  .mb-lg-xl { margin-bottom: var(--spacing-xl); }
  .mb-lg-2xl { margin-bottom: var(--spacing-2xl); }
  .mb-lg-3xl { margin-bottom: var(--spacing-3xl); }

  .pt-lg-0 { padding-top: 0; }
  .pt-lg-md { padding-top: var(--spacing-md); }
  .pt-lg-lg { padding-top: var(--spacing-lg); }
  .pt-lg-xl { padding-top: var(--spacing-xl); }
  .pt-lg-2xl { padding-top: var(--spacing-2xl); }
  .pt-lg-3xl { padding-top: var(--spacing-3xl); }

  .pb-lg-0 { padding-bottom: 0; }
  .pb-lg-md { padding-bottom: var(--spacing-md); }
  .pb-lg-lg { padding-bottom: var(--spacing-lg); }
  .pb-lg-xl { padding-bottom: var(--spacing-xl); }
  .pb-lg-2xl { padding-bottom: var(--spacing-2xl); }
  .pb-lg-3xl { padding-bottom: var(--spacing-3xl); }
}

/* ========================================
 * 响应式宽度工具类 (Responsive Width)
 * ======================================== */

.w-full { width: 100%; }
.w-auto { width: auto; }
.w-50 { width: 50%; }

@media (min-width: 768px) {
  .w-md-full { width: 100%; }
  .w-md-auto { width: auto; }
  .w-md-50 { width: 50%; }
  .w-md-33 { width: 33.333333%; }
  .w-md-25 { width: 25%; }
}

@media (min-width: 1200px) {
  .w-lg-full { width: 100%; }
  .w-lg-auto { width: auto; }
  .w-lg-50 { width: 50%; }
  .w-lg-33 { width: 33.333333%; }
  .w-lg-25 { width: 25%; }
  .w-lg-20 { width: 20%; }
}

/* ========================================
 * 响应式图片和媒体
 * ======================================== */

/* 响应式图片容器 */
.img-responsive {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 响应式视频容器 16:9 */
.video-responsive {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.video-responsive iframe,
.video-responsive video,
.video-responsive embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 响应式视频容器 4:3 */
.video-responsive--4x3 {
  padding-bottom: 75%; /* 4:3 */
}

/* ========================================
 * 页脚响应式补充
 * ======================================== */

/* 平板页脚布局 */
@media (min-width: 768px) and (max-width: 1199px) {
  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__brand {
    grid-column: span 2;
  }
}

/* ========================================
 * 卡片网格响应式
 * ======================================== */

.card-grid {
  display: grid;
  gap: var(--spacing-lg);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
  }

  .card-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
  }

  .card-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ========================================
 * 特性/功能列表响应式
 * ======================================== */

.feature-grid {
  display: grid;
  gap: var(--spacing-xl);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-2xl);
  }
}

@media (min-width: 1200px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
 * Hero 区域响应式
 * ======================================== */

.hero {
  text-align: center;
  padding: var(--spacing-2xl) 0;
}

.hero__title {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--spacing-md);
}

.hero__subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xl);
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  align-items: center;
}

@media (min-width: 768px) {
  .hero {
    padding: var(--spacing-3xl) 0;
  }

  .hero__title {
    font-size: var(--font-size-4xl);
  }

  .hero__subtitle {
    font-size: var(--font-size-xl);
  }

  .hero__actions {
    flex-direction: row;
    justify-content: center;
  }
}

@media (min-width: 1200px) {
  .hero {
    padding: var(--spacing-4xl) 0;
  }

  .hero__title {
    font-size: var(--font-size-5xl);
    margin-bottom: var(--spacing-lg);
  }

  .hero__subtitle {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-2xl);
  }
}

/* ========================================
 * 价格表响应式
 * ======================================== */

.pricing-grid {
  display: grid;
  gap: var(--spacing-lg);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
  }
}

@media (min-width: 1200px) {
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .pricing-grid--center {
    max-width: 1000px;
    margin: 0 auto;
  }
}

/* ========================================
 * 表格响应式
 * ======================================== */

.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 移动端表格卡片化（可选） */
@media (max-width: 767px) {
  .table--card-mobile thead {
    display: none;
  }

  .table--card-mobile tbody tr {
    display: block;
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
  }

  .table--card-mobile tbody td {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border: none;
    border-bottom: 1px solid var(--color-border-light);
  }

  .table--card-mobile tbody td:last-child {
    border-bottom: none;
  }

  .table--card-mobile tbody td::before {
    content: attr(data-label);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
  }
}

/* ========================================
 * 打印样式
 * ======================================== */

@media print {
  /* 隐藏导航和页脚 */
  .navbar,
  .footer,
  .btn,
  .navbar__mobile-menu {
    display: none !important;
  }

  /* 移除阴影和背景 */
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* 确保内容可打印 */
  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  /* 分页控制 */
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }

  img, table, figure {
    page-break-inside: avoid;
  }
}
