:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5b6673;
  --line: #d8dde4;
  --paper: #f7f8fa;
  --panel: #ffffff;
  --accent: #0c7a75;
  --accent-strong: #075b57;
  --warn: #a34810;
  --shadow: 0 14px 36px rgba(28, 39, 49, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: rgba(247, 248, 250, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 900;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a,
.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-decoration: none;
  font-weight: 650;
  cursor: pointer;
}

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

.button.primary:hover {
  background: var(--accent-strong);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  padding: clamp(56px, 9vw, 112px) clamp(18px, 4vw, 56px) 44px;
  background:
    linear-gradient(135deg, rgba(12, 122, 117, 0.12), rgba(247, 248, 250, 0) 42%),
    radial-gradient(circle at 80% 30%, rgba(232, 184, 77, 0.24), rgba(247, 248, 250, 0) 34%);
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(38px, 7vw, 86px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero p {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.status-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.metric {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.metric strong {
  font-size: 16px;
}

.section {
  padding: 34px clamp(18px, 4vw, 56px) 60px;
}

.section h2 {
  margin: 0 0 18px;
  font-size: 26px;
}

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

.card {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 7px 18px rgba(28, 39, 49, 0.06);
}

.card h3 {
  margin: 0;
  font-size: 19px;
}

.card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.card a {
  align-self: flex-start;
}

.login-wrap {
  min-height: calc(100vh - 75px);
  display: grid;
  place-items: center;
  padding: 34px 18px;
}

.login-panel {
  width: min(440px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.login-panel p {
  margin: 0 0 24px;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field label {
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #e6c1aa;
  border-radius: 8px;
  color: var(--warn);
  background: #fff4ed;
}

.footer {
  margin-top: auto;
  padding: 24px clamp(18px, 4vw, 56px);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 7px 18px rgba(28, 39, 49, 0.06);
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 19px;
}

.toolbar,
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.toolbar input,
.toolbar select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.form-grid textarea {
  grid-column: 1 / -1;
  min-height: 110px;
  padding: 12px;
  resize: vertical;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  background: #f1f4f6;
  font-size: 13px;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

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

.task-list label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.mini-card {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 650;
}

.note {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.research-grid {
  margin-top: 16px;
}

.landing-only {
  min-height: 100vh;
}

.landing-hero {
  min-height: 100vh;
  grid-template-columns: 1fr;
  align-items: center;
}

.landing-brand {
  margin-bottom: 24px;
}

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

.section-head h2,
.section-head p {
  margin: 0;
}

.section-head p {
  color: var(--muted);
}

.notebook-layout {
  display: grid;
  gap: 18px;
}

.notebook-upload {
  display: grid;
  gap: 12px;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.upload-row input,
.compact-form input,
.compact-form select {
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.notebook-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.5fr) minmax(220px, 0.8fr);
  gap: 16px;
  align-items: stretch;
}

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

.list-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
}

.list-item strong {
  line-height: 1.35;
}

.list-item span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.list-item.active {
  border-color: var(--accent);
  background: #eef9f7;
}

.document-preview {
  min-height: 560px;
  display: flex;
  flex-direction: column;
}

.document-preview iframe {
  width: 100%;
  min-height: 480px;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.full-button {
  width: 100%;
  margin-bottom: 12px;
}

.note-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

.notebook-editor textarea {
  width: 100%;
  min-height: 360px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
  font: inherit;
  line-height: 1.65;
}

.compact-form {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.75fr);
}

.note-preview {
  min-height: 448px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.note-preview h1,
.note-preview h2,
.note-preview h3 {
  margin: 0 0 10px;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #b7d9cf;
  border-radius: 8px;
  color: #075b57;
  background: #eef9f7;
}

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

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

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

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

  .split,
  .kanban,
  .toolbar,
  .form-grid,
  .notebook-grid,
  .upload-row,
  .section-head {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
  }

  .document-preview {
    min-height: auto;
  }

  .document-preview iframe {
    min-height: 420px;
  }
}
