/* 4VUPS 前台样式：主题变量由各主播页注入 :root，未注入时使用默认可爱风 */
:root {
  --vups-bg: #fff6f9;
  --vups-card: #ffffff;
  --vups-primary: #ff7fa8;
  --vups-primary-text: #ffffff;
  --vups-accent: #ffe1ec;
  --vups-text: #5c4048;
  --vups-muted: #a58a94;
  --vups-border: #ffd9e5;
  --vups-radius: 18px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.vups {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--vups-bg);
  color: var(--vups-text);
  line-height: 1.7;
}
a { color: var(--vups-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:has(> img) { text-decoration: none !important; }   /* 图片链接悬停不加下划线 */

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* 顶栏 */
.vups-nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--vups-card) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--vups-border);
}
.vups-nav .inner { display: flex; align-items: center; gap: 14px; height: 60px; }
.vups-nav .brand { font-weight: 700; font-size: 20px; color: var(--vups-primary); }
.vups-nav .spacer { flex: 1; }
.vups-nav .links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* 按钮 */
.btn {
  display: inline-block; border: none; cursor: pointer;
  padding: 8px 18px; border-radius: 999px;
  font-size: 14px; line-height: 1.4; text-decoration: none !important;
  transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-primary { background: var(--vups-primary); color: var(--vups-primary-text); }
.btn-ghost { background: transparent; color: var(--vups-primary); border: 1px solid var(--vups-border); }
.btn-danger { background: #e5484d; color: #fff; }
.btn-gray { background: #8f8896; color: #fff; font-weight: 600; }
.btn-gray[disabled] { opacity: 1; cursor: not-allowed; }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* 卡片与网格 */
.card {
  background: var(--vups-card);
  border: 1px solid var(--vups-border);
  border-radius: var(--vups-radius);
  padding: 20px;
}
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* 徽标 */
.badge {
  display: inline-block; font-size: 12px; padding: 2px 10px;
  border-radius: 999px; background: var(--vups-accent); color: var(--vups-text);
}
.badge-lock { background: #f2f0ee; color: #8a8078; }
.badge-ok { background: #e3f6e8; color: #1d7a3a; }
/* 点唱解锁条件（纯文字右对齐，沿用徽章时代文字色系）：免费=绿；SC=金；礼物=紫；会员=蓝（付费色已调亮） */
.ut-ok { color: #2eaf5a; }
.ut-sc { color: #d9a514; }
.ut-gift { color: #a855f7; }
.ut-vip { color: #4f8ef7; }

/* 曲风徽章配色（低饱和实底+白字，芯片激活时同色；与浅底解锁徽章形成两套视觉语言）
   流行·蓝 / 古风·红棕 / 说唱·芥末赭 / 摇滚·炭灰 / 爵士·暗紫 / 其他·暖灰褐 */
.st-pop,    .style-chips .chip.active.st-pop    { background: #476a9e; color: #fff; }
.st-gufeng, .style-chips .chip.active.st-gufeng { background: #9a4438; color: #fff; }
.st-rap,    .style-chips .chip.active.st-rap    { background: #857629; color: #fff; }
.st-rock,   .style-chips .chip.active.st-rock   { background: #3a4046; color: #fff; }
.st-jazz,   .style-chips .chip.active.st-jazz   { background: #6f4d8c; color: #fff; }
.st-other,  .style-chips .chip.active.st-other  { background: #7c6f64; color: #fff; }

/* 提示条 */
.flash { border-radius: 12px; padding: 10px 16px; margin: 12px 0; font-size: 14px; }
.flash.success { background: #e3f6e8; color: #1d7a3a; }
.flash.danger  { background: #fde8e8; color: #a02c2c; }
.flash.warning { background: #fff3d6; color: #8a6100; }
.flash.info   { background: var(--vups-accent); color: var(--vups-text); }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--vups-muted); }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 14px; font-size: 14px;
  border: 1px solid var(--vups-border); border-radius: 12px;
  background: var(--vups-card); color: var(--vups-text);
  font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--vups-primary); border-color: transparent;
}

/* 主播主页 */
.streamer-hero {
  padding: 22px 20px;
  border-bottom: 1px solid var(--vups-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--vups-accent) 55%, transparent), transparent);
}
.streamer-hero .hero-row { display: flex; align-items: center; gap: 18px; }
.streamer-hero .avatar {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--vups-card); box-shadow: 0 6px 18px rgba(0,0,0,.12);
  flex: none;
}
.streamer-hero .avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; background: var(--vups-accent); color: var(--vups-text);
}
.streamer-hero .hero-text { min-width: 0; }
.streamer-hero h1 { margin: 0 0 4px; font-size: 24px; }
.streamer-hero .bio {
  color: var(--vups-muted); margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.tab-nav { display: flex; gap: 4px; overflow-x: auto; padding: 12px 0; position: sticky; top: 60px;
  background: color-mix(in srgb, var(--vups-bg) 94%, transparent); z-index: 40; }
.tab-nav a {
  white-space: nowrap; padding: 6px 14px; border-radius: 999px; font-size: 14px;
  color: var(--vups-text); text-decoration: none !important;
}
.tab-nav a.active, .tab-nav a:hover { background: var(--vups-primary); color: var(--vups-primary-text); }

/* 平台首页介绍卡：双栏（主播/粉丝） */
.home-intro-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.home-intro-cols p { margin: 0; font-size: 14px; color: var(--vups-muted); }
@media (max-width: 640px) { .home-intro-cols { grid-template-columns: 1fr; gap: 14px; } }

/* 主播子页面主体（基座 hero+菜单 之下） */
.streamer-body { padding: 26px 20px 6px; }
.item-thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover;
  border: 1px solid var(--vups-border); flex: none; display: block; }

/* 通用折叠展开：默认 200px，超出时底部渐隐 + 右下角展开按钮（clamp.js）
   展开后仍保持 overflow:hidden：维持 BFC，避免首子元素 margin-top
   外露合并导致展开瞬间首行上移 */
.clamp-body { max-height: 200px; overflow: hidden; position: relative; }
.clamp-wrap.expanded .clamp-body { max-height: none; }
.clamp-wrap.clamped:not(.expanded) .clamp-body::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 64px;
  background: linear-gradient(180deg, transparent, var(--vups-card)); pointer-events: none;
}
.clamp-fade { display: none; text-align: right; margin-top: 8px; }
.clamp-wrap.clamped .clamp-fade { display: block; }

/* 受限文章卡：头部与可读文章一致（分隔线），下方居中解锁提示 */
.unlock-hint { text-align: center; color: var(--vups-muted); font-size: 14px; margin-top: 12px; }

/* 最新更新行：类型徽章定宽居中，保证各行标题左缘对齐（最长 4 字：艺术长廊/礼品商店） */
.type-badge { min-width: 68px; text-align: center; flex: none; }

/* 文件柜/留言板列表卡（复用 g-head 头部结构） */
.file-item-card, .board-item-card { margin-bottom: 18px; }

.b-title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.b-title-line .title { min-width: 0; }

/* 留言板卡：已留言昵称跑马灯（内容放不下时自动滚动，悬停暂停） */
.b-nicks-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.b-nicks-label { flex: none; font-size: 12px; color: var(--vups-muted); }
.b-marquee { flex: 1; min-width: 0; overflow: hidden; }
.b-marquee-track { display: flex; width: max-content; }
.b-nick-set { display: flex; gap: 8px; padding-right: 8px; }
.b-marquee .b-nick-set + .b-nick-set { display: none; }
.b-marquee.on .b-nick-set + .b-nick-set { display: flex; }
.b-marquee.on .b-marquee-track { animation: b-marquee-scroll linear infinite; }
.b-marquee:hover .b-marquee-track { animation-play-state: paused; }
@keyframes b-marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.gift-desc-box { min-height: 38px; display: flex; align-items: center; }
.gift-desc { white-space: nowrap; font-size: 13px; color: var(--vups-muted); }
.b-nick { flex: none; font-size: 12px; padding: 2px 12px; border-radius: 999px;
  border: 1px solid var(--vups-border); color: var(--vups-muted); white-space: nowrap; }

/* 文件柜卡：条目预览胶囊（单行，装满即止，JS 控制 +N） */
.f-entries { display: flex; flex-wrap: nowrap; gap: 8px; overflow: hidden; margin-top: 12px; }
.f-entry { display: inline-block; flex: none; max-width: 260px; padding: 4px 12px;
  border: 1px solid var(--vups-border); border-radius: 999px; font-size: 13px;
  color: var(--vups-text); text-decoration: none !important;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.f-entry:hover { border-color: var(--vups-primary); color: var(--vups-primary); }
.f-entry-more { border-style: dashed; color: var(--vups-muted); }

/* 艺术长廊图集卡：标题行 + 等高 1:1 缩略图横条（装满即止，放不下整张隐藏） */
.gallery-item-card { margin-bottom: 18px; }
.g-head { display: flex; align-items: flex-start; gap: 12px; }
.g-name { flex: 1; min-width: 0; }
.g-head .title { display: block; font-weight: 600; font-size: 16px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-head .meta { white-space: nowrap; font-size: 12px; color: var(--vups-muted); margin-top: 2px; }
.g-desc { flex: none; max-width: 55%; margin: 3px 0 0; font-size: 13px; color: var(--vups-muted);
  text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-right { display: flex; align-items: center; gap: 8px; flex: none; max-width: 70%;
  justify-content: flex-end; min-width: 0; }
.g-right .g-desc { max-width: none; flex: 0 1 auto; margin: 0; }
.count-pill { flex: none; font-size: 12px; padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--vups-border); color: var(--vups-muted); white-space: nowrap; }
.g-thumbs { display: flex; gap: 8px; overflow: hidden; margin-top: 12px; }
.g-thumb-link { flex: none; }
.g-thumbs img { width: 110px; height: 110px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--vups-border); display: block; }
.g-more { width: 110px; height: 110px; flex: none; display: none;
  align-items: center; justify-content: center;
  border: 1px dashed var(--vups-muted); border-radius: 10px;
  font-size: 20px; font-weight: 700; color: var(--vups-muted);
  background: color-mix(in srgb, var(--vups-accent) 30%, transparent);
  text-decoration: none !important; }

.section { margin: 26px 0; }
.section > h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.section > h2 .badge { font-weight: 400; }

.item-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px dashed var(--vups-border);
}
.item-row:last-child { border-bottom: none; }
.item-row .grow { flex: 1; min-width: 0; }
.item-row .title { font-weight: 600; }
.item-row .meta { font-size: 12px; color: var(--vups-muted); }

/* 图集 */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.gallery-grid figure { margin: 0; position: relative; }
.gallery-grid img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px;
  border: 1px solid var(--vups-border); cursor: zoom-in; display: block;
}
.gallery-grid figcaption { font-size: 12px; color: var(--vups-muted); margin-top: 4px; text-align: center; }

/* 文章 */
.article-body { font-size: 16px; overflow-wrap: break-word; }
.article-body img { max-width: 100%; height: auto; border-radius: 12px; }
.article-body blockquote {
  margin: 12px 0; padding: 10px 16px; border-left: 4px solid var(--vups-primary);
  background: color-mix(in srgb, var(--vups-accent) 45%, transparent); border-radius: 8px;
}
.article-body pre { background: #2b2b33; color: #f2f2f2; padding: 14px; border-radius: 10px; overflow-x: auto; }

/* 留言板 */
.msg-item { padding: 12px 0; border-bottom: 1px dashed var(--vups-border); }
.msg-item .nick { font-weight: 700; color: var(--vups-primary); }
.msg-item .time { font-size: 12px; color: var(--vups-muted); margin-left: 8px; }
.msg-item.masked .body em { color: #c0392b; font-style: normal; }

/* 放映模式 */
body.slide-mode { background: #101018; color: #fff; }
.slide-stage { height: 100vh; display: flex; align-items: center; justify-content: center; padding: 6vh 8vw; }
.slide-card {
  max-width: 760px; width: 100%; text-align: center;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px; padding: 48px 40px;
}
.slide-card .nick { font-size: 18px; color: #ffd3e0; }
.slide-card .body { font-size: 26px; margin: 18px 0; white-space: pre-wrap; }
.slide-card .time { color: rgba(255,255,255,.45); font-size: 13px; }
.slide-dots { position: fixed; bottom: 18px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.4); font-size: 13px; }
.slide-exit { position: fixed; top: 16px; right: 20px; }

/* 周表 */
.week-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.week-table th, .week-table td { padding: 10px 12px; border-bottom: 1px solid var(--vups-border); text-align: left; }
.week-table th { color: var(--vups-muted); font-weight: 500; font-size: 13px; }
.week-table .time { white-space: nowrap; color: var(--vups-primary); font-variant-numeric: tabular-nums; }
.week-table td:first-child { white-space: nowrap; }

/* 前台通用 modal（兑换二次确认等） */
.modal-mask { position: fixed; inset: 0; z-index: 200; display: flex;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(0, 0, 0, .45); }
.modal-card { background: var(--vups-card); border: 1px solid var(--vups-border);
  border-radius: var(--vups-radius); padding: 24px; max-width: 420px; width: 100%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .2); }

/* 礼物详情：京东式左右布局（图左信息右），窄屏堆叠 */
.gift-detail-grid { display: flex; gap: 26px; align-items: stretch; }
.gift-detail-img { flex: 0 0 400px; max-width: 45%; aspect-ratio: 1; }
.gift-detail-img img { width: 100%; height: 100%; object-fit: cover;
  border-radius: var(--vups-radius); border: 1px solid var(--vups-border); }
.gift-detail-info { flex: 1; min-width: 0; }
@media (max-width: 768px) {
  .gift-detail-grid { flex-direction: column; }
  .gift-detail-img { flex: none; max-width: 100%; width: 100%; }
}
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--vups-border);
  border-radius: 10px; overflow: hidden; }
.qty-stepper button { width: 34px; height: 34px; border: none; background: transparent;
  font-size: 16px; cursor: pointer; color: var(--vups-text); }
.qty-stepper button:hover { background: var(--vups-accent); }
.qty-stepper input { width: 52px; height: 34px; border: none; text-align: center;
  font-size: 14px; background: transparent; color: var(--vups-text);
  border-left: 1px solid var(--vups-border); border-right: 1px solid var(--vups-border); }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none; }

/* 礼物 */
.gift-card { text-align: center; }
.gift-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; border: 1px solid var(--vups-border); }
.gift-thumb-wrap { position: relative; }
.redeem-pill { position: absolute; right: 8px; bottom: 8px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px;
  padding: 2px 10px; border-radius: 999px; pointer-events: none; }
.gift-card .price { color: var(--vups-primary); font-weight: 700; }

.copy-diange { min-width: 124px; text-align: center; }   /* 反馈「✓ 已复制」时宽度不变 */

/* 歌曲点唱：固定列网格，备注列各行水平对齐（列宽用 fr，与内容无关） */
.song-row {
  display: grid; align-items: center; gap: 10px; padding: 10px 4px;
  grid-template-columns: auto minmax(0, 3fr) minmax(0, 1.6fr) auto auto;
  border-bottom: 1px dashed var(--vups-border);
}
.song-row:last-child { border-bottom: none; }
.song-row .s-main { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.song-row .s-title { font-weight: 600; flex: 0 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-row .s-artist { font-size: 13px; color: var(--vups-muted); flex: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-row .s-note { font-size: 12px; color: var(--vups-muted); padding-left: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-row .s-unlock { width: 132px; text-align: right; font-size: 12px;    /* 定宽保证各行备注列对齐 */
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .song-row { display: flex; flex-wrap: wrap; }
  .song-row .s-main { flex-wrap: wrap; }
  .song-row .s-note { padding-left: 0; }
}
.style-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.style-chips a, .style-chips button.chip {
  padding: 4px 14px; border-radius: 999px; border: 1px solid var(--vups-border); font-size: 13px;
  color: var(--vups-text); text-decoration: none !important; cursor: pointer;
  background: transparent; font-family: inherit; line-height: 1.6;
}
.style-chips a.active, .style-chips button.chip.active { background: var(--vups-primary); border-color: var(--vups-primary); color: var(--vups-primary-text); }

/* 页脚 */
.vups-footer { border-top: 1px solid var(--vups-border); margin-top: 40px; padding: 22px 0;
  color: var(--vups-muted); font-size: 13px; text-align: center; }
.vups-footer { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 14px; }
.footer-links a { color: var(--vups-muted); }

/* 分页 */
.pager { display: flex; gap: 8px; align-items: center; margin: 18px 0; font-size: 14px; }
.pager a, .pager span.cur { padding: 4px 12px; border-radius: 8px; border: 1px solid var(--vups-border); }
.pager span.cur { background: var(--vups-primary); color: var(--vups-primary-text); border-color: var(--vups-primary); }
.pager .info { color: var(--vups-muted); }

@media (max-width: 640px) {
  .vups-nav .inner { height: auto; flex-wrap: wrap; padding: 8px 0; }
  .slide-card .body { font-size: 20px; }
  .container { padding: 0 14px; }
}

/* 前台页眉用户区：头像 + 昵称 */
.nav-user { display: inline-flex; align-items: center; gap: 8px; padding: 2px 4px;
  border-radius: 999px; text-decoration: none !important; color: var(--vups-text); }
.nav-user:hover { background: var(--vups-accent); }
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--vups-border); display: inline-flex; align-items: center;
  justify-content: center; font-size: 14px; }
.nav-avatar-text { background: var(--vups-accent); }
.nav-username { font-size: 14px; max-width: 10em; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }

/* 前台页眉用户菜单（点击头像/昵称弹出） */
.nav-user-menu { position: relative; }
.nav-user-menu .nav-user { background: transparent; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px;
  border-radius: 999px; color: var(--vups-text); font-family: inherit; }
.nav-user-menu .nav-user:hover { background: var(--vups-accent); }
.nav-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--vups-card); border: 1px solid var(--vups-border);
  border-radius: 12px; box-shadow: 0 10px 32px rgba(0,0,0,.14);
  min-width: 132px; padding: 6px; z-index: 120; }
.nav-user-menu.open .nav-dropdown { display: block; }
.nav-dropdown a { display: block; padding: 8px 12px; border-radius: 8px;
  font-size: 14px; color: var(--vups-text); text-decoration: none !important; }
.nav-dropdown a:hover { background: var(--vups-accent); }
.nav-dropdown .nav-logout { color: #c0392b; }
