/* Wibx Web OS 精简演示样式 — SenseVoice / MOSS-TTS HF Space */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(180deg, #ececf0 0%, #f2f2f7 100%);
  color: #1d1d1f;
  font-size: 13px;
  line-height: 1.45;
}
.app { display: flex; flex-direction: column; height: 100vh; max-width: 720px; margin: 0 auto; }

/* ---------- 顶栏 ---------- */
.app-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 12px; flex-shrink: 0;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 0.5px solid rgba(0,0,0,0.08);
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 160px; }
.brand-icon { font-size: 20px; line-height: 1; flex-shrink: 0; }
.brand-text { min-width: 0; }
.brand-name { font-size: 13px; font-weight: 600; letter-spacing: -0.02em; }
.brand-name .en { font-weight: 500; color: #6e6e73; margin-left: 4px; font-size: 12px; }
.brand-meta { font-size: 10.5px; color: #8e8e93; margin-top: 1px; }
.brand-meta .sep { color: #d1d1d6; margin: 0 4px; }

/* ---------- 隐私说明 ---------- */
.privacy-banner {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 12px; flex-shrink: 0;
  background: rgba(52, 199, 89, 0.08);
  border-bottom: 0.5px solid rgba(52, 199, 89, 0.18);
  font-size: 11px; line-height: 1.45; color: #3a3a3c;
}
.privacy-banner > i {
  flex-shrink: 0; margin-top: 1px;
  font-size: 14px; color: #34c759;
}
.privacy-banner .privacy-text { min-width: 0; }
.privacy-banner .privacy-text .en {
  display: block; margin-top: 1px;
  color: #8e8e93; font-size: 10.5px; font-weight: 400;
}

/* ---------- 按钮 ---------- */
.btn {
  appearance: none; display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 10px; border: none; border-radius: 6px;
  font: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
  transition: background .12s, transform .08s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.38; cursor: default; }
.btn-primary { background: var(--accent, #007aff); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark, #0066d6); }
.btn-danger { background: #ff3b30; color: #fff; }
.btn-ghost { background: rgba(0,0,0,0.05); color: #1d1d1f; }
.btn-ghost:hover:not(:disabled) { background: rgba(0,0,0,0.09); }
.btn .en { font-weight: 400; opacity: 0.78; margin-left: 2px; }
.spacer { flex: 1; min-width: 4px; }

/* ---------- 主区 ---------- */
.main { flex: 1; min-height: 0; overflow-y: auto; background: #fff; -webkit-overflow-scrolling: touch; }
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; height: 100%; min-height: 200px; color: #aeaeb2; text-align: center; padding: 24px;
}
.empty .hint { font-size: 13px; font-weight: 500; color: #8e8e93; }
.empty .sub { font-size: 11px; color: #c7c7cc; line-height: 1.5; }
.empty .en { display: block; color: #c7c7cc; font-size: 11px; margin-top: 2px; font-weight: 400; }

.result-item {
  padding: 8px 14px; border-bottom: 0.5px solid rgba(0,0,0,0.05);
  border-left: 2px solid var(--accent, #007aff);
}
.result-item.mic { border-left-color: #ff3b30; }
.result-item.inprog { background: rgba(0,122,255,0.03); }
.result-text { margin: 0; font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.result-text.placeholder { color: #c7c7cc; font-style: italic; }

.test-row {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px;
  border-bottom: 0.5px solid rgba(0,0,0,0.06); background: rgba(250,250,252,0.9);
}
.test-row .label { font-size: 11px; color: #8e8e93; width: 100%; margin-bottom: 2px; }
.test-row .label .en { color: #c7c7cc; margin-left: 6px; }
.test-btn {
  padding: 4px 10px; border-radius: 5px; border: 0.5px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.8); font-size: 11px; cursor: pointer;
}
.test-btn:hover:not(:disabled) { background: #fff; border-color: var(--accent, #007aff); color: var(--accent, #007aff); }
.test-btn:disabled { opacity: 0.4; cursor: default; }

/* ---------- 底栏（grid 不抖动） ---------- */
.foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px auto;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 8px 14px;
  height: 38px;
  background: rgba(250,250,252,0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 0.5px solid rgba(0,0,0,0.08);
  font-size: 10.5px; color: #8e8e93;
}
.foot .status {
  display: inline-flex; align-items: center; gap: 4px;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.foot .status.ready { color: #34c759; font-weight: 600; }
.foot .status.error { color: #ff3b30; font-weight: 500; }
.foot .status.busy { color: var(--accent-dark, #0066d6); font-weight: 600; }
.foot .status .en { color: inherit; opacity: 0.65; font-weight: 400; margin-left: 4px; }

.foot .progress-block {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.foot .progress-text {
  flex: 1; min-width: 0; text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600; color: var(--accent, #007aff);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.foot .progress-text[hidden] { visibility: hidden; }
.foot .pgr {
  flex: 0 0 80px;
  height: 4px; border-radius: 2px;
  background: rgba(0,0,0,0.08);
  overflow: hidden;
  visibility: visible;
}
.foot:not(.loading):not(.busy-progress) .pgr { visibility: hidden; }
.foot .pgr-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent, #007aff), #34c759);
  transition: width .25s ease;
}

.foot .meta-right {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10.5px; color: #aeaeb2;
}
.foot .meta-stats {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wibx-soft {
  display: inline-flex; align-items: center; gap: 3px;
  color: #98989d; text-decoration: none;
  padding: 2px 6px; border-radius: 4px;
  font-size: 10.5px; font-weight: 400;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.wibx-soft i { font-size: 11px; opacity: 0.85; }
.wibx-soft:hover { color: #007aff; background: rgba(0,122,255,0.08); }
.wibx-soft .en { opacity: 0.7; margin-left: 2px; }

/* ---------- 录音指示 ---------- */
.rec-dot { width: 6px; height: 6px; border-radius: 50%; background: #ff3b30; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- TTS 面板 ---------- */
.tts-panel { margin: 12px; padding: 12px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.78); border: 0.5px solid rgba(255,255,255,0.7);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.tts-panel h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; }
.tts-panel h3 .en { font-weight: 400; color: #8e8e93; margin-left: 4px; }
.tts-panel textarea {
  width: 100%; min-height: 88px; padding: 10px; border-radius: 8px;
  border: 0.5px solid rgba(0,0,0,0.12); font: inherit; font-size: 13px; resize: vertical;
}
.tts-panel select { width: 100%; height: 32px; padding: 0 10px; border-radius: 8px; border: 0.5px solid rgba(0,0,0,0.12); font: inherit; }
.tts-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.tts-meta { font-size: 11px; color: #8e8e93; margin-left: auto; }
.tts-meta .en { display: block; color: #c7c7cc; font-size: 10.5px; }

/* ---------- TTS 输出列表 ---------- */
.audio-out-panel { margin-bottom: 0; }
.audio-out-list { display: flex; flex-direction: column; gap: 0; max-height: 220px; overflow-y: auto; }
.audio-out-list:empty::before {
  content: '暂无生成记录 · No outputs yet';
  display: block; padding: 16px 4px; text-align: center;
  font-size: 11px; color: #c7c7cc;
}
.audio-out-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 4px; border-top: 0.5px solid rgba(0,0,0,0.06);
}
.audio-out-item:first-child { border-top: none; }
.audio-out-idx {
  flex-shrink: 0; width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(0,122,255,0.1);
  color: var(--accent, #007aff); font-size: 10.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.audio-out-info { flex: 1; min-width: 0; }
.audio-out-info .title {
  font-size: 12px; color: #1d1d1f;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.audio-out-info .meta {
  font-size: 10.5px; color: #8e8e93; margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.audio-out-info .meta .en { color: #c7c7cc; margin-left: 4px; }
.audio-out-actions { display: flex; gap: 4px; flex-shrink: 0; }
.btn-icon {
  width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; border: none; cursor: pointer;
  background: rgba(0,0,0,0.05); color: #1d1d1f; font-size: 14px;
}
.btn-icon:hover:not(:disabled) { background: rgba(0,122,255,0.12); color: var(--accent, #007aff); }
.btn-icon:disabled { opacity: 0.35; cursor: default; }
.btn-icon.playing { background: rgba(0,122,255,0.15); color: var(--accent, #007aff); }

/* ---------- 移动端适配（窄屏） ---------- */
@media (max-width: 560px) {
  .foot { grid-template-columns: minmax(0, 1fr) 180px auto; gap: 8px; padding: 8px 10px; }
  .foot .pgr { flex: 0 0 56px; }
  .wibx-soft .en { display: none; }
  .brand-name .en { display: none; }
}
@media (max-width: 420px) {
  .foot { grid-template-columns: minmax(0, 1fr) auto; }
  .foot .progress-block { display: none; }
}
