/* ============================================================================
   社区积分 / 商店街 —— 共用样式
   ----------------------------------------------------------------------------
   2026-08-28：原先是「液态玻璃」版（漂移光斑 + backdrop-filter 磨砂卡片 +
   渐变描边）。全站推平到编辑式排版后，这一页跟着改成 hairline：分隔只用
   --rule，页头 / 数字 / 分区表头全部复用 style.css §54 的公共件。

   下面这组 --glass-* 变量保留了名字但换了值 —— 页面里有近千行标记引用它们，
   改名的收益不抵回归风险。现在它们的语义是「透明 + 一条 hairline」。

   注意：本项目**没有** --border-color / --bg-input / --accent-color 这几个变量，
   写 `var(--bg-input, #1b1b1f)` 这种带深色兜底的写法会在浅色模式下渲染成黑框。
   ========================================================================== */

/* ── 表面令牌（旧名保留，值已改成 hairline） ─────────────────────────────── */
.pts-page,
.pts-toasts {
  --glass:        transparent;
  --glass-soft:   transparent;
  --glass-deep:   color-mix(in srgb, var(--text-primary) 5%, transparent);
  --glass-edge:   var(--rule);
  --glass-line:   var(--rule);
  --glass-gleam:  transparent;
  --glass-shadow: none;
  --glass-shadow-hover: none;
  --gold: #d9971a;
}
[data-mode="dark"] .pts-page,
[data-mode="dark"] .pts-toasts { --gold: #f0b429; }

.pts-page { max-width: 1100px; margin: 0 auto; padding-bottom: var(--space-8); }

/* ── 活跃度模块 ─────────────────────────────────────────────────────────── */
.activity-module { margin: 0 0 var(--space-5); }
.activity-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-5); margin-bottom: var(--space-4);
}
.activity-head .pts-card-sub { margin-bottom: 0; }
.activity-today {
  flex-shrink: 0; min-width: 132px; text-align: right;
  display: flex; flex-direction: column; gap: 2px;
}
.activity-today > span,
.activity-today em { color: var(--text-tertiary); font-size: 11px; font-style: normal; }
.activity-today strong {
  color: var(--gold);
  font-family: var(--font-editorial); font-stretch: 114%; font-weight: 700;
  font-size: 30px; line-height: 1.05; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.activity-today small { font-size: 11px; font-weight: 650; }
.activity-rule-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.activity-rule {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center; gap: 10px; min-width: 0;
  padding: 11px 0; border-bottom: 1px solid var(--rule);
}
.activity-rule-icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px;
  color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent);
}
.activity-rule-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-secondary); font-size: 13px; font-weight: 600;
}
.activity-rule b { color: var(--gold); font-size: 14px; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .activity-head { align-items: center; }
  .activity-rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .activity-head { align-items: flex-start; }
  .activity-today { min-width: 94px; }
  .activity-rule-grid { grid-template-columns: 1fr; }
}

/* 环境光斑（.pts-ambient）已随「液态玻璃」一起删除：
   它存在的唯一理由是 backdrop-filter 后面得有东西可磨，改成 hairline
   之后就只剩噪声。模板里的标记也一并去掉了。 */

/* ── 页头 ───────────────────────────────────────────────────────────────
   本体走 §54 的 .page-head（模板里用 pg.page_head 宏），
   这里只管说明里那个「逛商店街 →」的链接色。 */
.page-subtitle a { color: var(--brand); text-decoration: none; white-space: nowrap; }
.page-subtitle a:hover { text-decoration: underline; }

/* ── 卡片基座：等同于 §54 的 .sheet ──────────────────────────────────────── */
.pts-card {
  position: relative;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--radius-l);
  padding: clamp(20px, 2.6vw, 32px);
}
.pts-card + .pts-card { margin-top: var(--space-4); }
/* 卡内标题：mono 大写小标签，展示级字号全留给页头 */
.pts-card-title {
  display: flex; align-items: center; gap: var(--space-2);
  margin: 0 0 var(--space-4);
  font-family: var(--font-data);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-tertiary);
}
.pts-card-title .bi { color: var(--text-tertiary); font-size: 12px; }
.pts-card-sub {
  font-size: 13px; line-height: 1.7; color: var(--text-secondary);
  margin-top: -6px; margin-bottom: var(--space-4);
}

/* ── 余额概览 ────────────────────────────────────────────────────────────── */
/* 三格数字条：竖 hairline 分隔，首尾贴齐栏宽——和 §54 的 .stat-band 同构 */
.pts-balances {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  margin-bottom: var(--space-6);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.pts-stat {
  position: relative;
  padding: clamp(20px, 2.6vw, 34px) clamp(12px, 2vw, 26px);
  border-left: 1px solid var(--rule);
  min-width: 0;
}
.pts-stat:first-child { border-left: 0; padding-left: 0; }
.pts-stat:last-child { padding-right: 0; }
.pts-stat-label {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-data);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--text-tertiary);
}
.pts-stat-label .bi { font-size: 11px; }
.pts-stat-value {
  display: block;
  margin-top: clamp(8px, 1.2vw, 14px);
  font-family: var(--font-editorial);
  font-weight: 700; font-stretch: 116%;
  font-size: clamp(26px, 3.6vw, 50px);
  line-height: 1; letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
/* 金币是这一页的主角，保留金色重音 */
.pts-stat.is-points .pts-stat-value { color: var(--gold); }
.pts-stat-hint {
  display: block; margin-top: var(--space-2);
  font-family: var(--font-data); font-size: 11px; line-height: 1.7;
  color: var(--text-tertiary);
}
/* 数字滚动结束时轻轻弹一下（JS 加 .is-bump 再移除） */
.pts-stat-value.is-bump { animation: ptsBump .45s var(--ease-spring); }
@keyframes ptsBump { 0% { transform: scale(1) } 35% { transform: scale(1.06) } 100% { transform: scale(1) } }

/* ── 分段控件：和 /blog 的 .tag-row 同一个读法 ──────────────────────────── */
.pts-segmented {
  position: relative;
  display: flex; gap: var(--space-2);
  padding: 0 0 clamp(18px, 2.6vw, 26px);
  max-width: 100%; overflow-x: auto;
  scrollbar-width: none;
}
.pts-segmented::-webkit-scrollbar { display: none; }
/* 玻璃滑块退场：选中态改成墨色实心 chip，JS 里的 .pts-seg-glider 隐藏即可 */
.pts-seg-glider { display: none; }
.pts-segmented button {
  position: relative; z-index: 1; flex-shrink: 0;
  height: 30px; padding: 0 var(--space-3);
  border: 1px solid var(--rule); background: transparent;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-family: var(--font-data);
  font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap; cursor: pointer;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.pts-segmented button:hover { color: var(--brand); border-color: var(--brand); }
.pts-segmented button.is-active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-body);
}
.pts-segmented button:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.pts-panel[hidden] { display: none; }
.pts-panel.is-in { animation: ptsPanelIn .45s var(--ease-out) both; }
@keyframes ptsPanelIn {
  from { opacity: 0; transform: translateY(14px) scale(.992); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* ── 兑换器 ─────────────────────────────────────────────────────────────── */
/* 桌面端左兑换右说明，窄屏自然堆叠。单独一张 520px 的卡片摆在 1100px 宽的页面
   左侧会显得很空，右边这栏顺便把「积分从哪来、闸门为什么存在」讲清楚。 */
.swap-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
@media (max-width: 900px) { .swap-layout { grid-template-columns: minmax(0, 1fr); } }

.howto { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.howto-item {
  display: flex; gap: var(--space-3); align-items: flex-start;
  border-radius: var(--radius-s); padding: 6px; margin: -6px;
  transition: background var(--dur-fast) var(--ease-out);
}
.howto-item:hover { background: color-mix(in srgb, var(--text-primary) 3.5%, transparent); }
.howto-icon {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px;
  background: transparent; border: 1px solid var(--rule); color: var(--text-secondary);
  transition: color var(--dur-base) ease, border-color var(--dur-base) ease;
}
.howto-item:hover .howto-icon { color: var(--brand); border-color: var(--brand); }
.howto-item.is-gold .howto-icon { background: rgba(240, 180, 41, .16); color: var(--gold); }
.howto-item.is-teal .howto-icon { background: var(--accent-soft); color: #1c9e91; }
[data-mode="dark"] .howto-item.is-teal .howto-icon { color: var(--accent); }
.howto-body { min-width: 0; }
.howto-body b { display: block; font-size: 13.5px; font-weight: 650; margin-bottom: 3px; }
.howto-body span { font-size: 12.5px; color: var(--text-secondary); line-height: 1.65; }
.howto-body a { color: var(--brand); text-decoration: none; }
.howto-body a:hover { text-decoration: underline; }

/* 轨道一律写 minmax(0, 1fr)：默认的 auto/1fr 轨道下限是内容的 min-content，
   窗口一窄轨道就不肯收缩，两口「井」会整块捅出卡片右边（901~1023px 必现）。 */
.swap { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.swap-side {
  position: relative;
  border: 1px solid var(--rule); border-radius: var(--radius-m);
  background: transparent;
  padding: var(--space-4);
  transition: border-color var(--dur-base) var(--ease-out);
}
/* 输入聚焦时整个「井」被点亮，而不是只有输入框 */
.swap-side:focus-within { border-color: var(--brand); }
.swap-side-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; color: var(--text-tertiary); margin-bottom: 10px;
}
.swap-side-head b { color: var(--text-secondary); font-weight: 600; }
.swap-input-row { display: flex; align-items: center; gap: var(--space-3); }
.swap-input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text-primary);
  font-family: var(--font-editorial); font-stretch: 112%;
  font-size: 30px; font-weight: 700; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; padding: 0; outline: none;
  -moz-appearance: textfield;
}
.swap-input::-webkit-outer-spin-button,
.swap-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.swap-input:disabled { color: var(--text-tertiary); }
/* 报价刷新时到账数字轻弹（JS 加 .is-pop） */
.swap-input.is-pop { animation: ptsBump .35s var(--ease-spring); }
.swap-unit { font-size: 14px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.swap-max {
  border: 1px solid var(--rule); background: transparent; color: var(--text-tertiary);
  font-family: var(--font-data);
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--radius-pill); cursor: pointer;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.swap-max:hover { border-color: var(--brand); color: var(--brand); }
.swap-max:active { transform: scale(.95); }

/* 方向切换：玻璃圆钮，JS 累加 rotate；两侧井随之上下换位 */
.swap-arrow { display: flex; justify-content: center; margin: -6px 0; position: relative; z-index: 1; }
.swap-arrow button {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--rule-strong);
  background: var(--bg-body);
  color: var(--text-secondary); font-size: 17px; cursor: pointer;
  display: grid; place-items: center;
  transition: transform .55s var(--ease-spring), border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.swap-arrow button:hover { border-color: var(--brand); color: var(--brand); }
.swap-arrow button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.swap.is-flipping .swap-side:first-child  { animation: ptsSlideDown .5s var(--ease-spring); }
.swap.is-flipping .swap-side:last-child   { animation: ptsSlideUp .5s var(--ease-spring); }
@keyframes ptsSlideDown {
  0% { transform: none } 45% { transform: translateY(26%) scale(.985); opacity: .55 } 100% { transform: none }
}
@keyframes ptsSlideUp {
  0% { transform: none } 45% { transform: translateY(-26%) scale(.985); opacity: .55 } 100% { transform: none }
}

.swap-summary {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: var(--space-4) 0 0;
  font-size: 13px; color: var(--text-secondary);
}
.swap-summary div { display: flex; justify-content: space-between; gap: var(--space-3); min-width: 0; }
.swap-summary b { color: var(--text-primary); font-weight: 650; font-variant-numeric: tabular-nums; }
.swap-summary .is-warn { color: var(--orange, #e8912d); }

/* 额度条：液态渐变 + 流动光带 */
.quota { margin-top: var(--space-4); }
.quota-bar {
  height: 6px; border-radius: 3px; overflow: hidden;
  background: color-mix(in srgb, var(--text-primary) 9%, transparent);
}
.quota-bar i {
  display: block; height: 100%; border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .35) 50%, transparent 100%) 0 0 / 200% 100%,
    linear-gradient(90deg, var(--brand), var(--accent));
  animation: ptsFlow 2.6s linear infinite;
  transition: width .6s var(--ease-out);
}
.quota-bar.is-full i { background:
  linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .3) 50%, transparent 100%) 0 0 / 200% 100%,
  linear-gradient(90deg, #e5484d, #ff7a45);
}
@keyframes ptsFlow { from { background-position: 200% 0, 0 0 } to { background-position: -200% 0, 0 0 } }
.quota-text { font-size: 12px; color: var(--text-tertiary); margin-top: 7px; display: flex; justify-content: space-between; }

/* ── 按钮 ───────────────────────────────────────────────────────────────── */
.pts-btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: var(--radius-btn);
  padding: 11px 20px; font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; line-height: 1.2;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background var(--dur-fast), opacity var(--dur-fast);
}
.pts-btn:active:not(:disabled) { transform: scale(.97); }
.pts-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.pts-btn:disabled { opacity: .45; cursor: not-allowed; }
/* 三档按钮和站内 §15 对齐：实心 / hairline / 危险，都没有渐变和投影 */
.pts-btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-contrast);
}
.pts-btn--primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}
.pts-btn--ghost { background: transparent; border-color: var(--rule-strong); color: var(--text-primary); }
.pts-btn--ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pts-btn--danger {
  background: var(--red, #e0453f);
  border-color: var(--red, #e0453f);
  color: #fff;
}
.pts-btn--danger:hover:not(:disabled) { opacity: .88; }
.pts-btn--sm { padding: 7px 14px; font-size: 12.5px; border-radius: var(--radius-pill); }
.pts-btn--block { width: 100%; }
.pts-btn .bi-arrow-repeat { animation: ptsSpin 1s linear infinite; }
@keyframes ptsSpin { to { transform: rotate(360deg) } }

/* 兑换成功的粒子迸发（JS 生成，动画完自删） */
.pts-burst { position: fixed; z-index: var(--z-toast); pointer-events: none; }
.pts-burst i {
  position: absolute; left: 0; top: 0; display: block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--clr, var(--brand));
  animation: ptsBurst .8s var(--ease-out) forwards;
}
@keyframes ptsBurst {
  0%   { transform: translate(0, 0) scale(1); opacity: 1 }
  100% { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0 }
}

/* ── 表单 ───────────────────────────────────────────────────────────────── */
.pts-field { display: block; }
.pts-field > span {
  display: block; margin-bottom: var(--space-2);
  font-family: var(--font-data);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-tertiary);
}
/* 和 §54 的 .field-input 一致：只有一条下边框 */
.pts-input, .pts-select, .pts-textarea {
  width: 100%; background: transparent; color: var(--text-primary);
  border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0;
  box-shadow: none;
  padding: 10px 2px; font-size: 15px; font-family: inherit; line-height: 1.5;
  transition: border-color var(--dur-base) ease;
}
.pts-input:focus, .pts-select:focus, .pts-textarea:focus {
  outline: none; box-shadow: none;
  border-bottom-color: var(--brand);
}
.pts-textarea { resize: vertical; min-height: 84px; }
.pts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: var(--space-4); }
.pts-actions { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; margin-top: var(--space-4); }

/* ── 红包 ───────────────────────────────────────────────────────────────── */
.pkt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(252px, 100%), 1fr)); gap: var(--space-4); }
.pkt {
  position: relative; overflow: hidden; border-radius: var(--radius-m);
  padding: var(--space-5) var(--space-5) var(--space-4);
  /* 顶部暖光 + 玻璃顶缘高光都用渐变叠加实现；早先用 ::before 画椭圆，在卡片
     顶边留下一道生硬的弧线，灰掉的「已抢完」卡片上尤其像脏点。 */
  background:
    linear-gradient(172deg, rgba(255, 255, 255, .22) 0%, transparent 30%),
    radial-gradient(88% 62% at 50% -18%, rgba(255, 216, 138, .42) 0%, transparent 62%),
    linear-gradient(158deg, #e0453f 0%, #c02a33 55%, #99161f 100%);
  color: #fff;
  display: flex; flex-direction: column; min-height: 178px;
  animation: ptsPanelIn .5s var(--ease-out) both;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base);
}
/* 入场小瀑布：前几张依次浮现 */
.pkt:nth-child(2) { animation-delay: .05s }
.pkt:nth-child(3) { animation-delay: .1s }
.pkt:nth-child(4) { animation-delay: .15s }
.pkt:nth-child(5) { animation-delay: .2s }
.pkt:nth-child(n+6) { animation-delay: .25s }
.pkt:hover { transform: translateY(-2px); }
.pkt.is-done {
  background:
    linear-gradient(172deg, rgba(255, 255, 255, .1) 0%, transparent 30%),
    radial-gradient(88% 62% at 50% -18%, rgba(255, 255, 255, .14) 0%, transparent 62%),
    linear-gradient(158deg, #6b6f7d 0%, #4a4e5a 60%, #383b45 100%);
}
.pkt-msg { font-size: 16px; font-weight: 700; line-height: 1.45; word-break: break-word; margin-bottom: 6px; }
.pkt-from { font-size: 12.5px; opacity: .82; }
.pkt-meta { margin-top: auto; padding-top: var(--space-4); font-size: 12px; opacity: .9; display: flex; gap: 10px; flex-wrap: wrap; }
.pkt-chip {
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-radius: var(--radius-pill); padding: 3px 9px;
}
.pkt-foot { margin-top: var(--space-3); display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.pkt-grab {
  border: 1px solid #ffcb69; border-radius: var(--radius-pill); cursor: pointer;
  background: #ffd98a; color: #7a3410;
  font-family: var(--font-data);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  padding: 8px 20px;
  transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-fast) ease;
}
.pkt-grab:hover:not(:disabled) { transform: scale(1.04); background: #ffe1a3; }
.pkt-grab:active:not(:disabled) { transform: scale(.96); }
.pkt-grab:disabled { background: rgba(255, 255, 255, .2); color: rgba(255, 255, 255, .75); cursor: default; box-shadow: none; }
.pkt-progress { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .22); overflow: hidden; margin-top: 10px; }
.pkt-progress i { display: block; height: 100%; background: rgba(255, 224, 160, .95); transition: width .5s var(--ease-out); }

/* ── 小店 ───────────────────────────────────────────────────────────────── */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(238px, 100%), 1fr)); gap: var(--space-4); }
/* 和 §54 的 .matrix-cell 同构：1px 网格缝由容器底色透出来 */
.shop-grid {
  gap: 1px; background: var(--rule);
  border: 1px solid var(--rule); border-radius: var(--radius-l);
  overflow: hidden;
}
.shop-tile {
  position: relative;
  text-align: left; width: 100%; cursor: pointer; font-family: inherit;
  background: var(--bg-body);
  border: 0; border-radius: 0; padding: clamp(18px, 2.2vw, 28px);
  color: inherit;
  transition: background var(--dur-base) ease;
}
.shop-tile:hover { background: color-mix(in srgb, var(--brand) 7%, var(--bg-body)); }
.shop-tile:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.shop-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: transparent; border: 1px solid var(--rule-strong);
  color: var(--text-secondary); font-weight: 600; font-size: 16px;
  display: grid; place-items: center; margin-bottom: var(--space-4);
  transition: color var(--dur-base) ease, border-color var(--dur-base) ease;
}
.shop-tile:hover .shop-avatar { color: var(--brand); border-color: var(--brand); }
.shop-name {
  font-family: var(--font-editorial); font-stretch: 108%; font-weight: 700;
  font-size: 19px; line-height: 1.2; letter-spacing: -0.022em;
  margin-bottom: 4px;
  transition: color var(--dur-base) ease;
}
.shop-tile:hover .shop-name { color: var(--brand); }
.shop-owner { font-family: var(--font-data); font-size: 11px; color: var(--text-tertiary); }
.shop-tile-foot {
  margin-top: var(--space-5); display: flex; gap: var(--space-4);
  font-family: var(--font-data); font-size: 10.5px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-tertiary);
}

.item-row {
  display: flex; gap: var(--space-4); align-items: flex-start;
  padding: var(--space-4) 0; border-bottom: 1px solid var(--rule);
}
.item-row:last-child { border-bottom: 0; padding-bottom: 0; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-size: 15px; font-weight: 650; }
.item-desc { font-size: 13.5px; color: var(--text-secondary); margin-top: 5px; line-height: 1.7; overflow-wrap: anywhere; }
.item-desc > :last-child { margin-bottom: 0; }
.item-desc :is(h1, h2, h3, h4) { font-size: 15px; margin: 8px 0 4px; }
.item-desc img { max-width: 100%; border-radius: var(--radius-xs); }
.item-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; flex-shrink: 0; }
.item-price {
  font-family: var(--font-display); font-size: 19px; font-weight: 800;
  color: var(--gold); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.item-price small { font-size: 11.5px; font-weight: 600; opacity: .75; margin-left: 2px; }

/* ── 通用小组件 ──────────────────────────────────────────────────────────── */
.pts-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-data);
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: transparent; border: 1px solid var(--rule);
  color: var(--text-tertiary);
}
.pts-tag.is-brand { color: var(--brand);  border-color: color-mix(in srgb, var(--brand) 42%, transparent); }
.pts-tag.is-warn  { color: #e8912d;       border-color: color-mix(in srgb, #e8912d 42%, transparent); }
.pts-tag.is-off   { color: var(--text-tertiary); border-color: var(--rule); }

.payload-box {
  margin-top: 10px; padding: 11px 13px; border-radius: var(--radius-xs);
  background: var(--accent-soft); border: 1px solid rgba(50, 214, 197, .3);
  font-family: var(--font-mono, ui-monospace, monospace); font-size: 13px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

/* WillSpace 脚本编辑器：等宽字体，编辑区与试运行结果同族 */
.pts-mono {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace) !important;
  font-size: 13px; line-height: 1.6; tab-size: 2;
}
#scriptHints { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
#scriptResult[hidden], #wsRef[hidden] { display: none; }
.ws-ref { margin-top: var(--space-3); }
.ws-ref h4 { margin: 0 0 var(--space-2); font-size: 13.5px; font-weight: 650; }
.ws-ref p { margin: var(--space-2) 0; font-size: 12.5px; }
.ws-ref code {
  font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px;
  padding: 1px 5px; border-radius: 4px; background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand);
}
.ws-ref pre {
  margin: var(--space-2) 0; padding: 11px 13px; border-radius: var(--radius-xs);
  background: transparent; border: 1px solid var(--rule);
  font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px;
  line-height: 1.6; overflow-x: auto; white-space: pre;
}

.pts-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pts-table th, .pts-table td { padding: var(--space-3) var(--space-4); text-align: left; border-bottom: 1px solid var(--rule); }
.pts-table th:first-child, .pts-table td:first-child { padding-left: 0; }
.pts-table th:last-child,  .pts-table td:last-child  { padding-right: 0; }
.pts-table tr:last-child td { border-bottom: 0; }
.pts-table th {
  font-family: var(--font-data);
  font-size: 10.5px; font-weight: 500; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: .18em; white-space: nowrap;
  border-bottom-color: var(--rule-strong);
}
.pts-table td.num { text-align: right; font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.pts-table tbody tr { transition: background var(--dur-fast); }
.pts-table tbody tr:hover { background: color-mix(in srgb, var(--text-primary) 3.5%, transparent); }
.amt-pos { color: #2ea36a; font-weight: 650; }
.amt-neg { color: #e5484d; font-weight: 650; }
[data-mode="dark"] .amt-pos { color: #3ecf8e; }

.rank-badge {
  display: inline-grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%;
  font-family: var(--font-data); font-size: 11px;
  font-variant-numeric: tabular-nums;
  background: transparent; border: 1px solid var(--rule);
  color: var(--text-tertiary);
}
/* 前三名是这张榜唯一需要一眼看出的信息，保留金银铜 */
.rank-badge.is-1 { background: #e8a51c; border-color: #e8a51c; color: #3d2800; }
.rank-badge.is-2 { background: #b3bac6; border-color: #b3bac6; color: #2c2f38; }
.rank-badge.is-3 { background: #c98a4f; border-color: #c98a4f; color: #3a2008; }

.pts-empty {
  padding: var(--space-7) 0;
  color: var(--text-secondary);
}
.pts-empty .bi {
  display: block; margin-bottom: var(--space-3);
  font-size: 30px;
  color: color-mix(in srgb, var(--text-primary) 22%, transparent);
}
.pts-empty p { margin: 0; font-size: 14px; line-height: 1.7; }

/* 骨架屏：灰阶底 + 流动高光 */
.pts-skeleton {
  border-radius: var(--radius-s);
  background:
    linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--text-primary) 8%, transparent) 50%, transparent 70%) 0 0 / 220% 100%,
    color-mix(in srgb, var(--text-primary) 5%, transparent);
  animation: ptsShimmer 1.4s linear infinite;
}
@keyframes ptsShimmer { from { background-position: 160% 0, 0 0 } to { background-position: -80% 0, 0 0 } }

/* 提示条 */
.pts-toasts {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: var(--z-toast); display: flex; flex-direction: column; gap: 10px;
  align-items: center; pointer-events: none; width: min(92vw, 460px);
}
.pts-toast {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 550; color: #fff;
  background: rgba(35, 39, 51, .78);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), var(--shadow-lift);
  animation: ptsToastIn .45s var(--ease-spring);
}
.pts-toast.is-ok { background: rgba(24, 112, 76, .82); }
.pts-toast.is-err { background: rgba(172, 46, 58, .84); }
@keyframes ptsToastIn { from { opacity: 0; transform: translateY(16px) scale(.95) } to { opacity: 1; transform: none } }

.pts-signin {
  display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent);
  border-radius: var(--radius-m); padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5); font-size: 14px;
}
.pts-signin .bi { color: var(--brand); font-size: 18px; }

@media (max-width: 620px) {
  .pts-card, .pts-stat { padding: var(--space-4); }
  .pts-stat-value { font-size: 27px; }
  .swap-input { font-size: 23px; }
  .item-row { flex-direction: column; gap: var(--space-3); }
  .item-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .quota-bar i, .pkt, .pts-skeleton, .pts-toast, .pts-panel.is-in,
  .swap.is-flipping .swap-side, .pts-burst i,
  .pts-stat-value.is-bump, .swap-input.is-pop, .pts-btn .bi-arrow-repeat {
    animation: none;
  }
  .pkt, .shop-tile, .swap-arrow button, .pts-btn { transition: none; }
}
