:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d7dee8;
  --primary: #0f6b5b;
  --primary-dark: #0a4d42;
  --accent: #a75213;
  --soft: #edf7f3;
  --warn: #fff4e5;
  --shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

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

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

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 9px 12px;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

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

button.full {
  width: 100%;
}

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

textarea {
  min-height: 94px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 107, 91, 0.12);
}

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

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

.sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: auto;
  background: #111827;
  color: #f8fafc;
  padding: 22px 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #18a284;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.brand p {
  margin: 2px 0 0;
  color: #b8c0cc;
  font-size: 13px;
}

.sidebar-section {
  display: grid;
  gap: 11px;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.section-title {
  color: #aeb7c4;
  font-size: 13px;
  font-weight: 800;
}

.sidebar input,
.sidebar select {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.sidebar select option {
  color: #111827;
}

.sidebar input::placeholder {
  color: #9ca3af;
}

.account-list {
  display: grid;
  gap: 8px;
}

.account-item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px;
  cursor: pointer;
}

.account-item.active {
  border-color: rgba(24, 162, 132, 0.7);
  background: rgba(24, 162, 132, 0.22);
}

.account-name {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 3px;
}

.account-meta {
  color: #c8d0dc;
  font-size: 12px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.workspace {
  padding: 24px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--primary);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 5px;
}

.topbar h2 {
  margin: 0 0 5px;
  font-size: 28px;
  letter-spacing: 0;
}

.topbar p {
  margin: 0;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.generator {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

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

.panel-heading {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel-heading h3 {
  margin: 0;
  font-size: 16px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 13px;
}

.form-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.tabs {
  padding: 12px 12px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  background: #f3f5f7;
}

.tab.active {
  background: var(--soft);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 800;
}

.tab-page {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.hidden {
  display: none;
}

.topic-card,
.block,
.history-item,
.day {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.topic-card {
  padding: 13px;
  display: grid;
  gap: 8px;
}

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

.topic-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  background: #fbfcfd;
  font-size: 12px;
}

.tag.hot {
  border-color: #fed7aa;
  color: var(--accent);
  background: var(--warn);
}

.block {
  overflow: hidden;
}

.block-title {
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.block-title strong {
  font-size: 14px;
}

.copy-btn {
  padding: 5px 8px;
  font-size: 12px;
}

.block-content {
  padding: 12px;
  white-space: pre-wrap;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  padding: 10px;
}

.history-item strong {
  display: block;
  margin-bottom: 4px;
}

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

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

.day {
  min-height: 82px;
  padding: 8px;
}

.day.today {
  background: var(--soft);
  border-color: var(--primary);
}

.day-num {
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 4px;
}

.day-title {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  background: #111827;
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: 0.18s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 980px) {
  .app,
  .generator,
  .topbar {
    grid-template-columns: 1fr;
  }

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

  .actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding: 14px;
  }

  .topbar h2 {
    font-size: 23px;
  }

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

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