/* ============================================================
   二次元发卡平台 · 樱花二次元主题
   ============================================================ */
:root {
  --pink:      #ff8ec7;
  --pink-deep: #f06bb0;
  --violet:    #8f7bff;
  --blue:      #7cc7ff;
  --text:      #4a3b5c;
  --text-mut:  #9a8fb0;
  --bg:        #fff5fa;
  --card:      #ffffff;
  --ok:        #34c98e;
  --warn:      #ffb020;
  --err:       #ff5d7e;
  --radius:    22px;
  --shadow:    0 12px 40px rgba(190, 120, 220, .16);
  --grad:      linear-gradient(135deg, #ff9ecb 0%, #a78bfa 55%, #7cc7ff 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(180deg, #fff0f8 0%, #f3efff 45%, #eef7ff 100%);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
}

/* ---------- 背景装饰光斑 ---------- */
.bg-blob {
  position: fixed; border-radius: 50%;
  filter: blur(60px); opacity: .35; z-index: -1; pointer-events: none;
}
.blob-1 { width: 420px; height: 420px; background: #ffc4e6; top: -120px; left: -100px; }
.blob-2 { width: 380px; height: 380px; background: #cabfff; bottom: -140px; right: -80px; }
.blob-3 { width: 260px; height: 260px; background: #bfe6ff; top: 40%; left: 62%; opacity: .25; }

/* ---------- 飘落花瓣 ---------- */
#petals { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.petal {
  position: absolute; top: -6%; user-select: none;
  animation: petal-fall linear infinite;
  opacity: .8;
}
@keyframes petal-fall {
  0%   { transform: translateY(-5vh) translateX(0) rotate(0deg); opacity: 0; }
  8%   { opacity: .85; }
  50%  { transform: translateY(55vh) translateX(4vw) rotate(180deg); }
  100% { transform: translateY(108vh) translateX(-3vw) rotate(360deg); opacity: .2; }
}

/* ---------- 顶部导航 ---------- */
.top-nav {
  position: sticky; top: 12px; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  max-width: 960px; margin: 12px auto 4px; padding: 10px 22px;
  background: rgba(255, 255, 255, .75);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 160, 210, .35);
  border-radius: 999px; box-shadow: 0 6px 24px rgba(190, 120, 220, .12);
}
.logo { font-weight: 800; font-size: 17px; color: var(--text); text-decoration: none; letter-spacing: .5px; }
.logo-star { color: var(--pink); animation: spin-slow 6s linear infinite; display: inline-block; }
@keyframes spin-slow { to { transform: rotate(360deg); } }
.nav-links a {
  margin-left: 10px; padding: 6px 14px; border-radius: 999px;
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600;
  transition: all .2s;
}
.nav-links a:hover { background: var(--grad); color: #fff; }

/* ---------- 主容器 ---------- */
.container { max-width: 960px; margin: 0 auto; padding: 20px 16px 40px; position: relative; z-index: 1; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 30px 10px 10px; }
.hero-title {
  font-size: 30px; font-weight: 900; letter-spacing: 1px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin-top: 8px; color: var(--text-mut); font-size: 14px; }
.hero-sub b { color: var(--pink-deep); }

/* ---------- 卡片面板 ---------- */
.card-panel {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid rgba(255, 160, 210, .30);
  box-shadow: var(--shadow);
  padding: 26px; margin: 18px auto;
}
.panel-title { font-size: 19px; font-weight: 800; margin-bottom: 14px; }
.panel-title::before { content: "✧ "; color: var(--pink); }

.notice-panel { border: 1px dashed var(--pink); }
.notice-title { font-weight: 800; color: var(--pink-deep); margin-bottom: 6px; }
.notice-body { color: var(--text); white-space: pre-wrap; }

/* ---------- 商品网格 ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px; margin-top: 20px;
}
.product-card {
  position: relative; background: var(--card);
  border-radius: var(--radius); padding: 24px 22px 20px;
  border: 1px solid rgba(255, 160, 210, .30);
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
  display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-5px) rotate(-.4deg); box-shadow: 0 18px 50px rgba(190, 120, 220, .28); }
.p-deco { position: absolute; top: 12px; right: 16px; color: #e8d9ff; font-size: 13px; letter-spacing: 3px; }
.p-name { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.p-desc {
  color: var(--text-mut); font-size: 13.5px; flex: 1;
  margin-bottom: 14px; word-break: break-word;
  max-height: 120px; overflow: hidden;
}
.p-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.p-price { font-size: 13px; color: var(--text-mut); }
.p-price b { font-size: 26px; font-weight: 900; color: var(--pink-deep); }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700;
}
.badge-ok   { background: #e0f9ef; color: #1e9e6c; }
.badge-warn { background: #fff3d9; color: #c07c00; }
.badge-err  { background: #ffe3e9; color: #e0436a; }
.badge-info { background: #e3f0ff; color: #3a7bd5; }
.badge-mut  { background: #f0ecf7; color: #8d82a5; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; border: none; cursor: pointer; text-decoration: none;
  padding: 11px 22px; border-radius: 999px; font-size: 15px; font-weight: 700;
  color: var(--text); background: #f0ecf7; text-align: center;
  transition: all .2s; font-family: inherit;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(240, 120, 190, .35); }
.btn-primary:hover { box-shadow: 0 12px 26px rgba(240, 120, 190, .5); }
.btn-ghost { background: transparent; border: 1.5px dashed var(--pink); color: var(--pink-deep); }
.btn-block { display: block; width: 100%; margin-top: 8px; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-danger { background: #ffe3e9; color: #e0436a; }

/* ---------- 提示条 ---------- */
.flash {
  border-radius: 16px; padding: 13px 18px; margin: 14px 0 0;
  font-size: 14px; font-weight: 600; border: 1px solid;
}
.flash-ok   { background: #e6fbf2; color: #157a53; border-color: #b7efD9; }
.flash-err  { background: #ffe9ee; color: #d63a60; border-color: #ffc6d3; }
.flash-info { background: #e8f1ff; color: #2f66b0; border-color: #c4dcff; }

/* ---------- 购买页 ---------- */
.buy-product { background: #fdf3fa; border-radius: 16px; padding: 16px 18px; margin-bottom: 16px; }
.buy-name { font-size: 17px; font-weight: 800; }
.buy-desc { color: var(--text-mut); font-size: 13.5px; margin-top: 4px; }
.buy-form .form-row { margin-bottom: 16px; }
.label { display: block; font-weight: 700; margin-bottom: 8px; font-size: 14px; }
.select, .input, .textarea {
  width: 100%; padding: 11px 14px; border-radius: 14px;
  border: 1.5px solid #eed7f0; background: #fffdf;
  font-size: 14.5px; color: var(--text); font-family: inherit; outline: none;
}
.select:focus, .input:focus, .textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 142, 199, .18); }
.channel-radios { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-pill {
  padding: 9px 18px; border-radius: 999px; background: #faf6fe;
  border: 1.5px solid #eed7f0; cursor: pointer; font-weight: 600; font-size: 14px;
}
.radio-pill:has(input:checked) { background: var(--grad); color: #fff; border-color: transparent; }
.radio-pill input { display: none; }
.buy-tips {
  margin-top: 14px; padding: 12px 16px; border-radius: 14px;
  background: #fdf3fa; color: #a05590; font-size: 13px; line-height: 1.7;
}
.buy-tips b { color: var(--pink-deep); }

/* ---------- 订单页 ---------- */
.order-brief {
  display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center;
  padding: 10px 14px; margin-bottom: 16px;
  background: #faf6fe; border-radius: 14px; font-size: 13.5px; color: var(--text-mut);
}
.order-brief b { color: var(--text); font-size: 13.5px; }

.amount-card {
  text-align: center; padding: 22px 16px 18px; margin-bottom: 16px;
  background: var(--grad); border-radius: 20px; color: #fff;
  box-shadow: 0 12px 30px rgba(240, 120, 190, .35);
}
.amount-label { font-size: 14px; opacity: .95; letter-spacing: 2px; }
.amount-hero {
  font-size: 52px; font-weight: 900; letter-spacing: 1px;
  text-shadow: 0 4px 14px rgba(255, 255, 255, .45); margin: 4px 0;
}
.amount-note { font-size: 12.5px; opacity: .95; line-height: 1.6; }
.amount-note b { background: rgba(255,255,255,.25); padding: 0 6px; border-radius: 8px; }

.steps { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.step {
  flex: 1; min-width: 150px; text-align: center; font-size: 13px; font-weight: 700;
  padding: 12px 8px; background: #faf6fe; border-radius: 16px; color: var(--text-mut);
  border: 1px solid #f0e4f8;
}
.step-num {
  display: inline-flex; width: 22px; height: 22px; margin-right: 6px;
  align-items: center; justify-content: center;
  background: var(--grad); color: #fff; border-radius: 50%; font-size: 12.5px;
}

.channel-tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; }
.tab {
  padding: 8px 26px; border-radius: 999px; border: 1.5px solid #eed7f0;
  background: #faf6fe; cursor: pointer; font-weight: 700; font-size: 14px;
  color: var(--text-mut); font-family: inherit;
}
.tab.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(240,120,190,.3); }

.qr-section { text-align: center; }
.qr-wrap { display: inline-block; }
.qr-img {
  display: none; width: 240px; height: 240px; object-fit: contain;
  background: #fff; padding: 10px; border-radius: 20px;
  border: 2px dashed var(--pink);
  box-shadow: var(--shadow);
}
.qr-img.active { display: block; }
.qr-tip { max-width: 420px; margin: 12px auto 0; font-size: 12.5px; color: var(--text-mut); }

.upload-zone {
  border: 2px dashed #dcb9ee; border-radius: 18px; padding: 18px;
  margin: 18px 0 6px; text-align: center; background: #fdf9ff;
  transition: border-color .2s;
}
.upload-zone:hover { border-color: var(--pink); }
.upload-zone input[type="file"] { font-size: 14px; cursor: pointer; }
.upload-hint { margin-top: 8px; font-size: 12.5px; color: var(--text-mut); }

.countdown {
  font-weight: 800; color: #fff; background: var(--pink-deep);
  padding: 2px 12px; border-radius: 999px; font-size: 13px;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .7; } }

.reject-reason { color: var(--err); font-weight: 600; margin-bottom: 10px; }

/* ---------- 结果页 ---------- */
.result-panel { text-align: center; }
.result-head {
  font-size: 21px; font-weight: 900; margin-bottom: 12px;
  border-radius: 16px; padding: 16px 12px;
}
.result-head.ok   { background: #e6fbf2; color: #15804f; }
.result-head.info { background: #e8f1ff; color: #2f66b0; }
.result-head.err  { background: #ffe9ee; color: #d63a60; }
.keys-title { margin: 18px 0 10px; font-weight: 800; }
.key-box {
  display: flex; align-items: center; gap: 10px;
  background: #faf6fe; border: 2px dashed #d9c2f0; border-radius: 16px;
  padding: 14px 16px; margin-bottom: 10px;
}
.key-text {
  flex: 1; text-align: left; font-family: Consolas, Monaco, monospace;
  font-size: 15px; font-weight: 700; word-break: break-all; color: #6b4fa0;
}
.copy-btn {
  border: none; cursor: pointer; background: var(--grad); color: #fff;
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  white-space: nowrap; font-family: inherit;
}
.result-panel .buy-tips { text-align: left; }

.empty-state { text-align: center; padding: 30px 0; }
.empty-emoji { font-size: 52px; margin-bottom: 10px; }

/* ---------- 查询页 ---------- */
.query-form { display: flex; gap: 10px; flex-wrap: wrap; }
.query-form .input { flex: 1; min-width: 220px; }
.query-result { margin-top: 20px; }
.query-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 4px; border-bottom: 1px dashed #eee3f6; font-size: 14px;
}
.query-row span:first-child { color: var(--text-mut); }

/* ---------- 加载遮罩 ---------- */
.loading-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(74, 59, 92, .45); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.loading-overlay[hidden] { display: none; }
.loading-card {
  background: #fff; border-radius: 24px; padding: 30px 40px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.loading-card p { font-weight: 700; margin-top: 12px; }
.loading-sub { font-size: 12.5px !important; color: var(--text-mut); font-weight: 400 !important; }
.spinner {
  width: 46px; height: 46px; margin: 0 auto;
  border: 5px solid #f6e3f3; border-top-color: var(--pink);
  border-radius: 50%; animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 页脚 ---------- */
.footer {
  text-align: center; padding: 26px 10px 34px;
  color: var(--text-mut); font-size: 12.5px;
}

/* ============================================================
   后台管理样式
   ============================================================ */
.admin-body { background: #f6f1fb; }
.admin-shell { display: flex; min-height: 100vh; }
.a-side {
  width: 190px; flex-shrink: 0; background: var(--grad);
  padding: 22px 14px; position: sticky; top: 0; height: 100vh;
}
.a-logo { color: #fff; font-weight: 900; font-size: 17px; padding: 6px 10px 18px; display: block; }
.a-nav-item {
  display: block; padding: 11px 14px; margin-bottom: 6px; border-radius: 14px;
  color: rgba(255,255,255,.92); text-decoration: none; font-weight: 700; font-size: 14px;
  transition: all .2s;
}
.a-nav-item:hover { background: rgba(255,255,255,.18); }
.a-nav-item.active { background: rgba(255,255,255,.3); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.5); }
.a-nav-item.exit { position: absolute; bottom: 18px; width: 158px; background: rgba(255,255,255,.14); font-size: 13px; }
.a-main { flex: 1; padding: 26px 30px; min-width: 0; }
.a-title { font-size: 22px; font-weight: 900; margin-bottom: 18px; }
.a-title::after { content: ""; display: block; width: 46px; height: 4px; border-radius: 4px; background: var(--grad); margin-top: 6px; }

.a-panel {
  background: #fff; border-radius: 18px; padding: 22px;
  box-shadow: 0 8px 28px rgba(150, 110, 190, .10); margin-bottom: 18px;
}
.a-panel h3 { font-size: 16px; margin-bottom: 12px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.stat {
  background: #fff; border-radius: 18px; padding: 18px;
  box-shadow: 0 8px 28px rgba(150, 110, 190, .10);
}
.stat-num { font-size: 26px; font-weight: 900; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { font-size: 12.5px; color: var(--text-mut); margin-top: 2px; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; }
.table th, .table td { padding: 10px 10px; border-bottom: 1px solid #f3ecfa; text-align: left; word-break: break-all; }
.table th { color: var(--text-mut); font-size: 12.5px; white-space: nowrap; }
.table tr:hover td { background: #fdf8ff; }
.table-wrap { overflow-x: auto; border-radius: 14px; }

.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form .input, .inline-form .select { width: auto; padding: 7px 10px; font-size: 13px; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.login-card {
  width: min(92vw, 380px); background: #fff; border-radius: 26px;
  padding: 36px 32px; box-shadow: 0 16px 50px rgba(150, 110, 190, .22);
  border: 1px solid rgba(255,160,210,.3); text-align: center;
}
.login-emoji { font-size: 50px; }
.login-card h1 { font-size: 20px; margin: 8px 0 20px; }
.login-card .input { margin-bottom: 14px; text-align: center; }

.vision-box {
  background: #faf6fe; border-radius: 14px; padding: 14px;
  font-size: 12.5px; white-space: pre-wrap; word-break: break-all;
  max-height: 260px; overflow: auto;
}
.qr-preview { max-width: 180px; border-radius: 14px; border: 2px dashed var(--pink); }

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
  .hero-title { font-size: 24px; }
  .amount-hero { font-size: 40px; }
  .steps { flex-direction: column; }
  .top-nav { top: 6px; margin: 6px 10px; padding: 8px 16px; }
  .nav-links a { margin-left: 4px; padding: 5px 10px; font-size: 13px; }
  .card-panel { padding: 20px 16px; }
  .admin-shell { flex-direction: column; }
  .a-side { width: 100%; height: auto; position: static; display: flex; flex-wrap: wrap; align-items: center; padding: 12px; }
  .a-logo { padding: 4px 10px; }
  .a-nav-item { display: inline-block; margin: 3px; padding: 8px 12px; }
  .a-nav-item.exit { position: static; width: auto; }
  .a-main { padding: 18px 14px; }
}
