/* ============================================
   攒米时刻 - H5移动端样式 v2
   风格: 现代简约 / 清爽卡片 / 大圆角
   ============================================ */

:root {
  --primary: #FF6B35;
  --primary-light: #FFF3ED;
  --primary-dark: #E55A2B;
  --link: #FF6B35;
  --bg: #F5F6FA;
  --card: #FFFFFF;
  --text: #1A1A2E;
  --text-secondary: #6B7280;
  --text-hint: #9CA3AF;
  --border: #EDEEF2;
  --border-light: #F3F4F6;
  --success: #10B981;
  --success-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 2px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.06);
  --tab-height: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  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;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--tab-height) + var(--safe-bottom) + 20px);
}

/* ===== 容器 ===== */
.page {
  background: var(--bg);
  min-height: 100vh;
}

.page-white {
  background: var(--bg);
}

/* ===== 顶部导航 ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid transparent;
}

.navbar-back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  color: var(--text);
  background: var(--bg);
  border-radius: 50%;
}

.navbar-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}

.navbar-placeholder {
  width: 36px;
}

/* ===== Tab栏 ===== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--tab-height);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  z-index: 200;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-hint);
  font-size: 11px;
  gap: 4px;
  transition: color 0.2s;
}

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

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

.tab-item.active .tab-item-label {
  font-weight: 600;
}

.tab-item::before {
  content: '';
  width: 24px;
  height: 3px;
  border-radius: 3px;
  background: transparent;
  transition: background 0.2s;
}

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

.tab-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 22px);
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  margin: 0 16px 12px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: 18px;
}

/* ===== 任务卡片 ===== */
.task-card {
  background: var(--card);
  margin: 0 16px 10px;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 1px solid var(--border-light);
}

.task-card:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-lg);
}

.task-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.task-card-info {
  flex: 1;
  min-width: 0;
}

.task-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}

.task-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

.tag-orange {
  background: #FFF3ED;
  color: var(--primary);
}

.tag-green {
  background: var(--success-bg);
  color: var(--success);
}

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

.tag-red {
  background: var(--danger-bg);
  color: var(--danger);
}

.tag-gray {
  background: var(--bg);
  color: var(--text-secondary);
}

.task-card-reward {
  flex-shrink: 0;
  text-align: right;
}

.task-card-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.task-card-btn {
  margin-top: 8px;
  padding: 6px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.task-card-btn:active {
  opacity: 0.85;
}

/* ===== 统计条 ===== */
.stats-banner {
  background: var(--card);
  margin: 0 16px 12px;
  border-radius: var(--radius);
  padding: 12px 18px;
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  border: 1px solid var(--border-light);
}

.stats-banner strong {
  color: var(--primary);
  font-size: 15px;
}

/* ===== 步骤条 ===== */
.steps {
  padding: 0;
}

.step-item {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-light);
}

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

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #FF8C5A);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(255,107,53,0.3);
}

.step-num.done {
  background: linear-gradient(135deg, var(--success), #34D399);
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.step-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.step-action {
  margin-top: 2px;
}

/* ===== 按钮 ===== */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:active {
  transform: scale(0.97);
}

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

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

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

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

.btn-sm {
  padding: 7px 16px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

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

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  background: var(--card);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

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

.form-hint {
  font-size: 12px;
  color: var(--text-hint);
  margin-top: 6px;
}

.form-link {
  font-size: 14px;
  color: var(--link);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}

/* ===== 上传区 ===== */
.upload-area {
  width: 100%;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  background: #FAFBFC;
  transition: border-color 0.2s, background 0.2s;
}

.upload-area:active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-area.has-image {
  padding: 8px;
  border-style: solid;
}

.upload-area img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 8px;
}

.upload-text {
  color: var(--text-hint);
  font-size: 14px;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-hint);
  margin-top: 8px;
}

/* ===== 用户信息 ===== */
.user-header {
  background: var(--card);
  padding: 28px 20px 24px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  margin: 0 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.user-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
  background: var(--bg);
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.user-nickname {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.user-id {
  font-size: 13px;
  color: var(--text-hint);
}

/* ===== 收益 ===== */
.earnings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px;
}

.earnings-item {
  background: var(--card);
  text-align: center;
  padding: 16px 10px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.earnings-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.earnings-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== 菜单列表 ===== */
.menu-list {
  background: var(--card);
  margin: 0 16px 12px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text);
  font-size: 15px;
  transition: background 0.15s;
}

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

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

.menu-item-arrow {
  color: var(--text-hint);
  font-size: 16px;
}

/* ===== 常见问题 ===== */
.faq-list {
  background: var(--card);
  margin: 0 16px 12px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.faq-item {
  border-bottom: 1px solid var(--border-light);
}

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

.faq-question {
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  transition: background 0.15s;
}

.faq-question:active {
  background: var(--bg);
}

.faq-arrow {
  font-size: 12px;
  color: var(--text-hint);
  transition: transform 0.2s;
}

.faq-item.open .faq-arrow {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 18px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

/* ===== 状态标签 ===== */
.status-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.status-pending {
  background: var(--warning-bg);
  color: #B45309;
}

.status-reviewing {
  background: var(--primary-light);
  color: var(--link);
}

.status-approved {
  background: var(--success-bg);
  color: #047857;
}

.status-rejected {
  background: var(--danger-bg);
  color: #B91C1C;
}

/* ===== 筛选Tab ===== */
.filter-tabs {
  display: flex;
  background: var(--card);
  padding: 4px;
  margin: 12px 16px;
  border-radius: var(--radius);
  gap: 4px;
  box-shadow: var(--shadow);
}

.filter-tab {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 12px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.filter-tab.active {
  background: var(--primary);
  color: white;
  font-weight: 600;
}

/* ===== 消息 ===== */
.message-item {
  background: var(--card);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin: 0 16px 2px;
}

.message-item:first-child {
  margin-top: 8px;
}

.message-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.message-content {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-time {
  font-size: 12px;
  color: var(--text-hint);
  margin-top: 4px;
}

.unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  margin-right: 6px;
}

/* ===== 节标题 ===== */
.section-title {
  padding: 8px 16px 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.section-title-sm {
  padding: 6px 16px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s;
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

/* ===== 复制文案 ===== */
.copy-text {
  background: #F9FAFB;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  position: relative;
  line-height: 1.6;
}

.copy-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  background: white;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--primary);
  transition: all 0.15s;
}

.copy-btn:active {
  background: var(--primary);
  color: white;
}

/* ===== 加载 ===== */
.loading {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-hint);
  font-size: 14px;
}

.loading::before {
  content: '';
  display: block;
  width: 28px;
  height: 28px;
  margin: 0 auto 12px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ===== 空状态 ===== */
.empty-state {
  padding: 60px 20px;
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state-text {
  font-size: 15px;
  color: var(--text-hint);
}

/* ===== 联系信息 ===== */
.contact-info {
  padding: 4px 0;
}

.contact-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}

.contact-row:last-child {
  border-bottom: none;
}

.contact-row span:first-child {
  color: var(--text-secondary);
}

.contact-row span:last-child {
  color: var(--text);
  font-weight: 500;
}

/* ===== 公告栏 ===== */
.notice-bar {
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  background: var(--card);
  margin: 0 16px 10px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.notice-icon {
  flex-shrink: 0;
  font-size: 18px;
}

.notice-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 动画 ===== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.78);
  color: white;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  pointer-events: none;
  animation: toastIn 0.25s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== 收益明细 ===== */
.record-item {
  background: var(--card);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin: 0 16px 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.record-item:first-child {
  margin-top: 8px;
}

.record-left {
  flex: 1;
}

.record-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.record-time {
  font-size: 12px;
  color: var(--text-hint);
}

.record-amount {
  font-size: 16px;
  font-weight: 700;
}

.record-amount.positive {
  color: var(--success);
}

.record-amount.negative {
  color: var(--danger);
}
