:root {
  --blue: #0a84ff;
  --blue-press: #0066d6;
  --indigo: #5e5ce6;
  --green: #248a3d;
  --green-bg: rgba(48, 209, 88, 0.16);
  --red: #d70015;
  --red-bg: rgba(255, 69, 58, 0.14);
  --orange: #c93400;
  --orange-bg: rgba(255, 159, 10, 0.16);
  --text: #1c1c1e;
  --text-2: #3a3a3c;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, 0.12);
  --fill: rgba(255, 255, 255, 0.66);
  --fill-strong: rgba(255, 255, 255, 0.82);
  --glass: rgba(255, 255, 255, 0.55);
  --radius: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --capsule: 999px;
  --shadow: 0 8px 30px rgba(28, 37, 72, 0.07), 0 1px 3px rgba(28, 37, 72, 0.04);
  --shadow-lg: 0 22px 60px rgba(28, 37, 72, 0.12);
  --blur: 24px;
  --nav-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

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

body {
  font-family: var(--font);
  color: var(--text);
  background: #e7eef7;
  min-height: 100vh;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(8px);
  pointer-events: none;
}

body::before {
  width: 520px;
  height: 520px;
  left: -140px;
  top: -160px;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.34), rgba(10, 132, 255, 0) 70%);
}

body::after {
  width: 460px;
  height: 460px;
  right: -120px;
  top: 120px;
  background: radial-gradient(circle, rgba(94, 92, 230, 0.26), rgba(94, 92, 230, 0) 70%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--blue);
  text-decoration: none;
}

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

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.site-nav {
  position: sticky;
  top: 12px;
  z-index: 40;
  margin: 12px auto 0;
  width: min(1120px, calc(100% - 40px));
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 16px;
  border-radius: var(--capsule);
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 16px;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--capsule);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 8px 20px rgba(28, 37, 72, 0.06);
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  background: linear-gradient(180deg, #3d9fff 0%, var(--blue) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(10, 132, 255, 0.28), 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #2f96ff 0%, var(--blue-press) 100%);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.42);
  box-shadow: none;
}

.btn-danger {
  background: linear-gradient(180deg, #ff6961, #ff453a);
  color: #fff;
}

.btn-sm {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.hero {
  padding: 56px 0 28px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 28px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: var(--capsule);
  background: rgba(10, 132, 255, 0.1);
  color: var(--blue);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

h1, h2, h3 {
  margin: 0;
  letter-spacing: -0.035em;
}

.hero h1 {
  margin-top: 14px;
  font-size: 42px;
  line-height: 1.16;
  font-weight: 750;
}

.lead {
  margin: 14px 0 0;
  color: var(--text-2);
  font-size: 16px;
  max-width: 46ch;
}

.hero-visual {
  border-radius: 32px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-lg);
}

.hero-visual img {
  width: 100%;
  height: auto;
}

.section {
  padding: 12px 0 40px;
}

.section-title {
  font-size: 22px;
  margin-bottom: 6px;
}

.section-desc {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  border-radius: var(--radius);
  padding: 22px;
  background: var(--fill);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

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

.order-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 18px;
  align-items: start;
}

.pkg-list {
  display: grid;
  gap: 10px;
}

.pkg-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1.5px solid rgba(60, 60, 67, 0.08);
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.pkg-card:hover {
  transform: translateY(-1px);
}

.pkg-card.is-active,
.pkg-card:has(input:checked) {
  border-color: rgba(10, 132, 255, 0.55);
  background: rgba(10, 132, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.08);
}

.pkg-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pkg-name {
  font-weight: 700;
  font-size: 15px;
}

.pkg-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.pkg-price {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.04em;
  color: var(--blue);
}

.pkg-price small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin: 0 0 7px 4px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: box-shadow .16s ease, border-color .16s ease;
}

.field textarea {
  min-height: 96px;
  padding: 12px 16px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(10, 132, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.12);
}

.hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.seg {
  display: flex;
  padding: 4px;
  background: rgba(118, 118, 128, 0.12);
  border-radius: var(--capsule);
  gap: 4px;
}

.seg-item {
  flex: 1;
  position: relative;
  display: block;
  cursor: pointer;
}

.seg-item span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: var(--capsule);
  font-size: 14px;
  font-weight: 650;
  color: var(--text-2);
}

.seg-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg-item.is-active span,
.seg-item:has(input:checked) span {
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.site-footer {
  padding: 18px 0 40px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.kefu-float {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 50;
}

.flash {
  width: min(1120px, calc(100% - 40px));
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
}

.flash-ok {
  background: var(--green-bg);
  color: var(--green);
}

.flash-err {
  background: var(--red-bg);
  color: var(--red);
}

.page-head {
  padding: 36px 0 18px;
}

.page-head h1 {
  font-size: 32px;
}

.query-form {
  display: flex;
  gap: 10px;
  margin: 18px 0 22px;
}

.query-form .field {
  flex: 1;
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th, td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-weight: 650;
  font-size: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: var(--capsule);
  font-size: 12px;
  font-weight: 650;
}

.tag-ok {
  background: var(--green-bg);
  color: var(--green);
}

.tag-wait {
  background: var(--orange-bg);
  color: var(--orange);
}

.tag-off {
  background: var(--red-bg);
  color: var(--red);
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.pager-item {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--capsule);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.pager-item.is-active {
  background: var(--blue);
  color: #fff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  pointer-events: none;
  background: rgba(28, 28, 30, 0.88);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--capsule);
  font-size: 13px;
  z-index: 80;
  transition: .2s ease;
}

.toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
}

.pay-wait {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pay-wait .card {
  width: min(420px, 100%);
  text-align: center;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(10, 132, 255, 0.18);
  border-top-color: var(--blue);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Admin */
.adm {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.adm-aside {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.32);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.55);
}

.adm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 18px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.adm-brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.adm-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 16px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}

.adm-link.is-active {
  background: rgba(255, 255, 255, 0.72);
  color: var(--blue);
  box-shadow: var(--shadow);
}

.adm-aside-foot {
  margin-top: auto;
  padding-top: 10px;
}

.adm-main {
  padding: 18px 22px 40px;
  min-width: 0;
}

.adm-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.adm-top h1 {
  font-size: 28px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  padding: 18px;
}

.stat b {
  display: block;
  font-size: 28px;
  letter-spacing: -0.04em;
  margin-top: 6px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-bar input {
  flex: 1;
  min-width: 180px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--capsule);
  border: 1px solid rgba(60, 60, 67, 0.12);
  background: rgba(255, 255, 255, 0.8);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.img-field {
  display: flex;
  align-items: center;
  gap: 12px;
}

.img-field img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.settings-sec {
  margin-bottom: 16px;
}

.settings-sec h2 {
  font-size: 16px;
  margin-bottom: 12px;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(400px, 100%);
  padding: 28px 24px;
}

.login-card h1 {
  font-size: 26px;
  margin: 10px 0 18px;
}

.adm-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
}

.adm-mask {
  display: none;
}

.inline-form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.inline-form input {
  width: 72px;
  min-height: 34px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0 8px;
  text-align: center;
}

.brand img,
.adm-brand img,
.login-card .brand img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}

.brand span,
.adm-brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.stat-grid-6 {
  grid-template-columns: repeat(3, 1fr);
}

.chart-card {
  margin-bottom: 16px;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  padding: 8px 4px 0;
}

.chart-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.chart-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 4px;
}

.chart-bar-wrap {
  width: 100%;
  max-width: 36px;
  height: 110px;
  background: rgba(10, 132, 255, 0.08);
  border-radius: 12px 12px 6px 6px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.chart-bar {
  width: 100%;
  min-height: 4px;
  background: linear-gradient(180deg, #5ac8fa, #0a84ff);
  border-radius: 12px 12px 6px 6px;
}

.chart-label,
.chart-money {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.set-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.set-tab {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.set-tab.is-active {
  background: linear-gradient(180deg, #3d9fff, #0a84ff);
  color: #fff;
}

.set-form .settings-sec {
  display: none;
}

.set-form .settings-sec.is-active {
  display: block;
}

.set-save {
  position: sticky;
  bottom: 16px;
  z-index: 8;
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}

.adm-tabbar {
  display: none;
}

@media (max-width: 1100px) {
  .stat-grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 980px) {
  .hero,
  .order-grid,
  .grid-3,
  .stat-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .stat-grid-6 {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid .span-2 {
    grid-column: span 1;
  }
  .hero h1 {
    font-size: 28px;
  }
  .hero {
    padding: 24px 0 16px;
    gap: 16px;
  }
  .adm {
    grid-template-columns: 1fr;
  }
  .adm-aside {
    position: fixed;
    left: 0;
    top: 0;
    width: min(280px, 86vw);
    z-index: 60;
    background: rgba(231, 238, 247, 0.94);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  .adm-aside.is-open {
    transform: none;
  }
  .adm-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .adm-mask.is-open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    z-index: 55;
  }
  .adm-main {
    padding: 12px 12px 96px;
  }
  .adm-top h1 {
    font-size: 20px;
  }
  .adm-tabbar {
    display: flex;
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 45;
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 22px;
    padding: 6px;
    box-shadow: var(--shadow-lg);
    gap: 4px;
  }
  .adm-tabbar a {
    flex: 1;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
  }
  .adm-tabbar a.is-active {
    background: var(--blue);
    color: #fff;
  }
  .set-save {
    bottom: 72px;
  }
  .kefu-float {
    bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 720px) {
  .wrap,
  .site-nav,
  .flash {
    width: calc(100% - 20px);
  }
  .site-nav {
    position: sticky;
    top: 8px;
    height: auto;
    min-height: 56px;
    padding: 6px 8px 6px 12px;
    border-radius: 20px;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    padding: 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    flex-direction: column;
    z-index: 30;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.is-open {
    display: flex;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .query-form {
    flex-direction: column;
  }
  .page-head {
    padding: 24px 0 12px;
  }
  .page-head h1 {
    font-size: 26px;
  }
  table {
    min-width: 560px;
  }
  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }
  .stat b {
    font-size: 22px;
  }
  .chart {
    height: 160px;
    overflow-x: auto;
  }
  .pkg-price {
    font-size: 18px;
  }
  .site-footer {
    padding-bottom: 88px;
  }
}

@media (max-width: 420px) {
  .stat-grid-6 {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 24px;
  }
}
