/* 通用样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#zero-tip {
  position: relative;
  top: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 13px;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: #f4f7fa;
  color: #333;
  padding: 60px 0;
}

a {
  text-decoration: none;
  color: inherit;
}

/* 导航栏样式 */
nav {
  background-color: #2c3e50;
  color: white;
  padding: 20px 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 999;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav ul {
  display: flex;
  justify-content: center;
  align-items: center;
  list-style: none;
}

nav ul li {
  margin: 0 20px;
}

nav ul li a {
  color: white;
  font-size: 16px;
  text-transform: uppercase;
  font-weight: 500;
  padding: 8px 12px;
  transition: background-color 0.3s ease;
}

nav ul li a:hover {
  background-color: #34495e;
  border-radius: 3px;
}

/* Banner区域 */
header {
  /* margin-top: 60px; */
  text-align: center;
  padding: 10px;
  background-color: #ecf0f1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.banner {
  width: 100%;
  height: auto;
  border-radius: 10px;
}

/* 搜索框 */
.search-box {
  /* margin-top: 20px; */
  text-align: center;
  padding: 10px;
}

#search {
  width: 100%;
  /* max-width: 400px; */
  padding: 12px;
  font-size: 13px;
  border: 1px solid #bdc3c7;
  border-radius: 10px;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#search:focus {
  border-color: #3498db;
  outline: none;
}

/* 股票列表样式 - 每个信息项一行显示 */
.stock-list {
  padding: 2px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stock-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  padding: 12px 18px;
  border-radius: 8px;
  width: 100%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stock-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.stock-item span {
  font-size: 13px;
  color: #333;
}

.stock-item .name {
  font-size: 14px;
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-item .price {
  font-size: 16px;
  font-weight: bold;
  color: #2c3e50;
}

.stock-item .change {
  font-size: 14px;
  font-weight: 500;
  text-align: right;
}

.stock-item .change.up {
  color: #27ae60; /* 涨幅为正，绿色 */
}

.stock-item .change.down {
  color: #e74c3c; /* 涨幅为负，红色 */
}

button {
  background-color: #3498db;
  color: white;
  padding: 8px 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 13px;
  margin-top: 10px;
  margin-left: 10px;
}

button:hover {
  background-color: #2980b9;
}

/* 弹窗 */
.popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.popup-content {
  background-color: white;
  padding: 25px 30px;
  border-radius: 8px;
  text-align: center;
  max-width: 350px;
  width: 90%;
}

.popup-content p {
  font-size: 18px;
  margin-bottom: 20px;
}

.popup-content button {
  background-color: #2ecc71;
}

.popup-content button:hover {
  background-color: #27ae60;
}
#stock-name {
    margin-top: 20px;
}
/* 适配移动端 */
@media (max-width: 768px) {
  nav ul {
    /* flex-direction: column; */
  }

  .banner {
    width: 100%;
  }

  .stock-item {
    width: 100%;
    font-size: 12px;
  }

  .stock-item .name {
    font-size: 12px;
    max-width: 100px;
  }

  .stock-item .price {
    font-size: 14px;
  }

  .stock-item .change {
    font-size: 12px;
  }

  .search-box {
    /* padding: 15px; */
  }
}

@media (max-width: 480px) {
  nav ul li a {
    font-size: 14px;
  }

  .stock-item {
    width: 100%;
    padding: 10px 8px;
    font-size: 10px;
  }

  .stock-item .name {
    font-size: 10px;
    max-width: 80px;
  }

  .stock-item .price {
    font-size: 12px;
  }

  .stock-item .change {
    font-size: 13px;
  }
}
