:root {
  color: #18201f;
  background: #f4f2eb;
  font-family: "Microsoft YaHei", "PingFang SC", "Inter", system-ui, sans-serif;
  font-synthesis: none;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  align-items: center;
  background:
    linear-gradient(110deg, rgba(16, 45, 42, 0.92), rgba(16, 45, 42, 0.72)),
    url("https://images.unsplash.com/photo-1552664730-d307ca884978?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
  display: flex;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.24);
  margin: 0 auto;
  max-width: 460px;
  padding: 34px;
  width: 100%;
}

.brand-line {
  align-items: center;
  display: flex;
  gap: 14px;
}

.brand-line h1 {
  font-size: 25px;
  line-height: 1.2;
  margin: 0 0 4px;
}

.brand-line p,
.brand-line small {
  color: rgba(24, 32, 31, 0.62);
  margin: 0;
}

.brand-line.compact {
  color: white;
}

.brand-line.compact small {
  color: rgba(255, 255, 255, 0.58);
  display: block;
}

.brand-mark {
  align-items: center;
  background: #0f5b52;
  border-radius: 8px;
  color: white;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 21px;
  font-weight: 900;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.form-stack {
  display: grid;
  gap: 16px;
  margin-top: 30px;
}

label {
  color: rgba(24, 32, 31, 0.72);
  display: grid;
  font-size: 14px;
  font-weight: 750;
  gap: 8px;
}

input,
select,
textarea {
  background: white;
  border: 1px solid rgba(31, 42, 41, 0.16);
  border-radius: 8px;
  color: #18201f;
  min-height: 44px;
  outline: none;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  line-height: 1.6;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #0f5b52;
  box-shadow: 0 0 0 3px rgba(15, 91, 82, 0.12);
}

.primary-button,
.secondary-button,
.ghost-button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.primary-button {
  background: #0f5b52;
  color: white;
}

.secondary-button {
  background: #e2efe9;
  color: #0f5b52;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.76);
  margin-top: auto;
  width: 100%;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.form-message {
  color: #a33d24;
  min-height: 22px;
  margin: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #102d2a;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav a {
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.68);
  font-weight: 750;
  padding: 12px 14px;
  text-decoration: none;
}

.side-nav a.active,
.side-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.workspace {
  padding: 28px clamp(20px, 4vw, 44px) 60px;
}

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

.eyebrow {
  color: #c0782f;
  font-size: 13px;
  font-weight: 900;
  margin: 0 0 4px;
}

.topbar h2 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0;
}

.panel-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric-card,
.section-panel,
.template-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(31, 42, 41, 0.1);
  border-radius: 8px;
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 110px;
  padding: 18px;
}

.metric-card span {
  color: rgba(24, 32, 31, 0.58);
  font-size: 14px;
  font-weight: 750;
}

.metric-card strong {
  align-self: end;
  font-size: 24px;
  line-height: 1.15;
}

.section-panel {
  margin-top: 18px;
  padding: 24px;
  scroll-margin-top: 18px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading.with-action {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.section-heading h3 {
  font-size: 22px;
  margin: 0 0 6px;
}

.section-heading p {
  color: rgba(24, 32, 31, 0.62);
  margin: 0;
}

.form-grid,
.send-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide-field {
  grid-column: 1 / -1;
}

.toggle-row {
  align-items: center;
  background: #f5f1e6;
  border: 1px solid rgba(31, 42, 41, 0.08);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
}

.toggle-row input {
  accent-color: #0f5b52;
  min-height: auto;
  width: auto;
}

.template-list {
  display: grid;
  gap: 14px;
}

.template-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.template-head {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 160px auto;
}

.knowledge-head {
  grid-template-columns: 1fr 120px auto;
}

.inline-toggle {
  min-height: 72px;
}

.template-card textarea {
  min-height: 150px;
}

.danger-button {
  background: #f5e0d9;
  border: 0;
  border-radius: 8px;
  color: #a33d24;
  font-weight: 800;
  min-height: 44px;
  padding: 0 14px;
}

.toast {
  background: #102d2a;
  border-radius: 8px;
  bottom: 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  color: white;
  left: 50%;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 20;
}

.question-list {
  display: grid;
  gap: 12px;
}

.question-card {
  background: #f8f5ed;
  border: 1px solid rgba(31, 42, 41, 0.08);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 16px;
}

.question-card div {
  display: grid;
  gap: 4px;
}

.question-card strong {
  color: #18201f;
}

.question-card span,
.empty-state {
  color: rgba(24, 32, 31, 0.58);
  font-size: 14px;
}

.question-card p,
.empty-state {
  margin: 0;
}

.ops-checklist {
  background: #f8f5ed;
  border: 1px solid rgba(31, 42, 41, 0.08);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 16px;
}

.schedule-box {
  background: #fbfaf5;
  border: 1px solid rgba(31, 42, 41, 0.08);
  border-radius: 8px;
  margin-top: 18px;
  padding: 18px;
}

.compact-heading {
  margin-bottom: 14px;
}

.ops-checklist strong {
  color: #102d2a;
}

.ops-checklist span {
  color: rgba(24, 32, 31, 0.68);
}

.ops-checklist code {
  background: rgba(15, 91, 82, 0.08);
  border-radius: 6px;
  color: #0f5b52;
  padding: 2px 6px;
}

.event-heading {
  margin-top: 20px;
}

.copy-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.copy-card {
  background: #fbfaf5;
  border: 1px solid rgba(31, 42, 41, 0.08);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.copy-card div {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.copy-card h4 {
  font-size: 17px;
  margin: 0;
}

.copy-card textarea {
  background: #ffffff;
  min-height: 120px;
}

@media (max-width: 1000px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    position: static;
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ghost-button {
    margin-top: 0;
  }

  .panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .login-panel {
    padding: 24px;
  }

  .workspace {
    padding: 20px 14px 44px;
  }

  .topbar,
  .section-heading.with-action {
    align-items: stretch;
    flex-direction: column;
  }

  .side-nav,
  .panel-grid,
  .form-grid,
  .send-layout,
  .template-head,
  .copy-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 18px;
  }
}
