/* ==========================================================================
   得物整点抢兑助手 · Web 版   界面（浅色 / 响应式）

   结构
   ----
     桌面：左侧固定导航 + 右侧顶栏 + 分视图内容（不再是一条长滚动）
     手机：顶栏 + 分视图 + 底部标签栏

   断点：1120（收起侧栏） / 780（手机） / 560（小屏手机）
   ========================================================================== */

:root {
  /* 品牌 */
  --red: #e6243f;
  --red-d: #c81d35;
  --red-l: #ff5a72;
  --red-s: #fff0f2;      /* 极浅红底 */
  --red-s2: #ffe3e8;

  /* 中性 */
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #131a29;
  --ink2: #4d586a;
  --ink3: #8b94a6;
  --line: #eef0f4;
  --line2: #e3e6ec;
  --hover: #f6f7f9;

  /* 语义 */
  --green: #0f9d58;
  --green-s: #e9f7ef;
  --blue: #3563e9;
  --blue-s: #eef3ff;
  --amber: #b07400;
  --amber-s: #fff6e5;
  --gold: #b8860b;
  --gold-s: #fff8e4;

  --r: 16px;
  --r-m: 12px;
  --r-s: 9px;
  --sh: 0 1px 2px rgba(19, 26, 41, .04);
  --sh-2: 0 1px 2px rgba(19, 26, 41, .04), 0 8px 24px rgba(19, 26, 41, .05);
  --sh-3: 0 6px 14px rgba(19, 26, 41, .07), 0 18px 44px rgba(19, 26, 41, .10);

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  --side-w: 236px;
  --head-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

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

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button { font: inherit; }

/* 图标（内联 SVG，线性描边） */
.i {
  width: 18px; height: 18px; flex: none; display: block;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.i-s { width: 15px; height: 15px; }
.i-l { width: 22px; height: 22px; }

::selection { background: var(--red-s2); }

/* 滚动条（桌面） */
* { scrollbar-width: thin; scrollbar-color: #d5dae3 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #d5dae3; border-radius: 9px;
  border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #bcc3cf; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   控件
   ========================================================================== */
input, select, textarea {
  font: inherit; width: 100%; max-width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line2);
  border-radius: var(--r-s);
  background: #fff; color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: #a8b0be; }
input:focus, select:focus, textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3.5px rgba(230, 36, 63, .1);
}
textarea { resize: vertical; min-height: 84px; font-family: var(--mono); font-size: 12px; line-height: 1.7; }
select { appearance: none; padding-right: 30px; background-repeat: no-repeat;
  background-position: right 10px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b94a6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }

.btn {
  border: none; border-radius: var(--r-s);
  padding: 9px 15px; cursor: pointer; font-weight: 500;
  white-space: nowrap; display: inline-flex; align-items: center;
  gap: 6px; justify-content: center;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-p { background: var(--red); color: #fff; box-shadow: 0 1px 2px rgba(230, 36, 63, .2), 0 6px 16px rgba(230, 36, 63, .2); }
.btn-p:hover:not(:disabled) { background: var(--red-d); }
.btn-s { background: #fff; color: var(--ink2); border: 1px solid var(--line2); }
.btn-s:hover:not(:disabled) { background: var(--hover); border-color: #d2d8e1; color: var(--ink); }
.btn-g { background: #eff1f5; color: var(--ink2); }
.btn-g:hover:not(:disabled) { background: #e6e9ef; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #ffd8dd; }
.btn-danger:hover:not(:disabled) { background: var(--red-s); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; gap: 4px; }
.btn-sm .i { width: 14px; height: 14px; }
.btn-block { width: 100%; }
.btn-ico { padding: 8px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; line-height: 1.75; white-space: nowrap;
}
.tag.ok   { background: var(--green-s); color: var(--green); }
.tag.bad  { background: var(--red-s);   color: var(--red); }
.tag.wait { background: #f0f2f6;        color: var(--ink3); }
.tag.run  { background: var(--blue-s);  color: var(--blue); }
.tag.warn { background: var(--amber-s); color: var(--amber); }

.muted { color: var(--ink3); font-size: 12.5px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sp { flex: 1; }

label.fld { display: block; margin-bottom: 13px; }
label.fld > span { display: block; font-size: 12px; color: var(--ink3); margin-bottom: 5px; font-weight: 500; }
label.fld .hint { font-size: 11.5px; color: var(--ink3); margin-top: 5px; line-height: 1.55; }
.chk { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; margin-bottom: 10px; cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: var(--red); flex: none; margin-top: 3px; }

.msg {
  font-size: 12.5px; padding: 9px 12px; border-radius: var(--r-s); margin: 10px 0 0;
  display: none; line-height: 1.6; word-break: break-word;
}
.msg.show { display: block; }
.msg.err { background: var(--red-s); color: var(--red); }
.msg.ok  { background: var(--green-s); color: var(--green); }

.empty { text-align: center; padding: 50px 20px; color: var(--ink3); font-size: 13px; line-height: 1.9; }
.empty .ico { display: flex; justify-content: center; margin-bottom: 12px; color: #ccd2dd; }
.empty .ico .i { width: 40px; height: 40px; stroke-width: 1.3; }
.empty b { display: block; color: var(--ink2); font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }

/* ==========================================================================
   登录页
   ========================================================================== */
.login-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(820px 400px at 8% -8%, rgba(230, 36, 63, .11), transparent 60%),
    radial-gradient(700px 400px at 96% 104%, rgba(53, 99, 233, .10), transparent 58%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 404px;
  background: var(--card); border-radius: 22px; padding: 32px 30px 22px;
  box-shadow: var(--sh-3);
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand .logo {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  background: linear-gradient(140deg, var(--red-l), var(--red));
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(230, 36, 63, .3);
}
.brand .logo .i { width: 24px; height: 24px; stroke-width: 1.9; }
.brand h1 { font-size: 16.5px; font-weight: 650; letter-spacing: .2px; }
.brand p { font-size: 12px; color: var(--ink3); margin-top: 1px; }
.login-foot {
  margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink3);
}
details.adv { margin: 2px 0 14px; }
details.adv summary {
  cursor: pointer; font-size: 12.5px; color: var(--ink3); padding: 7px 0;
  list-style: none; user-select: none; transition: color .15s;
}
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary::before { content: "+ "; font-weight: 700; }
details.adv[open] summary::before { content: "- "; }
details.adv summary:hover { color: var(--red); }

/* ==========================================================================
   应用骨架
   ========================================================================== */
.app { min-height: 100vh; min-height: 100dvh; }

/* ---------------------------------------------------------------- 侧栏 */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 60;
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px 12px;
}
.side .brand { padding: 0 8px; margin-bottom: 20px; gap: 10px; }
.side .brand .logo {
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(140deg, var(--red-l), var(--red));
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(230, 36, 63, .28);
}
.side .brand .logo .i { width: 20px; height: 20px; }
.side .brand h1 { font-size: 14px; font-weight: 650; line-height: 1.25; }
.side .brand p { font-size: 10.5px; color: var(--ink3); letter-spacing: .4px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav .nav-h {
  font-size: 10.5px; color: #a8b0be; font-weight: 600; letter-spacing: .8px;
  padding: 14px 12px 6px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--ink2); font-size: 13.5px; font-weight: 500;
  cursor: pointer; user-select: none; text-decoration: none;
  transition: background .14s, color .14s;
  -webkit-tap-highlight-color: transparent;
}
.nav-item:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav-item.on { background: var(--red-s); color: var(--red); font-weight: 600; }
.nav-item.on .i { stroke-width: 2; }
.nav-item .lb { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .bd {
  background: #eff1f5; color: var(--ink3); font-size: 11px; font-weight: 600;
  border-radius: 20px; padding: 0 7px; min-width: 20px; text-align: center;
}
.nav-item.on .bd { background: var(--red); color: #fff; }

.side-foot { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }
.whoami {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 10px; transition: background .14s;
}
.whoami:hover { background: var(--hover); }
.whoami .av {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: linear-gradient(140deg, #3c4759, #222b3a);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.whoami .t { min-width: 0; flex: 1; }
.whoami .t b { display: block; font-size: 12.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whoami .t span { display: block; font-size: 11px; color: var(--ink3); }
.icon-btn {
  border: none; background: none; cursor: pointer; color: var(--ink3);
  padding: 7px; border-radius: 9px; display: flex; transition: background .14s, color .14s;
}
.icon-btn:hover { background: #eff1f5; color: var(--ink); }

/* ---------------------------------------------------------------- 主区 */
.main { margin-left: var(--side-w); min-width: 0; }

.head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.head-in {
  height: var(--head-h); padding: 0 24px;
  display: flex; align-items: center; gap: 12px;
}
.head .ttl { min-width: 0; }
.head .ttl h2 { font-size: 16px; font-weight: 650; letter-spacing: -.1px;
  display: flex; align-items: center; gap: 8px; }
.head .ttl p { font-size: 11.5px; color: var(--ink3); margin-top: 1px; }
.head .acts { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: #f7f8fa; border: 1px solid var(--line);
  border-radius: 20px; padding: 5px 12px; font-size: 12.5px; color: var(--ink2);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.pill b { color: var(--ink); font-weight: 650; }
.pill .i { width: 14px; height: 14px; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; }
.pill .dot::after { content: ""; }
.pill.off { color: var(--ink3); }
.pill.off .dot { background: #c6ccd7; }
.pill.err .dot { background: var(--red); }
.pill.coin { background: var(--gold-s); border-color: #f2e3bb; }
.pill.coin b { color: var(--gold); }
.pill.coin .i { color: var(--gold); }
.pill.live .dot { box-shadow: 0 0 0 0 rgba(15, 157, 88, .5); animation: ping 2s infinite; }
@keyframes ping {
  70% { box-shadow: 0 0 0 7px rgba(15, 157, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 157, 88, 0); }
}

.view { padding: 20px 24px 60px; max-width: 1280px; }

/* 手机底部标签栏（桌面隐藏） */
.tabbar { display: none; }

/* ==========================================================================
   卡片
   ========================================================================== */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--sh);
  margin-bottom: 16px; overflow: hidden;
}
.card-h {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.card-h h3 { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-h h3 .i { color: var(--ink3); }
.card-h .num {
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 20px; padding: 1px 8px; min-width: 20px; text-align: center;
}
.card-h .sub { font-size: 12px; color: var(--ink3); }
.card-h .sp { flex: 1; }
.card-b { padding: 18px; }
.card-b.tight { padding: 0; }

/* ==========================================================================
   概览页
   ========================================================================== */
.hero {
  border-radius: var(--r); padding: 22px 24px; margin-bottom: 16px;
  background:
    radial-gradient(520px 200px at 100% 0%, rgba(230, 36, 63, .1), transparent 62%),
    linear-gradient(120deg, #fff 40%, #fff8f9 100%);
  border: 1px solid #f6e6e9;
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  box-shadow: var(--sh);
}
.hero .lbl { font-size: 12.5px; color: var(--ink3); display: flex; align-items: center; gap: 6px; }
.hero .lbl .i { width: 15px; height: 15px; color: var(--gold); }
.hero .big {
  font-size: 40px; font-weight: 700; line-height: 1.1; letter-spacing: -1px;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.hero .big em { font-size: 14px; font-weight: 600; font-style: normal; color: var(--ink3); margin-left: 7px; letter-spacing: 0; }
.hero .tip { font-size: 12px; color: var(--ink3); margin-top: 3px; }
.hero .div { width: 1px; align-self: stretch; background: linear-gradient(180deg, transparent, #ecdde0, transparent); }
.hero .mini { display: flex; gap: 26px; flex-wrap: wrap; }
.hero .mini .m .n { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.hero .mini .m .n.g { color: var(--green); }
.hero .mini .m .n.r { color: var(--red); }
.hero .mini .m .t { font-size: 11.5px; color: var(--ink3); }

.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); margin-bottom: 16px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 16px; box-shadow: var(--sh);
  display: flex; align-items: center; gap: 13px;
}
.stat .si {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #f2f4f8; color: var(--ink2);
}
.stat .si.red { background: var(--red-s); color: var(--red); }
.stat .si.green { background: var(--green-s); color: var(--green); }
.stat .si.blue { background: var(--blue-s); color: var(--blue); }
.stat .si.gold { background: var(--gold-s); color: var(--gold); }
.stat .b { min-width: 0; }
.stat .n { font-size: 21px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.stat .l { font-size: 11.5px; color: var(--ink3); }

/* 下一个任务 */
.next { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.next .im {
  width: 66px; height: 66px; border-radius: 14px; object-fit: cover; flex: none;
  background: #f2f4f8; border: 1px solid var(--line);
}
.next .info { min-width: 0; flex: 1; }
.next .info h4 { font-size: 14px; font-weight: 600; margin-bottom: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.next .info .metas { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink3); }
.next .info .metas b { color: var(--ink2); font-weight: 600; }
.next .cd { text-align: right; flex: none; }
.next .cd .t {
  font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: -.5px;
  color: var(--red); font-variant-numeric: tabular-nums; line-height: 1.2;
}
.next .cd .t.soon { animation: blink 1.1s infinite; }
@keyframes blink { 50% { opacity: .35 } }
.next .cd .k { font-size: 11.5px; color: var(--ink3); }
.next .cd .at { font-size: 11.5px; color: var(--ink3); font-family: var(--mono); }

/* 快捷操作（图标磁贴） */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); }
.tile {
  border: 1px solid var(--line); background: #fff; border-radius: 14px;
  padding: 15px 12px 13px; cursor: pointer; text-align: center;
  transition: border-color .15s, box-shadow .15s, transform .12s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.tile:hover { border-color: #ffd9df; box-shadow: 0 6px 18px rgba(230, 36, 63, .09); transform: translateY(-2px); }
.tile:active { transform: translateY(0); }
.tile.on { border-color: var(--green); background: var(--green-s); }
.tile.on .ti { background: #fff; color: var(--green); }
.tile .ti {
  width: 38px; height: 38px; border-radius: 12px; margin: 0 auto 9px;
  background: var(--red-s); color: var(--red);
  display: flex; align-items: center; justify-content: center;
}
.tile .tn { font-size: 13px; font-weight: 600; }
.tile .ts { font-size: 11px; color: var(--ink3); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 最近事件 */
.events { display: flex; flex-direction: column; }
.ev {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 18px; font-size: 12.5px; border-bottom: 1px solid var(--line);
}
.ev:last-child { border-bottom: none; }
.ev .d { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-top: 7px; background: #c6ccd7; }
.ev.ok .d { background: var(--green); }
.ev.error .d { background: var(--red); }
.ev.warn .d { background: #dda31a; }
.ev .tx { min-width: 0; word-break: break-word; color: var(--ink2); }
.ev.ok .tx { color: var(--green); }
.ev.error .tx { color: var(--red); }
.ev.warn .tx { color: var(--amber); }

/* ==========================================================================
   商品页
   ========================================================================== */
.filterbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 15px; }
.filterbar .grow { flex: 1; min-width: 168px; }
.seg { display: inline-flex; background: #eff1f5; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  border: none; background: none; font: inherit; font-size: 12.5px; cursor: pointer;
  padding: 5px 12px; border-radius: 8px; color: var(--ink3); white-space: nowrap;
  transition: background .15s, color .15s; font-weight: 500;
}
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(19, 26, 41, .08); }

.pgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); }
.pcard {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  transition: transform .16s, box-shadow .16s, border-color .16s;
  -webkit-tap-highlight-color: transparent;
}
.pcard:hover { transform: translateY(-3px); box-shadow: var(--sh-3); border-color: #ffdde2; }
.pcard:active { transform: scale(.988); }
.pcard.sel { border-color: var(--red); box-shadow: 0 0 0 3px rgba(230, 36, 63, .12); }
.pcard.oos { opacity: .62; }
.pcard .thumb { position: relative; aspect-ratio: 1/1; background: #f6f7f9; overflow: hidden; }
.pcard .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s cubic-bezier(.2,.8,.3,1); }
.pcard:hover .thumb img { transform: scale(1.05); }
.pcard .thumb .ph { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: #c9cfda; }
.pcard .thumb .ph .i { width: 34px; height: 34px; stroke-width: 1.3; }
.pcard .oos-mask {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .76); color: #5d6779; font-weight: 700; font-size: 12.5px;
  letter-spacing: 1.5px;
}
.pcard .lbl {
  position: absolute; right: 8px; top: 8px;
  background: rgba(230, 36, 63, .93); color: #fff; font-size: 10.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 20px; backdrop-filter: blur(4px);
}
.pcard .body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pcard .name {
  font-size: 12.8px; line-height: 1.45; color: var(--ink); font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 37px;
}
.pcard .row2 { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; }
.pcard .price { font-size: 15px; font-weight: 700; color: var(--red); letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.pcard .coin {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 600; color: var(--gold);
  background: var(--gold-s); border-radius: 20px; padding: 2px 8px; white-space: nowrap;
}
.pcard .coin .i { width: 12px; height: 12px; }
.pcard .stock { font-size: 11.5px; color: var(--ink3); display: flex; align-items: center; gap: 5px; }
.pcard .stock .i { width: 12px; height: 12px; }
.pcard .stock.low { color: var(--amber); font-weight: 600; }
.pcard .stock.no { color: var(--red); font-weight: 600; }

/* ==========================================================================
   任务页
   ========================================================================== */
.tlist { display: flex; flex-direction: column; gap: 12px; }
.task {
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
  padding: 14px; transition: border-color .15s, box-shadow .15s;
}
.task:hover { border-color: var(--line2); box-shadow: 0 2px 12px rgba(19, 26, 41, .05); }
.task.live { border-color: #cfe0ff; background: linear-gradient(120deg, #fff, #f7faff 90%); }
.task.win { border-color: #c4ebd5; background: linear-gradient(120deg, #fff, #f4fcf7 90%); }
.task.lose { border-color: #f4d6da; }
.task .t-top { display: flex; gap: 12px; align-items: center; }
.task .t-img { width: 50px; height: 50px; border-radius: 12px; object-fit: cover;
  background: #f2f4f8; flex: none; border: 1px solid var(--line); }
.task .t-main { min-width: 0; flex: 1; }
.task .t-name { font-size: 13.5px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.task .t-sub { display: flex; gap: 5px 12px; flex-wrap: wrap; font-size: 11.5px;
  color: var(--ink3); margin-top: 4px; }
.task .t-sub .id { font-family: var(--mono); }
.task .t-sub b { color: var(--ink2); font-weight: 600; }
.task .t-acts { display: flex; gap: 6px; flex: none; }
.task .t-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line2);
}
.task .t-bar .k { font-size: 11px; color: var(--ink3); }
.task .t-bar .v { font-size: 12.5px; color: var(--ink2); font-weight: 500; }
.task .t-bar .v.mono { font-family: var(--mono); }
.task .t-note { font-size: 12px; color: var(--ink3); flex: 1 1 100%;
  word-break: break-word; line-height: 1.55; }
.task .t-cd { font-family: var(--mono); font-weight: 700; color: var(--red);
  font-variant-numeric: tabular-nums; font-size: 13px; }
.task .t-cd.soon { animation: blink 1.1s infinite; }
.task.win .t-cd, .task.lose .t-cd { color: var(--ink3); animation: none; }

/* ==========================================================================
   日志页
   ========================================================================== */
.term {
  background: #11161f; border-radius: 14px; overflow: hidden;
  border: 1px solid #1d2531;
}
.term-bar {
  display: flex; align-items: center; gap: 7px; padding: 10px 14px;
  background: #171e29; border-bottom: 1px solid #222b38;
}
.term-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: #2d3644; flex: none; }
.term-bar .d1 { background: #ff5f57; }
.term-bar .d2 { background: #febc2e; }
.term-bar .d3 { background: #28c840; }
.term-bar .t { margin-left: 8px; font-size: 11.5px; color: #6b7a92; font-family: var(--mono); }
.term-bar .sp { flex: 1; }
.term-bar .btn { border-color: #2b3542; background: #1e2632; color: #93a3ba; }
.term-bar .btn:hover:not(:disabled) { background: #26303e; color: #cfdcee; border-color: #364353; }
#log {
  height: calc(100vh - 250px); min-height: 260px;
  overflow-y: auto; padding: 14px 16px;
  font-family: var(--mono); font-size: 12px; line-height: 1.85;
  color: #b9cbe4; white-space: pre-wrap; word-break: break-word;
}
#log .ln { padding: 1px 0; }
#log .ln:hover { background: rgba(255, 255, 255, .03); }
#log .l-ok { color: #6ee7a8; }
#log .l-warn { color: #ffcf70; }
#log .l-error { color: #ff8b95; }
#log .l-info { color: #9fb8d8; }
#log .ts { color: #4f5f78; margin-right: 8px; user-select: none; }

/* ==========================================================================
   设置页
   ========================================================================== */
.set-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.sec-t {
  display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 650;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.sec-t .si { width: 30px; height: 30px; border-radius: 9px; background: var(--red-s);
  color: var(--red); display: flex; align-items: center; justify-content: center; flex: none; }
.sec-t .si .i { width: 16px; height: 16px; }
.sec-t .sp { flex: 1; }
.sec-t .state { font-size: 11.5px; font-weight: 600; }
.sec-t .state.on { color: var(--green); }
.sec-t .state.off { color: var(--ink3); }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 7px 0; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv .k { color: var(--ink3); }
.kv .v { font-weight: 500; text-align: right; word-break: break-word; }

/* ==========================================================================
   表格（管理后台）
   ========================================================================== */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-m); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
th, td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #fafbfc; color: var(--ink3); font-weight: 600; font-size: 11.5px; white-space: nowrap; letter-spacing: .2px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbfd; }
td .pname { display: flex; align-items: center; gap: 9px; min-width: 190px; }
td .pname img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; flex: none; background: #f2f4f8; }
td .pname .t { min-width: 0; }
td .pname .t b { font-weight: 500; font-size: 12.8px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
td .pname .t span { font-size: 11px; color: var(--ink3); }
.acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ==========================================================================
   弹窗
   ========================================================================== */
.backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(17, 24, 36, .36); backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .15s ease; overflow-y: auto;
}
@keyframes fade { from { opacity: 0 } }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 470px;
  max-height: 90vh; overflow: auto; padding: 22px 22px 20px;
  box-shadow: 0 30px 70px rgba(17, 24, 36, .26);
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.15);
}
.modal.wide { max-width: 660px; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98) } }
.modal h3 { font-size: 15.5px; font-weight: 650; margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px; }
.modal h3 .i { color: var(--red); }
.modal .desc { font-size: 12.5px; color: var(--ink3); margin-bottom: 16px; line-height: 1.65; }
.modal .foot { display: flex; gap: 9px; justify-content: flex-end; margin-top: 18px;
  flex-wrap: wrap; align-items: center; }
.modal .foot .sp { flex: 1; }
.modal .sect { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 15px; }
.modal .sect > h4 { font-size: 12px; color: var(--ink3); font-weight: 600; margin-bottom: 11px; letter-spacing: .4px; }

/* 商品预览（弹窗顶部） */
.preview {
  display: flex; gap: 12px; background: #fafbfc; border: 1px solid var(--line);
  border-radius: var(--r-m); padding: 11px; margin-bottom: 15px;
}
.preview img { width: 62px; height: 62px; border-radius: 10px; object-fit: cover; background: #eef1f5; flex: none; }
.preview .info { min-width: 0; }
.preview .info b { font-size: 13px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.preview .info .meta { font-size: 12px; color: var(--ink3); margin-top: 5px;
  display: flex; gap: 6px 13px; flex-wrap: wrap; }
.preview .info .meta span { white-space: nowrap; }
/* 上面 .preview .info b 是给商品名做两行截断的；这里把 meta 里的 <b> 拉回行内，
   否则它会被做成块级，把「需要 1 金币」拆成三行。 */
.preview .info .meta b {
  display: inline; overflow: visible;
  -webkit-line-clamp: unset; -webkit-box-orient: initial;
  font-weight: 700; color: var(--ink);
}
.preview .info .meta .p { color: var(--red); font-weight: 700; }

/* 提示条 */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: #1a2233; color: #fff; padding: 11px 20px; border-radius: 12px;
  font-size: 13.5px; z-index: 200; box-shadow: 0 12px 34px rgba(0, 0, 0, .24);
  animation: up .2s ease; max-width: 88vw; text-align: center;
  display: flex; align-items: center; gap: 8px;
}
.toast .i { width: 16px; height: 16px; }
.toast.ok { background: #0f9d58; }
.toast.err { background: #d92b45; }
@keyframes up { from { opacity: 0; transform: translate(-50%, 12px) } }

/* 骨架屏 */
.skel { background: linear-gradient(90deg, #f1f3f6 25%, #e7ebf1 37%, #f1f3f6 63%);
  background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }

/* ==========================================================================
   平板：收起侧栏，改用底部标签栏
   ========================================================================== */
@media (max-width: 1120px) {
  .side { display: none; }
  .main { margin-left: 0; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 12px; }
  .view { padding: 16px 16px calc(78px + env(safe-area-inset-bottom)); }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar button {
    flex: 1; border: none; background: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 2px 7px; color: var(--ink3); font-size: 10.5px; font-weight: 500;
    position: relative; transition: color .15s; -webkit-tap-highlight-color: transparent;
  }
  .tabbar button .i { width: 21px; height: 21px; }
  .tabbar button.on { color: var(--red); }
  .tabbar button.on .i { stroke-width: 2.1; }
  .tabbar button .bd {
    position: absolute; top: 4px; left: 50%; margin-left: 8px;
    background: var(--red); color: #fff; font-size: 9.5px; font-weight: 700;
    border-radius: 20px; padding: 0 5px; min-width: 15px; line-height: 1.6;
  }
  .head-in { padding: 0 16px; }
  .head .hide-md { display: none; }
}

/* ==========================================================================
   手机
   ========================================================================== */
@media (max-width: 780px) {
  body { font-size: 13.5px; }
  .head-in { height: 56px; padding: 0 13px; gap: 9px; }
  .head .ttl h2 { font-size: 15px; }
  .head .ttl p { display: none; }
  .head .hide-sm { display: none; }
  .view { padding: 13px 12px calc(74px + env(safe-area-inset-bottom)); }
  .card { border-radius: 14px; margin-bottom: 12px; }
  .card-h { padding: 13px 14px; }
  .card-b { padding: 14px; }
  .hero { padding: 17px 16px; gap: 16px; border-radius: 14px; }
  .hero .big { font-size: 32px; }
  .hero .div { display: none; }
  .hero .mini { gap: 20px; width: 100%; }
  .hero .mini .m .n { font-size: 18px; }

  /* 商品 2 列 */
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pcard .body { padding: 9px 10px 11px; gap: 6px; }
  .pcard .name { font-size: 12.5px; min-height: 34px; }
  .pcard .price { font-size: 14px; }
  .pcard .coin { font-size: 11px; padding: 2px 7px; }
  .pcard .stock { font-size: 11px; }
  .filterbar .grow { flex: 1 1 100%; }
  .filterbar { gap: 8px; }

  /* 统计卡 2 列 */
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px; gap: 10px; border-radius: 13px; }
  .stat .si { width: 34px; height: 34px; border-radius: 10px; }
  .stat .si .i { width: 17px; height: 17px; }
  .stat .n { font-size: 18px; }
  .stat .l { font-size: 11px; }

  /* 磁贴 3 列 */
  .tiles { grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .tile { padding: 12px 6px 10px; border-radius: 12px; }
  .tile .ti { width: 34px; height: 34px; margin-bottom: 7px; }
  .tile .tn { font-size: 12px; }
  .tile .ts { display: none; }

  /* 下一个任务 */
  .next { gap: 13px; }
  .next .im { width: 54px; height: 54px; border-radius: 12px; }
  .next .cd { width: 100%; text-align: left; display: flex; align-items: baseline; gap: 9px;
    padding-top: 11px; border-top: 1px dashed var(--line2); }
  .next .cd .t { font-size: 22px; }

  /* 任务卡 */
  .task { padding: 12px; border-radius: 13px; }
  .task .t-top { flex-wrap: wrap; gap: 10px; align-items: flex-start; }
  .task .t-acts { width: 100%; }
  .task .t-acts .btn { flex: 1; }
  .task .t-bar { margin-top: 10px; padding-top: 9px; }
  .task .t-note { font-size: 11.5px; }

  /* 设置 */
  .set-grid { grid-template-columns: 1fr; gap: 12px; }

  /* 日志 */
  #log { height: calc(100vh - 300px); min-height: 200px; font-size: 11.5px; padding: 12px; }
  .term-bar { padding: 8px 11px; }

  /* 弹窗 → 底部抽屉 */
  .backdrop { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%; border-radius: 20px 20px 0 0; max-height: 92vh;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
    animation: sheet .24s cubic-bezier(.2, .9, .3, 1.05);
  }
  @keyframes sheet { from { transform: translateY(100%) } }
  .modal::before {
    content: ""; display: block; width: 38px; height: 4px; border-radius: 4px;
    background: #dfe3ea; margin: -6px auto 12px;
  }
  .modal .foot { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom));
    background: #fff; padding: 12px 0 6px; margin-top: 16px; }
  .modal .foot .btn { flex: 1; }
  .modal .foot .sp { display: none; }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .preview img { width: 54px; height: 54px; }
  .tbl-wrap table { min-width: 640px; }
  .tbl-wrap td, .tbl-wrap th { padding: 9px 10px; font-size: 12.2px; }
  .toast { bottom: calc(74px + env(safe-area-inset-bottom)); font-size: 13px; padding: 10px 16px; }
}

/* ==========================================================================
   小屏手机
   ========================================================================== */
@media (max-width: 560px) {
  .hero .mini .m:nth-child(3) { display: none; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .print-none { display: none; }
  .tag { padding: 2px 8px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
      transition-duration: .001ms !important; }
}

/* 键盘操作与小屏阅读 */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.modal { max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain; }
.task .t-name, td { overflow-wrap: anywhere; }
@media (max-width: 780px) {
  input, select, textarea { font-size: 16px; }
  .btn, .tabbar button { min-height: 44px; }
  .row > * { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

[hidden] { display: none !important; }
.workflow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0 0 18px; }
.workflow > div { padding: 16px; background: #fff; border: 1px solid var(--line2); border-radius: 14px; }
.workflow span { display: inline-flex; color: var(--blue); background: var(--blue-s); padding: 2px 8px; border-radius: 6px; font-weight: 650; margin-bottom: 10px; }
.workflow b, .workflow small { display: block; }
.workflow small { color: var(--ink2); font-size: 12px; margin-top: 4px; }
@media (max-width: 780px) { .workflow { grid-template-columns: repeat(2, 1fr); gap: 9px; } .workflow > div { padding: 12px; } }

.purchase-notice { background: var(--blue-s); border: 1px solid #dce5ff; border-radius: 12px; padding: 16px; margin-bottom: 18px; }
.purchase-notice p { color: var(--ink2); margin: 6px 0 12px; }
.access-link-row { padding: 14px 0; border-bottom: 1px solid var(--line2); }
.access-link-row:last-child { border-bottom: 0; }
.access-link-row p { margin: 6px 0; }
