﻿/* 撸点小钱 · 移动端样式（纯静态，无框架） */
:root {
  --bg: #0a0a0b;
  --bg-soft: #101012;
  --card: #161618;
  --card-2: #1d1d20;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #f4f4f5;
  --muted: #8e8e95;
  --muted-2: #616168;
  --accent: #ff7a2f;
  --accent-2: #ff4d6d;
  --accent-soft: rgba(255, 122, 47, 0.12);
  --green: #34d399;
  --red: #f87171;
  --nav: #14141c;
  --r: 18px;
  --r-sm: 12px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { overscroll-behavior-y: none; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

.shell { max-width: 520px; margin: 0 auto; min-height: 100vh; position: relative; }

/* ---------- 顶栏 ---------- */
.hd {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: calc(var(--sat) + 12px) 18px 12px;
  background: linear-gradient(180deg, rgba(10,10,11,.96) 60%, rgba(10,10,11,0));
  backdrop-filter: blur(18px);
}
.hd-title { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.hd-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hd-back {
  width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line);
}
.hd-r { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.avatar {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 13px; }

/* ---------- 页面主体 ---------- */
.main { padding: 4px 16px calc(96px + var(--sab)); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px; margin-bottom: 14px;
}
.card.tight { padding: 12px; }
.card-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-title { font-size: 15px; font-weight: 700; }
.card-more { margin-left: auto; font-size: 12px; color: var(--muted); }
.card-sub { font-size: 12px; color: var(--muted); }

/* ---------- 钱包 ---------- */
.wallet {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 20px;
  background: linear-gradient(135deg, #ff8a3d 0%, #ff5f2e 45%, #ff3f6c 100%);
  color: #fff; margin-bottom: 14px;
  box-shadow: 0 18px 40px -22px rgba(255, 96, 64, 0.9);
}
.wallet::after {
  content: ""; position: absolute; right: -40px; top: -60px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16); filter: blur(6px);
}
.wallet-label { font-size: 12px; opacity: .85; letter-spacing: .5px; }
.wallet-amount { font-size: 34px; font-weight: 800; letter-spacing: -.5px; margin: 4px 0 14px; }
.wallet-amount small { font-size: 16px; font-weight: 600; opacity: .85; margin-left: 4px; }
.wallet-row { display: flex; gap: 22px; font-size: 12px; position: relative; z-index: 1; }
.wallet-row b { display: block; font-size: 15px; margin-top: 2px; }
.wallet-btn {
  position: absolute; right: 18px; bottom: 18px; z-index: 2;
  background: rgba(0, 0, 0, .26); border: 1px solid rgba(255, 255, 255, .28);
  padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
}

/* ---------- 公告 ---------- */
.notice {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent-soft); border: 1px solid rgba(255, 122, 47, .18);
  color: #ffb98a; border-radius: 12px; padding: 9px 12px; font-size: 12.5px;
  margin-bottom: 14px; overflow: hidden;
}
.notice span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 签到 ---------- */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 14px; }
.day {
  border-radius: 12px; padding: 8px 0 6px; text-align: center;
  background: var(--card-2); border: 1px solid transparent;
  font-size: 11px; color: var(--muted);
}
.day b { display: block; font-size: 13px; color: var(--text); margin-bottom: 2px; }
.day.done { background: var(--accent-soft); border-color: rgba(255, 122, 47, .35); color: var(--accent); }
.day.done b { color: var(--accent); }
.day.today { border-color: rgba(255, 255, 255, .35); }

/* ---------- 任务 / 列表 ---------- */
.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.item:last-child { border-bottom: 0; padding-bottom: 0; }
.item:first-child { padding-top: 0; }
.item-ic {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 18px;
  background: var(--card-2); border: 1px solid var(--line);
}
.item-main { flex: 1; min-width: 0; }
.item-t { font-size: 14px; font-weight: 600; }
.item-d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.item-r { font-size: 13px; color: var(--muted); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  background: var(--card-2); border: 1px solid var(--line-2); color: var(--text);
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff5a2b);
  border: 0; color: #fff;
  box-shadow: 0 10px 24px -12px rgba(255, 122, 47, .9);
}
.btn-ghost { background: transparent; }
.btn-block { display: flex; width: 100%; padding: 14px; border-radius: 14px; font-size: 15px; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }
.btn-warn { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .3); color: #ffb4b4; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.input, .textarea, select.input {
  width: 100%; background: var(--card-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 14px; font-size: 15px; outline: none;
  transition: border-color .15s;
}
.input:focus, .textarea:focus { border-color: rgba(255, 122, 47, .55); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.hint { font-size: 12px; color: var(--muted-2); margin-top: 6px; }

/* ---------- 资源 ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 16px; border-radius: 999px; font-size: 13px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

.res { display: flex; gap: 12px; padding: 12px; }
.res + .res { border-top: 1px solid var(--line); }
.res-cover {
  width: 92px; height: 92px; border-radius: 14px; flex: none; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #2a2a2f, #1a1a1e);
}
.res-cover img { width: 100%; height: 100%; object-fit: cover; }
.res-cover .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; opacity: .5; }
.res-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.res-t { font-size: 14.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.res-d { font-size: 12px; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.res-f { margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 6px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(255, 122, 47, .22);
}
.badge.gray { background: var(--card-2); color: var(--muted); border-color: var(--line); }
.badge.green { background: rgba(52, 211, 153, .12); color: var(--green); border-color: rgba(52, 211, 153, .25); }
.badge.official {
  background: linear-gradient(135deg, rgba(255, 199, 61, .22), rgba(255, 122, 47, .18));
  color: #ffcb4d; border-color: rgba(255, 199, 61, .38); font-weight: 600;
}
.official-line { display: flex; align-items: center; gap: 6px; }
.pinned-dot { font-size: 10px; color: #ffcb4d; }

/* ---------- 商品 ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prod { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.prod-img { aspect-ratio: 1/1; background: linear-gradient(135deg, #26262b, #17171a); position: relative; }
.prod-img img { width: 100%; height: 100%; object-fit: cover; }
.prod-body { padding: 10px 12px 12px; }
.prod-t { font-size: 13.5px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.prod-price { color: var(--accent); font-weight: 700; font-size: 15px; margin-top: 6px; }
.prod-price small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 2px; }

/* ---------- 我的 ---------- */
.profile { display: flex; align-items: center; gap: 14px; padding: 6px 2px 18px; }
.profile .avatar { width: 62px; height: 62px; border-radius: 20px; font-size: 24px; }
.profile-name { font-size: 19px; font-weight: 700; }
.profile-id { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.assets { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.assets > div { padding: 6px 0; }
.assets b { display: block; font-size: 19px; font-weight: 800; }
.assets span { font-size: 11.5px; color: var(--muted); }
.menu { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.menu-item:last-child { border-bottom: 0; }
.menu-item .ic { width: 28px; text-align: center; font-size: 16px; }
.menu-item .ar { margin-left: auto; color: var(--muted-2); font-size: 18px; line-height: 1; }

/* ---------- 底栏 ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: 520px; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(20, 20, 28, .92); backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--sab);
}
.tab {
  height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10px; color: #7d7d86;
}
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--accent); }
.tab-plus {
  width: 46px; height: 46px; margin-top: -18px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #ff4d3d);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 10px 22px -8px rgba(255, 122, 47, .85);
}
.tab-plus svg { width: 24px; height: 24px; }

/* ---------- 通用 ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.center { text-align: center; }
.grow { flex: 1; }
.hair { height: 1px; background: var(--line); margin: 14px 0; }
.empty { padding: 44px 0; text-align: center; color: var(--muted-2); font-size: 13px; }
.empty .em { font-size: 34px; display: block; margin-bottom: 10px; opacity: .7; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center-load { display: grid; place-items: center; padding: 40px 0; }

/* ---------- Toast / Modal ---------- */
.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.94);
  background: rgba(28, 28, 32, .96); color: #fff; padding: 12px 18px; border-radius: 14px;
  font-size: 14px; max-width: 76vw; text-align: center; z-index: 200;
  opacity: 0; pointer-events: none; transition: all .18s ease;
  border: 1px solid var(--line-2); backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .62); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.mask.show { opacity: 1; pointer-events: auto; }
.mask.center { align-items: center; }
#mask-inner { width: 100%; display: flex; justify-content: center; align-items: flex-end; }
.mask.center #mask-inner { align-items: center; }
.sheet {
  width: 100%; max-width: 520px; background: var(--bg-soft);
  border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + var(--sab));
  transform: translateY(24px); transition: transform .22s ease;
  border-top: 1px solid var(--line-2);
}
.mask.show .sheet { transform: translateY(0); }
.dialog {
  width: calc(100% - 56px); max-width: 320px; background: var(--bg-soft);
  border-radius: 20px; padding: 22px 20px; text-align: center;
  border: 1px solid var(--line-2); transform: scale(.96); transition: transform .18s;
}
.mask.show .dialog { transform: scale(1); }
.dialog-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.dialog-body { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; white-space: pre-wrap; }
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions .btn { flex: 1; }

/* 广告弹窗 */
.ad-box {
  position: relative; background: #000; border-radius: 16px; overflow: hidden;
  aspect-ratio: 16/10; display: grid; place-items: center; color: #fff;
  background-image: radial-gradient(circle at 30% 20%, #2b1b3d, #000 70%);
}
.ad-timer {
  position: absolute; right: 10px; top: 10px; background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px;
  font-size: 12px; padding: 3px 10px;
}
.ad-play { font-size: 42px; opacity: .9; }
.ad-tip { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 12px; color: rgba(255,255,255,.7); }

/* 登录页 */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 0 26px calc(40px + var(--sab)); }
.auth-logo {
  width: 68px; height: 68px; border-radius: 22px; display: grid; place-items: center;
  font-size: 30px; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 40px -18px rgba(255, 90, 60, .9); margin-bottom: 18px;
}
.auth-title { font-size: 26px; font-weight: 800; letter-spacing: -.4px; }
.auth-sub { color: var(--muted); font-size: 13px; margin: 6px 0 26px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 20px; }
.auth-switch b { color: var(--accent); }

/* 详情页吸底 */
.fixed-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 520px;
  padding: 12px 16px calc(12px + var(--sab));
  background: rgba(10, 10, 11, .92); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); z-index: 45; display: flex; gap: 10px; align-items: center;
}

/* 后台 */
.admin { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.admin-hd { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.admin-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 4px; }
.admin-tabs .chip { padding: 8px 14px; }
.admin-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 16px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--card-2); border-radius: 14px; padding: 14px; }
.stat b { display: block; font-size: 22px; font-weight: 800; }
.stat span { font-size: 12px; color: var(--muted); }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
table.tb th, table.tb td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tb th { color: var(--muted); font-weight: 500; font-size: 12px; }
table.tb tr:hover td { background: rgba(255, 255, 255, .02); }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--card-2); }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--card-2); color: var(--muted); }
.tag.ok { background: rgba(52, 211, 153, .14); color: var(--green); }
.tag.warn { background: rgba(255, 122, 47, .14); color: var(--accent); }
.tag.err { background: rgba(248, 113, 113, .14); color: var(--red); }
.up-zone {
  border: 1px dashed var(--line-2); border-radius: 14px; padding: 26px; text-align: center;
  color: var(--muted); font-size: 13px; transition: border-color .15s;
}
.up-zone.over { border-color: var(--accent); color: var(--accent); }
.file-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* 文案编辑器（窄屏可用） */
.text-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.text-item .tk {
  width: 190px; flex: none; padding-top: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: var(--muted); word-break: break-all;
}
.text-item .tv { flex: 1; min-width: 0; }
.text-item input.input { padding: 9px 12px; font-size: 14px; }
@media (max-width: 720px) {
  .text-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; }
  .text-item .tk { grid-column: 1 / -1; width: auto; padding-top: 0; }
  .text-item .tv { grid-column: 1; width: 100%; }
  .text-item [data-del] { grid-column: 2; align-self: end; }
}

@media (min-width: 760px) {
  .admin { padding: 32px 32px 80px; }
}
