/* ===========================================================
   拼多多福袋互助平台 · 样式表 v2（视觉升级版）
   设计：暖调高级感、移动端优先、层次化阴影
   =========================================================== */

:root {
  /* 背景与卡片 */
  --bg-1: #fdfaf7;
  --bg-2: #f7f2ec;
  --card: #ffffff;

  /* 文字 */
  --ink: #1c1917;
  --ink-2: #6d6660;
  --ink-3: #a39b95;

  /* 描边 */
  --line: #f0eae4;
  --line-2: #e3dad1;

  /* 品牌色 */
  --brand: #ff6b35;
  --brand-2: #ff9048;
  --brand-deep: #e0521f;
  --brand-soft: #fff3ed;

  /* 状态色 */
  --ok: #12a06f;
  --ok-soft: #e7f7f0;
  --bad: #e5484d;
  --bad-soft: #fdeded;
  --warn: #d97a00;

  /* 圆角 */
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 10px;

  /* 阴影（三层，营造层次） */
  --sh-1: 0 1px 2px rgba(28, 25, 23, .04);
  --sh-2: 0 4px 16px rgba(28, 25, 23, .06);
  --sh-3: 0 16px 40px rgba(28, 25, 23, .10);
  --sh-brand: 0 6px 20px rgba(255, 107, 53, .26);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
               "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  background-color: var(--bg-1);
  background-image:
    radial-gradient(760px 340px at 50% -90px, rgba(255, 107, 53, .13), transparent 70%),
    linear-gradient(180deg, #fdfaf7 0%, #f8f3ed 100%);
  background-attachment: fixed;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------- 布局 ---------------- */
.page-shell {
  max-width: 580px;
  margin: 0 auto;
  padding: 22px 14px 44px;
}

/* ---------------- 头部 ---------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-mark {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 17px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: var(--sh-brand);
}

.site-header h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.2px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-mark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid rgba(18, 160, 111, .14);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.live-mark i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .3; transform: scale(.75); }
}

/* ---------------- 安全工具条 ---------------- */
.safety-tools {
  display: flex;
  gap: 9px;
  margin-bottom: 14px;
}

.safety-tools button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  border-radius: var(--radius-sm);
  padding: 9px 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--sh-1);
  transition: .18s;
}

.safety-tools button::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--line-2);
  transition: .18s;
}

.safety-tools button:hover {
  border-color: rgba(255, 107, 53, .35);
  color: var(--brand-deep);
  background: var(--brand-soft);
  transform: translateY(-1px);
  box-shadow: var(--sh-2);
}

.safety-tools button:hover::before { background: var(--brand); }

/* ---------------- 推广宫格 ---------------- */
.promo-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-bottom: 15px;
}

.promo-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 5px 11px;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--sh-1);
  transition: .2s;
  position: relative;
}

.promo-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-2);
  border-color: var(--line-2);
}

.promo-tile:active { transform: translateY(0) scale(.98); }

.promo-tile .promo-icon {
  width: 40px; height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

.promo-tile > span:not(.promo-icon) {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  letter-spacing: -.1px;
}

.promo-tile b {
  position: absolute;
  top: 8px; right: 9px;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 400;
  opacity: 0;
  transition: .2s;
}

.promo-tile:hover b { opacity: .8; }

.promo-wide {
  grid-column: span 4;
  flex-direction: row;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fff6f1, #ffefe5);
  border-color: rgba(255, 107, 53, .2);
}

.promo-wide .promo-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; }
.promo-wide > span:not(.promo-icon) { font-size: 13.5px; font-weight: 700; }
.promo-wide b { position: static; opacity: .6; font-size: 12px; margin-left: auto; }

/* 宫格图标底色 */
.promo-orange .promo-icon { background: linear-gradient(135deg, #fff0e6, #ffdcc6); }
.promo-purple .promo-icon { background: linear-gradient(135deg, #f3eeff, #e2d6ff); }
.promo-green  .promo-icon { background: linear-gradient(135deg, #e8f9f1, #cdf0e0); }
.promo-amber  .promo-icon { background: linear-gradient(135deg, #fff5e0, #ffe9bd); }
.promo-blue   .promo-icon { background: linear-gradient(135deg, #eaf3ff, #d3e5ff); }

/* ---------------- 主卡片 ---------------- */
.main-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--sh-2);
  padding: 20px 16px 20px;
}

.daily-total {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--line-2);
}

.daily-total > span { font-size: 13px; color: var(--ink-2); }

.daily-total strong {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.daily-total small { font-size: 13px; color: var(--ink-3); }

.refresh-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 13px 0 14px;
}

.refresh-line strong {
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.refresh-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand-2);
  animation: pulse 1.5s infinite;
}

.refresh-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.refresh-actions button {
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: .18s;
}

.refresh-actions button:hover {
  border-color: var(--brand-2);
  color: var(--brand-deep);
  background: var(--brand-soft);
}

/* 公告条 */
.notice-bar {
  background: var(--brand-soft);
  border: 1px solid rgba(255, 107, 53, .22);
  color: var(--brand-deep);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 13px;
  line-height: 1.55;
}

/* ---------------- 提交表单（搜索条样式） ---------------- */
.submit-form {
  display: flex;
  gap: 0;
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--line-2);
  border-radius: 14px;
  padding: 4px;
  transition: .2s;
}

.submit-form:focus-within {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(255, 107, 53, .10);
}

.submit-form input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 10px 12px;
  outline: none;
  letter-spacing: 1px;
  font-size: 15px;
}

.submit-form input::placeholder {
  color: var(--ink-3);
  letter-spacing: 0;
}

.btn-primary {
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-xs);
  padding: 11px 20px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--sh-brand);
  transition: .18s;
}

.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; filter: none; transform: none; }

/* ---------------- 快速跳转（次级 CTA） ---------------- */
.btn-smart {
  width: 100%;
  margin-top: 10px;
  border: 1px solid rgba(255, 107, 53, .26);
  background: linear-gradient(135deg, #fff8f4, #ffefe3);
  color: var(--brand-deep);
  border-radius: 14px;
  padding: 13px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--sh-1);
  transition: .2s;
}

.btn-smart:hover {
  transform: translateY(-1px);
  box-shadow: var(--sh-2);
  border-color: var(--brand-2);
}

.btn-smart:active { transform: translateY(0); }
.btn-smart:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-smart span { font-size: 16px; }

.smart-tip {
  margin: 8px 0 16px;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
}

/* ---------------- 列表 ---------------- */
.list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.list-heading h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 7px;
}

.list-heading h2::before {
  content: '';
  width: 3px; height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
}

.list-heading span { font-size: 12.5px; color: var(--ink-3); }
.list-heading b { color: var(--brand-deep); font-weight: 800; }

.codes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.loading-tip, .empty-tip {
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  padding: 26px 0;
}

.code-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
  background: #fff;
  box-shadow: var(--sh-1);
  transition: .18s;
}

.code-item:hover {
  border-color: var(--line-2);
  box-shadow: var(--sh-2);
  transform: translateY(-1px);
}

.code-item.is-used { opacity: .58; }
.code-item.is-used:hover { transform: none; box-shadow: var(--sh-1); }

.code-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.code-value {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 1.4px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.code-time { font-size: 11.5px; color: var(--ink-3); }

.code-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.code-status {
  font-size: 11px;
  border-radius: 999px;
  padding: 3px 9px;
  font-weight: 700;
  white-space: nowrap;
}

.s-free   { background: var(--ok-soft); color: var(--ok); }
.s-used   { background: #f4f1ee; color: var(--ink-3); }
.s-banned { background: var(--bad-soft); color: var(--bad); }

.btn-mini {
  border: 1px solid rgba(255, 107, 53, .32);
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: .18s;
}

.btn-mini:hover {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  border-color: transparent;
  color: #fff;
  box-shadow: var(--sh-brand);
}

.btn-mini:disabled { opacity: .5; cursor: not-allowed; }

.link-report {
  border: none;
  background: none;
  color: var(--ink-3);
  font-size: 11.5px;
  cursor: pointer;
  padding: 3px 2px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-report:hover { color: var(--bad); }

/* ---------------- 使用说明 ---------------- */
.help-card {
  margin-top: 15px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--sh-2);
  padding: 18px 16px 18px;
}

.help-card h2 {
  margin: 0 0 15px;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 7px;
}

.help-card h2::before {
  content: '';
  width: 3px; height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
}

.help-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.help-steps li { display: flex; gap: 11px; align-items: flex-start; }

.step-num {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

.help-steps .step-body { min-width: 0; }
.help-steps b { display: block; font-size: 13.5px; color: var(--ink); margin-bottom: 2px; }
.help-steps p { margin: 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal.show { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 20, 12, .48);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 82vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 22px;
  padding: 26px 20px 20px;
  box-shadow: 0 24px 60px rgba(60, 35, 15, .22);
  animation: pop .22s cubic-bezier(.2, .9, .3, 1.1);
}

@keyframes pop {
  from { transform: scale(.93) translateY(10px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 12px; right: 14px;
  width: 28px; height: 28px;
  border: none;
  border-radius: 50%;
  background: #f5f2ef;
  color: var(--ink-3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: .18s;
}

.modal-close:hover { background: var(--line-2); color: var(--ink); }

.modal-icon {
  width: 56px; height: 56px;
  margin: 0 auto 10px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  font-size: 27px;
  background: linear-gradient(135deg, #fff3ed, #ffe4d3);
}

.modal-panel h2 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
}

.modal-body {
  font-size: 13.5px;
  color: var(--ink-2);
  margin-bottom: 16px;
  line-height: 1.7;
}

.modal-body p { margin: 0 0 8px; }

.modal-actions { display: flex; gap: 9px; }

.modal-actions button, .modal-actions a {
  flex: 1;
  border: none;
  border-radius: var(--radius-xs);
  padding: 11px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  box-shadow: var(--sh-brand);
  transition: .18s;
}

.modal-actions button:hover, .modal-actions a:hover { filter: brightness(1.05); }
.modal-actions .btn-ghost { background: #f5f2ef; color: var(--ink-2); box-shadow: none; }

.records-note {
  font-size: 12px;
  color: var(--ink-3);
  margin: 0 0 14px;
  text-align: center;
  line-height: 1.6;
}

.record-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 13px;
  background: #f6f3f0;
  padding: 3px;
  border-radius: 999px;
}

.record-tab {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-2);
  transition: .18s;
}

.record-tab.active {
  background: #fff;
  color: var(--brand-deep);
  font-weight: 800;
  box-shadow: var(--sh-1);
}

.records-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
}

.record-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  font-size: 13px;
  background: #fff;
}

.record-item .r-code { font-weight: 800; letter-spacing: 1px; color: var(--ink); }
.record-item .r-time { font-size: 11.5px; color: var(--ink-3); }
.record-item .r-side { text-align: right; flex-shrink: 0; }

.badge {
  display: inline-block;
  font-size: 11px;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 700;
}

.badge-pending { background: #fff4e2; color: var(--warn); }
.badge-pass    { background: var(--ok-soft); color: var(--ok); }
.badge-reject  { background: var(--bad-soft); color: var(--bad); }

.appeal-form { display: flex; flex-direction: column; gap: 9px; }

.appeal-form textarea, .appeal-form input {
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-xs);
  padding: 11px 12px;
  outline: none;
  resize: vertical;
  min-height: 88px;
  font-size: 14px;
  background: #fff;
  transition: .18s;
}

.appeal-form input { min-height: 0; }

.appeal-form textarea:focus, .appeal-form input:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(255, 107, 53, .10);
}

.appeal-form button {
  border: none;
  border-radius: var(--radius-xs);
  padding: 12px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--sh-brand);
  transition: .18s;
}

.appeal-form button:hover { filter: brightness(1.05); }

.modal-note {
  margin-top: 11px;
  font-size: 12.5px;
  text-align: center;
  color: var(--ok);
  min-height: 18px;
}

.modal-note.err { color: var(--bad); }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translate(-50%, 20px);
  background: rgba(28, 25, 23, .94);
  color: #fff;
  font-size: 13.5px;
  padding: 11px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: .26s cubic-bezier(.2, .9, .3, 1.1);
  z-index: 999;
  max-width: 82vw;
  text-align: center;
  box-shadow: var(--sh-3);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 页脚 ---------------- */
.site-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.75;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 380px) {
  .promo-board { grid-template-columns: repeat(2, 1fr); }
  .promo-wide  { grid-column: span 2; }
  .submit-form { flex-direction: column; align-items: stretch; }
  .btn-primary { padding: 12px; }
  .daily-total strong { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
