:root {
  --bg: #060a14;
  --panel: rgba(255, 255, 255, 0.048);
  --panel-strong: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9eefb;
  --text-soft: #b7c2d8;
  --muted: #7f8ba3;
  --primary: #5b8cff;
  --primary-2: #8a5cff;
  --cyan: #37d5e9;
  --green: #34d399;
  --danger: #ff6b81;
  --warn: #fbbf24;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button {
  font-family: inherit;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
}

.bg-orb-a {
  width: 520px;
  height: 520px;
  top: -220px;
  left: -140px;
  background: rgba(91, 140, 255, 0.32);
}

.bg-orb-b {
  width: 560px;
  height: 560px;
  right: -200px;
  top: 180px;
  background: rgba(138, 92, 255, 0.2);
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 15%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 15%, transparent 75%);
}

.app {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0 48px;
}

/* 顶部栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 2px 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.95), rgba(138, 92, 255, 0.9));
  color: #fff;
  box-shadow: 0 12px 26px rgba(91, 140, 255, 0.35);
}

.logo svg {
  width: 24px;
  height: 24px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-desc {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.today {
  font-size: 13px;
  color: var(--muted);
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #dfe8ff;
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.28), rgba(138, 92, 255, 0.28));
  border: 1px solid rgba(140, 165, 255, 0.3);
}

/* 概览区 */
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 10px 4px 34px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(100deg, #ffffff 25%, #a9c2ff 70%, #b7a3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  margin: 0;
  max-width: 560px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-soft);
}

.hero-sub strong {
  color: var(--danger);
  font-weight: 700;
}

.mini-stats {
  display: flex;
  gap: 10px;
}

.mini-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 106px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(8px);
}

.mini-label {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.mini-value {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.mini-value em {
  font-style: normal;
  color: var(--cyan);
}

/* 布局 */
.grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr 1.15fr;
  gap: 20px;
  align-items: start;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.022));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.card-title {
  margin: 0 0 6px;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.card-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.badge {
  flex-shrink: 0;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-idle {
  color: var(--warn);
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.25);
}

.badge-done {
  color: var(--green);
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.28);
}

.badge-blue {
  color: #9fc0ff;
  background: rgba(91, 140, 255, 0.12);
  border-color: rgba(91, 140, 255, 0.26);
}

.badge-warn {
  color: var(--danger);
  background: rgba(255, 107, 129, 0.1);
  border-color: rgba(255, 107, 129, 0.24);
}

/* 签到卡片 */
.sign-card::before {
  content: "";
  position: absolute;
  top: -80px;
  left: -40px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 140, 255, 0.22), transparent 70%);
  pointer-events: none;
}

.streak-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(8, 13, 26, 0.4);
  margin-bottom: 20px;
}

.streak-num {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #7ea8ff, #b79bff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.streak-num small {
  font-size: 14px;
  font-weight: 600;
  -webkit-text-fill-color: var(--muted);
  color: var(--muted);
}

.streak-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
}

.streak-tip {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.week-dots {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.day-label {
  font-size: 10.5px;
  color: var(--muted);
}

.day-dot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  transition: all 0.2s ease;
}

.day-dot.on {
  color: #c9d8ff;
  border-color: rgba(91, 140, 255, 0.4);
  background: rgba(91, 140, 255, 0.16);
}

.day-dot.today {
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.18);
}

.day-dot.today.on {
  color: #eafff6;
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(52, 211, 153, 0.2);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

.btn-primary {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(135deg, #5b8cff, #8a5cff);
  box-shadow: 0 14px 30px rgba(91, 140, 255, 0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 18px 34px rgba(91, 140, 255, 0.4);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

.btn-primary:disabled {
  cursor: default;
  color: #d3f7e8;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.55), rgba(55, 213, 233, 0.4));
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.35);
}

.btn-primary.just-signed {
  animation: pop 0.45s ease;
}

@keyframes pop {
  0% { transform: scale(0.97); }
  55% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.sign-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  font-size: 11.5px;
  color: var(--muted);
}

.dot-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-dot.on {
  background: var(--primary);
}

.legend-dot.off {
  background: rgba(255, 255, 255, 0.18);
}

.sign-total {
  margin-left: auto;
}

.sign-total b {
  color: var(--text-soft);
}

/* 积分卡片 */
.points-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.13), rgba(138, 92, 255, 0.07));
}

.points-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.points-label {
  font-size: 11.5px;
  color: var(--muted);
}

.points-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.points-month {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.points-earned {
  font-size: 17px;
  font-weight: 700;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.points-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.chip {
  padding: 6px 13px;
  font-size: 12px;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}

.chip:hover {
  border-color: var(--border-strong);
}

.chip.is-active {
  color: #fff;
  border-color: rgba(91, 140, 255, 0.5);
  background: rgba(91, 140, 255, 0.18);
}

.points-list {
  list-style: none;
  margin: 0;
  padding: 0 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 268px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.points-list::-webkit-scrollbar {
  width: 5px;
}

.points-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.point-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 8px;
  border-radius: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.18s ease;
}

.point-item:hover {
  background: rgba(255, 255, 255, 0.035);
}

.point-item:last-child {
  border-bottom: none;
}

.point-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.point-icon.in {
  color: var(--green);
  background: rgba(52, 211, 153, 0.12);
}

.point-icon.out {
  color: var(--warn);
  background: rgba(251, 191, 36, 0.12);
}

.point-info {
  min-width: 0;
  flex: 1;
}

.point-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.point-meta {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

.point-amount {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.point-amount.in {
  color: var(--green);
}

.point-amount.out {
  color: var(--text-soft);
}

.empty-hint {
  padding: 24px 8px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

/* 代金券卡片 */
.coupon-alert {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  margin-bottom: 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #ffc2cb;
  border: 1px solid rgba(255, 107, 129, 0.28);
  border-radius: 12px;
  background: rgba(255, 107, 129, 0.08);
}

.alert-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 12px;
  font-weight: 800;
  color: #250a0f;
  border-radius: 50%;
  background: var(--danger);
}

.coupon-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.coupon-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.028);
  overflow: hidden;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.coupon-item:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--border-strong);
}

.coupon-item.urgent {
  border-color: rgba(255, 107, 129, 0.4);
  background: linear-gradient(90deg, rgba(255, 107, 129, 0.14), rgba(255, 107, 129, 0.045));
  box-shadow: 0 0 0 1px rgba(255, 107, 129, 0.06) inset;
}

.coupon-item.expired {
  opacity: 0.52;
}

.coupon-value {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 58px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(8, 13, 26, 0.35);
}

.coupon-value .cur {
  font-size: 11px;
  color: var(--muted);
}

.coupon-value .num {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.coupon-item.urgent .coupon-value {
  border-color: rgba(255, 107, 129, 0.35);
}

.coupon-item.urgent .coupon-value .num {
  color: #ffb3bd;
}

.coupon-info {
  flex: 1;
  min-width: 0;
}

.coupon-name {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coupon-sub {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.coupon-progress {
  display: block;
  height: 3px;
  margin-top: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.coupon-progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #37d5e9);
}

.coupon-item.urgent .coupon-progress i {
  background: linear-gradient(90deg, #ff6b81, #ffb05c);
}

.coupon-days {
  flex-shrink: 0;
  align-self: flex-start;
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 8px;
  white-space: nowrap;
}

.coupon-days.normal {
  color: #9ff0d4;
  background: rgba(52, 211, 153, 0.12);
}

.coupon-days.urgent {
  color: #ffc2cb;
  background: rgba(255, 107, 129, 0.16);
  animation: breathe 1.8s ease-in-out infinite;
}

.coupon-days.expired {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  animation: none;
}

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.coupon-note {
  margin: 16px 0 0;
  font-size: 11px;
  color: rgba(127, 139, 163, 0.75);
  text-align: center;
}

/* 页脚 */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 28px 4px 0;
  font-size: 12px;
  color: var(--muted);
}

.reset-btn {
  padding: 7px 14px;
  font-size: 12px;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}

.reset-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 50;
  padding: 12px 22px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 999px;
  background: rgba(13, 32, 25, 0.92);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

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

/* 响应式 */
@media (max-width: 1080px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }

  .coupon-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app {
    width: calc(100% - 28px);
    padding-top: 18px;
  }

  .brand-desc,
  .today {
    display: none;
  }

  .hero {
    gap: 20px;
    padding-bottom: 24px;
  }

  .mini-stats {
    width: 100%;
  }

  .mini-stat {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .coupon-card {
    grid-column: auto;
  }

  .card {
    padding: 20px;
  }

  .footer {
    justify-content: center;
    text-align: center;
  }
}