/* public/market-page.css - Styles specific to the Market Page */

/* Apply theme colors to the market page body */
body.market-page {
  background-color: var(--background-color);
  color: var(--other-text-color);
}

/* --- Navbar Styles (market.ejs) --- *//* --- Navbar Styles (market.ejs) --- */
.navbar {
  padding: 15px;
  display: flex;
  justify-content: space-between; /* 让左右两块内容分开 */
  align-items: center; /* <-- 修改这里：改为居中对齐 */
  border-bottom: 1px solid var(--navbar-text-color);
  position: relative;
  min-height: 100px;
  box-sizing: border-box;
  width: 100%;
}
/* 左侧 Logo 和介绍的容器 */
.navbar-content {
  display: flex;
  flex-direction: column; /* 让 Logo 和介绍垂直排列 */
  align-items: flex-start; /* 内容左对齐 */
  margin-right: 15px; /* 和右侧内容保持一点间距 */
}

.navbar .logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--navbar-text-color);
  margin: 0;
  line-height: 1.2;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.navbar .logo.is-hidden {
  visibility: hidden;
}

/* 新增的导航栏介绍样式 */
.navbar-intro {
  font-size: 13px;
  color: var(--navbar-text-color);
  margin-top: 8px; /* 与Logo的间距 */
  opacity: 0.9;
  line-height: 1.5;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* 右侧时间信息的容器 */
.navbar .time-container {
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0; /* 防止被压缩 */
}

.navbar .update-time, .navbar .real-time-price, .navbar .market-status {
  font-size: 13px;
  color: var(--navbar-text-color);
  margin: 0;
  line-height: 1.5;
}

.navbar .market-status {
    font-weight: bold;
    margin-top: 2px;
}
.navbar .real-time-price {
  margin-top: 2px;
  font-weight: bold;
}

/* --- Media Queries for Navbar --- */
@media (min-width: 600px) {
  .navbar .logo {
    font-size: 32px;
  }
  .navbar-intro {
    font-size: 15px;
  }
  .navbar .update-time, .navbar .real-time-price, .navbar .market-status {
    font-size: 14px;
  }
}

@media (min-width: 992px) {
  .navbar .logo {
    font-size: 36px;
  }
}
.navbar button {
  cursor: pointer;
  background-color: var(--navbar-text-color);
  color: var(--background-color);
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
}
.navbar button:hover {
  filter: brightness(0.9);
}

/* --- Index Page: Price Table Styles (market.ejs) --- */
.price-section {
  background-color: var(--background-color);
  padding: 15px 0;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}
.table-title {
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  color: var(--navbar-text-color);
  background-color: var(--title-bg-color);
  margin: 0 0 15px 0;
  padding: 10px 0;
  width: 100%;
  box-sizing: border-box;
}
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 0 10px;
}
#metals-table {
  width: 100%;
  min-width: 320px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--table-border-color);
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  border-radius: 6px;
  overflow: hidden;
}

#metals-table th, #metals-table td {
  border-bottom: 1px solid var(--table-border-color);
  border-right: 1px solid var(--table-border-color);
  text-align: center;
  word-wrap: break-word;
  vertical-align: middle;
}

/* 设置表格内容行的样式 */
#metals-table td {
  padding: 8px 10px;
  font-size: 17px;
}

/* --- 这是核心修改区域 --- */
/* 设置表头的样式 */
#metals-table th {
  padding: 12px 10px;
  font-size: 16px; /* 从 14px 增大到 16px */
  background-color: var(--table-header-bg-color);
  color: var(--table-header-text-color);
  white-space: nowrap;
  font-weight: bold;
}
/* --- 核心修改区域结束 --- */


#metals-table th.product-column,
#metals-table td.product-name {
  color: var(--table-product-text-color);
}
body.market-page #metals-table td.price-value,
body.market-page #metals-table td.price-neutral,
body.market-page #metals-table td.high-low span {
    color: var(--table-price-text-color) ;
}
body.market-page #metals-table span.price-neutral {
  color: var(--table-price-text-color) ;
}
#metals-table tbody tr:nth-child(odd) {
  background-color: color-mix(in srgb, var(--background-color) 90%, #444);
}
#metals-table tbody tr:nth-child(even) {
  background-color: color-mix(in srgb, var(--background-color) 95%, #333);
}
#metals-table tbody tr {
  line-height: 1.4;
}
.high-low {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 30px;
}

.high-low span {
  display: block;
  line-height: 1.3;
  font-size: 15px; 
}

#metals-table td.price-up, #metals-table span.price-up { color: var(--price-up-color) !important; }
#metals-table td.price-down, #metals-table span.price-down { color: var(--price-down-color) !important; }
#metals-table td.price-neutral, #metals-table span.price-neutral { color: var(--price-neutral-color); }


/* --- Index Page: About Us & Map Styles (market.ejs) --- */
.about-us, .map-section {
  padding: 15px 0;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  color: var(--other-text-color);
}
.about-us {
  text-align: center;
  margin: 15px 0;
  padding: 0;
}
.map-title, .about-us h2 {
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  color: var(--navbar-text-color);
  background-color: var(--title-bg-color);
  padding: 10px 0;
  width: 100%;
  margin: 0 0 15px 0;
  box-sizing: border-box;
}
.about-us .intro {
  font-size: 15px;
  color: var(--other-text-color);
  padding: 0 15px 0px 15px;
  margin: 0 auto;
  max-width: 90%;
  line-height: 1.8;
  text-align: left;
}
.about-us .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 15px 10px 15px;
}
.about-us-image {
  width: 80%;
  max-width: 150px;
  height: auto;
  margin-top: 5px;
  margin-bottom: 5px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  border: 1px solid var(--table-border-color);
  padding: 3px;
  background-color: var(--table-header-bg-color);
}
.about-us .contact, .about-us .address {
  font-size: 16px;
  margin: 1px 0;
  text-align: center;
}
.about-us .contact-link, .about-us .address-link {
  color: var(--other-text-color);
  text-decoration: none;
}
.about-us .contact-link:hover, .about-us .address-link:hover {
  text-decoration: underline;
}
.map-section {
  margin-top: 15px;
  padding: 0;
  width: 100%;
}
#map {
  width: 100%;
  height: 350px;
  margin: 0;
  border-top: 1px solid var(--table-header-bg-color);
  border-bottom: 1px solid var(--table-header-bg-color);
}

/* --- Footer Styles (market.ejs) --- */
.footer {
  background-color: color-mix(in srgb, var(--background-color) 70%, black);
  text-align: center;
  padding: 15px;
  font-size: 13px;
  color: var(--other-text-color);
  margin-top: 20px;
  border-top: 1px solid var(--navbar-text-color);
  box-sizing: border-box;
}
.footer p {
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.7;
}
.footer a {
  color: var(--other-text-color);
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}


/* --- Media Queries for Market Page --- */
@media (min-width: 600px) {
  .navbar .logo {
    font-size: 32px;
  }
  .navbar .time-container {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
  }
  .navbar .update-time, .navbar .real-time-price, .navbar .market-status {
    font-size: 14px;
  }
  .table-title, .about-us h2, .map-title {
    font-size: 24px;
  }
  
  #metals-table td {
    padding: 9px 10px;
    font-size: 18px;
  }
  /* --- 这是核心修改区域 (中等屏幕) --- */
  #metals-table th {
    padding: 12px 10px;
    font-size: 17px; /* 从 15px 增大到 17px */
  }
  /* --- 核心修改区域结束 --- */

  .about-us-image {
    max-width: 175px;
  }
  .footer {
    padding: 18px;
    font-size: 14px;
  }
  .footer p {
    font-size: 13px;
  }
}

@media (min-width: 992px) {
  .navbar .logo {
    font-size: 36px;
  }
  .table-title, .about-us h2, .map-title {
    font-size: 26px;
  }

  #metals-table td {
    padding: 11px;
    font-size: 19px;
  }
  /* --- 这是核心修改区域 (大屏幕) --- */
  #metals-table th {
    padding: 14px;
    font-size: 18px; /* 从 16px 增大到 18px */
  }
  /* --- 核心修改区域结束 --- */

   .about-us .intro {
    max-width: 80%;
  }
  .about-us-image {
    max-width: 200px;
  }
}

@media (min-width: 1200px) {
  body.market-page .container {
    max-width: 1140px;
    padding: 0 15px;
  }
}

#metals-table th:last-child,
#metals-table td:last-child {
  border-right: none;
}

#metals-table tr:last-child td {
  border-bottom: none;
}

.navbar-contact-info {
  display: flex;
  flex-wrap: wrap; /* 允许在小屏幕上换行 */
  gap: 15px; /* 项目之间的间距 */
  margin-top: 5px;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  padding: 1px 10px;
  border: 1px solid var(--navbar-text-color);
  border-radius: 4px;
  color: var(--navbar-text-color);
  text-decoration: none;
  font-size: 13px;
  transition: background-color 0.2s, color 0.2s;
}

.contact-item:hover {
  background-color: var(--navbar-text-color);
  color: var(--background-color); /* 或者 var(--title-bg-color) */
}

.contact-item .icon {
  margin-right: 6px;
  font-size: 13px;
}
.show-hl-colors .high-low span:first-child {
    color: #ff4d4f !important; /* 红色 (用于最高价) */
}
.show-hl-colors .high-low span:last-child {
    color: #52c41a !important; /* 绿色 (用于最低价) */
}