:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #19202a;
  --muted: #6e7785;
  --line: #e5eaf2;
  --blue: #2178ff;
  --teal: #20c7bd;
  --shadow: 0 18px 48px rgba(35, 52, 81, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #182235;
  color: #ffffff;
}

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

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  font-weight: 800;
}

.brand strong, .brand span { display: block; }
.brand span { margin-top: 4px; color: rgba(255,255,255,0.58); font-size: 13px; }

.nav {
  width: 100%;
  min-height: 58px;
  margin-bottom: 8px;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,0.72);
  text-align: left;
  font-size: 15px;
  cursor: pointer;
}

.nav-label,
.nav-sub {
  display: block;
}

.nav-label {
  color: inherit;
  font-size: 15px;
  font-weight: 700;
}

.nav-sub {
  margin-top: 5px;
  color: rgba(255,255,255,0.48);
  font-size: 12px;
  line-height: 1.35;
}

.nav.active, .nav:hover {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}

.nav.active .nav-sub,
.nav:hover .nav-sub {
  color: rgba(255,255,255,0.72);
}

.main { padding: 30px; }

.login, .workspace {
  max-width: 1180px;
  margin: 0 auto;
}

.login {
  margin-top: 80px;
  padding: 32px;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

h1 { margin: 0 0 8px; font-size: 28px; }
p { margin: 0; color: var(--muted); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.actions { display: flex; gap: 10px; }

button {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

button.primary {
  border-color: transparent;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  color: #ffffff;
}

.grid {
  display: grid;
  gap: 16px;
  margin: 22px 0;
}

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

label {
  display: block;
  color: #394252;
  font-size: 13px;
  font-weight: 600;
}

.full-label {
  margin: 4px 0 18px;
}

input, textarea, select {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

textarea { min-height: 92px; resize: vertical; line-height: 1.55; }

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

.rich-editor {
  min-height: 320px;
  margin-top: 8px;
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
  font-weight: 400;
}

.rich-editor:empty::before {
  content: "从公众号文章正文复制后，点这里粘贴。图片、段落、加粗、颜色会尽量保留。";
  color: #9aa3af;
}

.rich-editor img {
  max-width: 100%;
  height: auto;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #dcecff;
  border-radius: 8px;
  background: #f2f8ff;
  color: #466079;
  font-size: 14px;
}

.notice strong { color: #1b4d8f; }

.guide {
  margin-bottom: 14px;
}

.guide-card {
  display: grid;
  grid-template-columns: 1.25fr 1.1fr 0.9fr;
  gap: 16px;
  padding: 16px;
  border: 1px solid #dcecff;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.guide-label {
  margin-bottom: 8px;
  color: #1b4d8f;
  font-size: 13px;
  font-weight: 800;
}

.guide-card p {
  line-height: 1.65;
}

.step-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.step-list b {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eaf3ff;
  color: var(--blue);
  font-size: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f2f8ff;
  color: #1b4d8f;
  font-size: 13px;
  font-weight: 700;
}

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

.card {
  padding: 22px;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.compact-card {
  padding: 16px 18px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.compact-info {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.compact-thumb {
  width: 96px;
  height: 58px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #eef4fb;
}

.compact-thumb-empty {
  display: grid;
  place-items: center;
  color: #2278ff;
  font-weight: 800;
  font-size: 22px;
}

.card-title {
  font-weight: 800;
  line-height: 1.35;
}
.card-subtitle {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}

.status-badge.draft {
  background: #fff6df;
  color: #9a6200;
}

.status-badge.published {
  background: #e7fbf5;
  color: #06785f;
}

.item-message {
  margin-top: 6px;
  color: #06785f;
  font-size: 13px;
  line-height: 1.45;
}

.compact-desc {
  max-width: 760px;
  margin-top: 6px;
  color: #394252;
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.danger { color: #d93025; }

.card-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

button.small {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.image-row {
  display: grid;
  grid-template-columns: 1fr 108px;
  gap: 12px;
  align-items: end;
}

.preview-wrap {
  position: relative;
  width: 96px;
  height: 64px;
}

.preview {
  width: 96px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #eef3f8;
}

.preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

.fallback-preview {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

.broken-preview {
  display: none;
}

.broken-preview + .fallback-preview {
  display: flex;
}

.file-input {
  padding: 8px;
  background: #f8fafc;
}

.field-tip {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.advanced {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.advanced summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.advanced .grid {
  margin-bottom: 0;
}

.counter-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 13px;
}

.counter-title {
  margin-bottom: 10px;
  color: #1b4d8f;
  font-weight: 800;
}

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

.counter-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 110px;
  gap: 10px;
  align-items: center;
}

.counter-type {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 800;
}

.counter-type.view {
  background: #eaf3ff;
  color: #2178ff;
}

.counter-type.like {
  background: #fff6df;
  color: #9a6200;
}

.counter-openid {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #394252;
}

.counter-day {
  text-align: right;
}

.status {
  min-height: 22px;
  margin-bottom: 14px;
  color: var(--muted);
}

.hint {
  margin-top: 14px;
  font-size: 13px;
}

.login-status {
  min-height: 22px;
  margin-top: 14px;
  color: #d93025;
  font-size: 14px;
}

.feedback-toast {
  position: fixed;
  top: 22px;
  right: 28px;
  z-index: 9999;
  max-width: min(520px, calc(100vw - 40px));
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(25, 32, 42, 0.18);
  color: #ffffff;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

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

.feedback-toast.info {
  background: #2c6bd8;
}

.feedback-toast.success {
  background: #088260;
}

.feedback-toast.error {
  background: #c7352c;
}

.hidden { display: none; }

@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .main { padding: 18px; }
  .toolbar, .grid.two { grid-template-columns: 1fr; display: grid; }
  .guide-card { grid-template-columns: 1fr; }
}

/* Í϶¯ÅÅÐò */
.drag-handle { cursor: grab; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.card.dragging { opacity: 0.45; }
.card.drag-over { outline: 2px dashed #2178ff; outline-offset: 3px; }

