/**
 * 首页样式 —— 主题「晨曦 Aurora」
 *
 * @description Hero、通用区块、服务卡片、首页三栏（天气 / 工具 / 商城）、日历
 */

/* ==================== Hero ==================== */
.hero {
  padding: 128px 0 92px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* 双色极光：两个错位的径向光斑，比单一渐变更有层次 */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  opacity: .62;
}
.hero::before {
  width: 820px;
  height: 500px;
  top: -220px;
  left: 50%;
  transform: translateX(-80%);
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 38%, transparent) 0%, transparent 70%);
  animation: auroraA 14s var(--ease) infinite alternate;
}
.hero::after {
  width: 740px;
  height: 460px;
  top: -170px;
  left: 50%;
  transform: translateX(-14%);
  background: radial-gradient(circle, color-mix(in srgb, var(--info) 32%, transparent) 0%, transparent 70%);
  animation: auroraB 17s var(--ease) infinite alternate;
}

@keyframes auroraA {
  from { transform: translateX(-80%) scale(1); }
  to   { transform: translateX(-72%) scale(1.08); }
}
@keyframes auroraB {
  from { transform: translateX(-14%) scale(1); }
  to   { transform: translateX(-22%) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .hero::before, .hero::after { animation: none; }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 26px;
  position: relative;
  z-index: var(--z-base);
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-ring);
  box-shadow: var(--shadow-xs);
}

.hero-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
  box-shadow: 0 0 0 4px var(--primary-ring);
}

.hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 3.9rem);
  font-weight: 800;
  letter-spacing: -1.6px;
  color: var(--text);
  line-height: 1.14;
  margin-bottom: 20px;
  position: relative;
  z-index: var(--z-base);
}

/* 高亮词：品牌渐变文字 */
.hero h1 em {
  font-style: normal;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero .sub {
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 36px;
  position: relative;
  z-index: var(--z-base);
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 58px;
  flex-wrap: wrap;
  position: relative;
  z-index: var(--z-base);
}

.hero-actions .btn,
.hero-actions a.btn {
  padding: 15px 34px;
  font-size: 1.02rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: var(--z-base);
}

.hero-stats .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 132px;
  padding: 18px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.hero-stats .stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.hero-stats .num {
  font-size: 2.05rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.6px;
  display: flex;
  align-items: baseline;
  gap: 1px;
  font-variant-numeric: tabular-nums;
}

.hero-stats .num i {
  font-style: normal;
  font-size: 1rem;
  font-weight: 600;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-stats .label {
  font-size: 12.5px;
  color: var(--text-3);
}

/* ==================== 通用区块 ==================== */
.section { padding: var(--section-y) 0; }

.section-tint { background: var(--bg-soft); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 38px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: clamp(1.45rem, 2.4vw, 1.72rem);
  font-weight: 780;
  letter-spacing: -.5px;
  color: var(--text);
}
/* 标题左侧品牌竖条 */
.section-head h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  border-radius: 3px;
  background: var(--grad-brand);
  margin-right: 12px;
  vertical-align: -3px;
}

.section-head .sub {
  font-size: 13px;
  color: var(--text-3);
}

.section-head .more {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: opacity var(--dur);
}
.section-head .more:hover { opacity: .75; }

/* ==================== 滚动渐入 ==================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ==================== 平台服务卡片 ==================== */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.svc-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 28px 26px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all .28s var(--ease);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

/* 顶部品牌渐变条（hover 时展开） */
.svc-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.svc-card:hover::before { transform: scaleX(1); }

.svc-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.svc-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  transition: all .28s var(--ease);
}
.svc-card:hover .svc-icon {
  background: var(--grad-brand);
  color: var(--text-onbrand);
  transform: scale(1.07) rotate(-5deg);
  box-shadow: var(--shadow-brand);
}

.svc-text { flex: 1; min-width: 0; }
.svc-text h3 {
  font-size: 15.5px;
  font-weight: 680;
  color: var(--text);
  margin-bottom: 3px;
}
.svc-text p {
  font-size: 13px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.svc-card .arrow {
  color: var(--text-3);
  font-size: 18px;
  transition: all .28s var(--ease);
  flex-shrink: 0;
}
.svc-card:hover .arrow { color: var(--primary); transform: translateX(5px); }

/* ==================== 首页三栏布局 ==================== */
.home-main {
  display: grid;
  grid-template-columns: 290px 1fr 1fr;
  gap: 20px;
  /* 三栏等高：默认值就是 stretch，这里显式写出来并加注释。
     之前是 align-items:start —— 每列各按内容收缩，工具列 4 行把另外两列甩开一大截。
     现在列高由最高的列（推荐工具）决定，其余两列拉伸对齐。 */
  align-items: stretch;
}

.home-left,
.home-center,
.home-center > .goods-section,
.home-right > .goods-section {
  /* 列本身是 flex 纵向；中间/右侧的卡片都撑满所在列，
     与最高列（左侧天气+日历）底边对齐。 */
  min-height: 0;
}
.home-center > .goods-section,
.home-right > .goods-section { flex: 1 1 auto; height: 100%; }

/* 左列：天气保持自然高度，日历吃掉剩余高度（grid 行距均匀铺开填满卡片） */
.home-left > .calendar-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.home-left > .calendar-card .cal-grid {
  flex: 1 1 auto;
  align-content: space-evenly;
}
/* 天气卡也允许拉伸（若它成为最高内容），内容纵向居中避免下方留白 */
.home-left > .weather-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.home-left,
.home-center,
.home-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==================== 天气卡片 ==================== */
.weather-card {
  background: var(--grad-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.weather-card .w-icon {
  font-size: 2.8rem;
  margin-bottom: 8px;
  line-height: 1;
}
.weather-card .w-icon i {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.weather-card .w-temp {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.weather-card .w-desc { font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.weather-card .w-city { font-size: 13px; color: var(--text-3); }

/* ==================== 日历卡片 ==================== */
.calendar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-title { font-size: 14px; font-weight: 650; color: var(--text); }

.cal-nav { display: flex; gap: 4px; }

.cal-nav button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--text-2);
  transition: all var(--dur) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
}
.cal-nav button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

/* ==================== 三栏内的分区卡片 ==================== */
.goods-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.goods-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.goods-head .g-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.goods-head h3 { font-size: 15px; font-weight: 650; color: var(--text); flex: 1; }

.goods-head .g-more {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: opacity var(--dur);
}
.goods-head .g-more:hover { opacity: .75; }

/* ==================== 工具网格（首页） ==================== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.tool-card {
  padding: 14px 12px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  transition: all .25s var(--ease);
  text-decoration: none;
  display: block;
}

.tool-card:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.tool-card .tool-icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
}
.tool-card .tool-icon i {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.tool-card .tool-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-card .tool-desc {
  font-size: 11.5px;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== 商城上新（首页） ==================== */
.goods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* 商品卡片与上方「推荐工具」卡片保持同一套底与框：
   浅底(--card-soft) + 1px 边线(--border) + 同档圆角，静止时就看得见轮廓。
   之前这里写的是 border: 1px solid transparent —— 不 hover 就完全没有框，
   和旁边工具卡片放一起像个没做完的占位。 */
.good-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--card-soft);
  border: 1px solid var(--border);
  transition: all var(--dur) var(--ease);
}
.good-card:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.good-thumb {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.good-thumb img { width: 100%; height: 100%; object-fit: cover; }
.good-thumb .no-img { color: var(--text-3); font-size: 1.5rem; }

.good-info { flex: 1; min-width: 0; }

.good-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.good-price {
  font-size: 13px;
  font-weight: 750;
  background: var(--grad-warm);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

/* 右侧商城卡片：内容区吃掉卡片「剩余」高度。
   ★ 不能给 .goods 写 height:100% —— 那样会连 goods-head 一起顶出去，
     底部两件商品会溢出卡片边框（踩过）。正确做法是卡片自身做纵向 flex：
     标题栏固定高度，商品区 flex:1 + min-height:0 吃掉剩下的空间。 */
.home-right > .goods-section {
  display: flex;
  flex-direction: column;
}
.home-right > .goods-section > .goods-head { flex: 0 0 auto; }
.home-right > .goods-section > .goods {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  /* 6 个商品 2 列 × 3 行，行高按剩余空间均分；
     minmax(0, 1fr) 允许行收缩，空间不足时不会把内容挤出卡片 */
  grid-template-rows: repeat(3, minmax(0, 1fr));
}
.home-right .good-card {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px;
  text-align: center;
  height: 100%;
  overflow: hidden;
}
.home-right .good-info { flex: 0 0 auto; }
.home-right .good-thumb {
  width: 56px;
  height: 56px;
  flex: 0 1 auto;
  min-height: 0;   /* 空间不够时缩略图先缩，保证商品名/价格不被切掉 */
}

/* ==================== 日历 / 天气补齐 ==================== */
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.cal-week span {
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  padding: 2px 0;
}

.calendar-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 0;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background var(--dur), color var(--dur);
  min-height: 34px;
}
.calendar-day:hover { background: var(--bg-soft); }

.calendar-day .day-num {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.2;
}
.calendar-day .day-lunar {
  font-size: 9px;
  color: var(--text-3);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.calendar-day .day-lunar.special { color: var(--primary); }

.calendar-day.today {
  background: var(--grad-brand);
  box-shadow: var(--shadow-brand);
}
.calendar-day.today .day-num,
.calendar-day.today .day-lunar { color: var(--text-onbrand); }
.calendar-day.today .day-lunar.special { color: var(--text-onbrand); }

.calendar-day.selected { box-shadow: inset 0 0 0 2px var(--primary); }

.weather-card .w-extra {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
}
.weather-card .w-extra .fas { color: var(--primary); margin-right: 3px; }

/* ==================== 响应式 ==================== */
/* ---- 内容动态列宽：按显示块数用类控制（原来用内联 style，
     内联优先级最高会压死移动端媒体查询 —— 手机上 290px 1fr 1fr 直接挤碎） ---- */
.home-main.cols-3 { grid-template-columns: 290px 1fr 1fr; }
.home-main.cols-2 { grid-template-columns: 290px 1fr; }  /* 天气列固定窄，剩余给另一块 */
.home-main.cols-1 { grid-template-columns: 1fr; }

@media (max-width: 992px) {
  .svc-grid { grid-template-columns: repeat(2, 1fr); }
  .home-main.cols-3,
  .home-main.cols-2 { grid-template-columns: 1fr 1fr; }
  .home-left { grid-column: 1 / -1; flex-direction: row; }
  .home-left > * { flex: 1; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hero { padding: 56px 0 44px; }
  .hero h1 { letter-spacing: -.8px; }
  .hero .sub { font-size: .96rem; margin-bottom: 26px; }
  .hero-actions { margin-bottom: 38px; gap: 12px; }
  .hero-actions .btn,
  .hero-actions a.btn { padding: 13px 26px; font-size: .96rem; flex: 1 1 140px; }
  /* Hero 统计条：手机上一排固定 2 个（2×2）。
     原来是 flex 换行 + min-width:96px，390px 屏会挤成一行 3 个，视觉很乱 */
  .hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hero-stats .stat { min-width: 0; padding: 14px 12px; }
  .hero-stats .num { font-size: 1.5rem; }
  .section-head { margin-bottom: 22px; }
  .section-head h2 { font-size: 1.3rem; }
  .svc-card { padding: 18px 16px; gap: 14px; }
  .svc-grid { grid-template-columns: 1fr; }
  /* 内容动态：手机上全部通栏单列——推荐工具/商城上新挤在半列里
     会把标题挤成竖排字（「常/用/工/具」）、空状态文案断行，必须各自独占一行 */
  .home-main.cols-3,
  .home-main.cols-2,
  .home-main.cols-1 { grid-template-columns: 1fr; gap: 14px; }
  .home-left { display: contents; }               /* 让天气/日历成为 grid 直接子项 */
  .home-left > * { grid-column: 1 / -1; }         /* 各自通栏 */
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .goods { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 36px 0; }
  .section-head h2 { font-size: 1.2rem; }
  .calendar-day { min-height: 32px; padding: 3px 0; }
  .calendar-day .day-num { font-size: 12px; }
  .calendar-day .day-lunar { font-size: 8px; }
}
