/* ================= 基础 ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  --accent: #7c5cff;
  --accent-2: #ff86bd;
  --card-alpha: 0.55;
  --blur: 18px;
  --text: #0f172a;
  --muted: rgba(15, 23, 42, 0.6);
  min-height: 100vh;
  overflow-x: hidden;
  background: #bfe6fa;
  color: var(--text);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font-family: inherit;
}

/* ================= 主题配色 ================= */
body[data-theme="ocean"] {
  --sky-1: #4fb2e6;
  --sky-2: #a4dcf8;
  --sky-3: #e9f9ff;
  --sea-a: rgba(98, 214, 232, 0.72);
  --sea-b: rgba(24, 141, 186, 0.9);
  --cloud: 255, 255, 255;
}
body[data-theme="sky"] {
  --sky-1: #7cc9f5;
  --sky-2: #c9ebff;
  --sky-3: #f4fbff;
  --sea-a: rgba(142, 223, 245, 0.7);
  --sea-b: rgba(56, 163, 206, 0.85);
  --cloud: 255, 255, 255;
}
body[data-theme="sunset"] {
  --sky-1: #ff9d78;
  --sky-2: #ffcfa9;
  --sky-3: #ffeedd;
  --sea-a: rgba(255, 198, 154, 0.7);
  --sea-b: rgba(232, 124, 124, 0.86);
  --cloud: 255, 250, 245;
}
body[data-theme="forest"] {
  --sky-1: #8edab7;
  --sky-2: #d6f4e4;
  --sky-3: #f1fcf7;
  --sea-a: rgba(150, 229, 198, 0.7);
  --sea-b: rgba(44, 158, 122, 0.86);
  --cloud: 252, 255, 253;
}
body[data-theme="night"] {
  --sky-1: #1e2b60;
  --sky-2: #3a4c94;
  --sky-3: #7d8ccd;
  --sea-a: rgba(92, 130, 200, 0.55);
  --sea-b: rgba(24, 46, 104, 0.92);
  --cloud: 216, 226, 255;
}

/* ================= 背景场景 ================= */
.scene {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    var(--sky-1) 0%,
    var(--sky-2) 40%,
    var(--sky-3) 69%,
    #eafaff 100%
  );
  transition: background 0.6s ease;
}
.scene::before {
  content: "";
  position: absolute;
  inset: -22% -12% auto -12%;
  height: 72%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.5), transparent 72%);
  filter: blur(26px);
}
.sun {
  position: absolute;
  top: 4%;
  right: 10%;
  width: 26vw;
  height: 26vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 66%);
  filter: blur(18px);
  pointer-events: none;
}
.cloud {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgba(var(--cloud), 0.96),
    rgba(var(--cloud), 0.56) 56%,
    rgba(var(--cloud), 0) 78%
  );
  filter: blur(8px);
  opacity: 0.9;
  will-change: transform;
}
.c1 {
  width: 46vw;
  height: 27vw;
  left: -11vw;
  top: -2vh;
  animation: drift 24s ease-in-out infinite alternate;
}
.c2 {
  width: 38vw;
  height: 22vw;
  right: -9vw;
  top: 5vh;
  animation: drift 28s ease-in-out infinite alternate-reverse;
}
.c3 {
  width: 30vw;
  height: 18vw;
  left: 14vw;
  top: 21vh;
  opacity: 0.7;
  animation: drift 22s ease-in-out infinite alternate;
}
.c4 {
  width: 52vw;
  height: 28vw;
  right: -16vw;
  top: 25vh;
  animation: drift 30s ease-in-out infinite alternate;
}
.c5 {
  width: 34vw;
  height: 20vw;
  left: -8vw;
  top: 37vh;
  opacity: 0.75;
  animation: drift 26s ease-in-out infinite alternate-reverse;
}
.c6 {
  width: 26vw;
  height: 16vw;
  right: 16vw;
  top: 42vh;
  opacity: 0.6;
  animation: drift 20s ease-in-out infinite alternate;
}
.c7 {
  width: 40vw;
  height: 22vw;
  left: 24vw;
  top: 50vh;
  opacity: 0.5;
  animation: drift 32s ease-in-out infinite alternate;
}
.c8 {
  width: 30vw;
  height: 18vw;
  right: -7vw;
  top: 56vh;
  opacity: 0.55;
  animation: drift 25s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  to {
    transform: translate3d(2.6vw, 1.6vh, 0) scale(1.06);
  }
}

.sea {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 23%;
  background: linear-gradient(180deg, var(--sea-a), var(--sea-b));
  box-shadow: inset 0 16px 34px rgba(255, 255, 255, 0.42);
}
.sea::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.07) 0 2px,
    transparent 2px 7px
  );
}
.sparkles {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.92) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(255, 255, 255, 0.6) 0 1px, transparent 1.6px);
  background-size: 92px 48px, 132px 64px;
  background-position: 0 0, 44px 22px;
  opacity: 0.5;
}

/* ================= 顶栏 ================= */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(14px, env(safe-area-inset-left));
}
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}
.brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: #23405c;
  white-space: nowrap;
}
.round-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.58);
  color: #33506b;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: 0.2s ease;
}
.round-btn:hover {
  background: #fff;
  transform: translateY(-1px);
}
.round-btn svg {
  width: 18px;
  height: 18px;
}
.ico-moon {
  display: none;
}
body.dark .ico-sun {
  display: none;
}
body.dark .ico-moon {
  display: block;
}

/* ================= 内容页 ================= */
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 468px;
  margin: 0 auto;
  padding: 78px 16px 76px;
}

/* 主卡片 */
.card {
  position: relative;
  padding: 26px 20px 22px;
  text-align: center;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, calc(var(--card-alpha) + 0.16)),
    rgba(255, 255, 255, var(--card-alpha))
  );
  backdrop-filter: blur(var(--blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  box-shadow: 0 22px 52px rgba(20, 76, 112, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.clock {
  font-size: clamp(38px, 10vw, 52px);
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 3px 14px rgba(30, 90, 130, 0.12);
}
.date {
  margin-top: 6px;
  font-size: 12.5px;
  letter-spacing: 0.6px;
  color: var(--muted);
}
.clock-wrap.hidden {
  display: none;
}

/* 头像 */
.avatar-wrap {
  position: relative;
  width: 108px;
  height: 108px;
  margin: 18px auto 0;
}
.avatar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #ffd0e4,
    #ff8fb7,
    #b79bff,
    #6ee0ff,
    #9dffcf,
    #ffd0e4
  );
  animation: spin 12s linear infinite;
  filter: drop-shadow(0 8px 18px rgba(120, 90, 220, 0.32));
}
.avatar-img {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  border-radius: 50%;
  object-fit: cover;
  z-index: 1;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: #dbeafe;
}
.online-dot {
  position: absolute;
  right: 2px;
  bottom: 4px;
  z-index: 2;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #22c55e;
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.site-name {
  margin-top: 16px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1.2px;
}
.visit-count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 4px 13px 4px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.46);
  box-shadow: 0 4px 14px rgba(20, 76, 112, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12px;
  letter-spacing: 0.4px;
  color: var(--muted);
}
.visit-ico {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 3px 9px rgba(124, 92, 255, 0.38);
}
.visit-ico svg {
  width: 12px;
  height: 12px;
}
.visit-label {
  color: var(--muted);
}
.visit-num {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.6px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.divider-glow {
  width: 54px;
  height: 4px;
  margin: 9px auto 11px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 2px 12px rgba(124, 92, 255, 0.55);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  color: #15803d;
  font-size: 12px;
  font-weight: 500;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}
.desc {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 5px;
  max-width: 310px;
  margin: 14px auto 0;
  font-size: 13px;
  line-height: 1.85;
  color: var(--muted);
  white-space: pre-line;
}
.desc-ico {
  width: 14px;
  height: 14px;
  flex: none;
  margin-top: 5px;
  opacity: 0.72;
}

/* ================= 导航分组 ================= */
.sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 2px 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(15, 23, 42, 0.78);
}
.sec-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 22px rgba(24, 86, 124, 0.09);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.nav-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 14px 28px rgba(24, 86, 124, 0.16);
}
.nav-item:active {
  transform: translateY(0) scale(0.99);
}
.nav-ico {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.nav-ico svg {
  width: 20px;
  height: 20px;
}
.nav-ico--chat {
  background: rgba(124, 92, 255, 0.16);
  color: #7c5cff;
}
.nav-ico--bolt {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
}
.nav-ico--drop {
  background: rgba(14, 165, 233, 0.16);
  color: #0ea5e9;
}
.nav-ico--group {
  background: rgba(168, 85, 247, 0.16);
  color: #a855f7;
}
.nav-ico--link {
  background: rgba(16, 185, 129, 0.16);
  color: #10b981;
}
.nav-ico--shield {
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
}
.nav-ico--star {
  background: rgba(234, 179, 8, 0.18);
  color: #eab308;
}
.nav-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.nav-sub {
  font-size: 11.5px;
  color: var(--muted);
}
.chev {
  flex: none;
  width: 17px;
  height: 17px;
  color: rgba(15, 23, 42, 0.32);
}

/* ================= 页脚 ================= */
.footer {
  margin-top: 26px;
  padding-bottom: 4px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 10px rgba(16, 64, 96, 0.4);
}

/* ================= 悬浮按钮 ================= */
.fabs {
  position: fixed;
  left: 16px;
  bottom: 22px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fab {
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(18, 90, 130, 0.28);
  transition: transform 0.2s ease;
}
.fab:hover {
  transform: translateY(-2px) scale(1.03);
}
.fab svg {
  width: 20px;
  height: 20px;
}
.fab-music {
  background: linear-gradient(135deg, #38e0c8, #22a7e8);
}
.fab-top {
  background: linear-gradient(135deg, #5ee7a8, #22c1a8);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}
.fab-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.fab .ico-pause {
  display: none;
}
.fab.is-playing .ico-music {
  display: none;
}
.fab.is-playing .ico-pause {
  display: block;
}
.fab.is-playing::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(56, 224, 200, 0.6);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  from {
    opacity: 0.9;
    transform: scale(0.96);
  }
  to {
    opacity: 0;
    transform: scale(1.3);
  }
}

/* ================= 深色模式 ================= */
body.dark {
  --text: #eef2ff;
  --muted: rgba(226, 232, 240, 0.72);
}
body.dark .scene {
  filter: saturate(0.62) brightness(0.5);
}
body.dark .topbar::before {
  background: rgba(11, 19, 34, 0.55);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
body.dark .brand {
  color: #dbeafe;
}
body.dark .round-btn {
  background: rgba(30, 41, 59, 0.7);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.14);
}
body.dark .card {
  background: linear-gradient(160deg, rgba(23, 33, 52, 0.74), rgba(14, 22, 38, 0.58));
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
body.dark .status-pill {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
body.dark .visit-count {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
body.dark .sec-title {
  color: rgba(226, 232, 240, 0.85);
}
body.dark .nav-item {
  background: rgba(17, 27, 44, 0.5);
  border-color: rgba(255, 255, 255, 0.1);
}
body.dark .nav-item:hover {
  background: rgba(30, 41, 59, 0.72);
}
body.dark .chev {
  color: rgba(255, 255, 255, 0.35);
}
body.dark .footer {
  color: rgba(226, 232, 240, 0.62);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

/* 自定义背景 */
body.has-custom .scene {
  background-image: var(--custom-bg);
  background-size: cover;
  background-position: center;
}
body.has-custom .clouds,
body.has-custom .sun,
body.has-custom .sea {
  display: none;
}

/* ================= 提示条 ================= */
.fj-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 9999;
  max-width: 82vw;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.88);
  color: #fff;
  font-size: 12.5px;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: 0.25s ease;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.fj-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ================= 移动端适配 ================= */
@media (max-width: 560px) {
  .page {
    padding: 74px 14px 70px;
  }
  .card {
    padding: 22px 16px 20px;
    border-radius: 22px;
  }
  .avatar-wrap {
    width: 96px;
    height: 96px;
  }
  .site-name {
    font-size: 20px;
    margin-top: 14px;
  }
  .desc {
    font-size: 12.5px;
  }
  .nav-item {
    padding: 11px 12px;
  }
  .fabs {
    left: 12px;
    bottom: 18px;
  }
  .fab {
    width: 42px;
    height: 42px;
  }
}
