/* 全局初始化 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html,
body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #F5F7FA;
  color: #1F2937;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  border: none;
  vertical-align: middle;
}

a {
  text-decoration: none;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* 精灵图通用类 */
.index-icon,
.head .btn-feedback::before,
.beian-icon,
.scenic-item.recommended::before,
.weather-icon {
  background-image: url('https://tq.ie123.com/css_sprites.png') !important;
  background-repeat: no-repeat !important;
}

/* 返回顶部 */
.back-top {
  position: fixed;
  right: 20px;
  bottom: 30px;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #42a5f6;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 2px 10px rgba(66, 165, 246, 0.3);
}

.back-top:hover {
  background: #3394e4;
}

.back-top::after {
  content: "↑";
  font-weight: 700;
}

/* 头部 */
.head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
}

.head a {
  line-height: 0;
}

.head img {
  height: 48px;
  object-fit: contain;
}

.head .btn-feedback {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 8px 12px;
  background: #f0f7ff;
  color: #42a5f6;
  border-radius: 16px;
  font-size: 13px;
}

.head .btn-feedback::before {
  content: "";
  width: 16px;
  height: 16px;
  background-position: -234px -134px;
}

/* APP下载按钮 */
.head .bg-1app {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #42a5f6;
  color: #fff;
  border-radius: 16px;
  font-size: 13px;
}

.head .bg-1app::before {
  content: "";
  width: 16px;
  height: 16px;
  background-image: url('https://tq.ie123.com/css_sprites.png');
  background-repeat: no-repeat;
  background-position: -234px -62px;
}

/* 今日天气 */
.today {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 40px 20px 36px;
  color: #fff;
  text-align: center;
}

.today .area h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 4px;
}

.today .area p {
  font-size: 13px;
  opacity: .9;
}

.today .air {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0;
  padding: 6px 14px;
  background: rgba(255, 255, 255, .22);
  font-size: 14px;
  border-radius: 12px;
}

.today .air img {
  width: 18px;
  height: 18px;
}

.today .air-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
}

.today .temp-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 20px 0;
}

.today .degree {
  font-size: 88px;
  font-weight: 300;
  line-height: 1;
}

.today .weather-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 16px;
}

.today .weather-info img {
  width: 64px;
  height: 64px;
}

.today .tips {
  font-size: 15px;
  margin-bottom: 16px;
}

.today .observe {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  font-size: 13px;
  opacity: .95;
}

/* 实时数据图标 */
.observe-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.weather-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
}

.icon-wind {
  background-position: -82px -234px;
}

.icon-humidity {
  background-position: -234px -170px;
}

.icon-rain {
  background-position: -10px -234px;
}

.icon-pressure {
  background-position: -46px -234px;
}

/* 布局容器 */
.container {
  width: 100%;
  max-width: 98%;
  margin: 0 auto;
}

/* 卡片公共样式 */
.card,
.scenic,
.nearby {
  width: 100%;
  background: #fff;
  margin: 16px 0;
}

.card {
  padding: 24px 20px;
}

.scenic {
  padding: 30px 24px;
}

.nearby {
  padding: 20px;
}

.card .tit,
.scenic .tit,
.nearby .link-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #111827;
}

/* 气象百科 */
.encyclopedia {
  margin: 16px 0;
  padding: 24px 20px;
  background: #fff;
}

.encyclopedia .tit {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #111827;
}

.encyclopedia-content {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.encyclopedia-img {
  flex: 0 0 140px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
}

.encyclopedia-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.encyclopedia-text {
  flex: 1;
  font-size: 14px;
  color: #4B5563;
  line-height: 1.7;
  max-height: 100px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

/* 明日天气 */
.tomorrow {
  display: flex;
  gap: 14px;
  margin: 20px 0;
  width: 100%;
}

.tomorrow .item {
  flex: 1;
  padding: 24px 16px;
  background: #fff;
  text-align: center;
}

.tomorrow .date {
  font-size: 15px;
  color: #4B5563;
  margin-bottom: 8px;
}

.tomorrow .temperature {
  font-size: 17px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 12px;
}

.tomorrow .weather {
  font-size: 14px;
  color: #6B7280;
  margin-bottom: 10px;
}

.tomorrow .bottom img {
  width: 40px;
  height: 40px;
  margin: 0 2px;
}

/* 24小时预报 */
.hours-data {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

.hours-table {
  width: 100%;
  min-width: 540px;
  font-size: 14px;
  color: #374151;
}

.hours-table th,
.hours-table td {
  padding: 8px 6px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid #f3f4f6;
}

.hours-table th {
  font-weight: 500;
  color: #111827;
  background: #f9fafb;
}

.hours-table img {
  width: 20px;
  height: 20px;
}

/* 多日预报 */
.days dl {
  padding: 14px 0;
  border-bottom: 1px solid #F3F4F6;
}

.days dd {
  display: flex;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
}

.days dd span {
  flex: 1;
  text-align: center;
}

.days dd span img {
  width: 26px;
  height: 26px;
}

.temp-high {
  color: #ffb74d;
}

.temp-low {
  color: #4fc3f7;
}

/* 生活指数图标 */
.index-icon {
  display: inline-block;
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
}

.bg-airconditioner { background-position: -10px -10px; }
.bg-allergy { background-position: -66px -10px; }
.bg-carwash { background-position: -10px -66px; }
.bg-chill { background-position: -66px -66px; }
.bg-clothes { background-position: -178px -178px; height: 34px; }
.bg-cold { background-position: -122px -10px; }
.bg-diffusion { background-position: -122px -66px; }
.bg-drying { background-position: -10px -122px; }
.bg-fish { background-position: -66px -122px; }
.bg-heatstroke { background-position: -122px -122px; }
.bg-makeup { background-position: -178px -66px; }
.bg-sports { background-position: -178px -10px; }
.bg-sunscreen { background-position: -178px -122px; }
.bg-traffic { background-position: -10px -178px; }
.bg-ultraviolet { background-position: -66px -178px; }
.bg-umbrella { background-position: -122px -178px; }

/* 生活指数 */
.index {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.index .item {
  flex: 1 1 calc(25% - 12px);
  min-width: 110px;
  max-width: 160px;
  min-height: 100px;
  padding: 18px 12px;
  background: #F9FAFB;
  text-align: center;
  font-size: 12px;
  color: #4B5563;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.index .item span {
  min-height: 32px;
  line-height: 1.4;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.index .item p {
  margin-top: auto;
  color: #9CA3AF;
}

/* 景区推荐 */
.scenic-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(12px, 2vw, 20px);
}

.scenic-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 16px;
  background: #f9fafb;
  text-align: center;
}

.scenic-item.recommended::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 32px;
  height: 32px;
  background-position: -234px -10px;
}

.scenic-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.scenic-item img {
  width: 100%;
  min-height: 120px;
  aspect-ratio: 16/9;
  object-fit: cover;
  margin-bottom: 12px;
}

.scenic-item .name {
  font-size: 13px;
  color: #374151;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 4px;
}

.scenic-item .city {
  margin-top: 2px;
  font-size: 12px;
  color: #9ca3af;
}

/* 城市 & 友情链接网格 */
.grid-link {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px 8px;
}

.grid-link a {
  display: block;
  padding: 8px 0;
  max-width: 5em;
  color: #374151;
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 4px;
}

.grid-link a:hover {
  background: #eef5ff;
  color: #1976d2;
}

.link-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.btn-apply {
  padding: 2px 6px;
  background: #42a5f6;
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
}

/* 底部版权 */
.copyright {
  width: 100%;
  padding: 16px 20px;
  font-size: 14px;
  color: #9CA3AF;
  text-align: center;
  margin-top: 10px;
}

.beian-icon {
  display: inline-block;
  vertical-align: middle;
  width: 16px;
  height: 16px;
  margin-right: 4px;
  background-position: -234px -98px;
}

/* 响应式 */
@media (max-width: 480px) {
  .days .hide-mobile {
    display: none;
  }

  .head img {
    height: 40px;
  }

  .hours-table {
    min-width: 100%;
    font-size: 12px;
  }

  .hours-table th,
  .hours-table td {
    padding: 6px 4px;
  }

  .card {
    padding: 16px 12px;
  }

  .scenic {
    padding: 20px 12px;
  }

  .nearby {
    padding: 16px 12px;
  }

  .encyclopedia-content {
    flex-direction: column;
    gap: 12px;
  }

  .encyclopedia-img {
    flex: 0 0 100px;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .scenic-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .scenic-item {
    padding: 12px !important;
  }

  .scenic-item img {
    min-height: 90px !important;
  }
}