:root {
  --ink: #172033;
  --muted: #687082;
  --line: #dfe4ee;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --accent: #1677ff;
  --ok: #16a06a;
  --warn: #d97706;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: #eef2f7;
}
.login-screen.hidden { display: none; }
.login-box {
  width: min(360px, calc(100vw - 32px));
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  display: grid;
  gap: 12px;
}

aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 188px;
  background: #111827;
  color: white;
  padding: 18px 12px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  margin: 6px 8px 22px;
}

.nav {
  width: 100%;
  height: 40px;
  margin-bottom: 6px;
  border: 0;
  border-radius: 6px;
  color: #cbd5e1;
  background: transparent;
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}
.nav.active, .nav:hover { color: white; background: #263244; }

main { margin-left: 188px; padding: 24px; }
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
h1, h2, p { margin: 0; }
h1 { font-size: 24px; }
h2 { font-size: 18px; margin-bottom: 14px; }
header p { margin-top: 6px; color: var(--muted); }

input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  min-height: 38px;
  padding: 8px 10px;
  font: inherit;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
#token { width: 220px; }

.view { display: none; }
.view.active { display: block; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stats div, .panel, .content-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.stats div { padding: 16px; }
.stats strong { display: block; font-size: 28px; }
.stats span { color: var(--muted); }

.panel { padding: 18px; }
.daily-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
  background: #f8fafc;
}
.daily-box p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  max-width: 820px;
}
.form h2, .form button, .form p, .wide { grid-column: 1 / -1; }
label { display: grid; gap: 6px; color: var(--muted); }
button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  height: 40px;
  padding: 0 14px;
  cursor: pointer;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.content-list { display: grid; gap: 12px; }
.content-card { padding: 16px; }
.meta { color: var(--muted); font-size: 13px; margin: 7px 0 10px; }
.body { white-space: pre-wrap; line-height: 1.65; color: #263244; }
.article-preview {
  color: #1f2a44;
  line-height: 1.75;
  font-size: 16px;
}
.article-preview h3 {
  margin: 26px 0 10px;
  font-size: 20px;
}
.article-preview p {
  margin: 14px 0;
}
.article-image {
  margin: 18px 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
}
.article-image.cover {
  margin-top: 14px;
}
.article-image img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  background: #f8fafc;
}
.summary {
  color: #364152;
  background: #f8fafc;
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  margin: 8px 0 12px;
}
.asset-label {
  color: var(--muted);
  font-size: 13px;
  margin: 12px 0 8px;
}
.cover-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  margin: 12px 0 14px;
}
.cover-block .asset-label {
  margin: 0;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.cover-block img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #f8fafc;
}
.asset-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}
.asset-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
}
.asset-strip figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}
.asset-strip img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #f8fafc;
}
.asset-strip figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  color: var(--muted);
  font-size: 12px;
}
.quality {
  margin-top: 10px;
  color: #8a5200;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  padding: 9px 10px;
}
.error {
  color: #b42318;
  background: #fff1f0;
  border: 1px solid #ffccc7;
  border-radius: 6px;
  padding: 9px 10px;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ghost { background: #eef2f7; color: var(--ink); }
.small {
  min-height: 30px;
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}
.ok { background: var(--ok); }
.warn { background: var(--warn); }
.danger { background: #dc2626; }
.reply-box {
  white-space: pre-wrap;
  line-height: 1.7;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: #263244;
}
.lead-card h2 {
  font-size: 17px;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #111827;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.error {
  background: #b42318;
}
.list { display: grid; gap: 10px; }
.list-item { border-top: 1px solid var(--line); padding-top: 10px; }

@media (max-width: 760px) {
  aside { position: static; width: auto; display: flex; gap: 8px; overflow-x: auto; }
  .brand { min-width: max-content; margin: 8px; }
  .nav { min-width: 72px; text-align: center; }
  main { margin-left: 0; padding: 16px; }
  header { align-items: stretch; flex-direction: column; }
  #token { width: 100%; }
  .stats, .form { grid-template-columns: 1fr; }
}
