/* ===== 悬赏任务 App 样式（独立于子比主题） ===== */
.app, .tasklist {
  --primary: #FF5714;
  --primary-soft: #FFF1E8;
  --price: #FF9500;
  --bg: #F4F5F7;
  --card: #FFFFFF;
  --text: #1F2329;
  --text2: #8A8F99;
  --text3: #C0C4CC;
  --border: #EEF0F3;
  --green: #00C48C;
  --blue: #3B82F6;
  --danger: #FF4D4F;
}
/* 说明：全局 reset（* / html / body）已移至 templates/task-app.php 的 <style> 内，
   本文件只保留组件级样式，可被短代码页面安全引入而不会污染其他页面。 */

/* ===== App 容器：手机居中 ===== */
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
}

/* ===== 顶部导航 ===== */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 10px;
  background: var(--card);
}
.user-entry { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; max-width: 30%; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex: 0 0 auto;
}
.uname { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search {
  flex: 1 1 auto; display: flex; align-items: center; gap: 6px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 12px; color: var(--text2); min-width: 0;
}
.search svg { width: 16px; height: 16px; flex: 0 0 auto; }
.search input { border: none; outline: none; background: transparent; font-size: 13px; flex: 1; color: var(--text); min-width: 0; }
.search input::placeholder { color: var(--text3); }
.notify { position: relative; flex: 0 0 auto; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; color: var(--text2); }
.notify svg { width: 20px; height: 20px; }
.badge {
  position: absolute; top: 2px; right: 2px; min-width: 14px; height: 14px;
  padding: 0 3px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 14px; text-align: center;
}
.icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); border: none; background: transparent; cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }

/* ===== 余额卡 ===== */
.balance {
  flex: 0 0 auto;
  margin: 12px 12px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(120deg, #FF6A2B 0%, #FF5714 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
}
.balance .label { font-size: 12px; opacity: .9; }
.balance .money { font-size: 26px; font-weight: 800; letter-spacing: .5px; }
.balance .money em { font-style: normal; font-size: 15px; font-weight: 700; margin-right: 2px; }
.balance .spacer { flex: 1; }
.btn-wd {
  border: none; cursor: pointer;
  background: #fff; color: var(--primary);
  font-size: 13px; font-weight: 700;
  padding: 7px 14px; border-radius: 999px;
}

/* ===== 筛选栏 ===== */
.filter {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 12px 12px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text2);
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.chip.active { color: #fff; background: var(--primary); border-color: var(--primary); font-weight: 600; }

/* ===== 任务列表 ===== */
.tasklist {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 12px 16px;
}
.task-card {
  background: var(--card);
  border-radius: 14px;
  margin-top: 10px;
  padding: 14px;
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: transform .08s ease;
}
.task-card:active { transform: scale(.985); }
.task-icon {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
  background: var(--primary);
}
.task-body { flex: 1 1 auto; min-width: 0; }
.task-title {
  font-size: 15px; font-weight: 600;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.task-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--text2); }
.tag { padding: 1px 8px; border-radius: 4px; font-size: 11px; background: var(--primary-soft); color: var(--primary); }
.task-right { flex: 0 0 auto; text-align: right; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; }
.price { color: var(--price); font-size: 18px; font-weight: 800; }
.price em { font-style: normal; font-size: 12px; margin-right: 1px; }
.go-btn { margin-top: 6px; border: none; cursor: pointer; background: var(--primary); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; }
.empty { text-align: center; color: var(--text3); padding: 60px 0; font-size: 13px; }

/* ===== 置顶任务区（2×2 网格） ===== */
.sticky-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 8px 0 8px; }
.sticky-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sticky-card {
  background: var(--card);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: transform .08s ease;
}
.sticky-card:active { transform: scale(.97); }
.sticky-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.sticky-name {
  font-size: 13px; font-weight: 600; line-height: 1.35;
  min-height: 34px;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.sticky-reward { font-size: 16px; font-weight: 800; color: var(--price); }
.sticky-reward em { font-style: normal; font-size: 12px; margin-right: 1px; }

/* ===== 任务状态徽章 ===== */
.status { padding: 1px 8px; border-radius: 4px; font-size: 11px; white-space: nowrap; }
.status-open      { background: #FFF1E8; color: var(--primary); }
.status-ongoing   { background: #EBF3FF; color: var(--blue); }
.status-review    { background: #FFF7E6; color: var(--price); }
.status-completed { background: #E6FAF2; color: var(--green); }
.status-rejected  { background: #FFECEB; color: var(--danger); }
.status-closed    { background: #F0F1F3; color: var(--text2); }

/* ===== 底部 TabBar ===== */
.tabbar {
  flex: 0 0 auto;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 8px 0 7px;
  color: var(--text2); cursor: pointer;
  font-size: 11px;
  text-decoration: none;
}
.tab-item svg { width: 22px; height: 22px; transition: filter .18s ease, opacity .18s ease; }
.tab-item:not(.active) svg { filter: grayscale(1); opacity: .42; }
.tab-item:not(.active) { font-weight: 400; }
.tab-item.active { color: var(--primary); font-weight: 600; }
.tab-publish { flex: 1; display: flex; justify-content: center; align-items: center; }
.publish-btn {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-top: -16px; box-shadow: 0 6px 14px rgba(255,87,20,.4);
  cursor: pointer; border: none;
  text-decoration: none;
}
.publish-btn svg { width: 24px; height: 24px; }

/* ===== 桌面端：手机容器居中 ===== */
@media (min-width: 700px) {
  .app {
    max-width: 430px; height: 92vh;
    border-radius: 24px;
    box-shadow: 0 30px 70px rgba(0,0,0,.5);
    border: 1px solid #33343a;
  }
}

/* ===== RTL（维吾尔语等右到左语言） ===== */
html[dir="rtl"] .badge { right: auto; left: 2px; }
html[dir="rtl"] .balance .money em { margin-right: 0; margin-left: 2px; }
html[dir="rtl"] .price em { margin-right: 0; margin-left: 1px; }
html[dir="rtl"] .task-right { text-align: left; }
html[dir="rtl"] .sticky-reward em { margin-right: 0; margin-left: 1px; }
html[dir="rtl"] .icon-btn svg { transform: scaleX(-1); }