@font-face {
  font-family: "M PLUS 1";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/mplus1-latin-v1.woff2") format("woff2");
  /* 不含 U+2000-206F：中文标题里的破折号和弯引号要落到中文字体的全角字形 */
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* 暖色调色板 */
  --bg: #1a1814;
  --surface: #24211c;
  --text-strong: #e6dfd2;
  --text: #c9c1b4;
  --text-2: #9c958a;
  --text-3: #7d776e;
  --desc: #8f887e;
  --line: rgba(230, 223, 210, 0.12);
  --line-strong: rgba(230, 223, 210, 0.28);
  --nav-bg: rgba(26, 24, 20, 0.88);
  --code-bg: rgba(230, 223, 210, 0.07);
  --hover: rgba(230, 223, 210, 0.06);
  --pressed: rgba(230, 223, 210, 0.14);
  --danger: #d9897c;

  /* 字体栈 */
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* 桌面期次排版尺寸约束：正文 680px，右侧速览 200px，间距 40px */
  --measure: 680px;
  --rail: 200px;
  --issue-gap: 40px;
  --content-width: calc(var(--measure) + var(--issue-gap) + var(--rail));
  --container: min(var(--content-width), calc(100vw - 48px));

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.75 var(--font-text);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--pressed);
  color: var(--text-strong);
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  text-decoration-color: var(--line-strong);
}

a:hover {
  color: var(--text-strong);
  text-decoration-color: currentColor;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--text-strong);
  outline-offset: 2px;
}

button {
  font: inherit;
  letter-spacing: inherit;
}

code {
  padding: 0.12em 0.38em;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 0.88em;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

/* 导航 */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: var(--container);
  height: 100%;
  margin: 0 auto;
}

.brand {
  color: var(--text-strong);
  font: 500 16px/22px var(--font-display);
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}

.brand:hover {
  color: #fff;
}

.site-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-links a {
  display: inline-flex;
  align-items: center;
  color: var(--text-2);
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}

.site-links a:hover {
  color: var(--text-strong);
}

.site-links a[aria-current="page"] {
  color: var(--text-strong);
  font-weight: 500;
}

/* 期次页主栅格 */

.issue {
  display: grid;
  grid-template-columns: var(--measure) var(--rail);
  column-gap: var(--issue-gap);
  justify-content: center;
  align-items: start;
  width: var(--container);
  margin: 0 auto;
}

.issue-main {
  min-width: 0;
}

/* 刊头 */

.masthead {
  padding: 48px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 48px;
}

.masthead h1 {
  color: var(--text-strong);
  font: 500 38px/1.2 var(--font-display);
  letter-spacing: -0.02em;
}

.masthead-desc {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 22px;
}

.masthead-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 12px;
  color: var(--text-3);
  font-size: 13px;
  line-height: 20px;
}

.masthead-pager a {
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.15s;
}

.masthead-pager a:hover {
  color: var(--text-strong);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.masthead-pager [aria-disabled="true"] {
  color: var(--text-3);
  opacity: 0.5;
}

/* 侧边速览 */

.toc {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  margin-top: 48px;
  overflow-y: auto;
}

.toc-label {
  margin-bottom: 14px;
  color: var(--text-3);
  font: 500 12px/16px var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc ol {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toc a {
  display: flex;
  gap: 10px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
  text-decoration: none;
  word-break: normal;
  overflow-wrap: break-word;
  text-wrap: pretty;
  transition: color 0.15s;
}

.toc a:hover {
  color: var(--text-strong);
}

.toc-num {
  flex: none;
  width: 18px;
  color: var(--text-3);
  font: 500 12px/20px var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* 条目（连续正文排版，不套卡片） */

.item {
  scroll-margin-top: 80px;
}

.item + .item {
  margin-top: 56px;
  padding-top: 56px;
  border-top: 1px solid var(--line);
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  color: var(--text-3);
  font-size: 13px;
  line-height: 18px;
}

.item-num {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.item-source {
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.15s;
}

.item-source:hover {
  color: var(--text-strong);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.item-meta time {
  color: var(--text-3);
}

.item-title {
  margin-top: 6px;
  color: var(--text-strong);
  font: 600 23px/33px var(--font-display);
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.item-body {
  margin-top: 14px;
}

.item-body p {
  color: var(--text);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  text-wrap: pretty;
}

.item-body p + p {
  margin-top: 16px;
}

.item-why {
  margin-top: 18px;
  padding-left: 14px;
  border-left: 2px solid var(--line-strong);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  text-wrap: pretty;
}

.item-why strong {
  color: var(--text-strong);
  font-weight: 600;
}

.item-more {
  margin-top: 14px;
  color: var(--text-3);
  font-size: 13px;
  line-height: 20px;
}

.item-more a {
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  text-decoration-color: var(--line-strong);
}

.item-more a:hover {
  color: var(--text-strong);
  text-decoration-color: currentColor;
}

/* 标签与评分（作为条目注脚，自然融入正文流） */

.item-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 24px;
  margin-top: 24px;
  padding-top: 0;
  border-top: none;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tags li {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(230, 223, 210, 0.03);
  color: var(--text-3);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.rate {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
}

.rate-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rate-label {
  margin-right: 4px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0.02em;
}

.rate-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-3);
  font: 500 13px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.rate-btn:hover {
  border-color: var(--line-strong);
  color: var(--text-strong);
}

.rate-btn[aria-pressed="true"] {
  border-color: var(--text-strong);
  background: var(--text-strong);
  color: var(--bg);
  font-weight: 600;
}

.rate-reasons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 10px;
  animation: rate-fade-in 0.2s ease-out;
}

.rate-reasons[hidden] {
  display: none;
}

.reason-btn {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.reason-btn:hover {
  border-color: var(--line-strong);
  color: var(--text-strong);
}

.reason-btn[aria-pressed="true"] {
  background: var(--pressed);
  border-color: var(--line-strong);
  color: var(--text-strong);
}

.rate-status {
  color: var(--text-3);
  font-size: 12px;
  line-height: 18px;
}

.rate-status:not(:empty) {
  margin-top: 6px;
}

.rate-status.is-error {
  color: var(--danger);
}

@keyframes rate-fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 往期页 */

.archive {
  width: var(--container);
  margin: 0 auto;
  padding-top: 64px;
}

.archive-title {
  color: var(--text-strong);
  font: 500 36px/44px var(--font-display);
  letter-spacing: -0.02em;
}

.search {
  max-width: var(--measure);
  margin-top: 24px;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: 400 15px/22px var(--font-text);
  letter-spacing: inherit;
  appearance: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  outline: none;
  border-color: var(--line-strong);
}

.search-input::placeholder {
  color: var(--text-3);
}

.search-results {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.search-results:not(.open) {
  display: none;
}

.search-result-item a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-strong);
  text-decoration: none;
}

.search-result-meta,
.search-note {
  color: var(--text-3);
  font: 400 13px/20px var(--font-text);
}

.archive-month {
  margin: 48px 0 20px;
  color: var(--text-strong);
  font: 500 22px/30px var(--font-display);
}

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

.issue-card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.issue-card:hover {
  border-color: var(--line-strong);
  color: inherit;
}

.issue-card-date {
  color: var(--text-3);
  font-size: 13px;
  line-height: 18px;
}

.issue-card-titles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.issue-card-titles li {
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  line-height: 21px;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: pretty;
  transition: color 0.15s;
}

.issue-card:hover .issue-card-titles li {
  color: var(--text-strong);
}

/* 页脚 */

.site-foot {
  margin-top: 80px;
  border-top: 1px solid var(--line);
}

.site-foot-inner {
  width: var(--container);
  margin: 0 auto;
  padding: 32px 0 48px;
  color: var(--text-3);
  font-size: 13px;
  line-height: 20px;
}

.site-foot-inner a {
  color: var(--text-2);
  text-decoration: none;
}

.site-foot-inner a:hover {
  color: var(--text-strong);
  text-decoration: underline;
}

.site-foot-inner p + p {
  margin-top: 8px;
}

/* 响应式断点 */

@media (max-width: 980px) {
  .issue {
    grid-template-columns: minmax(0, 1fr);
  }

  .issue-main {
    display: contents;
  }

  .masthead {
    order: -2;
    margin-bottom: 24px;
    padding-bottom: 24px;
  }

  .toc {
    order: -1;
    position: static;
    max-height: none;
    margin: 0 0 36px;
    padding: 0 0 24px;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

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

@media (max-width: 760px) {
  :root {
    --container: calc(100vw - 40px);
  }

  .site-nav {
    height: 52px;
  }

  .site-links {
    gap: 16px;
  }

  .site-links a {
    font-size: 13px;
  }

  .masthead {
    padding: 32px 0 20px;
    margin-bottom: 24px;
  }

  .masthead h1,
  .archive-title {
    font-size: 28px;
    line-height: 36px;
  }

  .masthead-desc {
    font-size: 13px;
    line-height: 20px;
  }

  .toc a {
    word-break: keep-all;
    overflow-wrap: break-word;
    text-wrap: pretty;
  }

  .item + .item {
    margin-top: 40px;
    padding-top: 40px;
  }

  .item-title {
    font-size: 19px;
    line-height: 28px;
    word-break: keep-all;
    overflow-wrap: break-word;
    text-wrap: pretty;
  }

  .item-body p {
    font-size: 15px;
    line-height: 1.7;
  }

  .item-why {
    font-size: 14px;
    line-height: 1.65;
    padding-left: 12px;
  }

  .item-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .rate {
    align-items: flex-start;
    margin-left: 0;
  }

  .rate-row {
    gap: 8px;
  }

  .rate-reasons {
    justify-content: flex-start;
    gap: 8px;
  }

  .rate-btn {
    width: 32px;
    height: 32px;
  }

  .archive-month {
    font-size: 20px;
    line-height: 28px;
    margin: 36px 0 16px;
  }

  .archive-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rate-btn,
  .reason-btn,
  .issue-card {
    transition: none;
  }

  .rate-reasons {
    animation: none;
  }
}
