/* ========================================
   Web Tutorial — 页面专有样式
   ======================================== */

/* ---------- 顶部导航 ---------- */
.header {
  position: sticky; top: 0; z-index: 200;
  background: #fff;
  border-bottom: 1px solid #e8ecf1;
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  width: 100%;
}
.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  font-size: 36px;
  font-weight: 800;
  color: #2563eb;
  letter-spacing: -0.5px;
}
.logo span { color: #f59e0b; }
.logo .com {
  font-size: 18px;
  font-weight: 600;
  color: #94a3b8;
  margin-left: 2px;
}

/* ---------- 汉堡菜单按钮 ---------- */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 32px; height: 32px;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}
.menu-toggle span {
  display: block;
  width: 22px; height: 2.5px;
  background: #334155;
  border-radius: 2px;
  transition: all 0.3s;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 遮罩层 ---------- */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s;
}
.overlay.show {
  display: block;
  opacity: 1;
}

/* ---------- 语言切换 ---------- */
.lang-switch {
  display: flex;
  gap: 12px;
  align-items: center;
}
.lang-switch a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  opacity: 0.5;
  transition: all 0.2s;
  line-height: 0;
  text-decoration: none;
  position: relative;
}
.lang-switch a:hover {
  opacity: 0.8;
}
.lang-switch a.active {
  opacity: 1;
}
.lang-switch a img {
  width: 28px; height: 21px;
  display: block;
}
.lang-switch a::after {
  content: '';
  display: block;
  width: 0;
  height: 2px;
  background: #2563eb;
  border-radius: 1px;
  transition: width 0.2s;
}
.lang-switch a.active::after {
  width: 100%;
}

/* ---------- 主体布局 ---------- */
.layout {
  display: flex;
  width: 100%;
  min-height: calc(100vh - 72px);
}

/* ---------- 左栏导航 ---------- */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e8ecf1;
  padding: 12px 0;
  overflow-y: auto;
  height: calc(100vh - 72px);
  position: sticky;
  top: 72px;
}
.sidebar-section { 
  margin-bottom: 2px; 
}
.sidebar-title {
  font-size: 15px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 20px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.sidebar-section:last-child .sidebar-title::after {
  display: none;
}
.sidebar a {
  display: block;
  padding: 7px 20px 7px 56px;
  font-size: 14px;
  color: #334155;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  position: relative;
}
.sidebar a:hover {
  background: #f1f5f9;
  color: #2563eb;
  border-left-color: #2563eb;
}
.sidebar a::before {
  content: '';
  position: absolute;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border: 2px solid #94a3b8;
  border-radius: 50%;
  background: transparent;
  transition: all 0.15s;
}
.sidebar a:hover::before {
  background: #f59e0b;
  border-color: #f59e0b;
}
.sidebar a.active {
  background: #eff6ff;
  color: #2563eb;
  border-left-color: #2563eb;
  font-weight: 600;
}

/* ---------- 侧栏滚动条 ---------- */
.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ---------- 主内容区 ---------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #fff;
  padding: 64px 48px;
  text-align: center;
}
.hero h1 {
  font-size: 40px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.hero h1 span { color: #60a5fa; }
.hero p {
  font-size: 17px;
  color: #cbd5e1;
  max-width: 600px;
  margin: 0 auto 20px;
}
.hero-tags {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-tags span {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255,255,255,0.1);
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.08);
}

/* ---------- 特色区块 ---------- */
.features {
  background: #fff;
  border-bottom: 1px solid #e8ecf1;
}
.features .g-row { gap: 0; }
.feature-item {
  padding: 32px 28px;
  text-align: center;
  border-right: 1px solid #e8ecf1;
  transition: background 0.2s;
}
.feature-item:last-child { border-right: none; }
.feature-item:hover { background: #f8fafc; }
.feature-icon { font-size: 32px; margin-bottom: 10px; }
.feature-item h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}
.feature-item p {
  font-size: 13px;
  color: #64748b;
}

/* ---------- 技术卡片 ---------- */
.tech-grid-section {
  padding: 48px 40px;
  background: #fff;
}
.tech-grid-section h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
  text-align: center;
}
.tech-category {
  font-size: 17px;
  font-weight: 700;
  color: #334155;
  margin: 28px 0 14px;
  padding-left: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tech-category:first-of-type {
  margin-top: 8px;
}
.tech-category .cat-line {
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.tech-grid-section .g-auto-5 {
  gap: 20px;
}
.tech-card {
  position: relative;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 38px 0 0;
  text-align: center;
  transition: all 0.25s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}
.tech-card::after {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  position: absolute;
  top: -23px;
  right: -23px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #2563eb;
  z-index: 2;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 3px 0 10px 8px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  pointer-events: none;
  opacity: 0;
  content: attr(data-desc);
}
.tech-card.hot::after {
  opacity: 1;
  content: attr(data-badge);
}
.tech-card:hover::after {
  opacity: 1;
  top: 0;
  right: 0;
  width: 100%;
  height: calc(100% - 42px);
  border-radius: 14px 14px 0 0;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-size: 14px;
  text-align: center;
  line-height: 1.5;
  white-space: pre-line;
  content: attr(data-desc);
}
.tech-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(37,99,235,0.12);
  border-color: #93c5fd;
}
.tech-card .icon {
  font-size: 56px;
  margin-bottom: 14px;
  display: block;
  line-height: 1;
}
.tech-card i, .tech-card .icon-svg {
  font-size: 56px;
  margin-bottom: 14px;
  display: block;
  line-height: 1;
}
.tech-card .icon-svg {
  width: 56px;
  height: 56px;
  margin-left: auto;
  margin-right: auto;
}
.tech-card h4 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-top: 4px;
  margin-bottom: 14px;
}
.tech-card .badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 100px;
  background: #dbeafe;
  color: #2563eb;
  font-weight: 600;
  margin-top: 8px;
  margin-bottom: 12px;
}

/* ---------- 卡片底部三按钮 ---------- */
.tech-card-btns {
  display: flex;
  width: 100%;
  margin-top: auto;
  border-top: 1px solid #e2e8f0;
}
.tech-card-btns a {
  flex: 1;
  text-align: center;
  padding: 9px 4px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  transition: all 0.15s;
  text-decoration: none;
  border-right: 1px solid #e2e8f0;
}
.tech-card-btns a:last-child {
  border-right: none;
}
.tech-card-btns a:first-child {
  border-radius: 0 0 0 14px;
}
.tech-card-btns a:last-child {
  border-radius: 0 0 14px 0;
}
.tech-card-btns a:hover {
  background: #2563eb;
  color: #fff;
}

/* ---------- 页脚 ---------- */
.footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 40px 32px 24px;
  font-size: 13px;
  margin-top: auto;
}
.footer-inner {
  max-width: none;
  margin: 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
}
.footer-col {
  flex: 1;
  min-width: 160px;
}
.footer-col h4 {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}
.footer-col p, .footer-col a {
  color: #94a3b8;
  display: block;
  margin-bottom: 4px;
}
.footer-col a:hover { color: #60a5fa; }
.footer-bottom {
  text-align: center;
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid #334155;
  font-size: 12px;
  color: #64748b;
}

/* 宽屏 5列不变 */
/* >1400px 默认5列 */

/* ≤1400px 变4列，其他不变 */
@media (max-width: 1400px) {
  .g-auto-5 { grid-template-columns: repeat(4, 1fr); }
}

/* 平板 */
@media (max-width: 1024px) {
  .sidebar { width: 210px; }
  .hero { padding: 48px 32px; }
  .hero h1 { font-size: 32px; }
  .tech-grid-section { padding: 32px 24px; }
  .g-auto-5 { grid-template-columns: repeat(3, 1fr); }
}

/* 手机 */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .sidebar {
    position: fixed;
    top: 72px;
    left: -280px;
    width: 260px;
    height: calc(100vh - 72px);
    z-index: 100;
    transition: left 0.3s ease;
    box-shadow: 2px 0 20px rgba(0,0,0,0.1);
  }
  .sidebar.open { left: 0; }
  .header { padding: 0 16px; }
  .logo { font-size: 24px; }
  .logo .com { font-size: 13px; }
  .hero { padding: 32px 16px; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 14px; }
  .hero-tags { gap: 6px; }
  .hero-tags span { font-size: 11px; padding: 3px 10px; }
  .features .g-row { gap: 0; }
  .feature-item {
    border-right: none;
    border-bottom: 1px solid #e8ecf1;
    padding: 20px 16px;
  }
  .feature-item:last-child { border-bottom: none; }
  .feature-icon { font-size: 28px; }
  .feature-item h3 { font-size: 15px; }
  .feature-item p { font-size: 12px; }
  .tech-grid-section { padding: 24px 16px; }
  .tech-grid-section h2 { font-size: 18px; margin-bottom: 16px; }
  .tech-category { font-size: 15px; margin: 20px 0 10px; }
  .g-auto-5 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tech-card { padding: 16px 6px; min-height: 120px; }
  .tech-card i, .tech-card .icon-svg { font-size: 36px; margin-bottom: 8px; }
  .tech-card h4 { font-size: 13px; margin-bottom: 8px; }
  .tech-card .icon-svg { width: 36px; height: 36px; }
  .tech-card-btns a { font-size: 11px; padding: 6px 2px; }
  .tech-card::after { top: -18px; right: -18px; width: 42px; height: 42px; padding: 2px 0 6px 5px; font-size: 9px; }
  .tech-card.hot:hover::after { font-size: 12px; padding: 12px; }
  .footer { padding: 28px 20px 20px; }
  .footer-inner { flex-direction: column; gap: 20px; }
  .footer-col { min-width: 100%; }
  .footer-col h4 { font-size: 13px; }
  .lang-switch a img { width: 22px; height: 16px; }
  .lang-switch { gap: 8px; }
}

/* 小手机 */
@media (max-width: 480px) {
  .g-auto-5 { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 20px; }
  .hero-tags span { font-size: 10px; padding: 2px 8px; }
  .tech-card { padding: 12px 4px; min-height: 100px; }
  .tech-card i, .tech-card .icon-svg { font-size: 28px; }
  .tech-card h4 { font-size: 12px; }
  .tech-card-btns a { font-size: 10px; padding: 5px 2px; }
}
