:root {
  --bg: #f7f5fb;
  --bg-soft: #eef0fa;
  --ink: #1b2130;
  --ink-soft: #414a5e;
  --muted: #7b8598;
  --pink: #ff7fa8;
  --pink-deep: #f05c8c;
  --blue: #7b8cff;
  --cyan: #4fd1e0;
  --gold: #ffc46b;
  --card: rgba(255, 255, 255, 0.78);
  --line: rgba(27, 33, 48, 0.09);
  --shadow: 0 18px 50px -22px rgba(66, 76, 130, 0.45);
  --radius: 20px;
  --sans: "Inter", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(255, 190, 214, 0.35), transparent 65%),
    radial-gradient(820px 520px at 94% 2%, rgba(167, 193, 255, 0.32), transparent 62%),
    linear-gradient(180deg, #fbfaff 0%, #f5f4fb 55%, #f8f6fb 100%);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
.hidden { display: none !important; }

::selection { background: rgba(255, 127, 168, 0.28); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 127, 168, 0.6), rgba(123, 140, 255, 0.6));
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 环境光斑 */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.ambient .blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.55;
  animation: float 18s ease-in-out infinite alternate;
  will-change: transform;
}
.ambient .b1 { width: 460px; height: 460px; left: -120px; top: 10%; background: radial-gradient(circle, rgba(255, 157, 190, 0.55) 0%, rgba(255, 157, 190, 0) 70%); }
.ambient .b2 { width: 420px; height: 420px; right: -110px; top: 36%; background: radial-gradient(circle, rgba(139, 165, 255, 0.5) 0%, rgba(139, 165, 255, 0) 70%); animation-delay: -6s; }
.ambient .b3 { width: 400px; height: 400px; left: 42%; bottom: -160px; background: radial-gradient(circle, rgba(110, 220, 225, 0.42) 0%, rgba(110, 220, 225, 0) 70%); animation-delay: -12s; }

@keyframes float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(28px, -34px, 0) scale(1.12); }
}

/* ---------------------------------------------------------------- 顶栏 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(249, 247, 253, 0.94);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px -6px rgba(255, 111, 155, 0.65);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15.5px; letter-spacing: 0.5px; }
.brand-text i {
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 2.4px;
  color: var(--muted);
  margin-top: 3px;
}

.site-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.site-nav a {
  position: relative;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-soft);
  transition: color 0.25s ease, background 0.25s ease;
}
.site-nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.85); }
.site-nav a.active { color: #fff; background: linear-gradient(135deg, var(--pink), var(--blue)); }
.site-nav a.active::after { display: none; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #ff89ae 0%, #ff6d9c 45%, #8a8bff 100%);
  box-shadow: 0 14px 30px -12px rgba(255, 100, 150, 0.75);
}
.btn.primary:hover { box-shadow: 0 18px 34px -12px rgba(255, 100, 150, 0.9); transform: translateY(-1px); }
.btn.ghost {
  color: var(--ink-soft);
  border-color: rgba(27, 33, 48, 0.12);
  background: rgba(255, 255, 255, 0.65);
}
.btn.ghost:hover { color: var(--ink); border-color: rgba(255, 127, 168, 0.55); background: #fff; }
.btn.small { padding: 5px 12px; font-size: 12.5px; }

/* ---------------------------------------------------------------- 页脚 */

.site-footer {
  max-width: 1180px;
  margin: 60px auto 0;
  padding: 26px 24px 34px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12.5px;
}
.site-footer .dot { color: var(--pink); }
.site-footer a:hover { color: var(--pink-deep); }

/* ---------------------------------------------------------------- 动效 */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(123, 140, 255, 0.08);
  border-radius: var(--radius);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.toast {
  position: fixed;
  left: 50%;
  bottom: 38px;
  z-index: 10000;
  transform: translate(-50%, 16px);
  opacity: 0;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(27, 33, 48, 0.92);
  color: #fff;
  font-size: 13px;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 720px) {
  .ambient .blob { animation: none; }
  .header-inner { padding: 10px 16px; gap: 10px; }
  .brand-text i { display: none; }
  .site-nav { margin-left: 0; gap: 0; }
  .site-nav a { padding: 6px 9px; font-size: 13px; }
  .site-footer { padding: 22px 16px 30px; }
}

/* ================================================================ 功能 UI（v4 追加） */

/* ---------------------------------------------------------------- 头像下拉 */

.user-menu-wrap { position: relative; }

.user-avatar {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(135deg, var(--pink), var(--blue));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 8px 20px -10px rgba(255, 100, 150, 0.8);
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 210px;
  padding: 8px;
  z-index: 120;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px -24px rgba(30, 38, 70, 0.55);
}

.user-dropdown-head {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.user-dropdown-head b { font-size: 13.5px; }
.user-dropdown-head small { font-size: 11.5px; color: var(--muted); }

.user-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.user-dropdown-item:hover { background: rgba(255, 127, 168, 0.12); color: var(--ink); }
.user-dropdown-item.danger { color: var(--pink-deep); }

/* ---------------------------------------------------------------- 弹窗 */

.ui-mask {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 18, 26, 0.5);
  backdrop-filter: blur(3px);
  animation: fadeUp 0.18s ease;
}

.ui-dialog {
  width: 100%;
  max-width: 660px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.ui-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

.ui-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.ui-close:hover { color: var(--pink-deep); }

.ui-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 20px;
  overflow: auto;
}

.ui-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.8px;
  color: var(--muted);
}
.ui-field input,
.ui-field select,
.ui-field textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(27, 33, 48, 0.14);
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-size: 14px;
  outline: none;
}
.ui-field input:focus,
.ui-field select:focus,
.ui-field textarea:focus {
  border-color: rgba(255, 127, 168, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 127, 168, 0.14);
}
.ui-field textarea { resize: vertical; line-height: 1.65; }

.ui-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.ui-hint { margin: 0; font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- 今日运势 */

.fortune-box { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.fortune-box h3 { margin: 0; font-size: 26px; letter-spacing: 2px; }
.fortune-stars { margin: 0; font-size: 18px; letter-spacing: 5px; color: var(--gold); }
.fortune-box p { margin: 0; font-size: 13.2px; line-height: 1.75; color: var(--ink-soft); }

.fortune-date { font-size: 12px !important; color: var(--muted) !important; letter-spacing: 0.06em; }
.fortune-overall b { font-size: 22px; color: var(--pink-deep); margin: 0 3px; }

.fortune-dims {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
  text-align: left;
}
.fortune-dim {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}
.fortune-dim-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.fortune-dim-head b { font-size: 14px; color: var(--ink); }
.fortune-bar {
  height: 5px;
  margin: 7px 0 6px;
  border-radius: 999px;
  background: rgba(27, 33, 48, 0.08);
  overflow: hidden;
}
.fortune-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #fb7185, #8b8bff);
}
.fortune-dim[data-level="low"] .fortune-bar i { background: linear-gradient(90deg, #9aa3b2, #c3c9d4); }
.fortune-dim small { display: block; font-size: 11.5px; line-height: 1.55; color: var(--muted); }

.fortune-lucky {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  text-align: left;
}
.fortune-lucky div {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(123, 140, 255, 0.09);
  font-size: 12px;
  color: var(--ink-soft);
}
.fortune-color {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 2px 6px rgba(0, 0, 0, 0.15);
  flex: 0 0 auto;
}

.fortune-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fortune-chip {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid transparent;
}
.fortune-chip.good { color: #1f8a5b; background: rgba(31, 169, 124, 0.12); border-color: rgba(31, 169, 124, 0.3); }
.fortune-chip.bad { color: #c2415f; background: rgba(244, 63, 94, 0.1); border-color: rgba(244, 63, 94, 0.28); }

.fortune-advice {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 196, 107, 0.14);
  border: 1px dashed rgba(240, 163, 60, 0.45);
  font-size: 12.5px !important;
  line-height: 1.7 !important;
  color: var(--ink-soft) !important;
  text-align: left;
}

html[data-theme="dark"] .fortune-dim { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .fortune-bar { background: rgba(255, 255, 255, 0.12); }
html[data-theme="dark"] .fortune-lucky div { background: rgba(123, 140, 255, 0.16); }

@media (max-width: 560px) {
  .fortune-dims { grid-template-columns: minmax(0, 1fr); }
  .fortune-lucky { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------- 公告横幅 */

.announce-host {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.announce {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 13.2px;
  box-shadow: var(--shadow);
}
.announce .announce-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.announce .announce-text b { font-size: 13.5px; }
.announce .announce-text span { color: var(--ink-soft); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

.announce-info { border-color: rgba(123, 140, 255, 0.4); background: rgba(123, 140, 255, 0.1); }
.announce-success { border-color: rgba(31, 169, 124, 0.4); background: rgba(31, 169, 124, 0.1); }
.announce-warning { border-color: rgba(255, 196, 107, 0.55); background: rgba(255, 196, 107, 0.14); }
.announce-danger { border-color: rgba(240, 92, 140, 0.45); background: rgba(255, 127, 168, 0.12); }

.announce-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.announce-close:hover { color: var(--pink-deep); }

/* ---------------------------------------------------------------- 网易云音乐小面板 */

.music-box {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1500;
  width: 330px;
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 26px 70px -26px rgba(20, 26, 46, 0.6);
  overflow: hidden;
}

.music-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.music-head-actions { display: flex; align-items: center; gap: 2px; }
.music-head button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 2px 7px;
  cursor: pointer;
}
.music-head button:hover { color: var(--pink-deep); }

.music-search { display: flex; gap: 8px; padding: 10px 12px; }
.music-search input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid rgba(27, 33, 48, 0.14);
  background: rgba(255, 255, 255, 0.96);
  font-size: 13px;
  outline: none;
}
.music-search input:focus { border-color: rgba(255, 127, 168, 0.7); }

.music-results {
  display: flex;
  flex-direction: column;
  overflow: auto;
  max-height: 220px;
  border-top: 1px solid var(--line);
}
.music-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
}
.music-item b { font-weight: 600; }
.music-item small { color: var(--muted); font-size: 11.5px; }
.music-item:hover { background: rgba(255, 127, 168, 0.1); }

.music-player iframe { display: block; width: 100%; border: 0; }
.music-hint { margin: 0; padding: 8px 12px 10px; font-size: 11px; color: var(--muted); }

.music-box.music-minimized .music-search,
.music-box.music-minimized .music-results,
.music-box.music-minimized .music-hint { display: none; }

/* ---------------------------------------------------------------- 暗色主题（最小覆盖） */

html[data-theme="dark"] {
  --bg: #14161d;
  --bg-soft: #1b1f29;
  --ink: #e9ebf3;
  --ink-soft: #c4c9d7;
  --muted: #8b93a7;
  --card: rgba(30, 34, 45, 0.82);
  --line: rgba(233, 235, 243, 0.12);
  --shadow: 0 18px 50px -26px rgba(0, 0, 0, 0.85);
}

html[data-theme="dark"] body::before {
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(255, 127, 168, 0.16), transparent 65%),
    radial-gradient(820px 520px at 94% 2%, rgba(123, 140, 255, 0.18), transparent 62%),
    linear-gradient(180deg, #15171f 0%, #12141a 55%, #161821 100%);
}

html[data-theme="dark"] .site-header { background: rgba(20, 22, 29, 0.94); }
html[data-theme="dark"] .site-nav a:hover { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .btn.ghost {
  border-color: rgba(233, 235, 243, 0.18);
  background: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .btn.ghost:hover { background: rgba(255, 255, 255, 0.12); }
html[data-theme="dark"] .user-dropdown,
html[data-theme="dark"] .ui-dialog,
html[data-theme="dark"] .music-box { background: #1d212b; }
html[data-theme="dark"] .ui-field input,
html[data-theme="dark"] .ui-field select,
html[data-theme="dark"] .ui-field textarea,
html[data-theme="dark"] .music-search input { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .skeleton { background: rgba(123, 140, 255, 0.16); }
html[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

@media (max-width: 720px) {
  .announce-host { padding: 12px 16px 0; }
  .music-box { right: 12px; bottom: 12px; width: calc(100% - 24px); max-width: 330px; }
  .ui-dialog { max-height: 92vh; }
}
