:root {
  color-scheme: light;
  --bg: #f5f1ec;
  --panel: #fffaf3;
  --ink: #2f2a25;
  --muted: #7d7168;
  --line: #e6d9cc;
  --accent: #c84f62;
  --accent-2: #1f8a83;
  --soft: #f7d9de;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(200, 79, 98, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(31, 138, 131, 0.12), transparent 38%),
    var(--bg);
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  background: rgba(255, 250, 243, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 20px 70px rgba(47, 42, 37, 0.12);
}

.login-panel h1,
.sidebar h2,
.workspace h1 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

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

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

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 79, 98, 0.14);
}

form button,
.save-btn,
.ghost-btn,
.item-actions button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 11px 16px;
  font-weight: 700;
}

.login-panel form button {
  width: 100%;
  margin-top: 22px;
}

.message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--accent-2);
  font-size: 13px;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 22px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.86);
}

nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.nav-btn {
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 11px 12px;
  text-align: left;
}

.nav-btn.active {
  border-color: rgba(200, 79, 98, 0.28);
  background: var(--soft);
  color: var(--ink);
  font-weight: 700;
}

.workspace {
  padding: 28px;
}

.workspace header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: #fffaf3;
  color: var(--ink);
}

.editor {
  display: grid;
  gap: 16px;
}

.panel {
  background: rgba(255, 250, 243, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

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

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

.item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.item-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.item-actions .danger {
  background: #7f3b3b;
}

.add-btn {
  width: fit-content;
  border: 1px dashed var(--accent);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  padding: 11px 15px;
  font-weight: 700;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

dialog {
  width: min(920px, calc(100vw - 40px));
  max-height: 82vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

dialog::backdrop {
  background: rgba(47, 42, 37, 0.36);
}

.icon-btn {
  float: right;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

pre {
  max-height: 70vh;
  overflow: auto;
  white-space: pre-wrap;
}

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

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

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

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

  .workspace {
    padding: 20px;
  }
}
