/* ============================================================
   周三权益日面板 · v3.1 精致简洁风
   设计原则：单一主色 + 灰阶层次 + 克制的阴影 + 细腻微交互
   ============================================================ */

:root {
  /* 色板 */
  --bg: #f6f7f9;
  --bg-tint: #eef1f6;
  --card: #ffffff;
  --line: #e8eaf0;
  --line-strong: #d9dde5;
  --txt: #1b1e24;
  --dim: #868d99;
  --faint: #a8aeb8;
  --acc: #3056d3;
  --acc-deep: #2647b8;
  --acc-tint: #e9effc;
  --ok: #178a4c;
  --ok-tint: #e6f6ec;
  --bad: #d43847;
  --bad-tint: #fbebec;
  --warn: #c2760a;
  --warn-tint: #fdf3e2;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* 阴影（分层，克制） */
  --sh-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --sh: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .05);
  --sh-lg: 0 4px 12px rgba(16, 24, 40, .08), 0 12px 40px rgba(16, 24, 40, .14);

  --r-card: 14px;
  --r-ctl: 10px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0 }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth }
body {
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: linear-gradient(180deg, var(--bg-tint) 0%, var(--bg) 320px) fixed;
  color: var(--txt);
  max-width: 800px;
  margin: 0 auto;
  padding: 0 18px calc(28px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
h1 { font-size: 19px; font-weight: 700; letter-spacing: .2px }
h2 { font-size: 16px; font-weight: 650 }
a { color: var(--acc); text-decoration: none }
a:hover { text-decoration: underline }
::selection { background: rgba(48, 86, 211, .18) }
:focus-visible { outline: 2px solid rgba(48, 86, 211, .55); outline-offset: 2px; border-radius: 4px }

.mono { font-family: var(--mono); font-size: 12px }
.dim { color: var(--dim); font-size: 12.5px }
.sub { color: var(--dim); font-size: 13px }
.num { font-variant-numeric: tabular-nums }
.bad { color: var(--bad) } .ok { color: var(--ok) }

/* ---------------- 顶部导航 ---------------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 2px 12px 0;
  background: rgba(246, 247, 249, .82);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid rgba(23, 26, 31, .06);
  margin: 0 -18px; padding-left: 18px; padding-right: 18px;
}
.brand { display: flex; align-items: center; gap: 9px }
.brandmark {
  width: 27px; height: 27px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, #3f6ae5 0%, #6d5ae0 100%);
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 2px 6px rgba(63, 106, 229, .32);
}
.brand .nm { font-size: 15.5px; font-weight: 650; letter-spacing: .3px }
.top-r { display: flex; align-items: center; gap: 12px }
.uchip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 12px 4px 5px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-sm);
}
.uchip .av {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #5d7ce8, #8d7ae8);
  color: #fff; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase;
}
.uchip .un { font-size: 12.5px; font-weight: 550; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }

/* 分段式导航 */
.seg {
  display: inline-flex; gap: 3px; padding: 3px;
  background: #e9ebf0; border-radius: 12px;
}
.seg button {
  border: none; background: none; cursor: pointer;
  padding: 6px 16px; font-size: 13px; font-weight: 500; color: var(--dim);
  border-radius: 9px; transition: all .18s var(--ease);
  font-family: inherit; white-space: nowrap;
}
.seg button:hover { color: var(--txt) }
.seg button.on {
  background: #fff; color: var(--txt); font-weight: 600;
  box-shadow: var(--sh-sm);
}
.tabs { margin: 16px 0 4px }
main { min-height: 60vh }

/* ---------------- 页头（每页标题区） ---------------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 18px 2px 12px }
.ph .tt h2 { line-height: 1.3 }
.ph .tt .desc { color: var(--dim); font-size: 12.5px; margin-top: 2px }
.ph .act { display: flex; gap: 8px; align-items: center; flex: none }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--sh);
  padding: 16px; margin-bottom: 12px;
}
.card.flat { box-shadow: none }
.center { text-align: center }

/* 倒计时 hero */
.hero {
  position: relative; overflow: hidden;
  border-radius: 16px; border: 1px solid #e4e9f4;
  background: radial-gradient(150% 130% at 50% -30%, #e7edfb 0%, #ffffff 60%);
  padding: 24px 18px 20px; text-align: center; margin-bottom: 12px;
  box-shadow: var(--sh);
}
.hero::before {
  content: ''; position: absolute; right: -52px; top: -66px;
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(48, 86, 211, .09) 0%, rgba(48, 86, 211, 0) 68%);
  pointer-events: none;
}
.hero .lbl { color: var(--dim); font-size: 12px; letter-spacing: .35em; text-indent: .35em; font-weight: 500 }
.hero .when { font-size: 15px; font-weight: 600; margin-top: 4px }
.hero .cd {
  font-size: 42px; line-height: 1.15; font-weight: 700;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  letter-spacing: 1px; margin: 2px 0 4px;
  color: #23262d;
}
.hero .meta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 8px; flex-wrap: wrap;
}

/* 统计块 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--sh); padding: 15px 14px 13px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.stat:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(16,24,40,.05), 0 6px 18px rgba(16,24,40,.07) }
.stat .n { font-size: 25px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2 }
.stat .t { color: var(--dim); font-size: 12px; display: flex; align-items: center; gap: 6px; margin-top: 3px }

/* 行工具类 */
.row { display: flex; align-items: center; flex-wrap: wrap }
.spread { justify-content: space-between }
.g6 { gap: 6px } .g8 { gap: 8px } .g10 { gap: 10px }

/* ---------------- 表格 ---------------- */
.tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-card) }
.card > .tblwrap { margin: -16px }
table { border-collapse: collapse; width: 100% }
th, td { text-align: left; padding: 10px 12px; font-size: 13px; vertical-align: top }
th {
  color: var(--dim); font-weight: 600; font-size: 11.5px; letter-spacing: .05em;
  background: #fafbfc; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0;
}
td { border-bottom: 1px solid #f0f1f4; word-break: break-word }
tbody tr:last-child td { border-bottom: none }
tbody tr { transition: background .12s }
tbody tr:nth-child(even) { background: #fafbfd }
tbody tr:hover { background: #f1f4f9 }
td.num, th.num { text-align: right }
td .b { font-weight: 600 }

/* ---------------- 按钮 ---------------- */
button {
  font-family: inherit; font-size: 13px; font-weight: 500;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--txt);
  border-radius: var(--r-ctl); padding: 7px 15px; cursor: pointer;
  transition: all .16s var(--ease); line-height: 1.45;
}
button:hover { border-color: #c3c9d4; background: #fafbfc }
button:active { transform: translateY(1px) }
button:disabled { opacity: .5; cursor: default; transform: none }
button.primary {
  background: linear-gradient(180deg, #3d68e0 0%, #2f56cd 100%);
  border-color: #2f56cd; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(48, 86, 211, .4);
}
button.primary:hover { background: linear-gradient(180deg, #4471e6 0%, #3560da 100%) }
button.ghost { background: transparent; border-color: transparent; color: var(--dim) }
button.ghost:hover { background: #eef0f4; border-color: transparent; color: var(--txt) }
button.danger { color: var(--bad); border-color: #efcdd1; background: transparent }
button.danger:hover { background: var(--bad-tint); border-color: #e5b6bb }
button.sm { padding: 4px 11px; font-size: 12px; border-radius: 8px }
button.lg { padding: 10px 26px; font-size: 14px; border-radius: 11px }
button.block { width: 100% }
button.linklike {
  border: none; background: none; color: var(--acc); padding: 4px 6px; font-size: 12.5px;
}
button.linklike:hover { text-decoration: underline; background: none }

/* ---------------- 输入 ---------------- */
input, textarea, select {
  font-family: inherit; font-size: 13px; color: var(--txt);
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  padding: 8px 12px; background: #fff; transition: border-color .16s, box-shadow .16s;
}
input::placeholder, textarea::placeholder { color: var(--faint) }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(48, 86, 211, .13);
}
textarea { font-family: var(--mono); font-size: 12px; resize: vertical }
.fld { display: block; font-size: 12.5px; color: var(--dim); font-weight: 550; margin: 14px 0 7px }
.fld:first-child { margin-top: 0 }
details summary { cursor: pointer; font-size: 12.5px; color: var(--dim); user-select: none }
details summary:hover { color: var(--txt) }

/* ---------------- 徽章 / 状态点 ---------------- */
.bdg {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 550; line-height: 1.5;
  padding: 1px 8px; border-radius: 999px;
  background: #eef0f4; color: var(--dim); vertical-align: 1px; white-space: nowrap;
}
.bdg.ok { background: var(--ok-tint); color: var(--ok) }
.bdg.bad { background: var(--bad-tint); color: var(--bad) }
.bdg.warn { background: var(--warn-tint); color: var(--warn) }
.bdg.acc { background: var(--acc-tint); color: var(--acc) }
.bdg.honey { background: #f7efdc; color: #9a6b00 }   /* v3.4.5 羊毛余额徽章（蜂蜜金） */

.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #c4cad4; flex: none; position: relative;
}
.dot.ok { background: #29a865 }
.dot.bad { background: #e05563 }
.dot.ok::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; background: rgba(41, 168, 101, .18) }
.dot.bad::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; background: rgba(224, 85, 99, .16) }
.pulse { animation: pulse 2.4s var(--ease) infinite }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .45 } }

/* ---------------- 账号卡 ---------------- */
.acct { position: relative; padding-left: 20px }
.acct::before {
  content: ''; position: absolute; left: 0; top: 15px; bottom: 15px; width: 3px;
  border-radius: 3px; background: var(--line-strong); transition: background .2s;
}
.acct.st-active::before { background: #2fa567 }
.acct.st-expired::before { background: #da4a58 }
.acct.st-off::before { background: #c4cad4 }
.acct.st-banned::before { background: repeating-linear-gradient(45deg, #d9a441 0 4px, #f0d9a8 4px 8px) }
.acct .hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap }
.acct .ph-n { font-size: 15.5px; font-weight: 650; letter-spacing: .02em }
.acct .meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 9px }
.acct .meta .k { color: var(--faint); font-size: 12px }
.acct .meta .v { font-size: 12.5px; color: #4a4f58; font-weight: 500 }
.acct .ops { display: flex; gap: 6px; flex-wrap: wrap; flex: none }

/* ---------------- 骨架屏 ---------------- */
.sk {
  border-radius: 8px;
  background: linear-gradient(100deg, #ebedf1 40%, #f6f7f9 50%, #ebedf1 60%);
  background-size: 200% 100%;
  animation: skl 1.1s linear infinite;
}
.sk.blk { height: 118px; border-radius: var(--r-card) }
.sk.line { height: 13px; margin: 8px 0 }
@keyframes skl { to { background-position: -200% 0 } }

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; padding: 42px 18px; color: var(--dim) }
.empty .ic {
  width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 13px;
  background: #eef0f4; color: #b6bcc6; display: flex; align-items: center; justify-content: center;
}
.empty .ic svg { width: 22px; height: 22px }
.empty p { font-size: 13px; }

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15, 17, 21, .45);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 14px; opacity: 0; animation: fadeIn .16s var(--ease) forwards;
}
.modal.hidden { display: none }
@keyframes fadeIn { to { opacity: 1 } }
.modal-card {
  background: #fff; border-radius: 16px; box-shadow: var(--sh-lg);
  /* v3.4 出框修复：原来 min(560px, 94vw) + .modal 左右 padding 会超出屏幕宽度
     （手机 390px：94vw=366px + 36px padding = 402px > 390px，弹窗两侧出框） */
  width: min(560px, 100%); max-height: 84vh;
  display: flex; flex-direction: column;
  animation: pop .2s var(--ease);
}
@keyframes pop { from { transform: scale(.955) translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
  font-weight: 650; font-size: 14.5px;
}
.modal-x {
  border: none; background: none; cursor: pointer; color: var(--dim);
  width: 28px; height: 28px; border-radius: 8px; font-size: 14px; line-height: 1;
}
.modal-x:hover { background: #eef0f4; color: var(--txt) }
.modal-body { padding: 14px 18px 18px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch }

/* 奖品行 */
.prize {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px;
  margin-top: 7px; cursor: pointer; transition: all .15s var(--ease);
  background: #fff;
}
.prize:hover { border-color: #c3c9d4 }
.prize.on { border-color: rgba(48, 86, 211, .55); background: #f4f7fe }
.prize .ord {
  width: 21px; height: 21px; border-radius: 50%; flex: none;
  background: #eef0f4; color: transparent; font-size: 11px; font-weight: 650;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s var(--ease);
}
.prize.on .ord { background: var(--acc); color: #fff; box-shadow: 0 1px 3px rgba(48, 86, 211, .4) }
.prize .nm { flex: 1; font-size: 13px; min-width: 0; overflow-wrap: anywhere }
.prize .rm { color: var(--dim); font-size: 12px; white-space: nowrap }
.grp-lbl { color: var(--dim); font-size: 12px; font-weight: 600; margin: 14px 2px 2px }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: #1f232a; color: #fff; font-size: 13px; line-height: 1.5;
  padding: 10px 17px; border-radius: 11px; z-index: 60;
  max-width: 86vw; text-align: center; box-shadow: var(--sh-lg);
  animation: toastIn .22s var(--ease), toastOut .3s var(--ease) 2.9s forwards;
}
.toast::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #4ade80; margin-right: 8px; vertical-align: 2px;
}
.toast.err { background: #b32838 }
.toast.err::before { background: #fecaca }
@keyframes toastIn { from { transform: translate(-50%, 12px); opacity: 0 } }
@keyframes toastOut { to { transform: translate(-50%, 6px); opacity: 0 } }

/* ---------------- 登录页 ---------------- */
.authwrap { min-height: 86vh; display: flex; align-items: center; justify-content: center; padding: 20px 0 }
.authcard { width: 100%; max-width: 380px; padding: 30px 28px 24px; text-align: left }
.authcard .brandmark { width: 46px; height: 46px; border-radius: 13px; font-size: 20px; margin: 0 auto 14px }
.authcard h1 { text-align: center }
.authcard .sub { text-align: center; margin: 5px 0 6px }
.authcard .lnk { text-align: center; margin-top: 14px; font-size: 12.5px; color: var(--dim) }

/* ---------------- 页脚 ---------------- */
.foot {
  text-align: center; color: var(--faint); font-size: 12px;
  padding: 26px 0 4px;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 560px) {
  body { padding-left: 14px; padding-right: 14px }
  .top { margin: 0 -14px; padding-left: 14px; padding-right: 14px }
  .top-r { gap: 10px }
  .hero .cd { font-size: 36px }
  th, td { padding: 9px 10px }
  .stat { padding: 14px 13px }
  .seg button { padding: 6px 12px }
  .uchip .un { display: none }
  .uchip { padding-right: 9px }
  .modal { padding: 10px }
  .modal-body { padding: 12px 14px 16px }
  .prize { padding: 8px 9px }
}

/* 动效敏感用户 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important }
}

/* v3.3 萌小羊任务开关胶囊 */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; cursor: pointer; font-size: 12.5px;
  transition: all .15s var(--ease); user-select: none;
}
.chip:hover { border-color: #c3c9d4 }
.chip:has(input:checked) { border-color: rgba(48, 86, 211, .55); background: #f4f7fe }
.chip input { accent-color: var(--pri, #3056d3); margin: 0 }
