html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}
body {
  display: flex;
  flex-direction: column;
}
/* 移除原来的orientation检测 */
/* @media screen and (orientation: landscape) {
  body::before {
    content: "请旋转手机到竖屏模式";
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: #f5f5f5;
    color: #222;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #app,
  .player-container,
  .chat-container,
  .live-header {
    display: none !important;
  }
} */

/* 使用CSS自定义属性控制横屏提示 */
body.landscape-mode::before {
  content: "请旋转手机到竖屏模式";
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: #f5f5f5;
  color: #222;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.landscape-mode #app,
body.landscape-mode .player-container,
body.landscape-mode .chat-container,
body.landscape-mode .live-header {
  display: none !important;
}
input:disabled,
button:disabled {
  background: #f5f5f5 !important;
  color: #bbb !important;
  border-color: #eee !important;
  cursor: not-allowed !important;
  opacity: 0.7;
}
button:focus,
button:active {
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

.player-container {
  flex: 0 0 260px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.live-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 48px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  font-size: 17px;
  font-weight: 500;
  color: #222;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  z-index: 2;
}
.live-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exit-btn {
  color: #aaa;
  border: none;
  background: none;
  font-size: 12px;
  cursor: pointer;
  margin-left: 12px;
  transition: background 0.2s;
}
.exit-btn:active {
  color: #bbb;
}
.chat-container {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  padding-top: 5px;
}
.chat-messages {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 12px;
  font-size: 15px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 3%,
    #000 100%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 3%,
    #000 100%,
    transparent 100%
  );
}
.chat-message {
  display: flex;
  margin-bottom: 12px;
  word-break: break-all;
}
.chat-message.left {
  flex-direction: row;
  justify-content: flex-start;
}

.chat-message.left .chat-username {
  font-size: 13px;
  color: #888;
  margin: 0 0 2px 0;
  padding-left: 2px;
}
.chat-message.right {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.chat-message.right .chat-username {
  font-size: 13px;
  color: #888;
  text-align: end;
  margin: 0 0 2px 0;
  padding-left: 2px;
}
.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin: 0 8px;
  background: #eee;
  object-fit: cover;
}
.chat-bubble {
  max-width: 70vw;
  padding: 10px 14px;
  border-radius: 10px;
  position: relative;
  font-size: 15px;
  line-height: 1.5;
  box-sizing: border-box;
  word-break: break-word;
  background: #fff;
  color: #222;
}
.chat-message.left .chat-bubble {
  background: #fff;
  color: #222;
  border-top-left-radius: 4px;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  border-bottom-left-radius: 10px;
  border: 1px solid #eee;
}
.chat-message.right .chat-bubble {
  background: #95ec69;
  color: #222;
  border-top-right-radius: 4px;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  border: 1px solid #95ec69;
}
.chat-input-bar {
  display: flex;
  padding: 8px 12px;
  border-top: 1px solid #eee;
  background: #fff;
}
.chat-input-bar input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 15px;
  outline: none;
  margin-right: 8px;
}
.chat-input-bar button {
  background: #007aff;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}
.chat-input-bar button:active {
  background: #005bb5;
}
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.dialog-overlay.show {
  opacity: 1;
  visibility: visible;
}
.dialog {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 80%;
  max-width: 320px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transform: scale(0.7);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.dialog-overlay.show .dialog {
  transform: scale(1);
  opacity: 1;
}
.dialog-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 16px;
  text-align: center;
  color: #333;
}
.dialog-input {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  font-size: 16px;
  margin-bottom: 16px;
  box-sizing: border-box;
  outline: none;
}
.dialog-input:focus {
  border-color: #007aff;
}
.dialog-button {
  width: 100%;
  background: #007aff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.dialog-button:active {
  background: #005bb5;
}
.phone-input-error {
  color: red;
  font-size: 14px;
  margin-bottom: 16px;
}
.signin-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.signin-overlay.show {
  opacity: 1;
  visibility: visible;
}
.signin-dialog {
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  position: relative;
}
.signin-overlay.show .signin-dialog {
  transform: translateY(0);
}
.signin-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 16px;
  text-align: center;
  color: #333;
}
.signin-description {
  font-size: 14px;
  color: #666;
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.5;
}
.signin-button {
  width: 100%;
  background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}
.signin-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}
.signin-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}
.signin-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.signin-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0, 0, 0, 0.1);
  color: #666;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 1;
}

.signin-close-btn:hover {
  background: rgba(0, 0, 0, 0.2);
  color: #333;
}

.signin-close-btn:active {
  background: rgba(0, 0, 0, 0.3);
  transform: scale(0.95);
}
