:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f5f7fb;
  --text: #161616;
  --muted: #9a9a9a;
  --line: #eeeeee;
  --primary: #1d67d8;
  --primary-dark: #1652aa;
  --accent: #e7c86a;
  --danger: #b23b3b;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid #f1f1f1;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1060px;
  margin: 0 auto;
  padding: 8px 18px;
}

.brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  padding: 2px;
  border: 1px solid #eeeeee;
  border-radius: 6px;
  background: var(--surface);
}

.tab-button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.tab-button.active {
  background: var(--primary);
  color: #fff;
}

.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 18px 16px 48px;
}

.doc-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 650px);
  gap: 34px;
  align-items: start;
  justify-content: center;
}

.doc-sidebar {
  position: sticky;
  top: 58px;
  display: grid;
  gap: 7px;
  color: #b8b8b8;
  font-size: 12px;
  line-height: 1.45;
}

.doc-sidebar a {
  color: #b7b7b7;
}

.doc-sidebar .toc-title {
  color: #2c6fdd;
  font-weight: 600;
}

.toc-types {
  display: grid;
  gap: 6px;
  padding-left: 18px;
  margin-top: 2px;
}

.back-mark {
  color: #bbbbbb;
  font-size: 16px;
}

.doc-content {
  max-width: 650px;
  padding: 0 0 44px;
}

.ai-note {
  margin-top: 18px;
  padding-left: 10px;
  border-left: 3px solid #d8d8d8;
  color: #aaa;
  font-size: 13px;
}

.callout,
.success-note {
  border: 1px solid #eedb9a;
  border-radius: 5px;
  background: #fffdf4;
}

.callout {
  margin: 20px 0 30px;
  padding: 12px 14px;
  color: #4a5568;
  font-size: 13px;
}

.success-note {
  margin: 12px 0 18px;
  padding: 10px 12px;
  color: #365b44;
  font-size: 13px;
}

.doc-section {
  margin-top: 24px;
}

.doc-section p {
  margin: 10px 0 0;
  font-size: 14px;
}

.block-list {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding-left: 22px;
  font-size: 14px;
}

.block-list li::marker {
  color: #246bd6;
}

.daily-news-list {
  display: grid;
  gap: 20px;
}

.daily-item h3 {
  margin-bottom: 6px;
}

.daily-item ul {
  margin: 0;
  padding-left: 22px;
  font-size: 14px;
}

.daily-item li {
  margin: 4px 0;
}

.eyebrow {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.3;
}

h1 {
  margin-top: 0;
  font-size: 30px;
  text-align: center;
  font-weight: 750;
}

h2 {
  font-size: 22px;
  font-weight: 750;
}

h3 {
  font-size: 18px;
  font-weight: 750;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 650;
}

.prompt-box {
  margin: 12px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid #eeeeee;
  border-radius: 5px;
  background: #fafafa;
  color: var(--text);
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 14px;
}

.section-note {
  color: var(--muted);
  font-size: 13px;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  align-items: start;
}

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

.type-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.type-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.type-row.active {
  border-color: rgba(18, 109, 103, 0.4);
  background: var(--surface-soft);
}

.type-title {
  font-weight: 750;
}

.type-meta {
  color: var(--muted);
  font-size: 12px;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.icon-button,
.primary-button,
.secondary-button,
.danger-button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 13px;
  font-weight: 700;
}

.icon-button {
  width: 38px;
  padding: 0;
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--line);
}

.primary-button {
  background: var(--primary);
  color: #fff;
}

.secondary-button {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.danger-button {
  background: #f7e6e3;
  color: var(--danger);
}

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

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

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

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

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

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 109, 103, 0.12);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.switch-row input {
  width: 20px;
  height: 20px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.status-line {
  min-height: 22px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.empty-card {
  padding: 20px;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .topbar-inner {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
  }

  .nav-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 8px;
  }

  .tab-button {
    border-radius: 6px;
  }

  .page {
    padding: 14px 14px 34px;
  }

  .doc-layout,
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .doc-sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }

  .toc-types {
    display: none;
  }

  h1 {
    font-size: 25px;
    text-align: left;
  }

  .section-header {
    align-items: start;
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .hero-main,
  .summary-card,
  .news-card,
  .editor-panel {
    padding: 15px;
  }

  .type-row {
    grid-template-columns: 1fr;
  }

  .row-actions,
  .form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .primary-button,
  .secondary-button,
  .danger-button {
    width: 100%;
  }
}
