/* 主页面样式 */
#main-page {
  flex-direction: column;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

header {
  background: linear-gradient(90deg, #4361ee 0%, #3a0ca3 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 9000;
}

.header-left h1 {
  color: white;
  font-size: 20px;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

#logout-btn {
  min-width: 80px;
}

.user-info {
  display: flex;
  align-items: center;
  position: relative;
}

.user-avatar {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 20px;
  transition: background-color 0.3s ease;
  height: 40px;
  min-width: 100px;
  box-sizing: border-box;
}

.user-avatar:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-avatar i {
  font-size: 24px;
  color: #4cc9f0;
  margin-right: 8px;
}

.username {
  font-weight: 500;
  color: #e6e6e6;
  margin-right: 5px;
}

.user-dropdown {
  position: fixed;
  background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 10000;
  width: max-content;
  min-width: 120px;
  margin-top: 5px;
  overflow: visible;
  padding: 5px 0;
  box-sizing: border-box;
}

.dropdown-item {
  width: 100%;
  text-align: left;
  border-radius: 8px;
  margin-bottom: 5px;
  justify-content: flex-start;
  padding: 10px 15px;
  background: transparent;
  border: none;
  color: #e6e6e6;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  font-size: 14px;
  white-space: nowrap;
  box-sizing: border-box;
  height: auto;
  min-height: 36px;
  line-height: 1.2;
}

.dropdown-item:hover {
  background: linear-gradient(90deg, rgba(67, 97, 238, 0.2) 0%, rgba(58, 12, 163, 0.2) 100%);
  color: #ffffff;
  transform: translateX(3px);
}

.dropdown-item:last-child {
  margin-bottom: 0;
}

/* 退出登录按钮特殊样式 */
.btn-logout {
  color: #ff6b6b !important;
}

.btn-logout:hover {
  background: linear-gradient(90deg, rgba(255, 107, 107, 0.15) 0%, rgba(200, 50, 50, 0.15) 100%) !important;
  color: #ffaaaa !important;
  transform: translateX(3px);
}

.btn-logout i {
  color: #ff6b6b;
}

.btn-logout:hover i {
  color: #ffaaaa;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  padding: 15px;
  background: rgba(30, 30, 46, 0.7);
  border-radius: 10px;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.sidebar {
  width: 220px;
  background: linear-gradient(180deg, #1e1e2e 0%, #2d2d44 100%);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  padding: 20px 0;
  min-height: calc(100vh - 70px);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  color: #e6e6e6;
}

.sidebar li::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(76, 201, 240, 0.2), transparent);
  transition: 0.5s;
}

.sidebar li:hover::before {
  left: 100%;
}

.sidebar li:hover {
  background: linear-gradient(90deg, rgba(67, 97, 238, 0.2) 0%, rgba(58, 12, 163, 0.2) 100%);
  transform: translateX(5px);
}

.sidebar li.active {
  background: linear-gradient(90deg, #4361ee 0%, #3a0ca3 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.sidebar li.active::before {
  display: none;
}

.main-content {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(30, 30, 46, 0.5);
  backdrop-filter: blur(5px);
  border-radius: 15px;
  margin: 10px;
}

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stock-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stock-info {
  flex: 1;
}

.stock-name {
  font-weight: bold;
  margin-bottom: 5px;
  color: #e6e6e6;
}

.stock-code {
  color: #aaa;
  font-size: 14px;
}

.stock-price {
  font-size: 18px;
  font-weight: bold;
  color: #e6e6e6;
}

.stock-change {
  font-size: 14px;
}

.stock-change.positive {
  color: #4CAF50;
}

.stock-change.negative {
  color: #F44336;
}

.stock-actions {
  display: flex;
  gap: 5px;
}

.trade-type.buy {
  color: #4cc9f0;
  font-weight: bold;
}

.trade-type.sell {
  color: #ff006e;
  font-weight: bold;
}

.refresh-indicator {
  display: inline-block;
  margin-left: 10px;
  font-size: 12px;
  color: #aaa;
}

.refresh-indicator.loading {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}