﻿/* 全局可用字体定义*/
@font-face {
  font-family: "SanJiHuaChaoTi-Cu-2";
  src: url("/fonts/SanJiHuaChaoTi-Cu-2.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: "SanJiHuaChaoTi-Cu-2", system-ui, sans-serif;
  font-size: 16px;
  background: #f1f2f3 url("/img/aaa.png") center/cover fixed no-repeat;
}
header {
  padding: 0.6rem 0;
}
main {
  gap: 0.75rem;
}

/* 玻璃背景（不会影响透明度重叠）*/
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
}

/* 面板样式 */
.panel {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  transition: all .25s ease-in-out;
  padding: 1.25rem;
}
#panelBody { font-size: 14px; gap: 0.75rem !important; }

#playVideo:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ════════════════════════════════
 输入框优化：防止字体撑爆布局
════════════════════════════════ */
input {
  font-size: 0.95rem;         /* 固定字号防止因字体加载后膨胀 */
  max-width: 100%;         /* 防止被撑出容器 */
  min-width: 0;            /* 防止 flex 布局挤压 */
  padding: 0.45rem 0.65rem;
}
@media (max-width: 600px) {
  input {
    font-size: 13px;       /* 移动端字体适配 */
  }
}

/* ════════════════════════════════
 Toast 全局提示适配
════════════════════════════════ */
.toast {
  font-size: 18px;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  opacity: 0.85;
}
@media (max-width: 600px) {
  .toast {
    font-size: 15px;
    padding: 10px 14px;
    border-radius: 10px;
  }
}

/* 入场/退场动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-8px) scale(0.92); }
}
.animate-fade-in {
  animation: fadeIn 0.25s ease-out;
}
.animate-fade-out {
  animation: fadeOut 0.4s ease-in forwards;
}

/* ════════════════════════════════
 聊天消息布局增强
════════════════════════════════ */
.chat-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
  max-width: 100%;
}

.chat-item.other {
  align-items: flex-start;
}
.chat-item.self {
  align-items: flex-end;
}

/* 昵称独立一行 */
.chat-sender-line {
  font-size: 15px;
  font-weight: bold;
  color: #004d80;
  margin-bottom: 2px;
  padding: 0 4px;
  white-space: nowrap;
}
.chat-sender-line.self-name {
  align-self: flex-end;
  margin-right: 6px;
}

/* 气泡内容 */
.chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 19px;
  line-height: 1.5;
  background: #e8f4ff;
  border: 1px solid #c8e6ff;
  color: #333;
  max-width: 90vw;
  word-wrap: break-word;
}

/* 自己的消息色彩 */
.chat-item.self .chat-bubble {
  background: #cce5ff;
  border-color: #99d1ff;
  color: #0a3d62;
}

/* 透明聊天框 */
.glass-chat {
  background: rgba(255, 255, 255, 0) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #000;
}

/* 聊天内容在手机端自动缩小 */
@media (max-width: 600px) {
  .chat-bubble {
    font-size: 16px;
    padding: 8px 10px;
  }
  .chat-sender-line {
    font-size: 13px;
  }
}


/* ════════════════════════════════
 视频控制按钮布局移动端优化
════════════════════════════════ */
@media (max-width: 600px) {
  .btn-group {
    flex-direction: column !important;
  }
#tosModal {
  animation: fadeIn 0.25s ease-out;
}

#tosContent {
  background: #f9fafb;
  border-radius: 8px;
}

@media (max-width: 600px) {
  #tosModal .text-2xl { font-size: 20px; }
  #tosModal button { font-size: 14px; padding: 6px 12px; }
}
}
@keyframes fadeIn { from {opacity:.0; transform: translateY(-6px) scale(.98)} to {opacity:1; transform: translateY(0) scale(1)} }

.control-card {
  padding: 0.75rem 1rem !important;
  border-radius: 0.9rem;
}

#manualSync,
#sendChat,
#p2pRebuild,
#panel button,
#playVideo,
#panelExpandBtn {
  font-size: 0.95rem;
  padding: 0.45rem 0.9rem !important;
  border-radius: 0.65rem !important;
}
.decision-card {
  border-radius: 0.9rem !important;
}

#chatBox,
#infoSection {
  padding: 1rem !important;
}

#panel,
#chatBox,
#infoSection {
  margin-top: 1rem !important;
}

/* ƣڲϣ */
.volume-float {
  position: absolute;
  top: -50%;
  transform: translateY(-50%);
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 300;
  pointer-events: auto;
}
.volume-wrapper { position: relative; }
.volume-panel {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 10px;
  background: rgba(0,0,0,0.8);
  border-radius: 10px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  display: none;
}
.volume-panel.open { display: block; }
.volume-bar {
  width: 32px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.volume-bar:focus { outline: 2px solid rgba(255,255,255,0.35); outline-offset: 2px; }
.volume-track {
  position: relative;
  width: 8px;
  height: 110px;
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
}
.volume-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 60%;
  background: #00A1D6;
  border-radius: 999px;
}
.volume-thumb {
  position: absolute;
  left: 50%;
  transform: translate(-50%, 50%);
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.icon-volume-mute { display: none; }
.muted .icon-volume { display: none; }
.muted .icon-volume-mute { display: inline; }
@media (max-width: 600px) {
  .volume-float {
    right: 10px; top: -50%; transform: translateY(-50%);
    z-index: 400;
  }
  .volume-float .ctrl-btn {
    width: 34px;
    height: 34px;
    padding: 6px;
  }
  .volume-bar { height: 90px; width: 28px; }
  .volume-track { height: 82px; width: 7px; }
  .volume-thumb { width: 14px; height: 14px; }
}
/* ====================== 自定义光标映射 ====================== */
:root {
  --cur-pointer: url("/xiaodian/1.1.cur"), auto;
  --cur-pointer-active: url("/xiaodian/1.2.cur"), auto;
  --cur-link: url("/xiaodian/15.1.cur"), pointer;
  --cur-unavailable: url("/xiaodian/8.cur"), not-allowed;
  --cur-text: url("/xiaodian/6.cur") 4 16, text; /* 热点居中，若尺寸不同再调 */
  --cur-cross: url("/xiaodian/5.cur"), crosshair;
  --cur-busy: url("/xiaodian/4.cur"), wait;
}

body { cursor: var(--cur-pointer); }
body:active { cursor: var(--cur-pointer-active); }

button, a, [role="button"], .btn, .player-control-entity button {
  cursor: var(--cur-link);
}

input, textarea {
  cursor: var(--cur-text);
}
input:active, textarea:active {
  cursor: var(--cur-text);
}

.cursor-na, .unavailable { cursor: var(--cur-unavailable) !important; }
.cursor-cross { cursor: var(--cur-cross) !important; }
.cursor-busy, .busy { cursor: var(--cur-busy) !important; }

/* 链接点击态使用 15.2.cur */
a:active, button:active, [role="button"]:active, .btn:active, .player-control-entity button:active {
  cursor: url("/xiaodian/15.2.cur"), pointer !important;
}
