/* ==========================================================================
   LiveHub · 全站设计系统（冰感冷调 r25+）
   深蓝黑底 + 冰蓝主色 + 浅金点缀 · 移动优先 · 全站深色
   规范：配色由用户确认，禁止改动色值；如需微调用同色系明暗变体。
   ========================================================================== */

:root {
  /* ---- 基础色板（用户确认，勿改） ---- */
  --bg:            #07090f;   /* 页面底色：深蓝黑 */
  --bg-2:          #0b0e17;   /* 次级底色 */
  --card:          rgba(17, 23, 38, .9);  /* 卡片 */
  --primary:       #7fb8e8;   /* 主色：冰蓝 */
  --primary-lite:  #eaf6ff;   /* 亮主色 */
  --text:          #eef4fb;   /* 主文字 */
  --text-2:        #a6b3c8;   /* 次文字 */
  --text-3:        #68758c;   /* 弱文字 */
  --gold:          #e6c887;   /* 浅金 */
  --gold-lite:     #f3dfae;   /* 亮金 */
  --green:         #7fd0b0;   /* 绿：成功/在线 */
  --warn:          #ffb454;   /* 暖橙：直播中/警示/重点（无红色调） */

  /* ---- 派生语义色（可随上面微调，勿写死偏离色板） ---- */
  --primary-soft:  rgba(127, 184, 232, .14);  /* 冰蓝淡底 */
  --primary-line:  rgba(127, 184, 232, .32);  /* 冰蓝描边 */
  --gold-soft:     rgba(230, 200, 135, .16);  /* 浅金淡底 */
  --line:          rgba(166, 179, 200, .10);  /* 分隔线/描边 */
  --line-strong:   rgba(166, 179, 200, .18);
  --warn-soft:     rgba(255, 180, 84, .15);
  --green-soft:    rgba(127, 208, 176, .14);
  --shadow:        0 10px 30px rgba(0, 0, 0, .35);
  --shadow-sm:     0 4px 14px rgba(0, 0, 0, .28);
  --blur:          14px;      /* 玻璃拟态模糊 */
  --grad-live:     linear-gradient(135deg, #0b0e17 0%, #10182a 100%);
  --grad-primary:  linear-gradient(135deg, #7fb8e8 0%, #5d9bd4 100%);
  --grad-gold:     linear-gradient(135deg, #f3dfae 0%, #e6c887 100%);

  /* ---- 圆角 / 字距 / 动效 ---- */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-full: 999px;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 22px;
  --fs-3xl: 28px;
  --ease: cubic-bezier(.22, .8, .3, 1);
}

/* ============================ 基础 ============================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background:
    radial-gradient(1200px 500px at 78% -10%, rgba(127,184,232,.08), transparent 60%),
    radial-gradient(900px 460px at -10% 18%, rgba(127,184,232,.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--fs-md);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-lite); }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; color: var(--primary-lite); }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(127,184,232,.22); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(127,184,232,.38); }
::-webkit-scrollbar-track { background: transparent; }

::selection { background: rgba(127,184,232,.32); color: #fff; }

/* ============================ 布局容器 ============================ */
.page { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.page-narrow { max-width: 520px; }
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.center { justify-content: center; align-items: center; }
.hide { display: none !important; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.gold { color: var(--gold-lite); }
.green { color: var(--green); }
.red, .warn { color: var(--warn); }
.ice { color: var(--primary); }
.sm { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.tac { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* 主内容顶部留白（给吸底导航/顶栏让位） */
.with-topbar { padding-top: calc(64px + env(safe-area-inset-top)); }
.with-bottombar { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

/* ============================ 顶栏 ============================ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 64px; display: flex; align-items: center;
  background: rgba(7, 9, 15, .72);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1120px; margin: 0 auto; width: 100%; padding: 0 16px;
  display: flex; align-items: center; gap: 14px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: var(--fs-xl); letter-spacing: .3px; color: var(--primary-lite); }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--grad-primary); color: #06223a; box-shadow: 0 0 18px rgba(127,184,232,.5); }
.logo em { font-style: normal; color: var(--gold-lite); }

.topbar .nav { display: flex; gap: 4px; margin-left: 6px; }
.topbar .nav a { padding: 8px 13px; border-radius: var(--r-full); color: var(--text-2);
  font-size: var(--fs-md); font-weight: 500; transition: all .18s var(--ease); }
.topbar .nav a:hover { color: var(--primary-lite); background: rgba(127,184,232,.08); }
.topbar .nav a.active { color: var(--bg); background: var(--grad-primary); font-weight: 700; }

.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
@media (max-width: 640px) {
  .topbar .nav a span.lbl { display: none; }          /* 窄屏只留图标 */
  .topbar .nav a { font-size: var(--fs-lg); padding: 6px 9px; }
}

/* 吸底导航（移动端主导航） */
.bottombar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 99;
  height: calc(62px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(7, 9, 15, .8);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  border-top: 1px solid var(--line);
  display: none;
}
.bottombar nav { height: 100%; display: flex; }
.bottombar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--text-3); font-size: 10px; transition: color .2s var(--ease); }
.bottombar a .ico { font-size: 20px; line-height: 1; }
.bottombar a.active, .bottombar a:hover { color: var(--primary); }
.bottombar a.active .ico { color: var(--primary); filter: drop-shadow(0 0 6px rgba(127,184,232,.6)); }
@media (max-width: 640px) {
  .bottombar { display: block; }
  .only-desktop { display: none !important; }
}
@media (min-width: 641px) { .only-mobile { display: none !important; } }

/* ============================ 按钮 ============================ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 22px; border-radius: var(--r-full); font-weight: 600; font-size: var(--fs-md);
  color: var(--text); background: rgba(166,179,200,.12); border: 1px solid transparent;
  transition: all .18s var(--ease); white-space: nowrap; user-select: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { color: #06223a; background: var(--grad-primary);
  box-shadow: 0 6px 18px rgba(127,184,232,.25); }
.btn-primary:hover { filter: brightness(1.08); color: #06223a; }

.btn-gold { color: #2a2010; background: var(--grad-gold);
  box-shadow: 0 6px 18px rgba(230,200,135,.22); }
.btn-gold:hover { filter: brightness(1.06); color: #2a2010; }

.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary-line); }
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary-lite); }

.btn-danger { color: #241505; background: linear-gradient(135deg, #ffd59a, #ffb454);
  box-shadow: 0 6px 18px rgba(255,180,84,.22); }

.btn-soft { background: var(--primary-soft); color: var(--primary-lite); }
.btn-soft:hover { background: rgba(127,184,232,.22); }

.btn-lg { padding: 14px 30px; font-size: var(--fs-lg); border-radius: var(--r-lg); }
.btn-sm { padding: 6px 14px; font-size: var(--fs-sm); border-radius: var(--r-full); }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 18px;
  background: rgba(166,179,200,.1); color: var(--text-2); }
.btn-icon:hover { background: var(--primary-soft); color: var(--primary-lite); }

/* ============================ 卡片 ============================ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: var(--shadow-sm); }
.card-hover { transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease); }
.card-hover:hover { transform: translateY(-3px); border-color: var(--primary-line);
  box-shadow: 0 14px 34px rgba(0,0,0,.4); }
.glass { background: rgba(11,14,23,.6); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); }

.section-title { display: flex; align-items: center; gap: 10px; margin: 22px 0 14px; font-size: var(--fs-xl); }
.section-title::before { content: ""; width: 4px; height: 18px; border-radius: 4px;
  background: var(--grad-primary); box-shadow: 0 0 10px rgba(127,184,232,.6); }
.section-title small { font-weight: 400; color: var(--text-3); font-size: var(--fs-sm); margin-left: auto; }

/* ============================ 头像 ============================ */
.avatar { position: relative; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center;
  color: #06223a; font-weight: 800; background: var(--grad-primary); user-select: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 26px; height: 26px; font-size: 12px; }
.avatar-sm { width: 36px; height: 36px; font-size: 15px; }
.avatar-md { width: 46px; height: 46px; font-size: 18px; }
.avatar-lg { width: 68px; height: 68px; font-size: 26px; }
.avatar .dot-live { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%;
  background: var(--warn); border: 2px solid var(--bg); box-shadow: 0 0 0 1px rgba(255,180,84,.5), 0 0 8px rgba(255,180,84,.8); }

/* ============================ 输入控件 ============================ */
.field { margin-bottom: 16px; }
.field > label { display: block; margin-bottom: 7px; font-size: var(--fs-sm); color: var(--text-2); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--r); font-size: var(--fs-md);
  background: rgba(7,9,15,.5); color: var(--text);
  border: 1px solid var(--line-strong); outline: none; transition: all .18s var(--ease); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(127,184,232,.15); }
.select { appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a6b3c8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.select option { background: var(--bg-2); color: var(--text); }
.textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.control-with-icon { position: relative; }
.control-with-icon .input { padding-left: 40px; }
.control-with-icon > svg, .control-with-icon > .lead { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.input-hint { font-size: var(--fs-xs); color: var(--text-3); margin-top: 5px; }

/* 开关(segmented) */
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-full); background: rgba(7,9,15,.6);
  border: 1px solid var(--line); gap: 2px; }
.seg button { padding: 8px 18px; border-radius: var(--r-full); font-weight: 600; color: var(--text-2); transition: all .18s var(--ease); }
.seg button.on { background: var(--grad-primary); color: #06223a; box-shadow: 0 2px 8px rgba(127,184,232,.3); }

/* 标签/徽标 */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 600; }
.badge-live { color: var(--warn); background: var(--warn-soft); border: 1px solid rgba(255,180,84,.35); }
.badge-lock { color: var(--gold-lite); background: var(--gold-soft); border: 1px solid rgba(230,200,135,.3); }
.badge-cat { color: var(--primary); background: var(--primary-soft); border: 1px solid var(--primary-line); }
.badge-tag { color: var(--text-2); background: rgba(166,179,200,.1); }
.badge-online { color: var(--green); background: var(--green-soft); }

/* ============================ 直播卡片(大厅) ============================ */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.live-card { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--bg-2);
  border: 1px solid var(--line); cursor: pointer; transition: all .22s var(--ease);
  aspect-ratio: 9 / 12; display: flex; flex-direction: column; }
.live-card:hover { transform: translateY(-4px); border-color: var(--primary-line); box-shadow: var(--shadow); }
.live-cover { position: relative; flex: 1; overflow: hidden; background: var(--grad-live); }
.live-cover img, .live-cover .cover-poster { width: 100%; height: 100%; object-fit: cover; }
.live-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(7,9,15,.88)); }
.live-cover .cover-grad { width: 100%; height: 100%; display: grid; place-items: center; font-size: 40px; }
.cover-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px; z-index: 2; }
.cover-text h3 { font-size: var(--fs-md); color: var(--primary-lite); display: flex; align-items: center; gap: 6px; }
.cover-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; }
.live-marks { position: absolute; top: 10px; left: 10px; z-index: 3; display: flex; gap: 6px; flex-wrap: wrap; }
.live-topright { position: absolute; top: 10px; right: 10px; z-index: 3; display: flex; gap: 6px; }

.live-host { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: rgba(7,9,15,.4); }
.live-host .hname { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.live-host .htip { font-size: var(--fs-xs); color: var(--text-3); }

.online-num { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-size: var(--fs-xs); font-weight: 600; }
.online-num::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 6px rgba(127,208,176,.8); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ============================ 弹幕 & 直播间输入 ============================ */
.danmu-list { display: flex; flex-direction: column; gap: 2px; }
.danmu-row { display: flex; gap: 8px; align-items: baseline; padding: 5px 8px; border-radius: 8px; }
.danmu-row:hover { background: rgba(166,179,200,.05); }
.danmu-row .sender { color: var(--text-2); font-weight: 600; flex: none; }
.danmu-row.sys .sender { color: var(--gold); }
.danmu-row .txt { word-break: break-word; }

/* 礼物飞屏等动效动画 */
@keyframes floatUp { 0% { opacity: 0; transform: translateY(16px) scale(.8); } 12% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }
@keyframes popIn { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.float-enter { animation: floatUp 2.4s var(--ease) forwards; }
.pop-enter { animation: popIn .35s var(--ease) both; }

/* ============================ 聊天输入条(直播间/广场) ============================ */
.composer { display: flex; gap: 10px; align-items: flex-end; }
.composer .input { flex: 1; resize: none; max-height: 96px; }

/* ============================ 动态广场 ============================ */
.moment { display: flex; gap: 14px; padding: 16px; }
.moment-body { flex: 1; min-width: 0; }
.moment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.moment-head .who { font-weight: 700; color: var(--text); }
.moment-head .time { color: var(--text-3); font-size: var(--fs-xs); }
.moment-text { margin-bottom: 10px; white-space: pre-wrap; word-break: break-word; }
.moment-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.moment-imgs img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line); }
.moment-actions { display: flex; align-items: center; gap: 18px; color: var(--text-3); font-size: var(--fs-sm); }
.moment-actions button { color: var(--text-3); display: inline-flex; align-items: center; gap: 5px; transition: color .16s; }
.moment-actions button:hover, .moment-actions button.liked { color: var(--warn); }

/* ============================ 弹窗 / 底部抽屉 ============================ */
.overlay { position: fixed; inset: 0; z-index: 200; background: rgba(2,3,6,.6);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 18px; animation: fadeIn .2s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { width: 100%; max-width: 440px; max-height: 88vh; overflow: auto;
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: var(--r-xl);
  padding: 22px; box-shadow: var(--shadow); animation: popIn .28s var(--ease); }
.modal h3 { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.sheet-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: var(--bg-2); border-top: 1px solid var(--line-strong); border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.5);
  animation: slideUp .28s var(--ease); max-height: 85vh; overflow: auto; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.close-x { width: 32px; height: 32px; border-radius: 50%; color: var(--text-3); font-size: 16px;
  display: grid; place-items: center; }
.close-x:hover { background: rgba(166,179,200,.12); color: var(--text); }

/* ============================ Toast ============================ */
#toast-box { position: fixed; top: calc(70px + env(safe-area-inset-top)); left: 0; right: 0; z-index: 300;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { max-width: 86%; padding: 10px 20px; border-radius: var(--r-full); font-size: var(--fs-sm); font-weight: 500;
  background: rgba(11,14,23,.94); border: 1px solid var(--line-strong); color: var(--text);
  box-shadow: var(--shadow); animation: toastIn .25s var(--ease); }
.toast.ok { border-color: rgba(127,208,176,.4); }
.toast.err { border-color: rgba(255,180,84,.4); color: #ffd9a6; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ============================ 空态 / 加载 ============================ */
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty .empty-ico { font-size: 44px; margin-bottom: 10px; opacity: .7; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(127,184,232,.18);
  border-top-color: var(--primary); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: flex; justify-content: center; padding: 30px; }

/* 骨架屏占位 */
.skeleton { position: relative; overflow: hidden; background: rgba(166,179,200,.08); border-radius: var(--r); }
.skeleton::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(166,179,200,.12), transparent);
  animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ============================ 实用工具 ============================ */
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.sticky-bottom { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); }
@media (min-width: 641px) { .sticky-bottom { bottom: 16px; } }

/* 阴影下发光文字 */
.glow-text { text-shadow: 0 0 18px rgba(127,184,232,.45); }

/* ============================ SVG 图标（LiveIcons） ============================ */
.ico { display: inline-block; vertical-align: -0.18em; flex: none; }
button .ico, a .ico, .btn .ico { vertical-align: -0.16em; }
h1 .ico, h2 .ico, h3 .ico, .title .ico { vertical-align: -0.2em; }

/* 打印友好/减少动画 */
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
