:root {
  --blue: #0078d4;
  --orange: #ff6b35;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #222;
  --muted: #888;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  height: 100vh; display: flex; flex-direction: column;
}
header {
  background: var(--blue); color: #fff; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
header h1 { font-size: 18px; margin: 0; }
header small { opacity: .8; font-size: 12px; }
.server { font-size: 12px; }
.server input { width: 200px; padding: 4px 6px; border: none; border-radius: 4px; }

.tabs { display: flex; background: var(--card); border-bottom: 1px solid #e3e8ef; }
.tab {
  flex: 1; padding: 12px; border: none; background: none; cursor: pointer;
  font-size: 15px; color: var(--muted); border-bottom: 3px solid transparent;
}
.tab.active { color: var(--blue); border-bottom-color: var(--orange); font-weight: 600; }

.panel { display: none; flex: 1; overflow: hidden; flex-direction: column; padding: 16px; }
.panel.active { display: flex; }

/* chat */
.messages { flex: 1; overflow-y: auto; padding: 8px; }
.msg { max-width: 75%; padding: 10px 14px; border-radius: 12px; margin: 8px 0; white-space: pre-wrap; line-height: 1.5; }
.msg.user { background: var(--blue); color: #fff; margin-left: auto; }
.msg.bot { background: var(--card); border: 1px solid #e3e8ef; }
.msg img { max-width: 200px; border-radius: 8px; display: block; margin-top: 6px; }
.composer { display: flex; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid #e3e8ef; }
.composer textarea { flex: 1; resize: none; padding: 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; }
.composer button, .form button {
  background: var(--orange); color: #fff; border: none; padding: 10px 18px;
  border-radius: 8px; cursor: pointer; font-size: 15px;
}
.imgbtn { cursor: pointer; font-size: 22px; }
.imgname { font-size: 12px; color: var(--muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ppt */
.form { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.form label { display: flex; flex-direction: column; font-size: 13px; gap: 4px; }
.form label.check { flex-direction: row; align-items: center; gap: 6px; }
.form input[type=text], .form input:not([type]), .form input[type=number] {
  padding: 8px; border: 1px solid #ccc; border-radius: 6px; min-width: 280px;
}
.form input[type=number] { min-width: 80px; }
.status { color: var(--blue); font-weight: 600; }
.hint { color: var(--muted); font-size: 13px; }

/* realtime */
.rt-controls { display: flex; gap: 12px; align-items: center; }
.rt-controls button { padding: 10px 18px; border: none; border-radius: 8px; cursor: pointer; font-size: 15px; }
#rtStart { background: var(--orange); color: #fff; }
#rtStop { background: #ddd; }
.rt-log { flex: 1; overflow-y: auto; margin-top: 12px; font-size: 14px; }
.rt-line { padding: 6px 10px; margin: 4px 0; border-radius: 8px; max-width: 80%; }
.rt-line.you { background: var(--blue); color: #fff; margin-left: auto; }
.rt-line.ai { background: var(--card); border: 1px solid #e3e8ef; }
