:root {
  --bg-color: #f7f7f7;
  --text-color: #222222;
  --primary-color: #1e90ff;
  --secondary-color: #555555;
  --button-bg: #1e90ff;
  --button-hover-bg: #3aa0ff;
  --border-color: #ddd;
}
:root.dark {
  --bg-color: #121212;
  --text-color: #eee;
  --primary-color: #4a90e2;
  --secondary-color: #bbb;
  --button-bg: #4a90e2;
  --button-hover-bg: #65a1f4;
  --border-color: #333;
}

html, body {
  height: 100%;
  margin: 0; padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: "Segoe UI","Tahoma","Geneva","Verdana",sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: auto
}

.live-room-wrapper {
  background: var(--bg-color);
  box-shadow: 0 0 30px rgba(0,0,0,0.15);
  border-radius: 16px;
  width: 95vw;
  max-width: 1800px;
  height: 85vh;
  display: flex;
  flex-direction: row;
  border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
  .live-room-wrapper {
    flex-direction: column;
    height: auto;
    max-height: 95vh;
  }
}

.video-container {
  flex: 3;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
#mse {
  width: 100%;
  max-width: 860px;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  background-color: #000;
  box-shadow: 0 8px 30px rgba(0,0,0,0.7);
  position: relative; /* 关键，绝对定位参考 */
}

/* 左上角线路标签 */
#lineLabel {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: rgba(30, 30, 60, 0.8);
  color: #eee;
  padding: 6px 12px;
  font-weight: 600;
  border-radius: 12px;
  font-size: 0.85rem;
  pointer-events: none;
  user-select: none;
  box-shadow: 0 0 8px var(--primary-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  z-index: 20;
}

:root.dark #lineLabel {
  background-color: rgba(80, 80, 120, 0.9);
  color: #eee;
}

.sidebar {
  flex: 1;
  background-color: var(--primary-color);
  padding: 20px;
  border-radius: 0 16px 16px 0;
  display: flex;
  flex-direction: column;
  color: white;
}

@media (max-width: 768px) {
  .sidebar {
    border-radius: 0 0 16px 16px;
    padding: 20px;
    flex-direction: column;
  }
}

.anchor-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}
.anchor-pic {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 12px;
  border: 3px solid rgba(255,255,255,0.7);
  box-shadow: 0 0 12px rgba(255,255,255,0.5);
}

@media (max-width: 768px) {
  .anchor-pic {
    width: 60px;
    height: 60px;
  }
}

.anchor-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.anchor-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.anchor-desc {
  font-size: 1rem;
  opacity: 0.8;
  text-align: center;
}
@media (max-width: 768px) {
  .anchor-desc {
    font-size: 0.8rem;
  }
}

/* 按钮组 */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 768px) {
  .button-group {
    flex-direction: column;
  }
}

.btn {
  background-color: var(--button-bg);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

.btn:hover, .btn:focus {
  background-color: var(--button-hover-bg);
  outline: none;
}

.theme-toggle-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
  transition: background-color 0.3s ease;
  z-index: 1000;
}
.theme-toggle-btn:hover {
  background-color: var(--button-hover-bg);
}

.xgplayer-controller {
  background-color: rgba(30, 30, 60, 0.8) !important;
  border-radius: 0 0 12px 12px;
  box-shadow: inset 0 0 8px var(--primary-color);
}

/* 线路切换按钮组 */
.line-switcher {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: nowrap;
  max-width: 860px; /* 保持与播放器宽度匹配 */
  margin-left: auto;
  margin-right: auto;
}
.line-btn {
  padding: 8px 20px;
  background: var(--button-bg);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  transition: background-color 0.3s;
  flex: 1 1 auto;
  text-align: center;
  min-width: 100px;
}
.line-btn.active,
.line-btn:hover {
  background: var(--button-hover-bg);
}

/* 移动端横向滚动支持 */
@media (max-width: 768px) {
  .line-switcher {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .line-btn {
    flex: 0 0 auto;
    min-width: 120px;
  }
}
