:root {
  --paper: oklch(94.8% 0.018 77);
  --paper-deep: oklch(90.4% 0.025 76);
  --ink: oklch(24% 0.014 54);
  --muted: oklch(50% 0.018 61);
  --line: oklch(81.5% 0.028 75);
  --red: oklch(51.5% 0.125 32);
  --red-dark: oklch(38% 0.09 31);
  --gold: oklch(70% 0.09 78);
  --white: oklch(98.8% 0.008 80);
  --shadow: 0 24px 70px rgba(58, 42, 29, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 76% 4%, rgba(181, 43, 40, 0.09), transparent 23rem),
    linear-gradient(90deg, rgba(32, 29, 25, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 72px 100%, auto;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.23;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.17'/%3E%3C/svg%3E");
}

.masthead {
  max-width: 1500px;
  margin: 0 auto;
  padding: 56px 52px 42px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 3px solid var(--ink);
}

.eyebrow,
.section-label {
  margin: 0 0 9px;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.masthead h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(48px, 6vw, 92px);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 0.96;
}

.subtitle {
  margin: 18px 0 0;
  color: var(--muted);
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  letter-spacing: 0.08em;
}

.issue-stamp {
  width: 132px;
  height: 132px;
  display: grid;
  place-content: center;
  text-align: center;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  transform: rotate(5deg);
}

.issue-stamp strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 46px;
  line-height: 0.95;
}

.issue-stamp span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.layout {
  max-width: 1500px;
  min-height: calc(100vh - 250px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px 1fr;
}

.sidebar {
  padding: 42px 34px 80px 52px;
  border-right: 1px solid var(--line);
}

.progress-card {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.progress-number {
  margin: 13px 0;
  font-family: Georgia, serif;
  font-size: 58px;
  line-height: 1;
}

.progress-number small {
  color: var(--muted);
  font-size: 19px;
}

.progress-track {
  height: 4px;
  overflow: hidden;
  background: var(--paper-deep);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
  transition: width 420ms ease;
}

.progress-card > p,
.editor-note p {
  margin: 13px 0 0;
  color: var(--muted);
  font-family: "Songti SC", "STSong", serif;
  font-size: 13px;
  line-height: 1.8;
}

.filters {
  padding: 28px 0;
  display: grid;
}

.filter {
  position: relative;
  padding: 13px 0 13px 18px;
  border: 0;
  border-bottom: 1px solid rgba(207, 196, 179, 0.68);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color 180ms ease, padding 180ms ease;
}

.filter::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 7px;
  height: 7px;
  border: 1px solid var(--red);
  border-radius: 50%;
  transform: translateY(-50%);
}

.filter:hover,
.filter.active {
  padding-left: 25px;
  color: var(--red);
}

.filter.active::before {
  background: var(--red);
}

.editor-note {
  padding: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.42);
}

.content-area {
  padding: 42px 52px 90px;
}

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

.toolbar p,
.preview-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.search-box {
  min-width: min(330px, 42vw);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ink);
}

.search-box span {
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.article-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.article-card {
  min-height: 276px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 253, 247, 0.76);
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
  animation: rise-in 420ms both;
}

.article-card:hover {
  position: relative;
  z-index: 1;
  background: var(--white);
  box-shadow: 0 0 0 2px var(--red);
  transform: translateY(-3px);
}

.article-card.published {
  background: rgba(231, 222, 206, 0.58);
  opacity: 0.66;
}

.card-top,
.card-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.card-index {
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 14px;
}

.card-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.article-card.published .card-status {
  color: var(--red-dark);
}

.article-card:not(.published) .card-status {
  padding-bottom: 3px;
  border-bottom: 1px solid var(--gold);
  color: var(--red);
}

.article-card h2 {
  margin: 30px 0 15px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 25px;
  line-height: 1.42;
}

.article-card > p {
  margin: 0 0 28px;
  color: var(--muted);
  font-family: "Songti SC", "STSong", serif;
  font-size: 14px;
  line-height: 1.8;
}

.card-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 90px 30px;
  background: var(--white);
  text-align: center;
  font-family: "Songti SC", "STSong", serif;
}

.article-dialog {
  width: min(1240px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  padding: 0;
  overflow: auto;
  border: 0;
  background: var(--white);
  box-shadow: var(--shadow);
}

.article-dialog::backdrop {
  background: rgba(31, 27, 22, 0.78);
  backdrop-filter: blur(5px);
}

.dialog-shell {
  min-height: 100%;
}

.dialog-header {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 28px 36px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 2px solid var(--ink);
  background: rgba(255, 253, 247, 0.96);
  backdrop-filter: blur(16px);
}

.dialog-meta {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.dialog-header h2 {
  max-width: 940px;
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 30px;
  line-height: 1.35;
}

.close-button {
  min-width: 48px;
  padding: 8px 0;
  flex: 0 0 auto;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.copy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.copy-field {
  min-height: 172px;
  padding: 22px 24px;
  background: var(--white);
}

.copy-field > span {
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.copy-field p {
  min-height: 42px;
  margin: 13px 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 15px;
  line-height: 1.7;
}

.copy-field button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.article-preview-wrap {
  padding: 34px;
  background: var(--paper);
}

.audit-panel {
  width: min(677px, 100%);
  margin: 0 auto 16px;
  padding: 17px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.82);
}

.audit-panel > span,
.audit-panel span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.audit-panel strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 17px;
}

.audit-panel.passed {
  border-top: 2px solid var(--gold);
}

.audit-panel ul {
  max-width: 420px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

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

.primary-button,
.publish-button {
  padding: 13px 22px;
  border: 1px solid var(--red);
  background: var(--red);
  color: #fff;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.primary-button:hover,
.publish-button:hover {
  background: var(--red-dark);
}

.wechat-article {
  width: min(677px, 100%);
  margin: 0 auto;
  padding: 34px 36px 48px;
  background: #fff;
  box-shadow: 0 10px 34px rgba(67, 52, 39, 0.08);
  color: #303030;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.95;
}

.wechat-article .article-lead {
  margin: 0 0 30px;
  padding: 18px 20px;
  border: 1px solid #e8dfd2;
  border-top: 2px solid #a84c3d;
  background: #f7f3ed;
  color: #5b534b;
}

.wechat-article h3 {
  margin: 38px 0 18px;
  color: #202020;
  font-family: "Songti SC", "STSong", serif;
  font-size: 21px;
  line-height: 1.5;
}

.wechat-article p {
  margin: 0 0 20px;
}

.wechat-article .script {
  margin: 24px 0;
  padding: 20px 22px;
  border: 1px solid #ded6cb;
  background: #fffdfa;
  color: #202020;
}

.wechat-article .script strong {
  color: #b52b28;
}

.wechat-article .rule {
  margin: 38px 0 0;
  padding: 24px;
  border-top: 2px solid #202020;
  border-bottom: 1px solid #202020;
  font-family: "Songti SC", "STSong", serif;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.dialog-footer {
  position: sticky;
  bottom: 0;
  z-index: 4;
  padding: 20px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.97);
  backdrop-filter: blur(16px);
}

.dialog-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.publish-button.is-published {
  background: transparent;
  color: var(--red);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@media (max-width: 920px) {
  .masthead {
    padding: 34px 24px 28px;
  }

  .issue-stamp {
    width: 96px;
    height: 96px;
  }

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

  .sidebar {
    padding: 28px 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .editor-note {
    display: none;
  }

  .content-area {
    padding: 30px 24px 70px;
  }

  .copy-grid {
    display: flex;
    gap: 1px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .copy-grid::-webkit-scrollbar {
    display: none;
  }

  .copy-field {
    min-width: min(82vw, 310px);
    flex: 0 0 min(82vw, 310px);
    scroll-snap-align: start;
  }
}

@media (max-width: 680px) {
  .masthead {
    align-items: flex-start;
  }

  .masthead h1 {
    font-size: 49px;
  }

  .subtitle {
    max-width: 240px;
    font-size: 13px;
  }

  .issue-stamp {
    width: 72px;
    height: 72px;
  }

  .issue-stamp strong {
    font-size: 28px;
  }

  .issue-stamp span {
    font-size: 8px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    min-width: 100%;
  }

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

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

  .preview-heading,
  .dialog-footer,
  .audit-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .article-card {
    min-height: 245px;
  }

  .dialog-header,
  .dialog-footer {
    padding: 20px;
  }

  .dialog-header {
    position: sticky;
  }

  .dialog-meta {
    padding-right: 52px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dialog-header h2 {
    padding-right: 44px;
    font-size: 23px;
  }

  .close-button {
    position: absolute;
    top: 18px;
    right: 20px;
  }

  .article-preview-wrap {
    padding: 20px 10px;
  }

  .wechat-article {
    padding: 34px 24px 42px;
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
