:root { font-family: Inter, "Microsoft YaHei", sans-serif; color: #18211e; background: #f3f6f5; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { min-height: 40px; border: 0; background: #087f5b; color: white; padding: 9px 15px; border-radius: 6px; cursor: pointer; }
button:hover { filter: brightness(.95); }
button:disabled { cursor: not-allowed; opacity: .5; }
.quiet { background: #e6ece9; color: #31423c; }
.danger { background: #bc3e3e; }
.error { color: #b42318; min-height: 20px; }
.hint, .empty { color: #68766f; font-size: 13px; line-height: 1.6; }
.top-gap { margin-top: 14px; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; background: #087f5b; color: white; font-weight: 800; border-radius: 7px; }
.brand-mark.small { width: 32px; height: 32px; font-size: 12px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(390px, 100%); display: grid; gap: 14px; background: white; padding: 32px; border: 1px solid #d7dfdb; border-radius: 8px; box-shadow: 0 18px 45px rgb(25 54 43 / 8%); }
.login h1, .login p { margin: 0; }
.login label, .fields label, .panel > label { display: grid; gap: 6px; font-size: 14px; }
input, select, textarea { width: 100%; border: 1px solid #c8d2cd; border-radius: 5px; padding: 10px; background: white; color: #18211e; }
textarea { resize: vertical; line-height: 1.55; }
header { height: 60px; background: #183f35; color: white; display: flex; align-items: center; justify-content: space-between; padding: 0 max(18px, calc((100% - 1240px) / 2)); }
.brand, .header-actions, .command-row, .section-head { display: flex; align-items: center; gap: 10px; }
.header-actions { justify-content: flex-end; }
.status { background: #dff7eb; color: #096b4c; padding: 5px 9px; border-radius: 4px; font-size: 13px; }
.status.running { background: #bdebd8; }
.tabs { height: 52px; display: flex; gap: 2px; align-items: stretch; overflow-x: auto; background: white; border-bottom: 1px solid #d7dfdb; padding: 0 max(18px, calc((100% - 1240px) / 2)); }
.tabs button { min-width: max-content; background: transparent; color: #53625c; border-radius: 0; border-bottom: 3px solid transparent; }
.tabs button.active { color: #087f5b; border-bottom-color: #087f5b; }
.workspace { max-width: 1240px; margin: auto; padding: 22px 18px 60px; }
#notice { position: fixed; right: 20px; top: 76px; z-index: 20; max-width: 420px; background: #183f35; color: white; padding: 10px 14px; border-radius: 6px; box-shadow: 0 8px 24px rgb(0 0 0 / 15%); }
#notice:empty { display: none; }
.tab-page { display: none; gap: 18px; }
.tab-page.active { display: grid; }
.control-band { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: white; border-bottom: 1px solid #d7dfdb; padding: 16px 0; }
.control-band h2 { margin: 4px 0 0; font-size: 22px; }
.two-column { display: grid; grid-template-columns: minmax(0, 3fr) minmax(270px, 1fr); gap: 18px; }
.panel { background: white; border: 1px solid #d7dfdb; padding: 20px; border-radius: 7px; }
.panel h3 { margin: 0 0 18px; font-size: 17px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wide { grid-column: 1 / -1; }
.status-panel dl { display: grid; gap: 12px; margin: 0; }
.status-panel dl div { display: flex; justify-content: space-between; border-bottom: 1px solid #edf1ef; padding-bottom: 10px; }
.status-panel dt { color: #68766f; }
.status-panel dd { margin: 0; font-weight: 700; }
.section-head { justify-content: space-between; }
.events { max-height: 520px; overflow: auto; }
.event { display: grid; grid-template-columns: 80px 135px minmax(0, 1fr); gap: 10px; padding: 11px 0; border-bottom: 1px solid #edf1ef; }
.event small { color: #73817c; }
.event span { overflow-wrap: anywhere; }
.reply { display: block; color: #596861; margin-bottom: 4px; border-left: 3px solid #9fcbbb; padding-left: 8px; }
.event.tts b, .event.playback b { color: #087f5b; }
.event.moderation b, .event.system b { color: #a13d3d; }
.inline-check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; margin-top: 12px; }
.inline-check input { width: auto; }
.result { min-height: 80px; margin-top: 14px; padding: 12px; background: #f4f7f6; border: 1px solid #e0e7e4; white-space: pre-wrap; line-height: 1.6; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric { min-height: 90px; padding: 14px; background: #f4f7f6; border-left: 4px solid #087f5b; }
.metric b { display: block; font-size: 24px; margin-top: 7px; }
.diagnostics { display: grid; gap: 8px; }
.diagnostic { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #edf1ef; }
.ok { color: #087f5b; }
.bad { color: #b42318; }
.new-user { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; }
.user { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #edf1ef; }
.user div { display: flex; gap: 8px; }

@media (max-width: 800px) {
  header { padding: 0 12px; }
  #accountName { display: none; }
  .workspace { padding: 14px 10px 40px; }
  .two-column, .fields { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .control-band { align-items: flex-start; }
  .command-row { flex-wrap: wrap; }
  .event { grid-template-columns: 64px 90px minmax(0, 1fr); }
  .metrics { grid-template-columns: 1fr 1fr; }
  .new-user { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .brand strong { display: none; }
  .control-band { display: grid; }
  .command-row button { flex: 1; }
  .event { grid-template-columns: 58px minmax(0, 1fr); }
  .event > div { grid-column: 1 / -1; }
  .metrics { grid-template-columns: 1fr; }
}
