/* TS3 TTS 播报工具样式 */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  line-height: 1.5;
}

#app {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 头部 */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #16213e;
  border-radius: 8px;
  margin-bottom: 12px;
}

header h1 {
  font-size: 18px;
  font-weight: 600;
  color: #e0e0e0;
}

#status-bar {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 12px;
  background: #e74c3c;
  color: #fff;
  transition: background 0.3s;
}

#status-bar.connected {
  background: #2ecc71;
}

#status-bar.listening {
  background: #3498db;
}

/* 面板 */
.panel {
  background: #16213e;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.panel h2 {
  font-size: 14px;
  font-weight: 600;
  color: #8b8fa3;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.form-row:last-child {
  margin-bottom: 0;
}

label {
  font-size: 13px;
  color: #a0a0b0;
  white-space: nowrap;
  min-width: fit-content;
}

input, select {
  background: #0f3460;
  border: 1px solid #1a4a7a;
  color: #e0e0e0;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, select:focus {
  border-color: #4a9eff;
}

input[type="text"],
input[type="password"] {
  flex: 1;
  min-width: 80px;
}

input::placeholder {
  color: #555;
}

select {
  background: #0f3460;
  min-width: 120px;
  cursor: pointer;
}

select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 按钮 */
button {
  padding: 6px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  background: #2a4a7a;
  color: #e0e0e0;
  transition: background 0.2s, opacity 0.2s;
  white-space: nowrap;
}

button:hover:not(:disabled) {
  background: #3a5a8a;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

button.btn-primary {
  background: #2980b9;
  font-weight: 600;
  padding: 8px 24px;
}

button.btn-primary:hover:not(:disabled) {
  background: #3498db;
}

button.btn-primary.listening {
  background: #e67e22;
}

button.btn-primary.listening:hover:not(:disabled) {
  background: #f39c12;
}

/* 状态指示 */
.status-indicator {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #333;
  color: #999;
}

.status-indicator.connected {
  background: #1a6b3a;
  color: #2ecc71;
}

.status-indicator.error {
  background: #6b1a1a;
  color: #e74c3c;
}

/* 日志面板 */
.log-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.log-container {
  flex: 1;
  background: #0a0a1a;
  border-radius: 4px;
  padding: 8px;
  font-family: "Cascadia Code", "Fira Code", "JetBrains Mono", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-y: auto;
  max-height: 400px;
  min-height: 150px;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-placeholder {
  color: #555;
  font-style: italic;
}

.log-entry {
  padding: 1px 0;
  border-bottom: 1px solid #111;
}

.log-time {
  color: #666;
  margin-right: 6px;
}

.log-level-DEBUG { color: #888; }
.log-level-INFO { color: #8ab4f8; }
.log-level-WARNING { color: #fdd663; }
.log-level-ERROR { color: #f28b82; }
.log-level-CRITICAL { color: #f28b82; font-weight: bold; }

.log-name {
  color: #666;
  margin-right: 6px;
}

.log-msg {
  color: #e0e0e0;
}

/* 底部 */
footer {
  margin-top: auto;
  padding: 8px 16px;
  text-align: center;
  font-size: 12px;
  color: #555;
  border-top: 1px solid #222;
}

#footer-status {
  color: #666;
}
