* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #f5f7fa;
  color: #333;
  font-size: 14px;
}

/* ========== 登录注册页 ========== */
.auth-box {
  max-width: 400px;
  margin: 100px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  overflow: hidden;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
}

.tab-btn {
  flex: 1;
  padding: 14px;
  border: none;
  background: #fafafa;
  cursor: pointer;
  font-size: 16px;
  color: #666;
}

.tab-btn.active {
  background: #fff;
  color: #1677ff;
  font-weight: 500;
}

.auth-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form input {
  padding: 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
}

.primary-btn {
  padding: 12px 16px;
  border: none;
  border-radius: 6px;
  background: #1677ff;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.primary-btn.small {
  padding: 6px 12px;
  font-size: 13px;
}

.primary-btn:hover {
  background: #4096ff;
}

.cancel-btn {
  padding: 12px 16px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  color: #666;
  font-size: 14px;
  cursor: pointer;
}

.tip-text {
  font-size: 13px;
  color: #ff4d4f;
  text-align: center;
  min-height: 18px;
}

.text-btn {
  border: none;
  background: none;
  color: #1677ff;
  cursor: pointer;
  font-size: 13px;
  padding: 6px 8px;
}

/* ========== 主应用容器 ========== */
.main-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  padding-bottom: 60px; /* 给底部导航留位置 */
}

.page-item {
  display: none;
}

.page-item.active {
  display: block;
}

.empty-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60vh;
  color: #999;
  font-size: 15px;
}

/* ========== 页面头部 ========== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid #f0f0f0;
}

.page-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ========== 基金列表 ========== */
.fund-list-header {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr 1.2fr;
  padding: 12px 20px;
  background: #fafafa;
  font-size: 12px;
  color: #999;
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 57px;
  z-index: 9;
}

.col {
  text-align: right;
}

.col-name {
  text-align: left;
}

.fund-list-body {
  background: #fff;
}

.fund-item {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr 1.2fr;
  padding: 14px 20px;
  border-bottom: 1px solid #f5f5f5;
  align-items: center;
}

.fund-item:last-child {
  border-bottom: none;
}

/* 基金名称列 */
.fund-name-info .name {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fund-name-info .sub {
  font-size: 12px;
  color: #999;
  display: flex;
  justify-content: space-between;
}

/* 估值列 */
.fund-value-info .rate {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}

.fund-value-info .price {
  font-size: 12px;
  color: #999;
}

/* 收益列通用 */
.profit { color: #f5222d; }
.loss { color: #52c41a; }

.fund-day-profit .day-profit-num {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}

.fund-day-profit .sector {
  font-size: 12px;
  color: #999;
}

.fund-total-profit .total-profit-num {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}

.fund-total-profit .total-rate {
  font-size: 12px;
}

.loading {
  padding: 60px 20px;
  text-align: center;
  color: #999;
}

/* ========== 底部导航 ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #fff;
  display: flex;
  border-top: 1px solid #f0f0f0;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  color: #999;
  font-size: 12px;
}

.nav-item.active {
  color: #1677ff;
}

.nav-icon {
  font-size: 20px;
}

/* ========== 弹窗 ========== */
.modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-container {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.close-btn {
  border: none;
  background: none;
  font-size: 22px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-item label {
  font-size: 13px;
  color: #666;
}

.form-item input {
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 12px 20px 20px;
}

.modal-footer button {
  flex: 1;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
  .auth-box {
    margin: 60px 20px;
  }

  .page-header {
    padding: 14px 16px;
  }

  .fund-list-header {
    padding: 10px 16px;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
  }

  .fund-item {
    padding: 12px 16px;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
  }

  .fund-name-info .name {
    font-size: 14px;
  }

  .fund-value-info .rate,
  .fund-day-profit .day-profit-num,
  .fund-total-profit .total-profit-num {
    font-size: 14px;
  }

  .sub, .price, .sector, .total-rate {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .fund-list-header .col-day-profit,
  .fund-list-header .col-total-profit {
    font-size: 11px;
  }

  .fund-item {
    grid-template-columns: 1.5fr 0.9fr 0.9fr 0.9fr;
  }
}