:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: #e6eaf2;
  --ink: #0f172a;
  --muted: #667085;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eef4ff;
  --olive: #0f172a;
  --olive-soft: #eef2f7;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
}

a {
  color: var(--accent);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
}

.brand {
  font-size: 1.12rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0;
  color: var(--ink);
}

.nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  cursor: pointer;
  font: inherit;
}

main.shell {
  padding: 34px 0 46px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.narrow {
  max-width: 420px;
  margin: 48px auto 0;
}

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

label {
  display: grid;
  gap: 8px;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

textarea {
  resize: vertical;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}

button:hover,
.button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.secondary-button:hover {
  background: #f8fafc;
}

.disabled-button {
  opacity: 0.55;
  pointer-events: none;
}

.danger {
  background: #dc2626;
}

.danger:hover {
  background: #b91c1c;
}

.muted {
  color: var(--muted);
}

.error {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fdebe7;
  color: #8d2f1d;
  border: 1px solid #efb6a8;
}

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

.admin-shell {
  display: grid;
  gap: 18px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.admin-header h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.admin-subtitle {
  margin: 10px 0 0;
}

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

.summary-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.summary-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.summary-value {
  font-size: 1.2rem;
  line-height: 1.1;
}

.control-panel {
  margin-bottom: 0;
}

.toolbar {
  display: flex;
  gap: 16px;
  align-items: end;
}

.toolbar-field {
  flex: 1;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.toolbar-meta {
  margin: 12px 0 0;
  font-size: 0.88rem;
}

.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 24px;
}

.public-hero-copy,
.featured-card,
.public-list-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.public-hero-copy {
  padding: 28px;
}

.public-hero-copy h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.public-intro {
  max-width: 42rem;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.featured-card {
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.featured-card h2 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.25;
}

.featured-excerpt {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.featured-label,
.featured-meta,
.featured-link {
  color: var(--muted);
  font-size: 0.9rem;
}

.featured-link {
  color: var(--accent);
  font-weight: 600;
}

.public-list-shell {
  padding: 20px;
}

.public-list-head {
  margin-bottom: 14px;
}

.public-list-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.public-list {
  display: grid;
}

.public-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 4px;
  border-top: 1px solid var(--line);
}

.public-row:first-child {
  border-top: 0;
}

.public-row-main h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.45;
}

.public-row-main h3 a {
  color: var(--ink);
  text-decoration: none;
}

.public-row-main h3 a:hover {
  color: var(--accent);
}

.public-row-slug {
  margin: 6px 0 0;
  color: var(--muted);
  font-family: "JetBrains Mono", "Iosevka", monospace;
  font-size: 0.78rem;
}

.public-row-excerpt {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.public-row-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.article-board {
  padding: 16px;
}

.bulk-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid var(--line);
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.check-inline input,
.article-checkbox {
  width: auto;
}

.list-head {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(180px, 1fr) minmax(220px, 1.1fr) auto;
  gap: 14px;
  padding: 0 8px 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

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

.article-row {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(180px, 1fr) minmax(220px, 1.1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.row-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.row-title-wrap {
  min-width: 0;
}

.article-check span {
  font-size: 0.8rem;
  color: var(--muted);
}

.source-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-title {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.35;
}

.article-slug {
  margin: 4px 0 0;
  color: var(--muted);
  font-family: "JetBrains Mono", "Iosevka", monospace;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-source,
.row-time {
  display: grid;
  gap: 6px;
}

.source-name,
.row-time span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  word-break: break-word;
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
}

.ghost-button {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.ghost-button:hover {
  background: #f8fafc;
}

.copy-button {
  min-height: 32px;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.empty-state {
  padding: 38px 20px;
  text-align: center;
  border-radius: 16px;
  border: 1px dashed var(--line);
  background: #fbfdff;
}

.empty-state h2 {
  margin: 0 0 8px;
}

.reading-shell {
  max-width: 840px;
  margin: 0 auto;
}

.public-article-page {
  background: #f8fafc;
}

.article-only-shell {
  width: min(900px, calc(100% - 24px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.reading-shell-plain {
  max-width: 820px;
}

.reading-hero {
  margin-bottom: 18px;
  padding: 10px 4px 0;
}

.reading-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.reading-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

.reading-meta span {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.reading-body {
  padding: 28px;
}

.share-gate {
  max-width: 420px;
  margin: 56px auto 0;
}

.prose {
  line-height: 1.9;
  font-size: 1.08rem;
  color: #111827;
}

.prose h1,
.prose h2,
.prose h3 {
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.prose p,
.prose li {
  text-wrap: pretty;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.prose pre,
.prose code {
  font-family: "Iosevka", "JetBrains Mono", monospace;
}

.prose pre {
  overflow-x: auto;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 8px 10px;
}

@media (max-width: 720px) {
  .header-row,
  .admin-header,
  .toolbar,
  .toolbar-actions,
  .bulk-bar,
  .pager {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary-grid,
  .article-list {
    grid-template-columns: 1fr;
  }

  .public-hero,
  .public-row {
    grid-template-columns: 1fr;
  }

  .public-row-meta {
    justify-items: start;
  }

  .list-head {
    display: none;
  }

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

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

  .card {
    padding: 18px;
  }

  .public-hero-copy,
  .featured-card,
  .public-list-shell,
  .reading-body {
    padding: 20px;
  }
}
