/**
 * 低代码平台学习中心 - 统一样式表
 * 适用于 CN 目录下所有平台学习中心页面
 * 颜色规范: MIC品牌色纯色系统（嫩绿#10B981 + 深蓝#0a0e27 + 白灰）
 * 版本: 3.0 - 全面优化版
 * 更新时间: 2026-01-10
 */

/* ==================== 基础样式 ==================== */
body {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0a0e27 100%);
  position: relative;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* 全局背景装饰 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ==================== 卡片样式 ==================== */
.jdy-card, .tech-card, .card-tech {
  background: linear-gradient(to bottom right, #FFFFFF 0%, #F9FAFB 100%);
  border: 1px solid rgba(16, 185, 129, 0.15);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  position: relative;
}

.jdy-card::before, .tech-card::before, .card-tech::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.03) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: inherit;
  pointer-events: none;
}

.jdy-card:hover, .tech-card:hover, .card-tech:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.3);
}

.jdy-card:hover::before, .tech-card:hover::before, .card-tech:hover::before {
  opacity: 1;
}

/* ==================== 标题样式 ==================== */
.section-title {
  color: #10B981;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==================== 动画效果 ==================== */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

.floating {
  animation: float 6s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.3); }
  50% { box-shadow: 0 0 25px rgba(16, 185, 129, 0.5); }
}

.icon-box {
  transition: all 0.3s ease;
}

.icon-box:hover {
  transform: scale(1.08);
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Hero区背景动效 */
@keyframes gradient-shift {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.hero-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: gradient-shift 8s ease-in-out infinite;
  pointer-events: none;
}

.hero-bg-orb-1 {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
  top: -10%;
  left: -5%;
  width: 500px;
  height: 500px;
  animation-delay: 0s;
}

.hero-bg-orb-2 {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  bottom: -10%;
  right: -5%;
  width: 600px;
  height: 600px;
  animation-delay: 4s;
}

/* ==================== 按钮样式 ==================== */
.btn-primary {
  background: #10B981;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  background: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: #10B981;
  border: 2px solid rgba(16, 185, 129, 0.4);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}

.btn-secondary:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.6);
}

/* ==================== 导航样式 ==================== */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

/* ==================== 容器样式 ==================== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* ==================== 标签样式 ==================== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-primary {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

/* ==================== 链接样式 ==================== */
a {
  transition: all 0.3s ease;
}

.text-link {
  color: #10B981;
  text-decoration: none;
}

.text-link:hover {
  color: #059669;
  text-decoration: underline;
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}

::-webkit-scrollbar-thumb {
  background: #10B981;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #059669;
}

/* ==================== 响应式优化 ==================== */
@media (max-width: 768px) {
  .hero-bg-orb-1, .hero-bg-orb-2 {
    width: 300px;
    height: 300px;
  }
}

/* ==================== 移动端紧凑布局 ==================== */
@media (max-width: 767px) {
  /* --- 1. 多列网格改2列 --- */
  [class*="md\:grid-cols-3"],
  [class*="md\:grid-cols-4"],
  [class*="lg\:grid-cols-4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.375rem !important;
  }
  /* md:grid-cols-2 也改为移动端2列 */
  [class*="md\:grid-cols-2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.375rem !important;
  }
  /* 案例列表等大间距纵向堆叠保持1列 */
  .grid[class*="gap-12"],
  .grid[class*="gap-10"],
  .grid[class*="gap-8"] {
    grid-template-columns: 1fr !important;
    gap: 0.625rem !important;
  }

  /* --- 2. Section间距压缩 --- */
  section {
    padding-top: 0.625rem !important;
    padding-bottom: 0.625rem !important;
  }
  /* Hero区保留fixed导航偏移 (navbar 55px + breadcrumb ~35px) */
  section[class*="pt-28"],
  section[class*="pt-24"] {
    padding-top: 4rem !important;
    padding-bottom: 0.5rem !important;
  }
  main {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  /* --- 3. 卡片紧凑 --- */
  .jdy-card, .tech-card, .card-tech {
    padding: 0.5rem !important;
    margin-bottom: 0.375rem !important;
    border-radius: 0.625rem !important;
  }
  .case-card {
    padding: 0.625rem !important;
    margin-bottom: 0.5rem !important;
    border-radius: 0.75rem !important;
  }
  /* 内部子区块 */
  [class*="rounded-xl"][class*="p-5"],
  [class*="rounded-lg"][class*="p-5"],
  [class*="rounded-lg"][class*="p-4"] {
    padding: 0.375rem !important;
  }
  [class*="rounded-2xl"][class*="p-6"] {
    padding: 0.5rem !important;
  }
  [class*="rounded-2xl"][class*="p-10"] {
    padding: 0.625rem !important;
  }

  /* --- 4. 标题压缩 --- */
  h1 { font-size: 0.95rem !important; margin-bottom: 0.125rem !important; }
  h2 { font-size: 0.85rem !important; margin-bottom: 0.125rem !important; }
  h3 { font-size: 0.75rem !important; margin-bottom: 0.125rem !important; }
  h4 { font-size: 0.7rem !important; margin-bottom: 0.0625rem !important; }

  /* --- 5. 正文紧凑 --- */
  p { font-size: 0.7rem !important; line-height: 1.4 !important; }
  li { font-size: 0.7rem !important; line-height: 1.4 !important; }
  .text-lg { font-size: 0.75rem !important; }
  .text-sm { font-size: 0.65rem !important; }
  .text-xs { font-size: 0.6rem !important; }

  /* --- 6. 图标盒缩小 --- */
  .icon-box {
    width: 1.75rem !important;
    height: 1.75rem !important;
  }
  .icon-box i {
    font-size: 0.8rem !important;
  }
  /* Hero/Section大图标容器 */
  [class*="w-16"][class*="h-16"] { width: 2rem !important; height: 2rem !important; }
  [class*="w-14"][class*="h-14"] { width: 2rem !important; height: 2rem !important; }
  [class*="w-12"][class*="h-12"] { width: 1.75rem !important; height: 1.75rem !important; }
  [class*="w-20"][class*="h-20"] { width: 2.5rem !important; height: 2.5rem !important; }

  /* --- 7. 间距压缩 --- */
  .space-y-3 > * + * { margin-top: 0.25rem !important; }
  .space-y-2 > * + * { margin-top: 0.125rem !important; }
  [class*="mb-6"] { margin-bottom: 0.375rem !important; }
  [class*="mb-8"] { margin-bottom: 0.5rem !important; }
  [class*="mb-10"] { margin-bottom: 0.5rem !important; }
  [class*="mt-12"] { margin-top: 0.5rem !important; }
  [class*="gap-6"] { gap: 0.375rem !important; }

  /* --- 8. 按钮紧凑 --- */
  .btn-primary, .btn-outline, .btn-secondary, .btn-consult {
    padding: 0.3rem 0.625rem !important;
    font-size: 0.7rem !important;
    border-radius: 0.375rem !important;
  }

  /* --- 9. 面包屑紧凑 --- */
  nav[aria-label="Breadcrumb"] {
    padding-top: 0.125rem !important;
    padding-bottom: 0.125rem !important;
  }
  nav[aria-label="Breadcrumb"] ol {
    font-size: 0.6rem !important;
  }

  /* --- 10. 步骤徽章缩小 --- */
  .step-badge {
    width: 1.5rem !important;
    height: 1.5rem !important;
    font-size: 0.7rem !important;
    line-height: 1.5rem !important;
  }

  /* --- 11. 徽章标签紧凑 --- */
  .badge, .badge-primary, .badge-success, .badge-warning, .badge-recommended {
    padding: 0.125rem 0.375rem !important;
    font-size: 0.6rem !important;
  }

  /* --- 12. 手风琴折叠样式 --- */
  .mob-collapse {
    overflow: hidden;
    transition: max-height 0.35s ease;
  }
  .mob-toggle-icon {
    font-size: 0.5rem !important;
    color: #10B981;
    margin-left: auto;
    padding-left: 6px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
  }

  /* --- 13. Footer紧凑 --- */
  footer {
    padding-top: 0.75rem !important;
    padding-bottom: 0.5rem !important;
  }
  footer + div {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }
  /* 二维码区域紧凑 */
  footer ~ div img[class*="w-24"] {
    width: 3.5rem !important;
    height: 3.5rem !important;
  }
  footer ~ div h5 {
    font-size: 0.6rem !important;
    margin-bottom: 0.25rem !important;
  }
  footer ~ div [class*="rounded-xl"][class*="p-3"] {
    padding: 0.25rem !important;
  }
  /* 相关推荐区紧凑 */
  footer ~ section {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  /* --- 14. 装饰元素隐藏 --- */
  .hero-bg-orb,
  .hero-bg-orb-1,
  .hero-bg-orb-2 {
    display: none !important;
  }
  .floating {
    animation: none !important;
  }
}

/* ==================== 氚云子站统一二级导航（CN/ChuanYun 专用）==================== */
.cyun-subnav {
  background: #ffffff;
  border-bottom: 1px solid rgba(16, 185, 129, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 55px;
  z-index: 30;
  margin-top: 55px;
}
.cyun-subnav-wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cyun-subnav-wrap::-webkit-scrollbar { display: none; }
.cyun-subnav-item {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 10px;
  color: #4B5563;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .25s ease;
  background: transparent;
}
.cyun-subnav-item i { font-size: 0.95rem; }
.cyun-subnav-item:hover {
  background: #f0fdf4;
  color: #10B981;
}
.cyun-subnav-item.active {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}
@media (max-width: 768px) {
  .cyun-subnav-wrap { padding: 6px 12px; }
  .cyun-subnav-item { padding: 6px 10px; font-size: 0.8rem; gap: 4px; }
  .cyun-subnav-item i { font-size: 0.85rem; }
}

/* ==================== 全局宽度对齐（修复一级导航与主体宽度不一致问题）====================
   场景：/CN/MingDaoYun/、/CN/study/ 等引入本文件的页面存在以下不一致：
     1) 同目录各页面主体混用 max-w-6xl(1152px) 与 max-w-7xl(1280px)
     2) 二级导航 .cyun-subnav-wrap = 72rem(1152px) 与主体不一致
     3) 一级导航 #navbar > .container 无 max-w-*，在 ≥1536px 屏幕上会
       被 Tailwind 默认 .container 扩展到 1536px，与主体错位。
   修复：统一锁定为 80rem (1280px = Tailwind max-w-7xl)。
   ============================================================================ */

/* 1、强制所有 .container 为 80rem（压住 Tailwind 默认的 1536px 注入） */
.container {
  max-width: 80rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 2、主体中直接使用 max-w-6xl 的写法统一升级为 80rem（避免与 max-w-7xl 页面水平不齐） */
.max-w-6xl {
  max-width: 80rem !important;
}

/* 3、二级导航（明道云/简道云等平台页面公用）同步升级为 80rem */
.cyun-subnav-wrap {
  max-width: 80rem !important;
}

/* 4、统一水平内边距：与主体 HTML 中的 px-4 / md:px-6 / lg:px-8 保持一致，
   避免 Tailwind、platform-common、主体 utility 三者间出现 8px 错位。 */
.container {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}
@media (min-width: 768px) {
  .container {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
}
@media (min-width: 1024px) {
  .container {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
}

/* 5、一级导航内层布局：logo 左 / 菜单+CTA 右（不依赖 Tailwind 工具类） */
#navbar > .container > div {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  min-height: 55px;
  gap: 1rem;
}
#navbar > .container > div > div:last-child {
  display: flex !important;
  align-items: center !important;
  gap: 1rem;
  margin-left: auto;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  #navbar nav.hidden.md\:flex {
    display: flex !important;
    align-items: center;
    gap: 1.5rem;
  }
}
@media (max-width: 767px) {
  #navbar nav.hidden.md\:flex {
    display: none !important;
  }
}
