/* 客服+翻译通用样式 */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --bg: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 4px 20px rgba(0,0,0,0.15);
  --radius: 12px;
  --z-chat: 99999;
  --z-globe: 99998;
}

/* 客服浮窗按钮 */
.ys-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: var(--z-chat);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.ys-chat-btn:hover { transform: scale(1.1); box-shadow: 0 6px 25px rgba(99,102,241,0.4); }

/* 客服对话框 */
.ys-chat-dialog {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 360px;
  max-height: 520px;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: var(--z-chat);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
}
.ys-chat-dialog.open { display: flex; }
.ys-chat-header {
  background: var(--primary);
  color: white;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ys-chat-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 18px;
  opacity: 0.8;
}
.ys-chat-close:hover { opacity: 1; }
.ys-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  min-height: 200px;
  max-height: 350px;
}
.ys-msg {
  margin-bottom: 10px;
  padding: 8px 14px;
  border-radius: 16px;
  max-width: 85%;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}
.ys-msg.user {
  background: var(--primary);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.ys-msg.bot {
  background: #f3f4f6;
  color: var(--text);
  margin-right: auto;
  border-bottom-left-radius: 4px;
}
.ys-msg.typing {
  background: #f3f4f6;
  color: var(--text-muted);
  margin-right: auto;
  border-bottom-left-radius: 4px;
  font-style: italic;
}
.ys-chat-input-wrap {
  display: flex;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  gap: 8px;
}
.ys-chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
  outline: none;
}
.ys-chat-input:focus { border-color: var(--primary); }
.ys-chat-send {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 地球翻译按钮 */
.ys-globe-btn {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: var(--z-globe);
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-size: 20px;
  line-height: 1;
  transition: transform 0.2s;
}
.ys-globe-btn:hover { transform: scale(1.1); }

/* 翻译下拉菜单 */
.ys-lang-menu {
  position: fixed;
  top: 48px;
  right: 12px;
  z-index: var(--z-globe);
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  min-width: 140px;
  overflow: hidden;
}
.ys-lang-menu.open { display: flex; }
.ys-lang-item {
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  color: var(--text);
  transition: background 0.15s;
}
.ys-lang-item:hover { background: #f3f4f6; }
.ys-lang-item:not(:last-child) { border-bottom: 1px solid #f3f4f6; }
