:root {
  --bg-paper: #F7F5F0;
  --bg-surface: #EFECE5;
  --bg-card: #FAF8F4;
  --ink: #1C1B19;
  --ink-2: #524F4A;
  --ink-3: #8A867E;
  --border: #D9D5CC;
  --border-strong: #1C1B19;
  --accent: #B83A2A;
  --accent-soft: #F7EAE7;
  --font-serif: "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, Menlo, monospace;
  --header-h: 52px;
  --player-h: 64px;
  --max-w: 1080px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
}

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

button, input {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

code, pre {
  font-family: var(--font-mono);
}

[hidden] {
  display: none !important;
}

/* 顶部极简导航 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  background: var(--bg-paper);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-w);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.brand-domain {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

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

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 12px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
}

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

.nav-btn.is-active {
  color: var(--ink);
  border-bottom: 1.5px solid var(--ink);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.text-btn {
  background: transparent;
  border: 0;
  padding: 2px 4px;
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
}

.text-btn:hover {
  color: var(--accent);
}

/* 主区域 */
.site-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px calc(var(--player-h) + 56px);
}

.view-section {
  display: none;
}

.view-section.is-active {
  display: block;
}

/* 两栏博客 */
.blog-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

.post-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 28px);
  max-height: calc(100vh - var(--header-h) - var(--player-h) - 56px);
  overflow-y: auto;
  padding-right: 16px;
  border-right: 1px solid var(--border);
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  padding: 7px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-item:hover {
  background: var(--bg-surface);
}

.post-item.is-active {
  background: var(--bg-surface);
  border-left-color: var(--ink);
}

.post-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.post-item-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.post-item-lock {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.post-item-title {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
  word-break: break-word;
}

.post-item.is-locked .post-item-title {
  color: var(--ink-2);
}

/* 文章正文区 */
.post-canvas {
  min-width: 0;
  max-width: 700px;
}

.post-header {
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.post-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.38;
  color: var(--ink);
}

.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

/* 朴素加密框（对齐 hexo-blog-encrypt） */
.gate-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 28px 24px;
  margin: 12px 0 24px;
}

.gate-prompt {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--ink-2);
}

.gate-form {
  display: flex;
  gap: 8px;
  max-width: 440px;
}

.input-clean {
  flex: 1;
  min-width: 0;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  padding: 8px 12px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}

.input-clean:focus {
  border-color: var(--ink);
}

.input-sm {
  padding: 5px 9px;
  font-size: 12.5px;
}

.btn-ink {
  background: var(--ink);
  color: var(--bg-paper);
  border: 1px solid var(--ink);
  padding: 8px 16px;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-ink:hover {
  background: #000;
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border-strong);
  padding: 5px 11px;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--bg-paper);
}

.gate-feedback {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--accent);
}

.gate-feedback.is-patch {
  padding: 12px 14px;
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  color: var(--ink);
}

/* 正文块 */
.post-body > * {
  margin-bottom: 18px;
}

.post-p {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.85;
  white-space: pre-line;
}

.code-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  margin: 18px 0;
}

.code-card-head {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}

.code-card-pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.quote-card {
  border-left: 2px solid var(--border-strong);
  background: var(--bg-surface);
  padding: 12px 16px;
  margin: 18px 0;
}

.quote-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.quote-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-line;
}

/* 图片与附件 */
.figure-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  margin: 18px 0;
}

.figure-head {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}

.figure-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.figure-stage {
  padding: 14px;
  background: #FFFFFF;
  display: flex;
  justify-content: center;
  align-items: center;
}

.figure-stage.is-dark {
  background: #000000;
}

.figure-stage img {
  max-width: 100%;
  max-height: 460px;
  height: auto;
  display: block;
}

.file-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
}

.file-name {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
}

/* 站内互链（下一篇 / 支线入口） */
.related-links {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.related-link-btn {
  width: fit-content;
  background: transparent;
  border: 0;
  padding: 3px 0;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
}

.related-link-btn:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* 文内加密折叠段 */
.sublock-box {
  border: 1px solid var(--border);
  background: var(--bg-card);
  margin: 18px 0;
}

.sublock-head {
  padding: 8px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-2);
}

.sublock-body {
  padding: 16px 14px;
}

.sublock-form {
  display: flex;
  gap: 8px;
  max-width: 400px;
}

/* 歌单页 */
.single-col {
  max-width: 820px;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.page-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
}

.playlist-tools {
  width: 240px;
}

.track-table-wrap {
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow-x: auto;
}

.track-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.track-table th {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
}

.track-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.track-table tr:last-child td {
  border-bottom: 0;
}

.track-table tbody tr {
  cursor: pointer;
}

.track-table tbody tr:hover {
  background: var(--bg-surface);
}

.track-table tbody tr.is-playing {
  background: var(--ink);
  color: var(--bg-paper);
}

.track-table tbody tr.is-playing td,
.track-table tbody tr.is-playing a {
  color: var(--bg-paper);
}

.col-no {
  width: 46px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

.col-dur {
  width: 68px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

.col-act {
  width: 96px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* 抽屉 */
.drawer-backdrop {
  position: fixed;
  inset: 0 0 var(--player-h) 0;
  background: rgba(24, 24, 23, 0.3);
  z-index: 40;
}

.playlist-drawer {
  position: fixed;
  right: 24px;
  bottom: calc(var(--player-h) + 10px);
  width: min(460px, calc(100vw - 24px));
  max-height: 64vh;
  background: var(--bg-paper);
  border: 1px solid var(--border-strong);
  z-index: 45;
  display: flex;
  flex-direction: column;
}

.drawer-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drawer-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  line-height: 1;
}

.icon-btn:hover {
  background: var(--ink);
  color: var(--bg-paper);
  border-color: var(--ink);
}

.drawer-list {
  overflow-y: auto;
  flex: 1;
}

.drawer-row {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.drawer-row:hover {
  background: var(--bg-surface);
}

.drawer-row.is-playing {
  background: var(--ink);
  color: var(--bg-paper);
}

.drawer-row-no,
.drawer-row-dur {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

.drawer-row.is-playing .drawer-row-no,
.drawer-row.is-playing .drawer-row-dur,
.drawer-row.is-playing .drawer-row-artist {
  color: #D2CEC4;
}

.drawer-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.drawer-row-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-row-artist {
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 底部固定播放器 */
.player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--player-h);
  background: var(--ink);
  color: var(--bg-paper);
  z-index: 50;
  border-top: 1px solid #000;
}

.player-inner {
  max-width: var(--max-w);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-btn {
  width: 30px;
  height: 30px;
  background: transparent;
  color: var(--bg-paper);
  border: 1px solid #44423E;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.ctrl-btn:hover {
  border-color: var(--bg-paper);
}

.ctrl-play {
  width: 34px;
  height: 34px;
  background: var(--bg-paper);
  color: var(--ink);
  border-color: var(--bg-paper);
}

.ctrl-play:hover {
  background: #FFFFFF;
}

.player-now {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.player-track-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  min-width: 0;
}

.player-no {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #A8A399;
}

.player-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: 12px;
  color: #A8A399;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-time {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #A8A399;
  flex-shrink: 0;
}

.player-progress {
  width: 100%;
  height: 4px;
  background: #3A3834;
  cursor: pointer;
  position: relative;
}

.player-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--bg-paper);
}

.player-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar-btn {
  background: transparent;
  color: var(--bg-paper);
  border: 1px solid #44423E;
  padding: 5px 10px;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.bar-btn:hover {
  border-color: var(--bg-paper);
  color: var(--bg-paper);
}

.bar-btn.is-muted {
  color: #8A867E;
  border-color: #2E2D2A;
}

/* 轻提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--player-h) + 18px);
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg-paper);
  padding: 7px 14px;
  font-size: 12.5px;
  z-index: 60;
}

@media (max-width: 820px) {
  .blog-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .post-sidebar {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 16px;
  }
  .player-artist {
    display: none;
  }
}
