/* ============================================================
   羊毛大师 —— 全站样式
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #ff5b2e;
  --brand-dark: #e0431a;
  --brand-soft: #fff1ec;
  --ink: #1c1e21;
  --ink-2: #5a6169;
  --ink-3: #9298a1;
  --line: #e8eaed;
  --bg: #f6f7f9;
  --card: #ffffff;
  --ok: #12a05c;
  --warn: #e08a00;
  --danger: #e02020;
  --blue: #2f6fed;
  --radius: 14px;
}

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

a { color: var(--brand); text-decoration: none; }
.page { max-width: 460px; margin: 0 auto; padding: 16px 16px 48px; }
.page.wide { max-width: 1180px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.card + .card { margin-top: 14px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  border: none; border-radius: 10px; padding: 11px 20px;
  background: var(--brand); color: #fff;
  transition: background .15s, opacity .15s;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { display: flex; width: 100%; }
.btn.sm { font-size: 13px; padding: 6px 12px; border-radius: 8px; font-weight: 500; }
.btn.ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.btn.ghost:hover { background: #f2f3f5; color: var(--ink); }
.btn.blue { background: var(--blue); }
.btn.blue:hover { background: #1f57c9; }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid #f3cfcf; }
.btn.danger:hover { background: #fdf0f0; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.field > label .req { color: var(--danger); margin-left: 2px; }
input[type="text"], input[type="password"], input[type="number"], input[type="tel"],
textarea, select {
  width: 100%; padding: 11px 13px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 10px; background: #fbfbfc; color: var(--ink);
  transition: border-color .15s, background .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); background: #fff; }
textarea { resize: vertical; min-height: 80px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }

/* 输入校验状态（注册/登录用） */
input.ok { border-color: #35c07a; background: #fff; }
input.bad { border-color: #e5a3a3; background: #fffafa; }
.field .err-tip { font-size: 12px; color: #c0392b; margin-top: 5px; display: none; }
.field .err-tip.show { display: block; }
.field .ok-tip { font-size: 12px; color: #0b8a4b; margin-top: 5px; display: none; }
.field .ok-tip.show { display: block; }

/* 登录 / 注册 切换 */
.auth-tabs {
  display: flex; background: #f2f3f5; border-radius: 12px; padding: 4px; margin-bottom: 18px;
}
.auth-tabs button {
  flex: 1; border: 0; background: transparent; font-family: inherit; font-size: 15px;
  font-weight: 600; color: var(--ink-2); padding: 9px 0; border-radius: 9px; cursor: pointer;
  transition: background .15s, color .15s;
}
.auth-tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.auth-switch { text-align: center; font-size: 13px; color: var(--ink-3); margin-top: 14px; }
.auth-switch a { color: var(--brand); font-weight: 600; text-decoration: none; cursor: pointer; }
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 58px; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; font-size: 12px; color: var(--ink-3);
  cursor: pointer; padding: 6px 8px; font-family: inherit;
}

.alert { border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-top: 12px; }
.alert.err { background: #fdecec; color: #a01b1b; }
.alert.ok { background: #e8f8f0; color: #0b6b3f; }

/* ---------- 用户端首页 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--ink-2); margin-bottom: 10px;
}
.topbar .uid { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-weight: 600; }
.topbar .uid b { color: var(--brand); font-family: Consolas, monospace; }

.hero { text-align: center; padding: 34px 16px 26px; }
.hero h1 {
  font-size: 46px; font-weight: 800; letter-spacing: 4px; line-height: 1.2;
  color: var(--ink);
}
.hero .notice {
  margin: 22px auto 0; max-width: 400px; text-align: left;
  font-size: 15px; line-height: 1.9; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  white-space: pre-wrap; word-break: break-word; /* 保留后台配置里的换行和空格 */
}
.hero .notice .hl { color: var(--danger); font-weight: 800; }

.menu { margin-top: 16px; }
.menu .menu-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 10px; font-size: 16px; font-weight: 600;
  color: var(--ink); font-family: inherit;
  transition: border-color .15s, transform .1s;
}
.menu .menu-btn:hover { border-color: var(--brand); }
.menu .menu-btn:active { transform: scale(.99); }
.menu .menu-btn .arrow { color: var(--ink-3); font-size: 18px; }
.menu .menu-btn .sub { display: block; font-size: 12px; font-weight: 400; color: var(--ink-3); margin-top: 2px; }
.empty { text-align: center; color: var(--ink-3); font-size: 14px; padding: 30px 10px; }

.mine { margin-top: 18px; }
.mine h3 { font-size: 14px; color: var(--ink-2); margin-bottom: 8px; }
.mine .item {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 8px; font-size: 13px;
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
}
.mine .item .code { color: var(--ink-3); font-family: Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }

/* ---------- 任务详情页 ---------- */
.task-top {
  display: flex; align-items: center; gap: 10px; padding: 6px 0 14px;
}
.task-top .logo {
  width: 34px; height: 34px; border-radius: 8px; object-fit: contain;
  background: #fff; border: 1px solid var(--line); flex-shrink: 0;
}
.task-top .title { font-size: 16px; font-weight: 700; }
.back { font-size: 13px; color: var(--ink-3); display: inline-block; margin-bottom: 6px; }

.main-img {
  width: 100%; border-radius: var(--radius); display: block;
  background: #fff; border: 1px solid var(--line); object-fit: cover;
}
.price-box { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.price-box .origin { font-size: 14px; color: var(--ink-3); text-decoration: line-through; }
.price-box .pay { font-size: 26px; font-weight: 800; color: var(--brand); }
.price-box .pay small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.kv { display: flex; justify-content: space-between; font-size: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--ink-3); }
.kv .v { font-weight: 600; word-break: break-all; text-align: right; max-width: 70%; }

.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }

/* ---------- 后台 ---------- */
.admin-head {
  background: #fff; border-bottom: 1px solid var(--line); padding: 12px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.admin-head h1 { font-size: 17px; font-weight: 700; }
.admin-head .who { margin-left: auto; font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 10px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 20px 0; }
.tab {
  font-family: inherit; font-size: 14px; padding: 8px 16px; border-radius: 999px;
  background: #eef0f3; color: var(--ink-2); border: none; cursor: pointer; font-weight: 500;
}
.tab.active { background: var(--brand); color: #fff; }
.section { display: none; padding: 16px 20px 60px; }
.section.active { display: block; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .n { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.stat .k { font-size: 12px; color: var(--ink-3); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 180px; }

.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 14px; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #fafbfc; font-size: 13px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.table tr:last-child td { border-bottom: none; }
.table .nowrap { white-space: nowrap; }
.thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: #fff; }
.mono { font-family: Consolas, Menlo, monospace; }
.code-cell { max-width: 260px; }
.code-cell .code-text {
  display: block; font-family: Consolas, Menlo, monospace; font-size: 13px;
  background: #f6f7f9; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; word-break: break-all; margin-bottom: 6px; max-height: 92px; overflow: auto;
}

.badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge.pending { background: #fdf0dd; color: var(--warn); }
.badge.processing { background: #e8f0fe; color: var(--blue); }
.badge.done { background: #e8f8f0; color: var(--ok); }
.badge.invalid { background: #f1efE8; color: #888780; }
.badge.online { background: #e8f8f0; color: var(--ok); }
.badge.offline { background: #f1efe8; color: #888780; }
.badge.normal { background: #e8f8f0; color: var(--ok); }
.badge.banned { background: #fdecec; color: var(--danger); }

.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.upload { display: flex; align-items: center; gap: 12px; }
.upload .preview {
  width: 68px; height: 68px; border-radius: 10px; border: 1px dashed var(--line);
  background: #fafbfc center/cover no-repeat; flex-shrink: 0;
}
.upload .pick { position: relative; overflow: hidden; }
.upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(20,22,26,.5); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 520px; padding: 24px;
}
.modal h2 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.toast {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%);
  background: #1c1e21; color: #fff; font-size: 14px; padding: 10px 20px;
  border-radius: 999px; z-index: 99;
}
.toast.bad { background: #b32020; }
