/* 变量定义 */
:root {
  --primary: #00C5DD;
  --secondary: #FF6B35;
  --accent: #4CAF50;
  --dark: #1E293B;
  --light: #f8f9fa;
  --gray: #6c757d;
  --white: #ffffff;
  --blue: #00C5DD;
  --green: #2ecc71;
  --orange: #f39c12;
}

/* 基础样式 */
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--dark);
  background-color: var(--light);
  margin: 0;
  /* padding: 20px; */
}

.query {
  margin: 0 auto;
}

.main-title {
  font-size: 0.2083rem;
  font-weight: bold;
  margin: 0.3125rem auto;
}

/* 容器样式 */
.weather-tide-container {
  max-width: 1400px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 30px;
}

/* 页面标题 */
.page-title {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 30px;
  color: var(--dark);
  text-align: center;
}

/* 内容包装器 */
.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* 日期和标签部分 */
.date-section {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.date-info {
  font-size: .0729rem;
  color: #333;
}

.weather-tabs {
  display: flex;
  margin-left: .55rem;
  margin-right: .08rem;
  gap: 10px;
}

.tab {
  padding: .0417rem .0833rem;
  border: none;
  border-radius: .0313rem;
  background-color: var(--light);
  color: var(--dark);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: .0729rem;
}

.tab.active {
  background-color: var(--blue);
  color: var(--white);
}

.tab:hover {
  background-color: var(--blue);
  color: var(--white);
}

.tide-header {
  display: flex;
  align-items: center;
  gap: 15px;
}

.tide-title {
  display: flex;
  align-items: center;
  font-size: .125rem;
  font-weight: bold;
  margin: 0;
}

.tide-type {
  margin-left: .0521rem;
  background-color: #FF6E0C;
  color: var(--white);
  padding: .0104rem .0417rem;
  border-radius: .026rem;
  font-size: .0729rem;
}

.date-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: .5rem;
  position: relative;
}

.current-date {
  font-size: 14px;
  color: var(--gray);
  min-width: 100px;
}

.date-btn {
  padding: 6px 12px;
  border: 1px solid var(--blue);
  border-radius: 4px;
  background-color: var(--white);
  color: var(--blue);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 12px;
}

.date-btn:hover {
  background-color: var(--blue);
  color: var(--white);
}

.date-input {
  padding: 5px;
  border: 1px solid var(--blue);
  border-radius: 4px;
  font-size: 12px;
}

.tide-laydate {
  position: absolute;
  width: 0;
  height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
}

/* 主要内容部分 */
.main-content {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

/* 左侧天气信息 */
.weather-info {
  flex: 1;
  min-width: 47%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.weather-content {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.weather-content.active {
  display: flex;
}

/* 当前天气 */
.current-weather {
  display: flex;
  flex-direction: column;
  gap: .0781rem;
}

.temperature {
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: 'D-DIN-PRO', sans-serif;
}

.temp-info {
  display: flex;
  flex-direction: column;
}

.temp-info img {
  display: block;
  width: .25rem;
  height: .25rem;
}

.temperature .temp {
  font-size: .5rem;
  font-weight: bold;
  color: var(--dark);
}

.weather-icon {
  font-size: 32px;
}

.weather-desc {
  font-size: 18px;
  /* color: var(--gray); */
}

.weather-detail {
  display: flex;
  gap: 10px;
}

.temp-range {
  margin: 0;
  font-size: 14px;
}

.sunset {
  margin-left: 15px;
}

.sun-info {
  display: flex;
  gap: 20px;
  font-size: 14px;
  margin-left: auto;
}

.sun-icon {
  width: 24px;
  height: 24px;
  margin-right: 5px;
  vertical-align: middle;
}

.air-quality {
  margin-left: auto;
  font-size: .0729rem;
}

.air-quality span {
  background-color: #30BF25;
  padding: .0156rem;
  color: #fff;
  border-radius: .0208rem;
}

/* 天气统计 */
.weather-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 20px;
  border-radius: 12px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
}

.stat-label {
  padding-left: 5px;
  border-left: 4px solid #00C5DD;
}

.stat-value {
  color: var(--dark);
  font-weight: 500;
}

/* 天气图表容器 */
.weather-chart-container {
  height: 350px;
  /* padding: 20px; */
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.5);
}

#weatherChart,
#weatherChartTomorrow,
#weatherChartWeek {
  width: 100%;
  height: 100%;
}

/* 右侧潮汐信息 */
.tide-info {
  flex: 1;
  min-width: 47%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 潮汐时间卡片 */
.tide-times {
  display: flex;
  gap: 15px;
  flex-wrap: nowrap;
}

.tide-time-card {
  position: relative;
  flex: 1;
  min-width: 150px;
  padding: 20px;
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.tide-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.card-title {
  position: relative;
  z-index: 1;
  width: 100%;
  font-size: 16px;
  font-weight: bold;
  margin: 0;
  color: var(--dark);
}

.time-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--gray);
}

.time-icon {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;

}

.time-range {
  font-size: 12px;
}

.time-range-empty {
  color: #999;
}

.tide-info.tide-loading {
  opacity: 0.6;
  pointer-events: none;
}

.tide-error {
  color: #e74c3c;
  font-size: 12px;
}

/* 潮汐图表容器 */
.tide-chart-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-radius: 12px;
}

.tide-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
}

.tide-label {
  font-weight: 500;
  color: var(--dark);
}

.tide-status {
  display: flex;
  gap: 15px;
  font-size: 12px;
  color: var(--gray);
}

.current-tide {
  color: #FF6E0C;
  font-weight: bold;
}

#tideChart {
  width: 100%;
  height: 300px;
}

.tide-chart-footer {
  text-align: center;
  font-size: 12px;
  color: var(--gray);
}

.tide-chart-footer p {
  margin: 0;
}

/* 响应式设计 */
/* 笔记本尺寸 */
@media (max-width: 1600px) {
  .weather-tide-container {
    max-width: 1200px;
  }

  .time-icon {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 992px) {
  .main-title {
    font-size: 0.64rem;
    padding: 0 0.5333rem;
  }

  .main-content {
    flex-direction: column;
  }

  .weather-chart-container {
    width: 108%;
    margin-left: -7%;
  }

  .weather-info {
    flex: none;
  }

  .weather-info,
  .tide-info {
    max-width: 100%;
  }

  .date-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .tide-header {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .time-icon {
    width: 36px;
    height: 36px;
  }

  .weather-stats {
    gap: 10px;
    flex-wrap: wrap;
    padding: 0;
  }

  .stat-item {
    width: 47%;
  }

  .tide-title {
    font-size: 16px;
  }

  .tide-type {
    margin-left: 10px;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 12px;
  }

  .date-selector {
    margin-left: 0;
  }

  .tide-times {
    flex-wrap: wrap;
    flex-direction: row;
  }

  .tide-time-card {
    flex: none;
    width: 47% !important;
    box-sizing: border-box;
    padding: 10px;
  }

  .tide-chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .tide-status {
    flex-direction: column;
    gap: 5px;
  }

  .main-title {
    font-size: 0.64rem;
    padding: 0 0.5333rem;
  }

  .weather-tide-container {
    padding: 20px;
  }

  .page-title {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .temperature {
    /* flex-direction: column;
    align-items: flex-start; */
    flex-wrap: wrap;
    gap: 10px;
  }

  .temp-info img {
    width: 24px;
    height: 24px;
  }

  .weather-icon {
    font-size: 24px;
  }

  .weather-desc {
    font-size: 16px;
  }

  .sun-info {
    flex-direction: column;
    gap: 5px;
  }

  body {
    /* padding: 5px; */
  }

  .weather-tide-container {
    padding: 15px;
  }

  .page-title {
    font-size: 20px;
  }

  .temperature .temp {
    font-size: 52px;
  }

  .air-quality {
    font-size: 14px;
  }

  .air-quality span {
    padding: 2px 5px;
  }

  .sunset {
    margin-left: 0;
  }

  .weather-chart-container,
  #tideChart {
    height: 250px;
  }

  .date-info {
    width: 100%;
    font-size: 14px;
  }

  .weather-tabs {
    width: 100%;
    margin: 10px 0;
    gap: 0 .5rem;
  }

  .tab {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
  }

  .tide-chart-container {
    gap: 0;
    padding: 0;
  }
}

.date-info {
  width: 20%;
}

.weather-tabs {
  width: 30%;
  margin: 0;
  justify-content: flex-end;
}

.tide-header {
  width: 50%;
}

.date-section {
  flex-wrap: nowrap;
}

@media (max-width: 992px) {
  .date-info {
    width: 100%;
  }

  .weather-tabs {
    width: 100%;
  }

  .tide-header {
    width: 100%;
  }
}

.date-selector {
  flex-grow: 1;
  justify-content: flex-end;
}

/* layui.css 全局 a{color:#333} 污染站点头尾，在此恢复 */
.header .navbar .nav,
.header .navbar .nav > li a {
  color: #fff;
}

.header .navbar:hover .nav > li a,
.header .navbar:hover .nav-right-item,
.header .navbar:hover .temp {
  color: #000;
}

.header .navbar .nav > li a:hover {
  color: #00C5DD !important;
}

.header .navbar .nav .sub .sub-nav li:hover a {
  color: #fff !important;
}

.footer .link-list li a,
.footer .friend-list li a {
  color: inherit;
  transition: all 0.3s ease-in-out;
}

.footer .link-list li {
  color: #99A5AF;
}

.footer .link-list li:hover,
.footer .link-list li:hover a {
  color: #00C5DD;
}

.footer .link-list li:nth-child(1),
.footer .link-list li:nth-child(1) a {
  color: #fff;
}

.footer .link-list li:nth-child(1):hover,
.footer .link-list li:nth-child(1):hover a {
  color: #00C5DD;
}

.footer .friend-list li,
.footer .friend-list li a {
  color: #fff;
}

.footer .friend-list li:hover,
.footer .friend-list li:hover a {
  opacity: 1;
}