:root {
  --bg: #eef1f0;
  --panel: #fbfcfb;
  --ink: #202523;
  --muted: #6b7470;
  --line: #d9dfdc;
  --accent: #116149;
  --accent-2: #b83a32;
  --soft: #e4ebe8;
  --shadow: 0 18px 48px rgba(28, 38, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(32, 37, 35, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(32, 37, 35, 0.045) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

.login-page {
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
}

.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-panel h1 {
  margin-bottom: 20px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  min-height: 36px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  border-color: #9eaaa5;
}

.shell {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
}

.status-strip {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.metric {
  min-width: 128px;
  border: 1px solid var(--line);
  background: rgba(251, 252, 251, 0.82);
  border-radius: 8px;
  padding: 9px 12px;
}

.metric span,
.field span,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

.grid {
  display: grid;
  grid-template-columns: 330px minmax(420px, 1fr) 360px;
  gap: 14px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sidebar,
.composer,
.activity {
  padding: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head.compact {
  margin-top: 20px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 97, 73, 0.12);
}

.robot-list,
.contact-list,
.event-list {
  display: grid;
  gap: 8px;
}

.robot,
.contact,
.event {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px;
}

.robot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  background: var(--soft);
  color: var(--accent);
}

.badge.off {
  color: var(--accent-2);
  background: #f2e2e0;
}

.select-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.contact-list {
  max-height: 470px;
  overflow: auto;
  padding-right: 4px;
  margin-top: 10px;
}

.contact {
  display: flex;
  align-items: center;
  gap: 9px;
}

.contact input {
  width: 16px;
  height: 16px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--soft);
  padding: 5px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.tab {
  border: 0;
  background: transparent;
}

.tab.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 2px 10px rgba(28, 38, 34, 0.08);
}

.send-form {
  display: none;
}

.send-form.active {
  display: block;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.selected-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
}

.primary {
  width: 100%;
  min-height: 44px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.primary:hover {
  border-color: #0c4937;
  background: #0c4937;
}

.notice {
  border-left: 3px solid var(--accent-2);
  background: #f8eeec;
  color: #71302c;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 13px;
}

.sdk-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f8;
  padding: 12px;
  margin-bottom: 14px;
}

.compactless {
  margin-bottom: 10px;
}

.event-list {
  max-height: 640px;
  overflow: auto;
}

.event {
  display: grid;
  gap: 6px;
}

.event strong {
  font-size: 13px;
}

.event small {
  color: var(--muted);
}

.event.success {
  border-left: 3px solid var(--accent);
}

.event.error {
  border-left: 3px solid var(--accent-2);
}

.event.warn {
  border-left: 3px solid #b17917;
}

@media (max-width: 1180px) {
  .grid {
    grid-template-columns: 320px 1fr;
  }

  .activity {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 20px, 1500px);
    padding: 14px 0;
  }

  .topbar,
  .status-strip,
  .grid,
  .two-col {
    display: grid;
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }
}
