/* ============================================
   雾点 - 全局样式
   ============================================ */

/* CSS 变量 */
:root {
  --primary: #6366F1;
  --primary-dark: #4F46E5;
  --primary-light: #A5B4FC;
  --accent: #F59E0B;
  --accent-dark: #D97706;
  --bg: #FFFFFF;
  --bg-gray: #F8FAFC;
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --progress-height: 150px;
  --topnav-height: 56px;
  --bottomnav-height: 60px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 16px;
  scroll-behavior: smooth;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
               'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, textarea { font-family: inherit; outline: none; }

/* ============================================
   顶部收益进度条 - 醒目设计
   ============================================ */

.top-progress,
.earnings-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #4338CA 100%);
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.earnings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}
.earnings-title {
  color: rgba(255,255,255,0.95);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.earnings-update {
  color: rgba(255,255,255,0.6);
  font-size: 10px;
}

.earnings-stats {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 10px 8px;
  backdrop-filter: blur(10px);
}
.earnings-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.earnings-label {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 2px;
}
.earnings-value {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
}
.earnings-value.today { color: #34D399; } /* 绿色-今日 */
.earnings-value.total { color: #60A5FA; } /* 蓝色-累计 */
.earnings-value.goal { color: #FBBF24; font-size: 14px; } /* 金色-目标 */
.earnings-unit {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  margin-top: 1px;
}
.earnings-divider {
  width: 1px;
  height: 30px;
  background: rgba(255,255,255,0.2);
}

.progress-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.progress-track {
  height: 12px;
  background: rgba(255,255,255,0.15);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #34D399, #60A5FA, #A78BFA);
  border-radius: 100px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
  position: relative;
  overflow: hidden;
}
.progress-glow {
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6));
  animation: pulse-glow 1.5s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}
.progress-current {
  color: rgba(255,255,255,0.9);
  font-weight: 600;
}
.progress-current span { color: #34D399; }
.progress-percent {
  color: #FBBF24;
  font-weight: 800;
  font-size: 13px;
}

.earnings-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}
.consecutive-days {
  color: #F87171;
  font-weight: 600;
}
.goal-reminder {
  color: rgba(255,255,255,0.6);
}

/* ============================================
   顶部导航栏
   ============================================ */
.top-nav {
  position: fixed;
  top: 150px;
  left: 0;
  right: 0;
  height: var(--topnav-height);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.top-nav .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--primary);
}

.top-nav .logo .logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.top-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-nav .nav-link {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
}
.top-nav .nav-link:hover,
.top-nav .nav-link.active {
  color: var(--primary);
  background: #EEF2FF;
}
.top-nav .nav-link.primary {
  color: var(--primary);
  font-weight: 600;
}

.top-nav .nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-nav {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}
.btn-nav-login {
  color: var(--primary);
  border: 1.5px solid var(--primary);
  background: transparent;
}
.btn-nav-login:hover { background: var(--primary); color: white; }
.btn-nav-register {
  background: var(--primary);
  color: white;
}
.btn-nav-register:hover { background: var(--primary-dark); }
.btn-nav-publish {
  background: var(--accent);
  color: white;
}
.btn-nav-publish:hover { background: var(--accent-dark); }

/* ============================================
   底部导航栏（移动端）
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottomnav-height);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
}
.bottom-nav .nav-items {
  display: flex;
  width: 100%;
}
.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 0;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  transition: color 0.2s;
  text-decoration: none;
}
.bottom-nav .nav-item .nav-icon { font-size: 20px; line-height: 1; }
.bottom-nav .nav-item.active,
.bottom-nav .nav-item:hover { color: var(--primary); }

/* ============================================
   页面布局容器
   ============================================ */
.page-wrapper {
  padding-top: calc(var(--progress-height) + var(--topnav-height));
  padding-bottom: calc(var(--bottomnav-height) + 20px);
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================
   全局悬浮微信按钮
   ============================================ */
.float-wechat-btn {
  position: fixed;
  right: 16px;
  bottom: calc(var(--bottomnav-height) + 20px);
  z-index: 999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #07C160, #0DB660);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(7,193,96,0.45);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  font-size: 10px;
  font-weight: 600;
  gap: 2px;
  animation: floatPulse 2.5s ease-in-out infinite;
}
.float-wechat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(7,193,96,0.55);
}
.float-wechat-btn .wechat-icon { font-size: 24px; line-height: 1; }
.float-wechat-btn .wechat-text { font-size: 9px; font-weight: 600; }

@keyframes floatPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(7,193,96,0.45); }
  50% { box-shadow: 0 4px 32px rgba(7,193,96,0.70); }
}

/* 微信二维码弹层 */
.wechat-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.55);
  align-items: center;
  justify-content: center;
}

/* ============================================
   醒目登录悬浮按钮
   ============================================ */
.float-login-btn {
  position: fixed;
  right: 80px;
  bottom: calc(var(--bottomnav-height) + 16px);
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #A855F7 100%);
  color: white;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 24px rgba(139, 92, 246, 0.5);
  cursor: pointer;
  transition: all 0.25s ease;
  animation: loginPulse 2s ease-in-out infinite;
  border: 2px solid rgba(255,255,255,0.3);
}
.float-login-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.65);
}
.float-login-btn .float-login-icon {
  font-size: 18px;
  line-height: 1;
}
.float-login-btn .float-login-text {
  white-space: nowrap;
}

@keyframes loginPulse {
  0%, 100% {
    box-shadow: 0 4px 24px rgba(139, 92, 246, 0.5);
  }
  50% {
    box-shadow: 0 4px 36px rgba(139, 92, 246, 0.75), 0 0 0 4px rgba(139, 92, 246, 0.15);
  }
}

/* 隐藏状态 */
.float-login-btn.hidden {
  display: none;
}
.wechat-modal.show { display: flex; }
.wechat-modal-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px 24px 24px;
  max-width: 300px;
  width: 90%;
  text-align: center;
  position: relative;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.wechat-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}
.wechat-modal-qr {
  width: 180px;
  height: 180px;
  background: var(--bg-gray);
  border-radius: var(--radius-md);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  overflow: hidden;
}
.wechat-modal-qr img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-md) - 2px);
}
.wechat-modal-qr .qr-placeholder { font-size: 48px; }
.wechat-modal-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.wechat-modal-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.wechat-id {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 14px;
  background: #F0FDF4;
  border-radius: 20px;
  font-size: 13px;
  color: #059669;
  font-weight: 600;
}

/* ============================================
   通用卡片
   ============================================ */
.card {
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ============================================
   通用按钮
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,0.35); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(245,158,11,0.40); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ============================================
   标签
   ============================================ */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}
.tag-core {
  background: #EEF2FF;
  color: var(--primary);
}
.tag-pending {
  background: #FFF7ED;
  color: #EA580C;
}
.tag-primary {
  background: #EEF2FF;
  color: var(--primary);
}

/* ============================================
   区块标题
   ============================================ */
.section-header {
  padding: 20px 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}
.section-more {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
}

/* ============================================
   分割线 & 间距
   ============================================ */
.divider { height: 8px; background: var(--bg-gray); }
.divider-sm { height: 1px; background: var(--border); margin: 0 16px; }

/* ============================================
   空状态
   ============================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ============================================
   表单元素
   ============================================ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.form-input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg);
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--primary); }
.form-input::placeholder { color: var(--text-muted); }

.input-with-btn { display: flex; gap: 10px; }
.input-with-btn .form-input { flex: 1; }
.btn-send-code {
  flex-shrink: 0;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  height: 50px;
}
.btn-send-code:disabled { background: var(--text-muted); cursor: not-allowed; }

/* ============================================
   Loading & Toast
   ============================================ */
.toast {
  position: fixed;
  top: calc(var(--progress-height) + var(--topnav-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30,41,59,0.90);
  color: white;
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 14px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ============================================
   转化横幅
   ============================================ */
.cta-banner {
  background: linear-gradient(135deg, #1E1B4B, #312E81);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  margin: 24px 16px;
  text-align: center;
  color: white;
}
.cta-banner .cta-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; line-height: 1.5; }
.cta-banner .cta-price { font-size: 26px; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.cta-banner .cta-tip { font-size: 12px; color: rgba(255,255,255,0.65); margin-bottom: 16px; }

/* ============================================
   富文本内容样式
   ============================================ */
.rich-content { padding: 16px; font-size: 15px; line-height: 1.8; color: var(--text-primary); }
.rich-content h2 { font-size: 18px; font-weight: 700; margin: 24px 0 12px; }
.rich-content h3 { font-size: 16px; font-weight: 700; margin: 20px 0 10px; }
.rich-content p { margin-bottom: 14px; }
.rich-content img { width: 100%; border-radius: var(--radius-sm); margin: 12px 0; }
.rich-content ul { list-style: disc; padding-left: 20px; margin-bottom: 14px; }
.rich-content ul li { margin-bottom: 6px; }
.rich-content pre {
  background: #1E1B4B;
  color: #A5B4FC;
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  margin: 14px 0;
  font-family: 'Courier New', Courier, monospace;
}
.rich-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 12px 16px;
  background: #EEF2FF;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 14px 0;
  font-style: italic;
  color: var(--text-secondary);
}
.income-proof {
  border: 2px solid #10B981;
  border-radius: var(--radius-sm);
  position: relative;
  margin: 16px 0;
}
.income-proof::before {
  content: '真实记录';
  position: absolute;
  top: -11px;
  left: 12px;
  background: #10B981;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 100px;
}
.income-proof img { width: 100%; border-radius: 0; margin: 0; }

/* ============================================
   评论区
   ============================================ */
.comment-section { padding: 0 16px 24px; }
.comment-section-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.comment-input-box { display: flex; gap: 10px; margin-bottom: 20px; align-items: flex-start; }
.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.comment-textarea {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  resize: none;
  min-height: 72px;
  transition: border-color 0.2s;
}
.comment-textarea:focus { border-color: var(--primary); }
.comment-submit-row { display: flex; justify-content: flex-end; margin-top: 8px; }
.comment-item { display: flex; gap: 10px; margin-bottom: 16px; }
.comment-body { flex: 1; }
.comment-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.comment-time { font-size: 11px; color: var(--text-muted); margin-left: 8px; }
.comment-text { font-size: 14px; color: var(--text-secondary); margin: 4px 0 6px; line-height: 1.6; }
.comment-reply-btn { font-size: 12px; color: var(--text-muted); cursor: pointer; background: none; border: none; }
.comment-reply-btn:hover { color: var(--primary); }
.comment-replies { margin-top: 10px; padding: 10px; background: var(--bg-gray); border-radius: var(--radius-sm); }
.reply-item { margin-bottom: 8px; }
.reply-item:last-child { margin-bottom: 0; }

/* ============================================
   页面头部（内页通用）
   ============================================ */
.page-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.page-header .back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  cursor: pointer;
  background: none;
  border: none;
}

/* ============================================
   底部版权信息
   ============================================ */
.site-footer {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.8;
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--primary); }

/* ============================================
   弹窗提示（注册拦截）
   ============================================ */
.alert-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.55);
  align-items: center;
  justify-content: center;
}
.alert-modal.show { display: flex; }
.alert-modal-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  max-width: 300px;
  width: 85%;
  text-align: center;
  animation: modalIn 0.25s ease;
}
.alert-modal-icon { font-size: 40px; margin-bottom: 12px; }
.alert-modal-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.alert-modal-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }

/* ============================================
   响应式（桌面端居中展示）
   ============================================ */
@media (min-width: 768px) {
  .container { max-width: 540px; }
  .bottom-nav { display: none; }
  .page-wrapper { padding-bottom: 40px; }
  .float-wechat-btn { bottom: 32px; }
}
@media (min-width: 1024px) {
  .container { max-width: 600px; }
}
