/* 全局通用样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: #333333;
  background-color: #F5F7FA;
  -webkit-tap-highlight-color: transparent;
  height: 100%;
}

body {
  padding-bottom: 60px; /* 为底部导航栏留空间 */
}

.app-container {
  min-height: 100vh;
}

/* 全局 Loading */
.global-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.85);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #E0E0E0;
  border-top-color: #4A90D9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 12px;
  font-size: 14px;
  color: #666666;
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.75);
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10000;
  max-width: 80%;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.toast-show {
  opacity: 1;
}

/* 确认弹窗 */
.dialog-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog-box {
  background-color: #FFFFFF;
  border-radius: 12px;
  width: 300px;
  max-width: 85%;
  overflow: hidden;
}

.dialog-title {
  font-size: 16px;
  font-weight: 600;
  color: #333333;
  padding: 20px 20px 0;
  text-align: center;
}

.dialog-msg {
  font-size: 14px;
  color: #666666;
  padding: 16px 20px 20px;
  text-align: center;
  line-height: 1.6;
}

.dialog-btns {
  display: flex;
  border-top: 1px solid #EEEEEE;
}

.dialog-btn {
  flex: 1;
  height: 48px;
  border: none;
  background: none;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog-btn-cancel {
  color: #999999;
  border-right: 1px solid #EEEEEE;
}

.dialog-btn-confirm {
  color: #4A90D9;
  font-weight: 600;
}

.dialog-btn:active {
  background-color: #F5F5F5;
}

/* 底部导航栏 */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: #FFFFFF;
  border-top: 1px solid #E8E8E8;
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #999999;
  font-size: 11px;
  transition: color 0.2s;
}

.tab-item-active {
  color: #4A90D9;
}

.tab-icon {
  font-size: 22px;
  margin-bottom: 2px;
}

.tab-label {
  font-size: 11px;
}

/* 空状态 */
.empty-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: #999999;
  font-size: 15px;
}

/* 页面头部 */
.page-header {
  background-color: #4A90D9;
  color: #FFFFFF;
  padding: 16px 20px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-header-sub {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 4px;
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn:active {
  opacity: 0.8;
}

.btn-primary {
  background-color: #4A90D9;
  color: #FFFFFF;
}

.btn-success {
  background-color: #52C41A;
  color: #FFFFFF;
}

.btn-danger {
  background-color: #FF4D4F;
  color: #FFFFFF;
}

.btn-default {
  background-color: #F0F0F0;
  color: #333333;
}

.btn-small {
  height: 32px;
  padding: 0 14px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* 表单输入 */
.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-size: 15px;
  color: #333333;
  background-color: #F8F9FA;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: #4A90D9;
  background-color: #FFFFFF;
}

.form-input::placeholder {
  color: #BDBDBD;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333333;
  margin-bottom: 6px;
}

.form-group {
  margin-bottom: 16px;
}

/* 卡片 */
.card {
  background-color: #FFFFFF;
  border-radius: 10px;
  padding: 16px;
  margin: 12px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background-color: #FFFFFF;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
  flex: 1;
  min-width: 100px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #E0E0E0;
  border-radius: 6px;
  font-size: 13px;
  color: #333333;
  background-color: #F8F9FA;
  outline: none;
}

.filter-bar .btn {
  flex-shrink: 0;
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
}
