/* 许愿 — 温暖"家"系基调:暖木米白 + 柔和橙 */
:root {
  --bg: #faf6f0;
  --card: #ffffff;
  --ink: #3a3027;
  --ink-soft: #7a6f63;
  --line: #ece3d8;
  --brand: #e8814a;      /* 柔和橙,许愿之暖 */
  --brand-soft: #fbe8dc;
  --green: #5fa777;      /* 完成/积分 */
  --blue: #5b8bc4;
  --warn: #c96a4a;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(120, 90, 60, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* 顶栏 */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 240, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  display: flex; align-items: center; gap: 16px;
}
.nav .logo { font-size: 20px; font-weight: 700; color: var(--brand); }
.nav .logo span { font-size: 14px; color: var(--ink-soft); font-weight: 400; margin-left: 6px; }
.nav .spacer { flex: 1; }
.nav a.link { color: var(--ink-soft); padding: 6px 10px; border-radius: 10px; font-size: 15px; }
.nav a.link:hover, .nav a.link.active { color: var(--brand); background: var(--brand-soft); }
.nav .bell { position: relative; cursor: pointer; }
.nav .bell .dot { position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; background: var(--warn); border-radius: 50%; }

.wrap { max-width: 860px; margin: 0 auto; padding: 24px 20px 80px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #fff; border: none;
  padding: 10px 18px; border-radius: 12px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform .08s, opacity .2s;
}
.btn:hover { opacity: .92; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--card); color: var(--brand); border: 1px solid var(--brand); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.gray { background: #efe8df; color: var(--ink-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }

/* 卡片 */
.card {
  display: block;                 /* 关键:卡片常用 <a> 承载,必须 block 否则排版崩 */
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px;
  border: 1px solid var(--line);
  overflow: hidden;               /* 防止内部长文本/头像溢出卡片 */
}
a.card { color: inherit; }

/* 愿望卡 */
.wish { transition: transform .1s; }
.wish:hover { transform: translateY(-2px); }
.wish .head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wish .cat { font-size: 12px; padding: 2px 10px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); }
.wish .cat.offline { background: #e4eef6; color: var(--blue); }
.wish h3 { font-size: 17px; margin-bottom: 6px; }
.wish .detail { color: var(--ink-soft); font-size: 14px; margin-bottom: 12px; }
.wish .foot { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-soft); }
.wish .reward { color: var(--green); font-weight: 600; }
.wish .cash { color: var(--warn); font-weight: 600; }
.wish .status { margin-left: auto; padding: 3px 10px; border-radius: 20px; font-size: 12px; }
.status-open { background: #e8f3ec; color: var(--green); }
.status-claimed { background: #fef3e2; color: #cc8a2a; }
.status-submitted { background: #e4eef6; color: var(--blue); }
.status-done { background: #eee; color: #888; }
.status-cancelled { background: #f6e6e2; color: var(--warn); }

/* 表单 */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 12px; font-size: 15px; background: #fdfbf8; color: var(--ink);
  font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand); }
.field textarea { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 12px; }
.row .field { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 14px; }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

.title-xl { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 20px; }
.empty { text-align: center; color: var(--ink-soft); padding: 60px 20px; }
.empty .big { font-size: 40px; margin-bottom: 12px; }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 24px; border-radius: 12px; font-size: 14px; z-index: 100; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }

.pill { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-soft); color: var(--brand); padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.tab-bar { display: flex; gap: 6px; margin-bottom: 20px; }
.tab-bar .tab { flex: 1; text-align: center; padding: 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); cursor: pointer; color: var(--ink-soft); }
.tab-bar .tab.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.filter-bar { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
.filter-bar::-webkit-scrollbar { display: none; }

/* 头像下拉 */
.avatar-wrap { position: relative; margin-left: 8px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; cursor: pointer; position: relative; user-select: none;
  border: 1px solid var(--line);
}
.avatar:hover { background: #f8ddcb; }
.avatar .reddot { position: absolute; top: 0; right: 0; width: 9px; height: 9px; background: var(--warn); border-radius: 50%; border: 2px solid var(--bg); }
.dropdown {
  position: absolute; top: 46px; right: 0; width: 240px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 8px 28px rgba(120,90,60,.16); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .16s;
  z-index: 100;
}
.dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dd-head { display: flex; gap: 10px; padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dd-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex-shrink: 0; }
.dd-info { min-width: 0; flex: 1; }
.dd-name { font-weight: 700; font-size: 15px; }
.dd-email { font-size: 12px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-meta { font-size: 12px; color: var(--brand); margin-top: 2px; }
.dd-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 10px; font-size: 14px; color: var(--ink); cursor: pointer; }
.dd-item:hover { background: var(--bg); }
.dd-item.admin { color: var(--brand); font-weight: 600; }
.dd-item.danger { color: var(--warn); }
.dd-badge { background: var(--warn); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.dd-sep { height: 1px; background: var(--line); margin: 6px 0; }
