:root {
  --bg: #0d0b12;
  --text: #f4f0f9;
  --muted: #beb6cf;
  --line: rgba(246, 240, 255, .09);
  --line-strong: rgba(246, 240, 255, .18);
  --surface: rgba(246, 240, 255, .035);
  --surface-hover: rgba(246, 240, 255, .065);
  --accent: #d3b0e8;
  --accent-2: #9d7ad9;
  --accent-ink: #180f24;
  --ok: #9fd8bd;
  --warn: #f0a6b8;
  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1080px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --font-sans: "Google Sans", "Noto Sans SC", -apple-system, BlinkMacSystemFont,
               "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.page-bg {
  position: fixed;
  inset: -2%; /* 缩放余量，放大时不露边 */
  z-index: -2;
  pointer-events: none;
  background: url("https://www.dmoe.cc/random.php") center / cover no-repeat;
  filter: saturate(.95) brightness(.88) blur(3px);
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}

/* 加载后淡入 */
.page-bg.is-in { opacity: 1; }

/* 窗口尺寸变化：轻微放大 + 变淡，把 cover 重裁的跳变抹平 */
.page-bg.is-adjusting {
  opacity: .5;
  transform: scale(1.05);
  transition-duration: .28s;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(13, 11, 18, .55), rgba(13, 11, 18, .68)),
    radial-gradient(58% 42% at 12% -4%, rgba(211, 176, 232, .16), transparent 68%),
    radial-gradient(48% 38% at 88% 4%, rgba(157, 122, 217, .12), transparent 70%);
}

a { color: inherit; text-decoration: none; }

h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }

p { margin: 0; }

.brandline,
.section-head h2,
.section-note,
.status,
.site-footer { text-shadow: 0 1px 3px rgba(0, 0, 0, .7), 0 8px 24px rgba(0, 0, 0, .6); }

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 12px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  font-weight: 500;
  z-index: 100;
}
.skip:focus { left: 24px; }

.brandline {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 40px 0 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .01em;
}

.brand-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--accent-ink);
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
}

.brand-mark[hidden] { display: none; }

.section { padding: clamp(30px, 4.5vw, 46px) 0; scroll-margin-top: 32px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 22px;
}

.section-head h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; }

.section-note { font-size: 13.5px; color: var(--muted); }

.section-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status { padding: 4px 0 12px; font-size: 14px; color: var(--muted); }
.status.is-error { color: var(--warn); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s var(--ease), background-color .18s var(--ease),
              border-color .18s var(--ease), opacity .18s var(--ease);
}

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

.btn-primary {
  color: var(--accent-ink);
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 26px -14px rgba(211, 176, 232, .85);
}

.btn-primary:hover { filter: brightness(1.05); }

.btn-ghost {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(18, 14, 26, .58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-ghost:hover { background: var(--surface-hover); border-color: rgba(246, 240, 255, .28); }

.btn-ghost:disabled { opacity: .5; cursor: progress; }

.btn-small { padding: 7px 15px; font-size: 13px; }

.btn[aria-disabled="true"],
.btn.is-disabled {
  color: var(--muted);
  border-color: var(--line);
  background: transparent;
  cursor: not-allowed;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 18px;
}

.grid-contact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }

.tile {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 14, 26, .58);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  text-align: left;
  cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease),
              transform .2s var(--ease);
}

.tile[aria-disabled="true"] {
  opacity: .5;
  pointer-events: none;
  cursor: default;
}

.tile:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.tile-icon svg { width: 20px; height: 20px; display: block; }

.tile-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-weight: 700;
  color: var(--accent-ink);
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
}

.tile-body { flex: 1 1 auto; min-width: 0; display: block; }
.tile-title { display: block; font-size: 15px; font-weight: 500; }
.tile-text {
  display: block;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
#qq-number { font-size: 16px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.tile-cta {
  flex: 0 0 auto;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.tile:hover .tile-cta { color: var(--text); border-color: var(--accent); }

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 14, 26, .64), rgba(18, 14, 26, .46));
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  transition: transform .22s var(--ease), border-color .22s var(--ease),
              box-shadow .22s var(--ease);
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 26px 50px -34px rgba(0, 0, 0, .95);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ok);
  background: rgba(159, 216, 189, .10);
  border: 1px solid rgba(159, 216, 189, .26);
}

.pill.is-empty {
  color: var(--muted);
  background: var(--surface);
  border-color: var(--line);
}

.card-top h3 { font-size: 20px; font-weight: 700; min-width: 0; }

.card-info { font-size: 14.5px; color: var(--muted); }

.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.card-foot .btn { min-width: 140px; }

.site-footer {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  font-size: 13px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
}

.site-footer a { border-bottom: 1px solid transparent; transition: color .18s var(--ease); }
.site-footer a:hover { color: var(--text); border-bottom-color: var(--line-strong); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 50;
  max-width: min(90vw, 420px);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  text-align: center;
  color: var(--text);
  background: rgba(21, 17, 27, .96);
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .9);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}

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

@media (max-width: 640px) {
  .brandline { padding-top: 24px; }
  .section-head { align-items: flex-start; }
  .tile-cta { padding: 5px 12px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .card:hover, .tile:hover { transform: none; }
  .page-bg { transition: none; }
}