/* ============ 基础层：变量 / 重置 / 通用组件 ============ */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --text: #16192a;
  --text-2: #5b6478;
  --text-3: #9aa3b5;
  --border: #e6e9f2;
  --border-2: #eef1f7;

  --primary: #4f7cff;
  --primary-dark: #3a63e0;
  --primary-soft: #eef3ff;

  --success: #0fae6e;
  --success-soft: #e7f8f1;
  --warn: #e8912a;
  --warn-soft: #fdf3e4;
  --danger: #ef4444;
  --danger-soft: #fdecec;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(22, 25, 42, .04), 0 8px 24px -12px rgba(22, 25, 42, .14);
  --shadow-lg: 0 12px 48px -12px rgba(22, 25, 42, .26);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.35; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: .16s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: #d3d9e8; transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-danger { background: var(--surface); border-color: #f6c9c9; color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }

.btn-success { background: var(--success); border-color: var(--success); color: #fff; }

/* 拒绝（终态动作）：比普通危险按钮更重，用深色实底 */
.btn-deny { background: #3b4257; border-color: #3b4257; color: #fff; }
.btn-deny:hover:not(:disabled) { background: #2c3143; border-color: #2c3143; }

.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--border-2); }

/* 「查看任务详情」这类**入口**按钮：主色浅底 + 主色描边 + 主色文字，宽度撑满所在卡片。
   主人 2026-09-26「让任务详情醒目一点」—— 内容都收进详情弹窗之后，这个入口就是唯一通道，
   得让人一眼看见。用浅底而不是 .btn-primary 的实底，是为了不去抢「完成任务」那种主操作的位置。 */
.btn-detail {
  width: 100%;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 650;
  background: var(--primary-soft);
  border-color: #cddcff;
  color: var(--primary-dark);
}
.btn-detail:hover:not(:disabled) { background: #e3ecff; border-color: var(--primary); }

/* ---------- 表单 ---------- */

.field { margin-bottom: 14px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.field .hint { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 4px; }

/* 文本框统一皮肤。原来只列了 text / password / number / date / search，
   漏了 tel —— 手机号框就退回浏览器默认样式，和密码框长得不一样，特难看。
   这里保持和老写法同一优先级，避免压掉后台局部工具栏的样式。 */
input[type="text"], input[type="password"], input[type="number"],
input[type="tel"], input[type="email"], input[type="url"],
input[type="date"], input[type="search"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: .16s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; min-height: 110px; line-height: 1.65; }
select { cursor: pointer; }

/* ---------- 徽章 ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--border-2);
  color: var(--text-2);
  white-space: nowrap;
}
.badge-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-primary { background: var(--primary-soft); color: var(--primary-dark); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warn    { background: var(--warn-soft);    color: var(--warn); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
/* 已拒绝：比「已驳回」更重的终态，用深灰底做区分 */
.badge-dark    { background: #3b4257; color: #fff; }
/* 任务编号：像一块编号牌，一眼能从其它标签里认出来。
   全站一条序列 —— 第 1 条任务就是 1 号，一直往下数（不按天重置），博主端用的是同一个号 */
.badge-seq {
  background: var(--text);
  color: #fff;
  font-weight: 600;
  letter-spacing: .3px;
  flex: none;
}
/* 接单进度：跟「专属」「平台」这些身份标签区分开，用青蓝 */
.badge-info    { background: #e6f5f8; color: #0b7c8d; }
/* 描边款：给「数量 / 次数」这类补充信息用（分组头的「在架 2」、第几条、今天可接 N 单）。
   注意：任务卡上那颗**状态**徽章（在架 / 已下架 / 已删除）不再用它了 ——
   描边太浅，主人在长列表里分不出在架和已下架，已改走实心款 `.badge-live / off / del`（见 admin.css）。 */
.badge-outline {
  background: transparent;
  color: var(--success);
  box-shadow: inset 0 0 0 1px rgba(15, 174, 110, .45);
}
/* 弱化标签（已下架 / 暂无接单 / 排序）：只作补充说明，不该吸引目光 */
.badge-ghost   { background: transparent; color: var(--text-3); box-shadow: inset 0 0 0 1px var(--border); }

/* ---------- 名额（通用任务：每条要求放几个名额，谁先接单谁得） ---------- */

/* 博主端任务卡上的名额行：还剩几个名额 / 已被抢完 */
.slot-line {
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  margin-bottom: 10px;
}
.slot-line b { color: var(--primary-dark); }
.slot-line.sold-out {
  background: var(--warn-soft);
  color: var(--warn);
}
.slot-line.sold-out b { color: var(--warn); }

/* 名额说明块（接单弹窗里用）：三小段说明，正文照常字号 */
.slot-note {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
}
.slot-note p { margin: 0 0 7px; }
.slot-note p:last-child { margin-bottom: 0; }
.slot-note .dim { color: var(--text-3); font-size: 12.5px; }

/* 抢完的任务卡：淡一点，但别让它消失 —— 慢一步的人还得能看到「手慢了」 */
.task-card-out { opacity: .72; }

/* ---------- 卡片 ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- 弹窗 ---------- */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 40, .48);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  animation: pop .22s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-2);
}
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 18px 20px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border-2);
}
.modal-close {
  border: none; background: transparent; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--text-3);
  padding: 0 4px; border-radius: 6px;
}
.modal-close:hover { color: var(--text); background: var(--border-2); }

/* ---------- Toast ---------- */

#toast-wrap {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  border-radius: 10px;
  background: #1f2438;
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .22s ease;
  max-width: 84vw;
}
.toast.ok { background: #10905c; }
.toast.err { background: #d13c3c; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------- 空状态 / 加载 ---------- */

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}
.empty .big { font-size: 30px; display: block; margin-bottom: 8px; opacity: .5; }

.loading { padding: 40px; text-align: center; color: var(--text-3); font-size: 13.5px; }

/* ---------- 完成截图 ---------- */

.thumb-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 74px; height: 74px; }
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: zoom-in;
  background: var(--border-2);
  transition: transform .16s ease;
}
.thumb img:hover { transform: scale(1.03); }
.thumb-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 24, 35, .72);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.thumb-del:hover { background: var(--danger); }
/* 后台列表里的迷你缩略图 */
.thumb-mini { width: 40px; height: 40px; object-fit: cover; border-radius: 7px; border: 1px solid var(--border); cursor: zoom-in; background: var(--border-2); }
.thumb-row { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---------- 博主端的任务链接块（原样显示分享原文 + 一键复制） ---------- */

.url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 9px 8px 11px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
/* 整段分享文本（【标题】+ emoji + 短码 + 链接），原样显示、可多行 */
.url-row .url-text {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
  user-select: text;
}
.url-row .btn { flex: none; }
/* 博主端的主操作就是「复制这段文字」，做成主色实心小按钮 */
.url-row .btn-copy-text {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.url-row .btn-copy-text:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-xs { padding: 4px 11px; font-size: 12px; border-radius: 6px; }

/* ---------- 通用小组件（博主端「我的」页 与 后台「邀请奖励」弹窗共用） ---------- */

/* 奖励汇总三格：合计 / 已发放 / 待发放。
   口径是「合计 = 已发放 + 待发放」，三个数一定加得上 —— 别改成四格或换算法，会直接对不上账。 */
.sum-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(min(84px, 100%), 1fr));
  gap: 8px;
  margin-top: 12px;
}
.sum-grid > div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 8px;
  text-align: center;
}
.sum-grid .k { font-size: 11.5px; color: var(--text-3); }
.sum-grid .v { font-size: 18px; font-weight: 700; margin-top: 2px; }
.sum-grid .v small { font-size: 11px; font-weight: 500; margin-left: 1px; }
.sum-grid .v.ok { color: var(--success); }
.sum-grid .v.wait { color: var(--warn); }

/* 状态小标签（已发放 / 待发放）：塞在表格单元格里，不占一行高 */
.tag-mini {
  display: inline-block;
  font-size: 11.5px; font-weight: 600;
  border-radius: 999px; padding: 2px 9px;
  white-space: nowrap;
}
.tag-mini.is-ok { color: var(--success); background: var(--success-soft); }
.tag-mini.is-wait { color: var(--warn); background: var(--warn-soft); }

/* 后台表格 / 后台任务列表里的「任务链接」：小字 + 可点击跳转 + 一键复制 */
.link-cell { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.link-cell .lnk {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.link-cell .lnk:hover { color: var(--primary-dark); text-decoration-thickness: 2px; }
.link-cell .cp,
.link-cell .op {
  flex: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  font-size: 11px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.link-cell .cp:hover,
.link-cell .op:hover { color: var(--primary); border-color: var(--primary); }
/* 「打开」比「复制」更常用，用主色底把它挑出来 */
.link-cell .op {
  color: var(--primary);
  border-color: transparent;
  background: var(--primary-soft);
  font-weight: 600;
}
.link-cell .op:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 工具类 ---------- */

.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.fs12 { font-size: 12px; }
.fs13 { font-size: 13px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, "Consolas", "Courier New", monospace; }

.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--border-2);
  flex-shrink: 0;
}
/* 头像地址不可用时的文字占位：显示名字首字，别让浏览器去请求坏地址、渲染成破图 */
.avatar-txt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 650;
  line-height: 1;
  user-select: none;
}
