/* ==========================================================
   一和在线 · 首页专用样式（css/home.css）
   设计语言对标：智学云课堂 · 教育服务平台（科技蓝）
   说明：本文件只服务首页 index.html，类名前缀 hp-，
        不改动 style.css 中其它页面的既有样式。
   ========================================================== */

/* ---------- 设计变量（科技蓝族） ---------- */
:root {
  --hp-blue-900: #0B2E6B;
  --hp-blue-700: #1450B4;
  --hp-blue-600: #1A6AFF;
  --hp-blue-500: #2E86FF;
  --hp-blue-400: #5AA4FF;
  --hp-blue-100: #E8F1FF;
  --hp-blue-50:  #F2F7FF;

  --hp-ink-900: #0E1A2B;
  --hp-ink-700: #2A3B52;
  --hp-ink-500: #5B6B82;
  --hp-ink-400: #8A99AC;
  --hp-line: #EDF1F7;

  --hp-radius-l: 18px;
  --hp-radius-m: 14px;
  --hp-radius-s: 10px;

  --hp-shadow-s: 0 2px 8px rgba(18, 55, 110, .06);
  --hp-shadow-m: 0 6px 20px rgba(18, 55, 110, .10);
  --hp-shadow-blue: 0 8px 20px rgba(26, 106, 255, .28);

  --hp-grad: linear-gradient(135deg, #3E8BFF 0%, #57A6FF 55%, #7CC0FF 100%);
  --hp-grad-deep: linear-gradient(135deg, #1E56BE 0%, #2E74E8 50%, #4E9CFF 100%);
}

/* ==========================================================
   一、顶部头部（品牌 + 工具 + 搜索 + 数据）
   ========================================================== */
.hp-hero {
  position: relative;
  background: var(--hp-grad-deep);
  padding: calc(var(--safe-top, 0px) + 16px) 20px 62px;
  border-radius: 0 0 26px 26px;
  overflow: visible;
}

/* 装饰光斑（单独容器，负责裁切圆角） */
.hp-hero-bg {
  position: absolute;
  inset: 0;
  border-radius: 0 0 26px 26px;
  overflow: hidden;
  pointer-events: none;
}
.hp-hero-bg::after {
  content: "";
  position: absolute;
  width: 280px; height: 280px;
  right: -110px; top: -130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 68%);
}
.hp-hero-bg::before {
  content: "";
  position: absolute;
  width: 180px; height: 180px;
  left: -70px; bottom: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 190, 255, .22), transparent 70%);
}

.hp-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

/* --- 品牌 --- */
.hp-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.hp-logo {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .32);
  display: flex; align-items: center; justify-content: center;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.hp-logo svg { width: 23px; height: 23px; }

.hp-brand-txt { min-width: 0; }
.hp-brand-txt b {
  display: block;
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .6px;
  line-height: 1.15;
}
.hp-brand-txt i {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  color: rgba(255, 255, 255, .72);
  letter-spacing: 1.6px;
  margin-top: 3px;
  text-transform: uppercase;
}

/* --- 右上工具 --- */
.hp-tools { display: flex; align-items: center; gap: 9px; }

.hp-icon-btn {
  width: 34px; height: 34px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .24);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background .16s;
}
.hp-icon-btn:active { background: rgba(255, 255, 255, .3); }
.hp-icon-btn svg { width: 17px; height: 17px; }

.hp-dot-badge {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 15px; height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: #FF5B5B;
  color: #fff;
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  border: 1.5px solid #16459e;
}

/* --- 搜索 --- */
.hp-search-wrap { position: relative; z-index: 30; }

.hp-search {
  margin-top: 18px;
  height: 44px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .96);
  display: flex;
  align-items: center;
  padding: 0 6px 0 15px;
  gap: 9px;
  box-shadow: 0 6px 18px rgba(4, 26, 66, .20);
}
.hp-search > svg {
  width: 17px; height: 17px;
  flex: 0 0 17px;
}
.hp-search input {
  flex: 1;
  min-width: 0;
  border: 0; outline: 0;
  background: transparent;
  font-size: 13.5px;
  color: var(--hp-ink-900);
  font-family: inherit;
}
.hp-search input::placeholder { color: var(--hp-ink-400); }

.hp-search-go {
  height: 32px;
  padding: 0 16px;
  border-radius: 16px;
  background: var(--hp-grad);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.hp-search-go:active { opacity: .85; }

/* --- 搜索结果面板 --- */
.hp-search-panel {
  display: none;
  position: absolute;
  left: 0; right: 0; top: calc(100% + 8px);
  max-height: 300px;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--hp-radius-m);
  box-shadow: 0 14px 34px rgba(9, 33, 78, .22);
  z-index: 40;
  padding: 6px;
}
.hp-search-panel.is-open { display: block; }
.hp-sr-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--hp-radius-s);
}
.hp-sr-item:active { background: var(--hp-blue-50); }
.hp-sr-ico {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #E4EFFF, #CFE1FF);
  color: var(--hp-blue-600);
  display: flex; align-items: center; justify-content: center;
}
.hp-sr-ico svg { width: 16px; height: 16px; }
.hp-sr-txt { min-width: 0; flex: 1; }
.hp-sr-txt b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--hp-ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hp-sr-txt span {
  display: block;
  font-size: 10.5px;
  color: var(--hp-ink-400);
  margin-top: 2px;
}
.hp-sr-empty {
  padding: 18px 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--hp-ink-400);
}

/* --- 数据条（数字突出、文字小、上下两排） --- */
.hp-stats {
  margin-top: 16px;
  display: flex;
  align-items: stretch;
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 14px;
  padding: 12px 4px 10px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.hp-stat { flex: 1; text-align: center; position: relative; }
.hp-stat + .hp-stat::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 1px; height: 30px;
  background: rgba(255, 255, 255, .22);
}
.hp-stat b {
  display: block;
  font-size: 24px;
  line-height: 1.1;
  color: #fff;
  font-weight: 800;
  letter-spacing: .2px;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(10, 40, 100, .22);
}
.hp-stat b i {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  margin-left: 2px;
  opacity: .88;
}
.hp-stat > span {
  display: block;
  font-size: 10px;
  color: rgba(255, 255, 255, .75);
  margin-top: 4px;
  letter-spacing: .6px;
}

/* ==========================================================
   二、轮播图（渐变运营位）
   ========================================================== */
.hp-carousel {
  margin: -44px 16px 0;
  position: relative;
  z-index: 3;
  border-radius: var(--hp-radius-l);
  overflow: hidden;
  box-shadow: var(--hp-shadow-m);
  background: #fff;
}
.hp-track {
  display: flex;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}
.hp-slide {
  flex: 0 0 100%;
  height: 156px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.hp-slide.s1 { background: linear-gradient(120deg, #2E74E8 0%, #4E9CFF 55%, #85C3FF 100%); }
.hp-slide.s2 { background: linear-gradient(120deg, #1E56BE 0%, #3E8BFF 55%, #6FB6FF 100%); }
.hp-slide.s3 { background: linear-gradient(120deg, #2A66D9 0%, #4E8FF2 52%, #9CCDFF 100%); }
.hp-slide.s4 { background: linear-gradient(120deg, #1F5AC8 0%, #3E85F0 50%, #6FB6FF 100%); }
.hp-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 88% 22%, rgba(255, 255, 255, .22), transparent 42%),
    radial-gradient(circle at 12% 92%, rgba(255, 255, 255, .14), transparent 40%);
}
.hp-slide.s2::before {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 150px; height: 150px;
  border-radius: 50%;
  border: 22px solid rgba(255, 255, 255, .10);
}
.hp-slide-body {
  position: relative;
  z-index: 2;
  padding: 0 20px;
  max-width: 74%;
}
.hp-slide-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .22);
  border: 1px solid rgba(255, 255, 255, .3);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.hp-slide-title {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  letter-spacing: .4px;
  text-shadow: 0 2px 8px rgba(6, 30, 80, .28);
}
.hp-slide-sub {
  font-size: 11.5px;
  color: rgba(255, 255, 255, .85);
  margin-top: 6px;
  line-height: 1.5;
}
.hp-slide-art {
  position: absolute;
  right: 14px; bottom: 10px;
  z-index: 2;
  opacity: .92;
}
.hp-slide-art svg { width: 86px; height: 86px; }

.hp-dots {
  position: absolute;
  left: 0; right: 0; bottom: 9px;
  display: flex;
  justify-content: center;
  gap: 5px;
  z-index: 4;
}
.hp-dots i {
  width: 5px; height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .55);
  transition: all .3s;
}
.hp-dots i.on { width: 16px; background: #fff; }

/* ==========================================================
   三、通用板块
   ========================================================== */
.hp-section { padding: 20px 16px 0; }

.hp-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}
.hp-sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--hp-ink-900);
  letter-spacing: .3px;
}
.hp-sec-title::before {
  content: "";
  width: 4px; height: 16px;
  border-radius: 2px;
  background: var(--hp-grad);
}
.hp-sec-title small {
  font-size: 11px;
  font-weight: 500;
  color: var(--hp-ink-400);
  letter-spacing: 0;
  margin-left: 2px;
}
.hp-more {
  font-size: 12px;
  color: var(--hp-ink-500);
  display: flex;
  align-items: center;
  gap: 3px;
}
.hp-more svg { width: 12px; height: 12px; }

/* ==========================================================
   四、功能模块（学习中心样式）
   ========================================================== */
.hp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px 4px;
  background: #fff;
  border-radius: var(--hp-radius-l);
  padding: 16px 8px 12px;
  box-shadow: var(--hp-shadow-s);
}
.hp-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  border-radius: 12px;
  position: relative;
  transition: background .16s;
}
.hp-grid-item:active { background: var(--hp-blue-50); }

.hp-gi-ico {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: #fff;
  box-shadow: 0 4px 10px rgba(46, 116, 232, .26);
}
.hp-gi-ico svg { width: 22px; height: 22px; }
.hp-gi-ico.b1 { background: linear-gradient(135deg, #2E74E8, #4E9CFF); }
.hp-gi-ico.b2 { background: linear-gradient(135deg, #1E56BE, #3E8BFF); }
.hp-gi-ico.b3 { background: linear-gradient(135deg, #3E85F0, #6FB6FF); }
.hp-gi-ico.b4 { background: linear-gradient(135deg, #2A66D9, #57A6FF); }

.hp-gi-txt {
  font-size: 11.5px;
  color: var(--hp-ink-700);
  font-weight: 600;
  letter-spacing: .2px;
  text-align: center;
  line-height: 1.25;
}
.hp-gi-badge {
  position: absolute;
  top: -4px; right: -6px;
  padding: 1px 5px;
  border-radius: 7px;
  background: linear-gradient(135deg, #FF6B6B, #FF3D3D);
  color: #fff;
  font-style: normal;
  font-size: 8.5px;
  font-weight: 700;
  transform: scale(.92);
  box-shadow: 0 2px 5px rgba(255, 61, 61, .35);
}
.hp-gi-badge.hot {
  background: linear-gradient(135deg, #FFA53D, #FF7A00);
  box-shadow: 0 2px 5px rgba(255, 122, 0, .35);
}

/* ==========================================================
   五、优秀项目展示（热门课程卡片样式）
   ========================================================== */
.hp-cards {
  display: flex;
  gap: 11px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin: 0 -16px;
  padding: 2px 16px 6px;
}
.hp-cards::-webkit-scrollbar { display: none; }

.hp-card {
  flex: 0 0 208px;
  background: #fff;
  border-radius: var(--hp-radius-m);
  overflow: hidden;
  box-shadow: var(--hp-shadow-s);
  border: 1px solid #EFF4FC;
  transition: transform .16s;
}
.hp-card:active { transform: scale(.98); }

.hp-card-cover {
  height: 96px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hp-card-cover.c1 { background: linear-gradient(135deg, #2E74E8, #6FB6FF); }
.hp-card-cover.c2 { background: linear-gradient(135deg, #1E56BE, #4E9CFF); }
.hp-card-cover.c3 { background: linear-gradient(135deg, #3E85F0, #85C3FF); }
.hp-card-cover.c4 { background: linear-gradient(135deg, #2A66D9, #6FB6FF); }
.hp-card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 15%, rgba(255, 255, 255, .24), transparent 45%);
}
.hp-play {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  border: 1.5px solid rgba(255, 255, 255, .5);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  z-index: 2;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.hp-play svg { width: 15px; height: 15px; }

.hp-corner-tag {
  position: absolute;
  left: 9px; top: 9px;
  padding: 3px 8px;
  border-radius: 6px;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  color: #fff;
  background: rgba(6, 32, 80, .42);
  border: 1px solid rgba(255, 255, 255, .24);
  z-index: 2;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  max-width: 150px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  /* 专业图标 + 专业名称：每个专业一个与本专业相关的图标 */
  display: -webkit-inline-box;
  display: inline-flex;
  -webkit-box-align: center;
  align-items: center;
  gap: 4px;
}
.hp-corner-ico { display: inline-block; width: 12px; height: 12px; line-height: 0; }
.hp-corner-ico svg { width: 12px; height: 12px; display: block; }
.hp-corner-txt { display: inline-block; }

.hp-card-body { padding: 10px 11px 12px; }
.hp-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--hp-ink-900);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 副标题：正标题下方小字 */
.hp-card-sub {
  font-size: 10.5px;
  color: var(--hp-ink-400);
  line-height: 1.4;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hp-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 9px;
}
/* 价格统一为「会员免费」（橙色字，颜色由后台配置 --hp-free-color 驱动） */
.hp-free {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--hp-free-color, #FF8A1F);
  letter-spacing: .2px;
}
.hp-price {
  color: #FF4D4D;
  font-size: 14px;
  font-weight: 800;
}
.hp-price i {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  margin-right: 1px;
}
.hp-joined { font-size: 10px; color: var(--hp-ink-400); }
.hp-bar {
  height: 4px;
  border-radius: 2px;
  background: #EDF2FA;
  margin-top: 9px;
  overflow: hidden;
}
.hp-bar em {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--hp-grad);
}

/* ==========================================================
   六、资讯动态（图文列表）
   ========================================================== */
.hp-news {
  background: #fff;
  border-radius: var(--hp-radius-l);
  padding: 4px 14px;
  box-shadow: var(--hp-shadow-s);
}
.hp-news-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hp-line);
}
.hp-news-item:last-child { border-bottom: 0; }
.hp-news-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hp-news-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--hp-ink-900);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hp-news-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}
.hp-news-cat {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--hp-blue-600);
  background: var(--hp-blue-100);
  padding: 2px 7px;
  border-radius: 5px;
}
.hp-news-cat.c2 { color: #1B8A6B; background: #E1F6EF; }
.hp-news-cat.c3 { color: #C4761B; background: #FDF0DC; }
.hp-news-time { font-size: 10.5px; color: var(--hp-ink-400); }

.hp-news-thumb {
  width: 88px; height: 62px;
  flex: 0 0 88px;
  border-radius: 11px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hp-news-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hp-news-thumb.n1 { background: linear-gradient(135deg, #2E74E8, #6FB6FF); }
.hp-news-thumb.n2 { background: linear-gradient(135deg, #1E56BE, #4E9CFF); }
.hp-news-thumb.n3 { background: linear-gradient(135deg, #3E85F0, #9CCDFF); }
.hp-news-thumb.n4 { background: linear-gradient(135deg, #2A66D9, #6FB6FF); }
/* 蓝色调统一层：压住任何配图颜色，保证与上方板块色调一致 */
.hp-news-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(135deg, rgba(46, 116, 232, .68), rgba(111, 182, 255, .40));
  pointer-events: none;
}
.hp-news-thumb > span {
  position: relative;
  z-index: 3;
  font-size: 22px;
  opacity: .9;
}
.hp-news-thumb > img {
  position: relative;
  z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.5) brightness(1.08);
}

/* ==========================================================
   七、底部说明 & 底部导航（对标链接样式）
   ========================================================== */
.hp-footnote {
  text-align: center;
  font-size: 10.5px;
  color: var(--hp-ink-400);
  padding: 22px 0 8px;
  letter-spacing: .4px;
}

/* 首页底部导航加高，容纳中央凸起按钮 */
:root { --tabbar-h: 70px; }

#tabbar {
  height: calc(70px + var(--safe-bottom, 0px));
  align-items: flex-start;
  padding: 9px 6px 0;
  background: rgba(255, 255, 255, .94);
}
#tabbar .tab-item {
  min-height: 0;
  justify-content: flex-start;
  gap: 3px;
  padding-top: 3px;
  color: var(--hp-ink-400);
}
#tabbar .tab-icon { width: 22px; height: 22px; }
#tabbar .tab-text {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .2px;
}
#tabbar .tab-item.is-active { color: var(--hp-blue-600); }

/* 中央凸起「学习」按钮 */
#tabbar .tab-center {
  flex: 0 0 62px;
  margin-top: -27px;
  padding-top: 0;
  color: var(--hp-blue-600);
}
.tab-fab {
  width: 50px; height: 50px;
  border-radius: 17px;
  background: var(--hp-grad);
  border: 3px solid #fff;
  box-shadow: var(--hp-shadow-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.tab-fab svg { width: 24px; height: 24px; }
#tabbar .tab-center .tab-text {
  font-weight: 700;
  color: var(--hp-blue-700);
}

.hp-bottom-space {
  height: calc(70px + var(--safe-bottom, 0px) + 12px);
}

/* ==========================================================
   八、小屏适配
   ========================================================== */
@media (max-width: 350px) {
  .hp-hero { padding-left: 15px; padding-right: 15px; }
  .hp-carousel { margin-left: 12px; margin-right: 12px; }
  .hp-section { padding-left: 12px; padding-right: 12px; }
  .hp-cards { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .hp-card { flex: 0 0 188px; }
  .hp-news-thumb { width: 78px; flex-basis: 78px; height: 58px; }
  .hp-brand-txt b { font-size: 17.5px; }
  .hp-gi-ico { width: 40px; height: 40px; }
  .hp-gi-txt { font-size: 10.8px; }
}

/* 画框模式下轮播高度略收，并让头部避开刘海 */
@media (min-width: 600px) {
  .hp-slide { height: 162px; }
  .phone-frame .hp-hero { padding-top: 36px; }
}
