:root {
  --ink: #140910;
  --rose: #c43d78;
  --rose-deep: #7c2448;
  --petal: #f3b7cf;
  --silk: rgba(255, 246, 248, 0.92);
  --gold: #f0d7a2;
  --gold-deep: #a68445;
  --line: rgba(240, 215, 162, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: #2a1520;
  font-family: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  background: #10080e;
}

h1, h2, button, .seal, .tabs, .brand p {
  font-family: "KaiTi", "STKaiti", "KaiTi_GB2312", "Songti SC", serif;
}

button, select, input { font: inherit; }

.ink {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(196, 61, 120, 0.45), transparent 42%),
    radial-gradient(ellipse at 80% 10%, rgba(90, 20, 60, 0.55), transparent 46%),
    radial-gradient(circle at 50% 120%, #3a1028, #10080e 55%);
}

.mist {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(196, 61, 120, 0.16) 40%, rgba(20, 8, 16, 0.2));
  filter: blur(2px);
}

.moon {
  position: absolute;
  right: 8%;
  top: 7%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 255, 255, 0.95), transparent 18%),
    radial-gradient(circle at 62% 58%, rgba(180, 90, 120, 0.28) 0 10%, transparent 12%),
    radial-gradient(circle at 50% 50%, #f7e4ea, #d7a0b6 62%, #a45c7c 100%);
  box-shadow: 0 0 80px rgba(243, 183, 207, 0.45);
  opacity: 0.85;
}

.threads {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 46%, rgba(180, 30, 60, 0.35) 46.2%, transparent 46.6% 58%, rgba(180, 30, 60, 0.22) 58.2%, transparent 58.5%),
    linear-gradient(68deg, transparent 0 30%, rgba(240, 215, 162, 0.12) 30.2%, transparent 30.5%);
}

.petals i {
  position: absolute;
  width: 14px;
  height: 18px;
  border-radius: 70% 10% 70% 10%;
  background: linear-gradient(135deg, #fff, var(--petal) 40%, var(--rose));
  opacity: 0.75;
  animation: drift 14s linear infinite;
}
.petals i:nth-child(1) { left: 8%; top: -10%; animation-duration: 16s; }
.petals i:nth-child(2) { left: 22%; top: -20%; animation-duration: 19s; animation-delay: -4s; }
.petals i:nth-child(3) { left: 40%; top: -8%; width: 10px; height: 14px; animation-duration: 13s; }
.petals i:nth-child(4) { left: 58%; top: -24%; animation-duration: 21s; animation-delay: -8s; }
.petals i:nth-child(5) { left: 72%; top: -12%; animation-duration: 17s; }
.petals i:nth-child(6) { left: 86%; top: -18%; width: 11px; animation-duration: 15s; animation-delay: -6s; }
.petals i:nth-child(7) { left: 94%; top: -6%; animation-duration: 18s; }

@keyframes drift {
  to { transform: translateY(110vh) rotate(220deg); }
}

.gate, .shell { position: relative; z-index: 1; }

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.panel {
  width: min(440px, 100%);
  padding: 36px 32px 28px;
  color: #3a1c28;
  background:
    linear-gradient(180deg, rgba(255, 250, 252, 0.96), rgba(255, 236, 242, 0.92));
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.brand { text-align: center; margin-bottom: 18px; }
.brand h1, .top h1 { margin: 0; letter-spacing: 0.42em; font-weight: 500; font-size: 34px; color: #6d1838; }
.top h1 { letter-spacing: 0.14em; font-size: 26px; }
.brand p, .top p { margin: 0; letter-spacing: 0.46em; color: var(--gold-deep); }

.seal {
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  color: var(--gold);
  letter-spacing: 0.12em;
  background:
    radial-gradient(circle at 50% 50%, transparent 58%, rgba(240, 215, 162, 0.7) 59% 62%, transparent 63%),
    radial-gradient(circle at 50% 45%, #9a2450, #4a1024);
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(90, 16, 40, 0.35);
}

label { display: block; margin: 12px 0; letter-spacing: 0.12em; color: #6a3144; }
input, select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  color: #2a1520;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(166, 132, 69, 0.45);
  outline: none;
}
textarea { min-height: 140px; font-family: Consolas, "Sarasa Mono SC", monospace; font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: var(--rose); }

.cap-row { display: flex; gap: 8px; align-items: center; }
.cap-row input { flex: 1; }
.cap-row img { width: 112px; height: 40px; margin-top: 6px; background: #fff; cursor: pointer; border: 1px solid var(--line); }

button {
  width: 100%;
  margin-top: 8px;
  padding: 11px 16px;
  letter-spacing: 0.22em;
  color: #fff8ef;
  cursor: pointer;
  border: 0;
  background: linear-gradient(180deg, #c44778, #7a2048);
  box-shadow: 0 8px 18px rgba(122, 32, 72, 0.28);
}
button:hover { filter: brightness(1.06); }
button.ghost {
  color: #7a2048;
  background: transparent;
  border: 1px solid rgba(122, 32, 72, 0.45);
  box-shadow: none;
}
button:disabled { opacity: 0.55; cursor: default; }

.err { min-height: 1.2em; color: #a11d3a; letter-spacing: 0.06em; }
.hint { color: #8a6070; font-size: 13px; letter-spacing: 0.08em; line-height: 1.7; }

.shell { min-height: 100vh; padding: 22px 28px 48px; }
.top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 8px 4px 16px;
}
.top .brand { display: flex; align-items: center; gap: 14px; text-align: left; margin: 0; }
.top .seal { width: 54px; height: 54px; margin: 0; flex: none; }
.top h1 { color: var(--gold); text-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.top p { color: var(--petal); }

.wallet { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.coin, .yuan {
  padding: 8px 14px;
  color: var(--gold);
  letter-spacing: 0.08em;
  background: rgba(20, 8, 16, 0.45);
  border: 1px solid var(--line);
}
.wallet select, .wallet button { width: auto; margin: 0; }
.wallet select { min-width: 180px; background: rgba(255, 248, 250, 0.92); }
.wallet button { padding: 8px 14px; letter-spacing: 0.12em; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.tabs button {
  width: auto;
  margin: 0;
  padding: 8px 14px;
  letter-spacing: 0.14em;
  color: var(--gold);
  background: rgba(20, 8, 16, 0.35);
  border: 1px solid transparent;
  box-shadow: none;
}
.tabs button.on {
  color: #4a1024;
  background: linear-gradient(180deg, #fff6ea, var(--gold));
  border-color: rgba(255, 255, 255, 0.4);
}

#pageErr { color: #ffd0dc; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

#view > .card { max-width: 420px; }

.card {
  position: relative;
  padding: 18px 16px 14px;
  background:
    linear-gradient(180deg, rgba(255, 250, 252, 0.96), rgba(255, 236, 243, 0.9));
  border: 1px solid rgba(240, 215, 162, 0.7);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--gold), var(--rose));
}
.card h3 { margin: 0 0 6px; letter-spacing: 0.12em; font-weight: 500; color: #6d1838; }
.price { color: var(--rose-deep); letter-spacing: 0.08em; }
.price b { font-size: 28px; font-weight: 500; }
.ratio {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  color: #7a2048;
  letter-spacing: 0.08em;
  font-size: 12px;
  border: 1px solid rgba(196, 61, 120, 0.4);
}
.desc { min-height: 2.6em; color: #7d5362; font-size: 13px; letter-spacing: 0.04em; line-height: 1.6; }
.items { margin: 8px 0 12px; padding: 0; list-style: none; }
.items li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(166, 132, 69, 0.35);
  font-size: 14px;
}
.items b { color: #6d1838; font-weight: 500; }
.card button { letter-spacing: 0.16em; }
.banner {
  margin: 0 0 16px;
  padding: 16px 18px;
  color: #4a2432;
  letter-spacing: 0.06em;
  line-height: 1.7;
  background: var(--silk);
  border: 1px solid var(--line);
}
.orders { margin-top: 18px; }
.orders table, table { width: 100%; border-collapse: collapse; background: var(--silk); }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid rgba(166, 132, 69, 0.25); font-size: 14px; }
th { color: #6d1838; letter-spacing: 0.12em; font-weight: 500; }
.tag { color: #8a6070; font-size: 12px; letter-spacing: 0.08em; }

@media (max-width: 800px) {
  .shell { padding: 14px 12px 32px; }
  .top { align-items: flex-start; flex-direction: column; }
  .moon { width: 110px; height: 110px; }
  .wallet { width: 100%; }
  .wallet select { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .petals i { animation: none; }
}
