/* ============================================================
   宏才教育学员端 - 通用样式
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-size: var(--font-size-md);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 70px;
  position: relative;
}

a {
  text-decoration: none;
  color: inherit;
}

/* 页面头部 */
.page-header {
  background: var(--bg-card);
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  flex: 1;
  text-align: center;
}

.page-header .back-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
}

/* 卡片样式 */
.card {
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

/* 按钮样式 */
.btn {
  height: 44px;
  border-radius: 8px;
  border: none;
  font-size: var(--font-size-md);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.btn:active {
  opacity: 0.8;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-block {
  width: 100%;
}

/* 输入框 */
.input {
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0 var(--spacing-md);
  font-size: var(--font-size-sm);
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}

.input:focus {
  border-color: var(--primary);
}

.input::placeholder {
  color: var(--text-placeholder);
}

/* 底部导航栏 */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 60px;
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: color 0.2s;
}

.tab-item.active {
  color: var(--primary);
}

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

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.tag-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.tag-success {
  background: #f6ffed;
  color: var(--success);
}

.tag-warning {
  background: #fffbe6;
  color: var(--warning);
}

.tag-danger {
  background: #fff2f0;
  color: var(--danger);
}

/* 列表 */
.list-item {
  display: flex;
  align-items: center;
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

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

.list-item:active {
  background: var(--bg-page);
}

.list-item .item-content {
  flex: 1;
}

.list-item .item-title {
  font-size: var(--font-size-md);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.list-item .item-desc {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.list-item .item-arrow {
  color: var(--text-placeholder);
  font-size: 18px;
}

/* 头像 */
.avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  color: var(--primary);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px var(--spacing-lg);
  color: var(--text-placeholder);
}

.empty-state .empty-icon {
  font-size: 64px;
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

.empty-state .empty-text {
  font-size: var(--font-size-sm);
}

/* 进度条 */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar .progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* 通知红点 */
.badge {
  position: absolute;
  top: 4px;
  right: 50%;
  transform: translateX(18px);
  width: 16px;
  height: 16px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 分割线 */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--spacing-md) 0;
}

/* 文字省略 */
.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-ellipsis-2 {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 倒计时样式 */
.countdown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--danger);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.countdown .cd-num {
  background: var(--danger);
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  min-width: 24px;
  text-align: center;
}

/* 浮动按钮 */
.fab {
  position: fixed;
  bottom: 80px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.4);
  cursor: pointer;
  z-index: 50;
}

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
