:root {
  --blue: #2563EB;
  --blue-2: #3B82F6;
  --blue-soft: #EFF6FF;
  --text: #1F2937;
  --muted: #6B7280;
  --border: #E5E7EB;
  --bg: #F7F8FA;
  --card: #fff;
  --red: #DC2626;
  --green: #16A34A;
  --orange: #F59E0B;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { display: block; }
svg { width: 24px; height: 24px; flex-shrink: 0; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 15px; }

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  position: relative;
  box-shadow: 0 0 40px rgba(15,23,42,.06);
}

/* 隐藏 */
.hidden { display: none !important; }

/* ===== 启动页 ===== */
.splash {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 30px;
  text-align: center;
}
.splash .avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--blue-soft);
  box-shadow: 0 8px 24px rgba(37,99,235,.15);
  margin-bottom: 20px;
}
.splash h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.splash .brand { color: var(--muted); margin-bottom: 40px; font-size: 14px; }
.splash .enter {
  width: 200px; padding: 13px 0;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff; border: none; border-radius: 50px;
  font-size: 16px; font-weight: 600;
  box-shadow: 0 8px 20px rgba(37,99,235,.3);
  transition: transform .1s;
}
.splash .enter:active { transform: scale(.97); }
.splash .foot { position: absolute; bottom: 40px; color: #C0C4CC; font-size: 12px; }

/* ===== 顶部栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
}
.topbar .logo {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue), #60A5FA);
  color: #fff; font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.topbar .search {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--bg); border-radius: 50px; padding: 8px 14px;
  color: var(--muted);
}
.topbar .search input { border: none; background: none; outline: none; flex: 1; font-size: 14px; }
.topbar .search svg { width: 17px; height: 17px; stroke: var(--muted); flex-shrink: 0; }

/* ===== 轮播图 ===== */
.carousel { position: relative; margin: 12px 14px 0; border-radius: 14px; overflow: hidden; }
.carousel .slides { display: flex; transition: transform .4s ease; }
.carousel .slide { min-width: 100%; }
.carousel img { width: 100%; height: 150px; object-fit: cover; }
.carousel .dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.carousel .dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.6); }
.carousel .dot.on { width: 16px; border-radius: 10px; background: #fff; }

/* ===== 功能区五宫格 ===== */
.section-title { margin: 18px 16px 10px; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; color: #0F172A; }
.section-title::before { content: ''; width: 4px; height: 16px; background: linear-gradient(180deg, var(--blue), #60A5FA); border-radius: 2px; }
.modules {
  margin: 0 14px;
  background: #fff; border: 1px solid var(--border); border-radius: 18px;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 16px 8px;
  box-shadow: 0 8px 24px rgba(15,23,42,.04);
}
.module { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 6px 0; border: none; background: none; }
.module .ic-pic {
  position: relative;
  width: 44px; height: 44px; border-radius: 13px; overflow: hidden;
  background: #fff; border: 1px solid #EEF2F7;
  box-shadow: 0 4px 12px rgba(15,23,42,.10);
  transition: transform .16s ease, box-shadow .16s ease;
}
.module .ic-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.module .ic-pic .badge-ic {
  position: absolute; right: -4px; bottom: -4px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--tint, var(--blue)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  border: 2px solid #fff;
}
.module .ic-pic .badge-ic svg { width: 9px; height: 9px; stroke: #fff; stroke-width: 3; }
.module .ic-plain {
  width: 44px; height: 44px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: linear-gradient(135deg, var(--tint, #EC4899), #A855F7);
  box-shadow: 0 4px 12px rgba(236,72,153,.28);
  transition: transform .16s ease;
}
.module .ic-plain svg { width: 22px; height: 22px; stroke: #fff; }
.module:active .ic-pic, .module:active .ic-plain { transform: scale(.92); }
.module .lb { font-size: 12px; color: #374151; font-weight: 600; }

/* ===== 内容卡片 ===== */
.grid-list {
  margin: 0 14px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding-bottom: 14px;
}
.grid-list.cols-3 { grid-template-columns: repeat(3, 1fr); }
.item-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.item-card .cover { position: relative; }
.item-card .cover img { width: 100%; height: 110px; object-fit: cover; }
.item-card .cover .official {
  position: absolute; top: 8px; left: 8px;
  background: var(--blue); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 20px;
}
.item-card .info { padding: 10px 12px; }
.item-card .info .name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card .info .sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card .info .author { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.item-card .info .author img { width: 18px; height: 18px; border-radius: 50%; }
.item-card .info .author span { font-size: 12px; color: var(--muted); }

/* ===== 公告 ===== */
.notice {
  margin: 12px 14px; padding: 12px 14px;
  background: var(--blue-soft); border-radius: 12px;
  display: flex; align-items: center; gap: 10px;
}
.notice svg { width: 20px; height: 20px; stroke: var(--blue); flex-shrink: 0; }
.notice .ntitle { font-weight: 600; font-size: 14px; color: var(--blue); }
.notice .ncontent { font-size: 13px; color: #64748B; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 底部导航 ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px;
  background: #fff; border-top: 1px solid var(--border);
  display: flex; z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 6px; color: #9CA3AF; border: none; background: none; font-size: 11px;
}
.bottom-nav .tab svg { width: 22px; height: 22px; stroke: currentColor; }
.bottom-nav .tab.on { color: var(--blue); font-weight: 600; }
.bottom-nav .tab .badge {
  position: relative;
}
.bottom-nav .tab .bd {
  position: absolute; top: -1px; right: -8px;
  background: var(--red); color: #fff; font-size: 10px; min-width: 16px; height: 16px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ===== 页面通用 ===== */
.page { padding-bottom: 80px; min-height: 70vh; }
.page-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 15;
}
.page-head .back { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: center; }
.page-head .back svg { width: 18px; height: 18px; stroke: var(--text); }
.page-head h2 { font-size: 17px; flex: 1; text-align: center; }
.page-head .spacer { width: 32px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--blue); color: #fff; border: none; border-radius: 12px;
  padding: 12px 20px; font-size: 15px; font-weight: 600; transition: opacity .15s;
}
.btn:active { opacity: .85; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--blue); border: 1px solid var(--border); }
.btn.sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn svg { width: 18px; height: 18px; stroke: currentColor; }

/* ===== 表单 ===== */
.form-card { margin: 12px 14px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; outline: none; background: #fff;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--blue); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group .file-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ===== 聊天 ===== */
.chat-layout { display: flex; flex-direction: column; height: calc(100vh - 60px); }
.chat-top { padding: 12px 14px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.chat-top .search { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 50px; padding: 8px 13px; color: var(--muted); }
.chat-top .search input { border: none; background: none; outline: none; flex: 1; font-size: 14px; }
.chat-top .search svg { width: 17px; height: 17px; stroke: var(--muted); flex-shrink: 0; }
.conv-list { flex: 1; overflow-y: auto; background: #fff; }
.conv-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.conv-item .ava { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; }
.conv-item .mid { flex: 1; min-width: 0; }
.conv-item .mid .nm { font-weight: 600; font-size: 15px; }
.conv-item .mid .msg { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item .right { text-align: right; }
.conv-item .right .time { font-size: 11px; color: var(--muted); }
.conv-item .right .unread { background: var(--red); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; margin-top: 4px; }

.chat-window { display: flex; flex-direction: column; height: calc(100vh - 60px); }
.chat-whead { padding: 11px 14px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.chat-whead .back { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: center; }
.chat-whead .back svg { width: 18px; height: 18px; stroke: var(--text); }
.chat-whead .uinfo { display: flex; align-items: center; gap: 9px; }
.chat-whead .uinfo img { width: 36px; height: 36px; border-radius: 50%; }
.chat-whead .uinfo b { font-size: 15px; display: block; }
.chat-whead .uinfo small { color: var(--muted); font-size: 11px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.msg { max-width: 72%; }
.msg .bubble {
  padding: 10px 13px; border-radius: 14px; font-size: 15px; word-break: break-word;
  background: #fff; border: 1px solid var(--border);
}
.msg.me { align-self: flex-end; }
.msg.me .bubble { background: var(--blue); color: #fff; border: none; }
.msg .bubble img { max-width: 200px; border-radius: 10px; }
.msg .bubble audio { max-width: 200px; }
.msg .time { font-size: 10px; color: var(--muted); margin-top: 3px; text-align: right; }
.chat-input { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid var(--border); }
.chat-input .tool { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-input .tool svg { width: 19px; height: 19px; stroke: var(--muted); }
.chat-input .in { flex: 1; background: var(--bg); border-radius: 50px; padding: 9px 14px; border: none; outline: none; }
.chat-input .send { width: 38px; height: 38px; border-radius: 50%; background: var(--blue); border: none; display: flex; align-items: center; justify-content: center; }
.chat-input .send svg { width: 20px; height: 20px; stroke: #fff; }
.chat-input .rec.on { background: var(--red); border-color: var(--red); }
.chat-input .rec.on svg { stroke: #fff; }

/* 搜索结果 */
.search-result { background: #fff; margin: 8px 14px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.search-result .sr-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.search-result .sr-item:last-child { border-bottom: none; }
.search-result .sr-item img { width: 40px; height: 40px; border-radius: 50%; }
.search-result .sr-item .mid { flex: 1; }
.search-result .sr-item .mid b { font-size: 14px; }
.search-result .sr-item .mid small { display: block; color: var(--muted); font-size: 12px; }

/* ===== 我的页面 ===== */
.profile-card {
  margin: 14px; background: #fff; border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, var(--blue), #60A5FA);
  color: #fff; padding: 22px 18px; display: flex; align-items: center; gap: 14px;
}
.profile-card .ava { width: 64px; height: 64px; border-radius: 50%; border: 3px solid rgba(255,255,255,.6); object-fit: cover; }
.profile-card .uinfo { flex: 1; }
.profile-card .uinfo b { font-size: 18px; }
.profile-card .uinfo small { display: block; opacity: .85; margin-top: 3px; }
.profile-card .points { text-align: center; }
.profile-card .points .n { font-size: 24px; font-weight: 800; }
.profile-card .points .l { font-size: 12px; opacity: .85; }
.menu-card { margin: 0 14px 12px; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--border); width: 100%; background: none; border-left: none; border-right: none; border-top: none; text-align: left; font-size: 15px; color: var(--text); }
.menu-item:last-child { border-bottom: none; }
.menu-item .ic { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.menu-item .ic svg { width: 18px; height: 18px; stroke: #fff; }
.menu-item .arrow { margin-left: auto; color: #C0C4CC; }
.menu-item .arrow svg { width: 18px; height: 18px; stroke: #C0C4CC; }

/* 我的-功能宫格 */
.me-card { margin: 0 14px 12px; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.me-card .section-title { margin: 14px 16px 2px; }
.me-grid { display: grid; grid-template-columns: repeat(4, 1fr); padding: 10px 8px 6px; }
.me-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 2px; border: none; background: none; }
.me-tile .ic { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; }
.me-tile .ic svg { width: 23px; height: 23px; stroke: currentColor; }
.me-tile .lb { font-size: 12px; color: var(--text); }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(17,24,39,.92); color: #fff; padding: 10px 20px; border-radius: 50px;
  font-size: 14px; z-index: 999; max-width: 86%; text-align: center;
  animation: fadeInDown .25s;
}
@keyframes fadeInDown { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===== 弹窗 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 400px; padding: 20px; }
.modal h3 { margin-bottom: 14px; font-size: 17px; text-align: center; }

/* 公告弹窗 / 列表 */
.ann-pop { text-align: center; padding: 6px 2px; }
.ann-pop .ann-pop-ic { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; background: linear-gradient(135deg,#0EA5E9,#2563EB); color: #fff; display: flex; align-items: center; justify-content: center; }
.ann-pop .ann-pop-ic svg { width: 26px; height: 26px; stroke: #fff; }
.ann-pop h3 { margin: 0 0 8px; font-size: 17px; }
.ann-pop p { color: #64748B; font-size: 14px; line-height: 1.7; }
.ann-list .ann-item { padding: 12px 2px; border-bottom: 1px solid #F1F5F9; }
.ann-list .ann-item:last-child { border-bottom: none; }
.ann-list .ann-head { display: flex; align-items: center; gap: 8px; }
.ann-list .ann-head svg { width: 17px; height: 17px; stroke: var(--blue); flex-shrink: 0; }
.ann-list .ann-head b { font-size: 15px; }
.ann-list .ann-item p { color: #6B7280; font-size: 13px; margin-top: 5px; line-height: 1.6; }

/* 音乐封面播放浮层 */
.item-card .cover .play-ov {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(15,23,42,.18); color: #fff; opacity: 0; transition: opacity .2s;
}
.item-card .cover .play-ov svg { width: 34px; height: 34px; stroke: #fff; fill: #fff; stroke-width: 1; }
.item-card:active .cover .play-ov { opacity: 1; }

/* 迷你播放器 */
.mini-player {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 62px; width: calc(100% - 24px); max-width: 536px;
  height: 56px; background: #fff; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15,23,42,.14);
  display: flex; align-items: center; gap: 10px; padding: 0 12px; z-index: 40;
}
.mini-player img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.mini-player .mp-mid { flex: 1; min-width: 0; }
.mini-player .mp-mid #mpTitle { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-player .mp-mid #mpArtist { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-player .mp-btn { width: 34px; height: 34px; border: none; background: none; color: #374151; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.mini-player .mp-btn svg { width: 18px; height: 18px; stroke: currentColor; }
.mini-player .mp-btn.main { width: 38px; height: 38px; background: linear-gradient(135deg,#EC4899,#8B5CF6); color: #fff; box-shadow: 0 4px 10px rgba(236,72,153,.32); }
.mini-player .mp-btn.main svg { width: 18px; height: 18px; fill: #fff; stroke: none; }

/* 详情页 */
.detail-card { margin: 12px 14px; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.detail-card .cover img { width: 100%; height: 200px; object-fit: cover; }
.detail-card .body { padding: 16px; }
.detail-card .body h2 { font-size: 18px; margin-bottom: 8px; }
.detail-card .body .meta { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.detail-card .body .intro { color: #374151; font-size: 14px; white-space: pre-wrap; }

.auth-head { text-align: center; padding: 40px 16px 20px; }
.auth-head .lgo { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg,var(--blue),#60A5FA); color: #fff; font-size: 28px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.auth-head h2 { font-size: 20px; }
.auth-tabs { display: flex; margin: 0 14px; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.auth-tabs button { flex: 1; padding: 12px; background: none; border: none; font-size: 15px; color: var(--muted); }
.auth-tabs button.on { color: var(--blue); font-weight: 600; background: var(--blue-soft); }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty svg { width: 60px; height: 60px; stroke: #D1D5DB; stroke-width: 1.5; margin-bottom: 12px; }

/* ===== 花瓣飘落动画 ===== */
.petals {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 150;
  overflow: hidden;
}
.petal {
  position: absolute; top: -6vh;
  display: block;
  border-radius: 50% 0 50% 50%;
  opacity: 0;
  animation: petal-fall linear infinite;
  will-change: transform, opacity;
}
.petal.p1 { background: linear-gradient(135deg, #DBEAFE, #93C5FD); }
.petal.p2 { background: linear-gradient(135deg, #BFDBFE, #60A5FA); }
.petal.p3 { background: linear-gradient(135deg, #C7D2FE, #818CF8); }
.petal.p4 { background: linear-gradient(135deg, #93C5FD, #3B82F6); }
@keyframes petal-fall {
  0%   { transform: translate3d(0, -6vh, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: .8; }
  100% { transform: translate3d(var(--drift, 50px), 108vh, 0) rotate(var(--spin, 320deg)); opacity: .3; }
}

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