:root {
  color-scheme: light;
  --bg: #f7f6f1;
  --panel: #ffffff;
  --panel-soft: #f1f5f2;
  --ink: #17211b;
  --muted: #627069;
  --line: #dce3dd;
  --green: #2f6b4f;
  --teal: #1e6f77;
  --gold: #a76d1d;
  --red: #b54845;
  --blue: #365f91;
  --shadow: 0 18px 48px rgba(35, 44, 39, 0.1);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px;
  background: #13251d;
  color: #f5f3ed;
}

.brand-mark {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 52px;
}

.logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f0c45c;
  color: #17211b;
  font-weight: 900;
}

.brand-mark span,
.sidebar-footer,
.mini-stat span,
.section-header p,
small,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.brand-mark span,
.sidebar-footer {
  color: #b9c6be;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #d9e4dd;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  border-color: rgba(240, 196, 92, 0.38);
  background: rgba(240, 196, 92, 0.12);
  color: #ffffff;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 15px;
  font-weight: 900;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #79d492;
}

.main {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}

.storage-badge {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(35, 44, 39, 0.12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.storage-badge.json {
  border-color: rgba(47, 107, 79, 0.28);
  color: var(--green);
}

.storage-badge.local {
  border-color: rgba(167, 109, 29, 0.28);
  color: var(--gold);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 86px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-weight: 800;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.topbar-actions,
.button-row,
.panel-row,
.editor-bottom,
.chips {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-stat {
  display: grid;
  min-width: 126px;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.mini-stat strong {
  font-size: 19px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 330px 1fr;
  grid-template-rows: minmax(300px, auto) 1fr;
  gap: 16px;
}

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

.brand-panel,
.topic-panel,
.drafts-panel,
.full-panel,
.analytics-grid .panel {
  padding: 18px;
}

.drafts-panel {
  grid-column: 1 / -1;
}

.section-header {
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 94px;
  padding: 11px;
  resize: vertical;
  line-height: 1.6;
}

input,
select {
  min-height: 40px;
  padding: 0 12px;
}

.chip,
.tag,
.platform {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.chips {
  flex-wrap: wrap;
}

.risk-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: #fff7e8;
  color: #6f4717;
}

.risk-box p {
  margin-bottom: 0;
  line-height: 1.5;
}

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

.topic-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 118px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.topic-card div {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.topic-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.topic-action {
  justify-self: start;
  min-height: 34px;
  margin-top: 2px;
  border: 1px solid rgba(47, 107, 79, 0.22);
  border-radius: 8px;
  padding: 0 11px;
  background: #eef7f1;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.topic-action:hover {
  border-color: var(--green);
  background: #e4f2e9;
}

.panel-row {
  justify-content: space-between;
  align-items: flex-start;
}

.draft-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  min-height: 455px;
}

.draft-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.draft-item {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  text-align: left;
}

.draft-item.active {
  border-color: var(--green);
  background: #eef7f1;
}

.xiaohongshu {
  color: #a92f3b;
}

.douyin {
  color: var(--teal);
}

.wechat {
  color: var(--green);
}

.editor {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  min-height: 455px;
}

.editor-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.body-editor {
  min-height: 285px;
}

.editor-bottom {
  justify-content: space-between;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

button.primary,
button.secondary,
.text-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  font-weight: 800;
}

button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

button.primary.dark {
  border-color: #16261d;
  background: #16261d;
}

button.secondary {
  background: #ffffff;
  color: var(--green);
}

.text-button {
  background: transparent;
  color: var(--green);
}

.risk.high {
  background: #ffe9e8;
  color: var(--red);
}

.risk.medium {
  background: #fff3d9;
  color: var(--gold);
}

.risk.low {
  background: #e9f6ef;
  color: var(--green);
}

.score {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 900;
  color: var(--blue);
}

.full-panel {
  min-height: calc(100vh - 158px);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 10px;
}

.calendar-day {
  min-height: 440px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.calendar-event {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #eef7f1;
}

.calendar-event p {
  margin: 8px 0 6px;
  line-height: 1.35;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.metric-card {
  display: grid;
  gap: 6px;
  min-height: 110px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.metric-card strong {
  font-size: 30px;
}

.good {
  color: var(--green);
}

.warn {
  color: var(--red);
}

.report {
  line-height: 1.65;
}

.data-import-panel {
  grid-column: 1 / -1;
}

.import-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) 1.1fr;
  gap: 16px;
}

.csv-editor {
  min-height: 170px;
  margin-bottom: 12px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.import-result {
  display: grid;
  align-content: start;
  gap: 12px;
}

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

.metric-grid.compact .metric-card {
  min-height: 82px;
}

.import-table .table-row {
  grid-template-columns: 1fr 120px 100px 100px 80px;
}

.persona-shell {
  background: #f7f6f1;
}

.persona-main {
  padding-bottom: 72px;
}

.agent-status {
  min-height: 42px;
  border: 1px solid rgba(47, 107, 79, 0.22);
  border-radius: 8px;
  padding: 11px 14px;
  background: #eef7f1;
  color: var(--green);
  font-weight: 900;
}

.persona-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.hero-panel,
.proposal-panel {
  grid-column: 1 / -1;
  padding: 18px;
}

.decision-panel {
  padding: 18px;
}

.employee-banner {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
}

.employee-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: #f0c45c;
  color: #13251d;
  font-size: 28px;
  font-weight: 900;
}

.employee-avatar.large {
  width: 84px;
  height: 84px;
  font-size: 36px;
}

.progress-track {
  width: 100%;
  height: 10px;
  margin-top: 10px;
  border-radius: 999px;
  background: #dce3dd;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.decision-card {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  padding: 13px;
  background: #fbfcfa;
}

.decision-card.strategy {
  border-left-color: #d4892c;
}

.decision-card.learning {
  border-left-color: #365f91;
}

.decision-card.compliance {
  border-left-color: #b54845;
}

.onboarding-panel {
  padding: 24px;
}

.onboarding-card {
  display: grid;
  gap: 14px;
  max-width: 820px;
  margin-top: 22px;
}

.rag-box {
  display: grid;
  gap: 12px;
  max-width: 820px;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfa;
}

.rag-status {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.onboarding-card details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfa;
}

.editor-desk {
  display: grid;
  grid-template-columns: 310px minmax(420px, 1fr) 320px;
  gap: 14px;
  padding: 18px;
}

.explain-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.explain-panel details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.explain-panel summary {
  cursor: pointer;
  color: var(--green);
  font-weight: 900;
}

.profile-panel {
  padding: 20px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.trait-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.trait-row input[type="range"] {
  padding: 0;
}

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

.learning-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fbfcfa;
}

.version-table {
  margin-top: 10px;
}

.version-table .table-row {
  grid-template-columns: 100px 1fr 220px;
}

.report-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.report-letter {
  grid-row: span 2;
  padding: 24px;
  line-height: 1.75;
}

.report-letter h3 {
  margin-top: 20px;
}

.report-letter ol {
  padding-left: 22px;
}

.report ul {
  padding-left: 18px;
}

.next-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.review-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.review-step {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.review-step span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--green);
  color: #ffffff;
  font-weight: 900;
}

.review-step p {
  color: var(--muted);
  line-height: 1.5;
}

.table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table-row {
  display: grid;
  grid-template-columns: 120px 1fr 110px 1fr 90px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row.head {
  min-height: 42px;
  background: #eef2ef;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-direction: row;
    overflow-x: auto;
  }

  .brand-mark,
  .sidebar-footer {
    display: none;
  }

  nav {
    display: flex;
  }

  .nav-item {
    grid-template-columns: 28px auto;
    min-width: 128px;
  }

  .topbar,
  .topbar-actions,
  .editor-toolbar,
  .editor-bottom {
    display: grid;
    gap: 12px;
  }

  .workspace-grid,
  .draft-layout,
  .analytics-grid,
  .import-grid {
    grid-template-columns: 1fr;
  }

  .topic-list,
  .metric-grid,
  .review-steps,
  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .calendar-day {
    min-height: 160px;
  }
}
