/* ==================== 同城互助悬赏平台 - 全局样式 ==================== */
/* 文件：www.0883.me/assets/css/style.css */

:root {
  --primary: #4F6EF7;
  --primary-light: #6B85F9;
  --primary-dark: #3A55E0;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --bg: #F5F7FA;
  --card-bg: #FFFFFF;
  --text: #1F2937;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --border: #E5E7EB;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --nav-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-height: 48px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: calc(var(--nav-height) + 16px + var(--safe-bottom));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
input, textarea, select, button { font-family: inherit; font-size: inherit; outline: none; }

/* ==================== Layout ==================== */
.page-main {
  max-width: 480px;
  margin: 0 auto;
  min-height: calc(100vh - var(--nav-height) - var(--safe-bottom));
  padding-bottom: 16px;
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 24px;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  gap: 6px; white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; }
.btn-lg { height: 50px; font-size: 17px; }
.btn-disabled, .btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-icon { width: 44px; padding: 0; font-size: 20px; }

/* ==================== Tags ==================== */
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500; line-height: 1.6;
}

/* ==================== Forms ==================== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 500;
  margin-bottom: 6px; color: var(--text-secondary);
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 15px; transition: border-color 0.2s; background: #fff;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,247,0.1); }
.form-input-error { border-color: var(--danger) !important; }
.form-textarea {
  width: 100%; min-height: 100px; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 15px; resize: vertical; background: #fff;
  transition: border-color 0.2s;
}
.form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,247,0.1); }
.form-select {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 15px; background: #fff; cursor: pointer;
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; display: none; }
.form-error.show { display: block; }
.input-group { display: flex; gap: 10px; }
.input-group .form-input { flex: 1; }

/* ==================== Cards ==================== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}

/* ==================== Page Header ==================== */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: var(--header-height);
  background: var(--card-bg);
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 17px; font-weight: 700; }
.page-back {
  width: 36px; height: 36px; display: flex; align-items: center;
  justify-content: center; font-size: 26px; cursor: pointer;
  border-radius: 50%; color: var(--text); font-weight: 300;
  transition: background 0.15s;
}
.page-back:active { background: var(--bg); }
.page-right { font-size: 14px; color: var(--primary); cursor: pointer; min-width: 36px; text-align: right; }

/* ==================== Task Card ==================== */
.task-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 0 16px 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.task-card:active { transform: scale(0.98); }
.task-card .task-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; gap: 8px; }
.task-card .task-title { font-size: 15px; font-weight: 600; flex: 1; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-card .task-price { font-size: 18px; font-weight: 700; color: var(--danger); white-space: nowrap; flex-shrink: 0; }
.task-card .task-price span { font-size: 12px; font-weight: 400; }
.task-card .task-desc {
  font-size: 13px; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 10px; line-height: 1.5;
}
.task-card .task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.task-card .task-footer {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-secondary);
  border-top: 1px solid var(--border); padding-top: 10px;
}
.task-card .task-user { display: flex; align-items: center; gap: 6px; }

/* ==================== Avatar ==================== */
.avatar {
  border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; color: #fff; font-weight: 700; flex-shrink: 0;
}

/* ==================== Empty State ==================== */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; font-weight: 500; }
.empty-state p { font-size: 13px; color: var(--text-muted); }

/* ==================== Loading ==================== */
.loading-state { text-align: center; padding: 60px 20px; }
.loading-spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state p { font-size: 14px; color: var(--text-muted); }
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { padding: 16px; margin: 0 16px 12px; background: var(--card-bg); border-radius: var(--radius); }

/* ==================== Toast ==================== */
.toast {
  position: fixed; top: 20%; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.78); color: #fff;
  padding: 10px 24px; border-radius: 8px;
  font-size: 14px; z-index: 10000;
  animation: toastIn 0.3s ease;
  max-width: 80%; text-align: center;
  pointer-events: none;
}
.toast-success { background: rgba(34,197,94,0.9); }
.toast-error { background: rgba(239,68,68,0.9); }
.toast-warning { background: rgba(245,158,11,0.9); }
.toast-out { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(-50%) translateY(-12px); } }

/* ==================== Modal ==================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn 0.2s;
}
.modal-box {
  background: var(--card-bg); border-radius: 16px;
  width: 100%; max-width: 380px; max-height: 80vh; overflow-y: auto;
  padding: 24px; animation: modalIn 0.25s ease;
}
.modal-box h2 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.modal-box .btn-row { display: flex; gap: 10px; margin-top: 20px; }
.modal-box .btn-row .btn { flex: 1; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

/* ==================== Bottom Nav ==================== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  display: flex; z-index: 200;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.bnav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; font-size: 11px; color: var(--text-secondary);
  cursor: pointer; transition: color 0.2s; gap: 1px;
  padding: 4px 0;
}
.bnav-item .bnav-icon { font-size: 22px; line-height: 1.2; }
.bnav-item .bnav-label { font-size: 10px; }
.bnav-item.active { color: var(--primary); }
.bnav-item .badge-dot {
  position: absolute; top: 2px; right: 2px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
}

/* ==================== Category Scroll ==================== */
.category-scroll {
  display: flex; gap: 12px; padding: 12px 16px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }
.category-item {
  flex-shrink: 0; display: flex; flex-direction: column;
  align-items: center; gap: 4px; cursor: pointer;
}
.category-item .cat-icon {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: var(--card-bg); box-shadow: var(--shadow);
  transition: all 0.2s;
}
.category-item .cat-label { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.category-item.active .cat-icon { background: var(--primary); color: #fff; }
.category-item.active .cat-label { color: var(--primary); font-weight: 600; }

/* ==================== Filter Bar ==================== */
.filter-bar { display: flex; gap: 8px; padding: 8px 16px; overflow-x: auto; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-btn {
  flex-shrink: 0; padding: 6px 16px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--card-bg);
  font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ==================== Messages / Chat ==================== */
.chat-page { display: flex; flex-direction: column; height: calc(100vh - var(--nav-height) - var(--safe-bottom)); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; }
.chat-input-bar {
  display: flex; gap: 10px; padding: 10px 16px;
  padding-bottom: calc(10px + var(--safe-bottom));
  background: var(--card-bg); border-top: 1px solid var(--border);
}
.chat-input-bar input { flex: 1; height: 40px; padding: 0 14px; border: 1.5px solid var(--border); border-radius: 20px; }
.chat-input-bar input:focus { border-color: var(--primary); }
.chat-input-bar button {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: var(--primary); color: #fff; font-size: 18px;
  cursor: pointer; flex-shrink: 0;
}
.message-item { display: flex; gap: 10px; margin-bottom: 16px; }
.message-item.mine { flex-direction: row-reverse; }
.message-item .msg-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff;
}
.message-item .msg-bubble {
  max-width: 75%; padding: 10px 14px; border-radius: 16px;
  font-size: 14px; line-height: 1.5; word-break: break-word;
}
.message-item .msg-bubble.sent { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.message-item .msg-bubble.received { background: #F0F0F0; color: var(--text); border-bottom-left-radius: 4px; }
.message-item .msg-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.message-item.mine .msg-time { text-align: right; }

/* ==================== Profile ==================== */
.profile-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; padding: 28px 16px 20px; text-align: center;
  margin-bottom: 12px;
}
.profile-header .avatar-lg {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255,255,255,0.25);
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff;
}
.profile-header .profile-name { font-size: 18px; font-weight: 700; }
.profile-header .profile-cert { font-size: 12px; opacity: 0.8; margin-top: 4px; }
.profile-header .profile-stats {
  display: flex; justify-content: center; gap: 24px; margin-top: 16px;
}
.profile-header .profile-stats .stat-item { text-align: center; }
.profile-header .profile-stats .stat-value { font-size: 20px; font-weight: 700; }
.profile-header .profile-stats .stat-label { font-size: 11px; opacity: 0.75; }
.profile-menu { margin: 0 16px 12px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.profile-menu .menu-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--card-bg);
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background 0.15s;
}
.profile-menu .menu-item:active { background: var(--bg); }
.profile-menu .menu-item:last-child { border-bottom: none; }
.profile-menu .menu-left { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.profile-menu .menu-icon { font-size: 20px; width: 28px; text-align: center; }
.profile-menu .menu-arrow { color: var(--text-muted); font-size: 16px; }
.profile-menu .menu-badge {
  background: var(--danger); color: #fff; font-size: 11px;
  padding: 1px 8px; border-radius: 10px; margin-left: 6px;
}

/* ==================== Detail Page ==================== */
.detail-section {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin: 0 16px 12px;
}
.detail-section h3 {
  font-size: 15px; font-weight: 600; margin-bottom: 10px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.detail-actions {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-bottom));
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.detail-actions .btn { flex: 1; }

/* ==================== Deposit ==================== */
.deposit-card { background: var(--card-bg); border-radius: var(--radius); padding: 16px; margin: 0 16px 12px; box-shadow: var(--shadow); }
.deposit-card .deposit-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.deposit-card .deposit-amount { font-size: 22px; font-weight: 700; color: var(--primary); }
.deposit-card .deposit-body { font-size: 13px; color: var(--text-secondary); }
.deposit-card .deposit-body .info-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.deposit-flow { display: flex; align-items: flex-start; padding: 16px 0; }
.deposit-flow .flow-step {
  flex: 1; text-align: center; font-size: 12px; color: var(--text-muted);
  position: relative;
}
.deposit-flow .flow-step .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--border); display: block; margin: 0 auto 6px;
}
.deposit-flow .flow-step.active .dot { background: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,247,0.2); }
.deposit-flow .flow-step.done .dot { background: var(--success); }
.deposit-flow .flow-step::after {
  content: ''; position: absolute; top: 5px; left: 50%;
  width: 100%; height: 2px; background: var(--border); z-index: 0;
}
.deposit-flow .flow-step:last-child::after { display: none; }
.deposit-flow .flow-step.done::after,
.deposit-flow .flow-step.active::after { background: var(--success); }

.penalty-item { background: var(--card-bg); border-radius: var(--radius); padding: 14px; margin: 0 16px 10px; box-shadow: var(--shadow); }
.penalty-item .p-title { display: flex; justify-content: space-between; font-size: 14px; font-weight: 500; }
.penalty-item .p-detail { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
.penalty-item .p-actions { margin-top: 10px; display: flex; gap: 8px; }

/* ==================== Appeal ==================== */
.appeal-page { padding: 16px; padding-bottom: 80px; }
.appeal-upload {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 24px; text-align: center; font-size: 13px;
  color: var(--text-secondary); cursor: pointer;
  transition: border-color 0.2s;
}
.appeal-upload:hover { border-color: var(--primary); }
.appeal-upload .upload-icon { font-size: 32px; margin-bottom: 8px; }

/* ==================== Agreement ==================== */
.agreement-page { padding: 16px; line-height: 1.8; }
.agreement-page h2 { font-size: 18px; margin-bottom: 12px; }
.agreement-page h3 { font-size: 15px; margin: 16px 0 8px; }
.agreement-page p { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }

/* ==================== Msg List ==================== */
.msg-item {
  display: flex; gap: 12px; padding: 14px 16px;
  background: var(--card-bg); border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s;
}
.msg-item:active { background: var(--bg); }
.msg-item .msg-avatar { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--primary-light); color: #fff; flex-shrink: 0; }
.msg-item .msg-info { flex: 1; min-width: 0; }
.msg-item .msg-title { font-size: 14px; font-weight: 500; display: flex; justify-content: space-between; }
.msg-item .msg-preview { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.msg-item .msg-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.msg-item .msg-unread { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); display: inline-block; margin-right: 4px; flex-shrink: 0; }

/* ==================== Divider ==================== */
.divider { text-align: center; margin: 20px 0; color: var(--text-muted); font-size: 13px; position: relative; }
.divider::before, .divider::after { content: ''; position: absolute; top: 50%; width: 30%; height: 1px; background: var(--border); }
.divider::before { left: 8%; }
.divider::after { right: 8%; }

/* ==================== Credit ==================== */
.credit-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.credit-high { background: #FEF9C3; color: #A16207; }
.credit-good { background: #E6F9ED; color: #15803D; }
.credit-normal { background: #F0F0F0; color: #6B7280; }
.credit-low { background: #FDE8E8; color: #DC2626; }

/* ==================== Notice Bar ==================== */
.notice-bar {
  background: #FEF9C3; color: #92400E; font-size: 13px;
  padding: 8px 16px; display: flex; align-items: center; gap: 6px;
  overflow: hidden; white-space: nowrap;
}

/* ==================== Order List ==================== */
.order-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--card-bg);
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.order-item:active { background: var(--bg); }
.order-item .order-info { flex: 1; min-width: 0; }
.order-item .order-title { font-size: 14px; font-weight: 500; }
.order-item .order-meta { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.order-item .order-amount { font-size: 16px; font-weight: 700; color: var(--danger); }

/* ==================== Tag Selector ==================== */
.tag-selector { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-option {
  padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
  font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.tag-option.selected { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ==================== Score Stars ==================== */
.stars { display: flex; gap: 4px; }
.star { font-size: 22px; cursor: pointer; color: var(--border); transition: color 0.15s; }
.star.active { color: #F59E0B; }

/* ==================== Status Info ==================== */
.status-info {
  display: flex; align-items: center; gap: 8px;
  background: #EEF0FF; padding: 12px 16px; border-radius: 10px;
  font-size: 13px; color: var(--primary); margin-bottom: 12px;
}

/* ==================== Responsive ==================== */
@media (min-width: 768px) {
  .page-main { max-width: 720px; }
  body { padding-bottom: 0; }
  .task-card { margin: 0 auto 12px; max-width: 680px; }
}
@media (min-width: 1024px) {
  .page-main { max-width: 960px; }
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
}
