:root {
  --page-bg: #071538;
  --panel-bg: #0d1c48;
  --panel-soft: #15275a;
  --panel-deep: #0a1637;
  --text-main: #f4f6ff;
  --text-soft: rgba(231, 235, 255, 0.72);
  --text-dim: rgba(225, 230, 255, 0.5);
  --line-soft: rgba(143, 170, 255, 0.18);
  --accent: #a35dff;
  --accent-2: #6d85ff;
  --gold: #f6d26f;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(100, 88, 255, 0.25), transparent 28%),
    linear-gradient(180deg, #06122f 0%, #081a42 100%);
  color: var(--text-main);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.2;
}

button,
input { font: inherit; }

button {
  border: 0;
  background: none;
  cursor: pointer;
}

.app-shell {
  max-width: 390px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px 14px 168px;
}

.topbar {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.brand-mark {
  display: flex;
  align-items: baseline;
  gap: 0;
  font-weight: 800;
  letter-spacing: -2px;
  color: #b9c7ff;
}

.brand-mark__c,
.brand-mark__5,
.brand-mark__2 {
  font-size: 26px;
  line-height: 1;
  background: linear-gradient(180deg, #7fd5ff 0%, #8d6dff 50%, #b35dff 100%);
  -webkit-background-clip: text;
  color: transparent;
}

.topbar__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.topbar__subtitle {
  display: none;
}

.ghost-btn,
.primary-btn,
.secondary-btn {
  border-radius: 999px;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(90deg, #7c5cff 0%, #bf65ff 100%);
  box-shadow: 0 10px 24px rgba(143, 83, 255, 0.28);
}

.ghost-btn,
.secondary-btn {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.page-body {
  padding-bottom: 22px;
}

.bottom-fixed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 31;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  pointer-events: none;
}

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.card {
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(19, 35, 82, 0.96), rgba(11, 22, 52, 0.96));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line-soft);
}

.card + .card,
.section + .section {
  margin-top: 14px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 138px;
  padding: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 18%, rgba(8, 19, 52, 0.85) 100%);
}

.hero-card__content {
  position: absolute;
  inset: auto 16px 14px 16px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: end;
}

.hero-card__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 4px;
}

.hero-card__dots {
  display: flex;
  gap: 8px;
}

.hero-card__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.42);
}

.hero-card__dot.is-active { background: #000; }

.search-row {
  display: grid;
  grid-template-columns: 1fr 68px;
  gap: 0;
  margin-bottom: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px;
  overflow: hidden;
  border-radius: 2px 0 0 2px;
  background: rgba(20, 34, 82, 0.9);
  border: 1px solid rgba(110, 131, 214, 0.18);
  border-right: 0;
}

.search-icon,
.sort-icon,
.coin-icon,
.tabbar__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.search-icon svg,
.sort-icon svg,
.coin-icon svg,
.tabbar__icon svg {
  width: 100%;
  height: 100%;
}

.search-box .input {
  display: block;
  flex: 1;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  line-height: 40px;
}

.input {
  width: 100%;
  box-sizing: border-box;
  color: var(--text-main);
}

.input::placeholder {
  color: rgba(235, 239, 255, 0.4);
}

.search-btn {
  position: relative;
  height: 40px;
  padding: 0;
  overflow: hidden;
  border-radius: 0 2px 2px 0;
  box-shadow: none;
}

.search-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, rgba(255,255,255,0.28) 0%, transparent 30%);
}

.search-btn::after {
  content: "";
  position: absolute;
  left: -12px;
  top: 0;
  bottom: 0;
  width: 24px;
  transform: skewX(-18deg);
  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.02));
}

.filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 2px 10px;
  gap: 12px;
}

.chip-dropdown {
  position: relative;
  min-width: 112px;
}

.chip {
  position: relative;
  display: inline-block;
  min-width: 88px;
  height: 28px;
  padding: 0 26px 0 14px;
  border-radius: 14px 2px 14px 14px;
  background: linear-gradient(90deg, #7f67ff 0%, #c560ff 100%);
  color: #fff;
  font-size: 13px;
  text-align: left;
  line-height: 28px;
}

.chip-toggle {
  width: 100%;
}

.chip::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  margin-top: -2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid rgba(255,255,255,0.9);
}

.chip.is-open::after {
  transform: rotate(180deg);
  margin-top: -4px;
}

.chip-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 132px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(110, 131, 214, 0.2);
  background: rgba(10, 20, 50, 0.96);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  display: none;
  z-index: 3;
}

.chip-panel.is-open {
  display: grid;
  gap: 8px;
}

.chip-option {
  width: 100%;
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  font-size: 13px;
  text-align: left;
}

.chip-option.is-active {
  background: linear-gradient(90deg, #7f67ff 0%, #c560ff 100%);
  color: #fff;
}

.sort-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  font-size: 14px;
  padding: 0;
}

.sort-icon {
  width: 18px;
  height: 18px;
  color: #a45cff;
}

.section__head {
  display: none;
}

.section__title {
  font-size: 22px;
  font-weight: 700;
}

.section__subtitle,
.muted {
  color: var(--text-soft);
  font-size: 12px;
}

.goods-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.list-status {
  padding: 14px 0 6px;
  text-align: center;
  color: var(--text-soft);
  font-size: 12px;
}

.goods-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  border-radius: 0;
  background: #13204d;
  border: 1px solid rgba(77, 104, 196, 0.16);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.goods-card.is-selected {
  border-color: rgba(196, 153, 75, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 220, 125, 0.36), 0 10px 24px rgba(0, 0, 0, 0.24);
  transform: translateY(-2px);
}

.goods-card__selected {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  min-width: 42px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  line-height: 22px;
  text-align: center;
  color: #fff5cf;
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(90deg, rgba(168, 124, 29, 0.96), rgba(239, 198, 92, 0.96));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.goods-card__media {
  display: block;
  padding: 10px 8px 0;
  background: radial-gradient(circle at top, rgba(255,255,255,0.24), rgba(12, 15, 38, 0.95) 58%);
}

.goods-card__image {
  display: block;
  width: 100%;
  height: 92px;
  object-fit: contain;
}

.goods-card__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 3px;
  background: rgba(8, 13, 34, 0.96);
}

.goods-card__price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
}

.coin-icon {
  width: 14px;
  height: 14px;
}

.goods-card__stock {
  color: rgba(255,255,255,0.78);
  font-size: 11px;
}

.goods-card__body {
  padding: 7px 8px 8px;
}

.goods-card__name {
  min-height: 36px;
  line-height: 1.4;
  font-size: 13px;
}

.list-item__meta {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 11px;
}

.goods-card__type {
  margin-top: 4px;
  color: #8ea4ff;
  font-size: 12px;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.highlight {
  color: var(--gold);
  font-weight: 700;
}

.summary {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px 16px;
  border-radius: 18px 18px 0 0;
}

.summary::before,
.summary::after {
  content: "";
  position: absolute;
  bottom: -1px;
  width: 34px;
  height: 14px;
  border-top: 2px solid #4c6ddf;
}

.summary::before {
  left: 0;
  border-right: 2px solid #4c6ddf;
  border-radius: 0 12px 0 0;
}

.summary::after {
  right: 0;
  border-left: 2px solid #4c6ddf;
  border-radius: 12px 0 0 0;
}

.summary__value {
  margin-top: 4px;
  font-size: 28px;
  font-weight: 700;
}

.summary__value.summary__value--gold {
  color: var(--gold);
}

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

.list-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(19,32,77,0.95), rgba(12,23,55,0.95));
  border: 1px solid var(--line-soft);
}

.list-item__image {
  width: 80px;
  height: 80px;
  object-fit: contain;
  padding: 8px;
  border-radius: 12px;
  background: radial-gradient(circle at top, rgba(255,255,255,0.18), rgba(16, 19, 45, 0.92) 62%);
}

.list-item__body {
  flex: 1;
  min-width: 0;
}

.list-item__title {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
}

.qty-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.qty-box button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.empty {
  padding: 48px 0;
  text-align: center;
  color: var(--text-dim);
}

.tabbar {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  width: 100%;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 0;
  padding: 12px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #0d1d4a, #0a1638);
  border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 1;
  pointer-events: auto;
}

.action-dock {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  width: 100%;
  padding: 0 14px;
  z-index: 2;
  pointer-events: none;
}

.action-dock__panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, rgba(12,24,59,0.98), rgba(10,20,48,0.98));
  border: 1px solid rgba(102, 138, 255, 0.34);
  border-bottom: 0;
  pointer-events: auto;
}

.action-dock__total {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.action-dock__badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(178, 202, 255, 0.16), rgba(157, 106, 255, 0.22));
  border: 1px solid rgba(255,255,255,0.12);
}

.action-dock__label {
  color: var(--text-soft);
  font-size: 12px;
}

.action-dock__value {
  margin-top: 2px;
  color: #cdbdff;
  font-size: 13px;
}

.action-dock__value strong {
  color: var(--gold);
  font-size: 24px;
  font-weight: 700;
}

.action-dock__submit {
  min-width: 90px;
  height: 34px;
  padding: 0 18px;
  border-radius: 12px 4px 12px 12px;
}

.action-dock__submit[disabled] {
  opacity: 0.48;
  cursor: not-allowed;
}

.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255,255,255,0.6);
  font-size: 11px;
}

.tabbar__item.is-active {
  color: #cfc6ff;
}

.tabbar__icon {
  width: 22px;
  height: 22px;
}

.footer-action {
  margin-top: 16px;
}

.footer-action .primary-btn {
  width: 100%;
  height: 42px;
  border-radius: 14px 4px 14px 14px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 50;
}

.modal.is-open { display: block; }

.modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
}

.modal__panel {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(19,35,82,0.98), rgba(11,22,52,0.98));
  border: 1px solid var(--line-soft);
}

.modal__title {
  font-size: 22px;
  font-weight: 700;
}

.modal__desc {
  margin: 8px 0 14px;
  color: var(--text-soft);
  font-size: 13px;
}

.modal .input,
.modal .search-box {
  margin-top: 12px;
}

.modal .input {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

.modal .primary-btn {
  width: 100%;
  height: 42px;
  margin-top: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 104px;
  z-index: 60;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.toast.is-show { opacity: 1; }

.order-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.order-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.recharge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.recharge-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  text-align: left;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.recharge-card.is-active {
  background: rgba(147, 93, 255, 0.18);
  border-color: rgba(191, 101, 255, 0.52);
  box-shadow: 0 10px 22px rgba(126, 91, 255, 0.2);
}

.recharge-card__title {
  font-size: 18px;
  font-weight: 700;
}

.recharge-card__bonus {
  margin-top: 6px;
  display: block;
}

.recharge-custom {
  margin-top: 12px;
}

.recharge-custom .input {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

.recharge-hint {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
}

.checkout-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}

.checkout-screen.is-open {
  display: block;
}

.checkout-screen__mask {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 18, 0.7);
}

.checkout-screen__panel {
  position: absolute;
  inset: 0;
  overflow: auto;
  background: linear-gradient(180deg, #071538 0%, #0a1a42 100%);
  padding: 18px 14px 110px;
}

.checkout-screen__header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.checkout-screen__title {
  font-size: 24px;
  font-weight: 700;
}

.checkout-screen__desc {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 13px;
}

.checkout-screen__close {
  min-width: 58px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
}

.checkout-screen__content {
  margin-top: 14px;
}

.checkout-card {
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(19,32,77,0.98), rgba(12,23,55,0.98));
  border: 1px solid rgba(102,138,255,0.18);
}

.checkout-card + .checkout-card {
  margin-top: 12px;
}

.checkout-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}

.checkout-item__image {
  width: 72px;
  height: 72px;
  object-fit: contain;
  padding: 6px;
  border-radius: 12px;
  background: radial-gradient(circle at top, rgba(255,255,255,0.18), rgba(16, 19, 45, 0.92) 62%);
}

.checkout-item__body {
  flex: 1;
  min-width: 0;
}

.checkout-item__name {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
}

.checkout-item__meta {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 12px;
}

.checkout-item__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.checkout-item__qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.checkout-item__qty button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.checkout-address__title,
.checkout-summary__title {
  font-size: 15px;
  font-weight: 700;
}

.checkout-address__value,
.checkout-summary__row {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 13px;
}

.checkout-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checkout-summary__row strong {
  color: var(--gold);
  font-size: 20px;
}

.checkout-submit {
  width: 100%;
  height: 44px;
  margin-top: 14px;
  border-radius: 14px 4px 14px 14px;
}
