/* 圣音 ShengYin —— 样式 */
:root {
  --bg: #08080f;
  --panel: #12121d;
  --panel2: #1a1a2b;
  --txt: #f3f3f7;
  --sub: #9b9bb0;
  --line: rgba(255,255,255,.08);
  --accent: #8b5cf6;
  --gold: #f5c451;
  --grad: linear-gradient(135deg, #8b5cf6, #f5c451);
  --danger: #ef4444;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: #040409;
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex; justify-content: center;
  overflow: hidden;
}
#app {
  position: relative;
  width: 100%; max-width: 460px; height: 100vh; height: 100dvh;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(139,92,246,.14), transparent 60%),
    radial-gradient(900px 400px at 10% 110%, rgba(245,196,81,.08), transparent 60%),
    var(--bg);
  overflow: hidden;
  display: flex; flex-direction: column;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; background: none; color: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 0; height: 0; }

#view { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 10px;
  background: linear-gradient(rgba(5,5,10,.55), transparent);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.tabs { display: flex; gap: 22px; }
.tab { color: rgba(255,255,255,.62); font-size: 16px; font-weight: 500; padding: 4px 2px; position: relative; }
.tab.active { color: #fff; font-weight: 700; }
.tab.active::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); bottom: -6px; width: 22px; height: 3px; border-radius: 2px; background: var(--grad); }
.topright { display: flex; gap: 10px; align-items: center; }
.coinpill { font-size: 12px; color: var(--gold); background: rgba(0,0,0,.4); border: 1px solid rgba(245,196,81,.3); padding: 4px 10px; border-radius: 999px; }
.searchlink { font-size: 19px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.35); border-radius: 50%; }

/* ---------- 信息流 ---------- */
.feed { flex: 1; overflow-y: auto; scroll-snap-type: y mandatory; height: 100%; }
.slide { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; background: #000; }
.slide .vid { width: 100%; height: 100%; object-fit: contain; background: #000; }
.slide.video-blur .vid { object-fit: cover; }
.vgrad { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.35), transparent 22%, transparent 55%, rgba(0,0,0,.62)); }
.pauseicon {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(.6);
  width: 74px; height: 74px; border-radius: 50%; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; font-size: 30px; color: rgba(255,255,255,.9);
  opacity: 0; pointer-events: none; transition: .18s;
}
.slide.paused .pauseicon { opacity: 1; transform: translate(-50%,-50%) scale(1); }

.vinfo { position: absolute; left: 0; bottom: 0; z-index: 10; width: calc(100% - 84px); padding: 0 14px calc(env(safe-area-inset-bottom, 0px) + 18px); }
.vuser { font-size: 17px; font-weight: 700; margin-bottom: 6px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.vtitle { font-size: 14px; line-height: 1.5; margin-bottom: 6px; text-shadow: 0 1px 4px rgba(0,0,0,.6); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vtags { font-size: 13px; margin-bottom: 8px; }
.vtags span { color: #f0e6ff; background: rgba(139,92,246,.28); border-radius: 6px; padding: 2px 7px; margin-right: 6px; display: inline-block; margin-bottom: 4px; }
.music { font-size: 12px; color: rgba(255,255,255,.85); display: flex; align-items: center; gap: 6px; width: 200px; overflow: hidden; white-space: nowrap; }
.music .mv { display: inline-block; animation: slide 6s linear infinite; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.rail { position: absolute; right: 8px; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.rbtn { display: flex; flex-direction: column; align-items: center; gap: 3px; color: #fff; font-size: 11px; }
.rbtn svg { width: 34px; height: 34px; filter: drop-shadow(0 2px 5px rgba(0,0,0,.55)); }
.rbtn .cnt { text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.rbtn.like.on svg { fill: #fe2c55; color: #fe2c55; }
.rbtn svg { fill: none; stroke: #fff; stroke-width: 1.8; }
.rbtn.like.on svg { fill: #fe2c55; stroke: #fe2c55; }
.rbtn.giftbtn { font-size: 11px; }
.rbtn .gemoji { font-size: 30px; line-height: 34px; filter: drop-shadow(0 2px 5px rgba(0,0,0,.55)); }
.avatarwrap { position: relative; margin-bottom: 4px; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; color: #fff;
}
.followplus {
  position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  width: 18px; height: 18px; border-radius: 50%; background: var(--danger);
  color: #fff; font-size: 13px; line-height: 18px; text-align: center; font-weight: 700;
}
.followplus.done { background: #555; }

/* 广告滑页 */
.adslide { display: flex; align-items: center; justify-content: center; }
.adbg { position: absolute; inset: 0; }
.adcard {
  position: relative; z-index: 5; width: 82%; background: rgba(10,10,20,.78);
  border: 1px solid var(--line); border-radius: 18px; padding: 26px 22px; text-align: center;
  backdrop-filter: blur(6px);
}
.adbadge { display: inline-block; font-size: 11px; color: var(--gold); border: 1px solid rgba(245,196,81,.5); padding: 2px 8px; border-radius: 4px; margin-bottom: 12px; }
.ademoji { font-size: 44px; margin-bottom: 10px; }
.adtitle { font-size: 17px; font-weight: 700; line-height: 1.5; margin-bottom: 18px; }
.adcta { display: inline-block; padding: 10px 30px; border-radius: 999px; background: var(--grad); font-weight: 700; font-size: 14px; }

.soundpill {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); left: 50%; transform: translateX(-50%);
  z-index: 40; font-size: 12px; padding: 6px 14px; border-radius: 999px;
  background: rgba(0,0,0,.55); border: 1px solid var(--line); color: #fff;
  display: flex; align-items: center; gap: 6px; animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: .95; } 50% { opacity: .6; } }

.loading { padding: 60px 0; text-align: center; color: var(--sub); font-size: 13px; }
.empty { padding: 80px 30px; text-align: center; color: var(--sub); font-size: 14px; line-height: 2; }

/* ---------- 底部导航 ---------- */
.nav {
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: rgba(8,8,16,.96); border-top: 1px solid var(--line);
  padding: 6px 6px calc(env(safe-area-inset-bottom, 0px) + 6px); z-index: 50;
}
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--sub); font-size: 10px; padding: 4px 0; }
.nav a.active { color: #fff; }
.nav .nicon { font-size: 21px; line-height: 1; }
.nav .plus {
  width: 46px; height: 32px; border-radius: 10px; background: var(--grad);
  color: #0a0a12; font-size: 24px; font-weight: 700; line-height: 32px; text-align: center;
  box-shadow: 0 4px 16px rgba(139,92,246,.4);
}

/* ---------- 通用视图 ---------- */
.page { flex: 1; overflow-y: auto; padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 20px); }
.pagehead { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pagehead h2 { font-size: 18px; }
.backbtn { font-size: 22px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: var(--panel); border-radius: 50%; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.btn { display: block; width: 100%; padding: 12px; border-radius: 12px; font-size: 15px; font-weight: 700; text-align: center; }
.btn-primary { background: var(--grad); color: #0a0a12; }
.btn-ghost { background: var(--panel2); color: var(--txt); border: 1px solid var(--line); }
.btn-danger { background: rgba(239,68,68,.15); color: var(--danger); border: 1px solid rgba(239,68,68,.35); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.input {
  width: 100%; background: var(--panel2); border: 1px solid var(--line); color: var(--txt);
  border-radius: 12px; padding: 12px 14px; font-size: 15px; outline: none; margin-bottom: 10px;
}
.input:focus { border-color: var(--accent); }
.muted { color: var(--sub); font-size: 12px; line-height: 1.7; }
.gold { color: var(--gold); }

/* ---------- 登录 ---------- */
.auth { flex: 1; overflow-y: auto; display: flex; flex-direction: column; justify-content: center; padding: 30px 26px calc(env(safe-area-inset-bottom, 0px) + 30px); }
.logo { text-align: center; margin-bottom: 30px; }
.logo svg { width: 84px; height: 84px; }
.logo h1 { font-size: 34px; margin-top: 12px; letter-spacing: 6px; }
.logo p { color: var(--sub); font-size: 13px; margin-top: 6px; letter-spacing: 2px; }
.authtabs { display: flex; margin-bottom: 16px; background: var(--panel); border-radius: 10px; padding: 4px; }
.authtabs button { flex: 1; padding: 9px; border-radius: 8px; color: var(--sub); font-size: 14px; font-weight: 600; }
.authtabs button.on { background: var(--panel2); color: #fff; }
.authhint { text-align: center; margin-top: 14px; }
.linklike { color: var(--accent); font-size: 13px; cursor: pointer; }

/* ---------- 抽屉 ---------- */
.overlay { position: absolute; inset: 0; z-index: 90; background: rgba(0,0,0,.5); opacity: 0; transition: .2s; pointer-events: none; }
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 95;
  height: 68%; background: #15151f; border-radius: 18px 18px 0 0;
  transform: translateY(105%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.drawer.show { transform: translateY(0); }
.drawer-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.drawer-head b { font-size: 14px; }
.drawer-close { font-size: 18px; color: var(--sub); width: 32px; height: 32px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 16px; }
.cm-item { display: flex; gap: 10px; margin-bottom: 16px; }
.cm-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; }
.cm-main { flex: 1; }
.cm-name { font-size: 13px; color: var(--sub); margin-bottom: 3px; }
.cm-text { font-size: 14px; line-height: 1.5; }
.cm-time { font-size: 11px; color: #666; margin-top: 3px; }
.cm-input-row { display: flex; gap: 8px; padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px); border-top: 1px solid var(--line); }
.cm-input-row input { flex: 1; }
.cm-send { padding: 0 18px; border-radius: 10px; background: var(--grad); color: #0a0a12; font-weight: 700; font-size: 14px; }

.gift-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.gift-item { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 4px; text-align: center; }
.gift-item.sel { border-color: var(--gold); background: rgba(245,196,81,.1); }
.gift-item .ge { font-size: 30px; }
.gift-item .gn { font-size: 12px; margin-top: 4px; }
.gift-item .gc { font-size: 11px; color: var(--gold); margin-top: 2px; }
.gift-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 12px); border-top: 1px solid var(--line); }
.gift-bal { font-size: 13px; color: var(--gold); }
.gift-send { padding: 10px 26px; border-radius: 999px; background: var(--grad); font-weight: 700; font-size: 14px; color: #0a0a12; }
.gift-send[disabled] { opacity: .45; }

.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 6px 0 14px; }
.share-item { text-align: center; font-size: 12px; color: var(--sub); }
.share-item .se { width: 52px; height: 52px; border-radius: 50%; background: var(--panel2); display: flex; align-items: center; justify-content: center; font-size: 24px; margin: 0 auto 6px; }

/* ---------- 视频卡片网格 ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vcard .poster {
  position: relative; aspect-ratio: 9/13; border-radius: 10px; overflow: hidden;
  background: linear-gradient(160deg, #241b3d, #0d0d17); background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
}
.vcard .poster .pfallback { font-size: 34px; opacity: .6; }
.vcard .playcnt { position: absolute; left: 8px; bottom: 6px; font-size: 11px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.vcard .dur { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: #fff; background: rgba(0,0,0,.5); border-radius: 4px; padding: 1px 5px; }
.vc-t { font-size: 13px; line-height: 1.4; margin: 6px 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.userrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.userrow .avatar { width: 46px; height: 46px; border: none; }
.userrow .un { font-size: 15px; font-weight: 600; }
.userrow .uf { font-size: 12px; color: var(--sub); margin-top: 2px; }
.followbtn { margin-left: auto; padding: 7px 18px; border-radius: 8px; background: var(--danger); font-size: 13px; font-weight: 600; }
.followbtn.on { background: var(--panel2); color: var(--sub); border: 1px solid var(--line); }

.tagcloud { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.tagcloud a { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: 13px; }
.tagcloud a b { color: var(--gold); margin-left: 6px; font-size: 11px; }

/* ---------- 个人页 ---------- */
.pf-head { display: flex; flex-direction: column; align-items: center; padding: 16px 0 6px; }
.pf-avatar { width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 700; border: 3px solid rgba(255,255,255,.2); }
.pf-name { font-size: 20px; font-weight: 700; margin-top: 10px; }
.pf-id { font-size: 12px; color: var(--sub); margin-top: 4px; }
.vipbadge {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  background: linear-gradient(120deg, #f5c451, #b8912f); color: #2a1e00;
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  border-radius: 6px; padding: 2px 8px; box-shadow: 0 0 10px rgba(245,196,81,.45);
}
.pf-bio { font-size: 13px; color: var(--sub); margin-top: 8px; text-align: center; padding: 0 26px; line-height: 1.6; }
.statrow { display: flex; justify-content: center; gap: 34px; margin: 18px 0; }
.stat { text-align: center; }
.stat b { font-size: 18px; display: block; }
.stat span { font-size: 12px; color: var(--sub); }
.pf-actions { display: flex; gap: 10px; padding: 0 16px; margin-bottom: 16px; }
.pf-actions .btn { padding: 10px; font-size: 14px; }

/* ---------- 钱包 ---------- */
.wallet-hero { text-align: center; padding: 26px 0 18px; }
.wallet-hero .amt { font-size: 42px; font-weight: 800; color: var(--gold); }
.wallet-hero .lbl { color: var(--sub); font-size: 12px; margin-top: 4px; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 14px; }
.tier { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 4px; text-align: center; }
.tier b { font-size: 15px; display: block; }
.tier span { font-size: 11px; color: var(--gold); }
.tx { display: flex; justify-content: space-between; padding: 11px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.tx .t { color: var(--sub); font-size: 11px; margin-top: 2px; }
.tx .amt.plus { color: #34d399; }
.tx .amt.minus { color: var(--danger); }
.warnbox { background: rgba(245,196,81,.08); border: 1px solid rgba(245,196,81,.3); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: #e8d9ad; line-height: 1.6; margin-bottom: 12px; }
.section-title { font-size: 15px; font-weight: 700; margin: 18px 0 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.statcard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 6px; text-align: center; }
.statcard b { font-size: 18px; display: block; }
.statcard span { font-size: 11px; color: var(--sub); }

/* ---------- 上传 ---------- */
.drop {
  border: 1.5px dashed rgba(139,92,246,.5); border-radius: 14px; padding: 34px 16px;
  text-align: center; color: var(--sub); font-size: 14px; line-height: 2; cursor: pointer; margin-bottom: 14px;
}
.drop.has { padding: 0; border-style: solid; }
.drop video { width: 100%; max-height: 46vh; border-radius: 13px; display: block; }
.prog { height: 6px; background: var(--panel2); border-radius: 3px; overflow: hidden; margin: 10px 0; }
.prog i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }

/* ---------- 消息 ---------- */
.notif { display: flex; gap: 12px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.notif .nicon2 { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.notif .ntxt { font-size: 13px; line-height: 1.5; flex: 1; }
.notif .ntime { font-size: 11px; color: var(--sub); margin-top: 2px; }

/* ---------- 私信 ---------- */
.dm-row { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.dm-row .avatar { width: 46px; height: 46px; border: none; }
.dm-name { font-size: 15px; font-weight: 600; }
.dm-last { font-size: 12.5px; color: var(--sub); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-time { font-size: 11px; color: var(--sub); flex: none; }
.chatbox { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 12px; border-bottom: 1px solid var(--line); }
.chat-head b { font-size: 16px; }
.consultbtn { margin-left: auto; border: 1px solid rgba(245,196,81,.45); color: var(--gold); background: rgba(245,196,81,.1); border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 700; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px 14px; }
.bubble-row { display: flex; gap: 8px; margin-bottom: 14px; align-items: flex-end; }
.bubble-row.mine { flex-direction: row-reverse; }
.b-av { width: 30px; height: 30px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; }
.bubble { max-width: 72%; background: var(--panel2); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 10px 13px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.bubble-row.mine .bubble { background: linear-gradient(135deg, rgba(139,92,246,.85), rgba(245,196,81,.75)); color: #14091f; border: none; border-radius: 14px 14px 4px 14px; font-weight: 500; }
.chat-input { display: flex; gap: 8px; padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px); border-top: 1px solid var(--line); }

/* ---------- 互动玄学卡 ---------- */
.fortslide { display: flex; align-items: center; justify-content: center; }
.fortwrap { position: relative; z-index: 5; width: 86%; text-align: center; }
.fortcards { display: flex; gap: 12px; justify-content: center; margin-top: 8px; transition: opacity .3s; }
.fortcard {
  width: 28%; aspect-ratio: 3/4; border-radius: 14px; cursor: pointer;
  background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.15);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: all .25s; backdrop-filter: blur(4px);
}
.fortcard:active { transform: scale(.95); }

/* ---------- toast / 动效 ---------- */
.toast {
  position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%);
  z-index: 200; background: rgba(20,20,32,.95); border: 1px solid var(--line);
  padding: 10px 18px; border-radius: 10px; font-size: 13px; max-width: 80%;
  animation: toastin .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } }
.burst { position: absolute; z-index: 120; pointer-events: none; font-size: 26px; animation: floatup 1.15s ease-out forwards; }
@keyframes floatup {
  0% { opacity: 0; transform: translateY(0) scale(.5); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-160px) scale(1.25); }
}
