:root {
  --primary: #534ab7;
  --primary-soft: #eeedfe;
  --bg: #f6f5fa;
  --ink: #26215c;
  --muted: #8a86a8;
  --ok-bg: #e1f5ee;
  --ok-fg: #0f6e56;
  --bad-bg: #fcebeb;
  --bad-fg: #a32d2d;
  --card-radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
}

/* 手机外框：桌面端居中模拟小程序观感 */
.app-shell {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background: var(--bg);
}
.phone {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--primary);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-title { font-size: 17px; font-weight: 600; }
.link-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
}
.app-header .link-btn { color: #fff; opacity: 0.9; }

.app-main {
  flex: 1;
  padding-bottom: 72px; /* 给底部 tab 留位 */
  overflow-y: auto;
}

/* 卡片 */
.card {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 18px;
  margin: 12px;
  box-shadow: 0 2px 8px rgba(83, 74, 183, 0.05);
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.note { font-size: 13px; color: var(--muted); }

/* 按钮 */
.btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  padding: 12px 18px;
  text-align: center;
  cursor: pointer;
  display: inline-block;
}
.btn.block { width: 100%; display: block; }
.btn.sm { padding: 6px 16px; font-size: 13px; }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.danger { background: var(--bad-fg); }
.btn[disabled] { opacity: 0.5; cursor: default; }

/* 表单 */
.inp {
  width: 100%;
  background: var(--bg);
  border: 1px solid #e7e5f2;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 15px;
  outline: none;
}
textarea.inp { min-height: 80px; resize: vertical; }
.form-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.form-label { width: 56px; color: var(--muted); font-size: 14px; flex: 0 0 auto; }

.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }

/* 标签 */
.tag {
  display: inline-block;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  margin-right: 6px;
}
.tag.ok { background: var(--ok-bg); color: var(--ok-fg); }
.tag.bad { background: var(--bad-bg); color: var(--bad-fg); }
.tag.pend { background: var(--primary-soft); color: var(--primary); }

.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 36px 0; }
.err { color: var(--bad-fg); font-size: 13px; margin-top: 10px; }
.loading { text-align: center; color: var(--muted); padding: 60px 0; }

/* 首页 hero */
.hero { background: linear-gradient(135deg, #5b52c4, #534ab7); color: #fff; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; }
.hero .note { color: rgba(255, 255, 255, 0.85); }
.hero-points { font-size: 38px; font-weight: 700; line-height: 1.1; margin-top: 4px; }
.hero-user { text-align: right; cursor: pointer; max-width: 50%; }
.hero-profile { font-size: 12px; color: rgba(255, 255, 255, 0.8); margin-top: 4px; }
.hero-edit { font-size: 12px; color: rgba(255, 255, 255, 0.9); margin-top: 2px; }

.switcher { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; }
.sw-hint { font-size: 13px; color: rgba(255, 255, 255, 0.85); }
.picker-box {
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  max-width: 230px;
}

.section-title { font-size: 15px; font-weight: 600; margin: 6px 14px; }

.task-card .task-name { font-size: 16px; font-weight: 600; }
.task-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 2px; }

/* 打卡页 */
.photo-box {
  border: 1px dashed #cfcbe8;
  border-radius: 12px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  background: var(--bg);
}
.photo-placeholder { text-align: center; color: var(--muted); }
.photo-icon { font-size: 34px; line-height: 1; }
.photo-img { width: 100%; height: 100%; object-fit: cover; }
.record { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid #f0eef8; }
.record-photo { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; cursor: pointer; }
.record-note { font-size: 14px; margin: 4px 0; }

/* 明细 */
.balance { font-size: 34px; font-weight: 700; color: var(--primary); }
.log-item { display: flex; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-top: 1px solid #f0eef8; }
.log-delta { font-weight: 700; font-size: 16px; }
.log-delta.plus { color: var(--ok-fg); }
.log-delta.minus { color: var(--bad-fg); }

/* 兑换 */
.rd-item { padding: 12px 0; border-top: 1px solid #f0eef8; }

/* 底部 tabbar */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 60px;
  background: #fff;
  border-top: 1px solid #eceaf5;
  display: flex;
  z-index: 20;
}
.tabbar button {
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.tabbar button.on { color: var(--primary); font-weight: 600; }

/* 登录页 */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-logo { font-size: 26px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.login .note { margin-bottom: 18px; }
.quick { margin-top: 14px; display: flex; gap: 16px; justify-content: center; }
.quick .link-btn { color: var(--primary); font-size: 13px; }
