/* ==========================================================================
   slime.tiredslime.space — 卡片式博客样式
   ========================================================================== */

:root {
  --bg: #f2f3f5;
  --card: #ffffff;
  --text: #303540;
  --text-2: #6b7280;
  --muted: #9aa1ad;
  --line: #eef0f3;
  --line-dash: #e6e8ec;
  --accent: #4aa8f0;
  --accent-hover: #2f93e0;
  --accent-soft: #eaf4fd;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 6px 20px rgba(17, 24, 39, .05);
  --shadow-hover: 0 2px 6px rgba(17, 24, 39, .06), 0 14px 34px rgba(17, 24, 39, .09);
  --page-w: 1360px;
  --side-w: 340px;
}

[data-theme="dark"] {
  --bg: #14171c;
  --card: #1b1f26;
  --text: #e7eaf0;
  --text-2: #a4adbb;
  --muted: #79828f;
  --line: #252a32;
  --line-dash: #2b313a;
  --accent: #4aa8f0;
  --accent-hover: #63b6f5;
  --accent-soft: #16283a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .28);
  --shadow-hover: 0 2px 6px rgba(0, 0, 0, .34), 0 14px 34px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

::selection { background: var(--accent-soft); color: var(--accent-hover); }

/* ---------------------------------------------------------------- 布局 */

.page {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 30px 24px 72px;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.main { min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- 侧栏 */

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

.profile {
  padding: 34px 28px 24px;
  text-align: center;
}

.avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  margin: 0 auto;
  object-fit: cover;
  background: var(--accent-soft);
  box-shadow: 0 0 0 5px var(--card), 0 0 0 6px var(--line), 0 8px 20px rgba(17, 24, 39, .1);
}

.name {
  display: block;
  margin: 18px 0 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text);
  transition: color .2s ease;
}

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

.motto {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--muted);
  padding: 0 4px;
}

.stats {
  display: flex;
  justify-content: space-around;
  margin: 22px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
}

.stat b {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat span {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.btn-github {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  margin-top: 20px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color .2s ease, transform .2s ease;
}

.btn-github:hover { background: var(--accent-hover); }
.btn-github:active { transform: scale(.985); }
.btn-github svg { opacity: .95; }

.socials {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
}

.soc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text);
  opacity: .8;
  transition: opacity .2s ease, background-color .2s ease;
}

.soc:hover { opacity: 1; background: var(--line); }
.soc svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- 音乐卡 */

.music-card { padding: 18px 20px 16px; }

.music-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.disc {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(17, 24, 39, .12);
}

.disc img { width: 100%; height: 100%; }

.music-card.is-playing .disc { animation: spin 8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.music-info { min-width: 0; }

.music-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-artist {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-progress { margin-top: 14px; }

.bar {
  position: relative;
  height: 3px;
  border-radius: 3px;
  background: var(--line-dash);
  cursor: pointer;
}

.bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: var(--accent);
  transition: width .15s linear;
}

.bar::after {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--knob, 0%);
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  transition: left .15s linear;
}

.times {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.music-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
}

.mc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line-dash);
  border-radius: 50%;
  background: var(--card);
  color: var(--text-2);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.mc:hover { color: var(--accent); border-color: var(--accent); }
.mc svg { width: 13px; height: 13px; }

.mc.play {
  width: 40px;
  height: 40px;
  border: 0;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(74, 168, 240, .35);
}

.mc.play:hover { background: var(--accent-hover); color: #fff; }
.mc.play svg { width: 15px; height: 15px; }

.music-card.is-empty .mc { opacity: .45; cursor: not-allowed; }
.music-card.is-empty .bar { cursor: default; }

.music-hint {
  margin: 10px 0 0;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
  display: none;
}

.music-card.is-empty .music-hint { display: block; }

/* ---------------------------------------------------------------- 侧栏列表卡 */

.list-card { padding: 18px 20px 16px; }

.card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}

.card-title .ic { display: inline-flex; color: var(--text-2); }
.card-title .ic svg { width: 16px; height: 16px; }

ul { list-style: none; margin: 0; padding: 0; }

.latest li {
  padding: 9px 0;
  border-bottom: 1px dashed var(--line-dash);
}

.latest li:last-child { border-bottom: 0; padding-bottom: 2px; }
.latest li:first-child { padding-top: 2px; }

.latest a {
  display: block;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .2s ease;
}

.latest a:hover { color: var(--accent); }

.latest time {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cat-list li { border-bottom: 1px dashed var(--line-dash); }
.cat-list li:last-child { border-bottom: 0; }

.cat-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  font-size: 13.5px;
  color: var(--text);
  transition: color .2s ease;
}

.cat-list a:hover { color: var(--accent); }

.cat-list em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px;
  color: var(--text-2);
  transition: background-color .2s ease, color .2s ease;
}

.tag-cloud a:hover { background: var(--accent-soft); color: var(--accent-hover); }

.tag-cloud i {
  font-style: normal;
  font-size: 10.5px;
  color: var(--muted);
}

.tag-cloud.big { gap: 10px; }
.tag-cloud.big a { padding: 5px 14px; font-size: 13px; }

/* ---------------------------------------------------------------- 文章卡片流 */

.post-list { display: flex; flex-direction: column; gap: 20px; }

.post-card {
  padding: 30px 34px 32px;
  transition: box-shadow .25s ease, transform .25s ease;
}

.post-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.post-card h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .01em;
}

.post-card h2 a { transition: color .2s ease; }
.post-card h2 a:hover { color: var(--accent); }

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.post-meta .ic { display: inline-flex; margin-right: 5px; vertical-align: -2px; }
.post-meta .ic svg { width: 13px; height: 13px; }

.meta-date { display: inline-flex; align-items: center; }

.meta-cat {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  transition: color .2s ease;
}

.meta-cat:hover { color: var(--accent); }

.post-excerpt {
  margin: 14px 0 0;
  font-size: 14.5px;
  line-height: 2;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------------------------------------------------------------- 文章页 */

.article { padding: 40px 46px 46px; }

.article-head h1 {
  margin: 0;
  font-size: 29px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: .01em;
}

.article-head .post-meta { margin-top: 14px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }

.lead { margin: 14px 0 0; color: var(--text-2); font-size: 14px; }

.prose { margin-top: 26px; font-size: 15.5px; line-height: 2.05; color: var(--text); }

.prose > *:first-child { margin-top: 0; }

.prose p { margin: 0 0 1.35em; }

.prose h1, .prose h2, .prose h3, .prose h4 {
  margin: 2em 0 .8em;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

.prose h1 { font-size: 24px; }
.prose h2 { font-size: 21px; }
.prose h3 { font-size: 18px; }
.prose h4 { font-size: 16px; }

.prose h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 15px;
  margin-right: 10px;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: -2px;
}

.prose a { color: var(--accent-hover); border-bottom: 1px solid currentColor; }
.prose a:hover { color: var(--accent); }

.prose strong { font-weight: 600; }

.prose ul, .prose ol { margin: 0 0 1.35em; padding-left: 1.4em; }

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

.prose li { margin: .35em 0; }

.prose blockquote {
  margin: 1.6em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft);
  color: var(--text-2);
}

.prose blockquote p:last-child { margin-bottom: 0; }

.prose code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .88em;
  color: #c7254e;
}

[data-theme="dark"] .prose code { color: #ff8fb0; }

.prose pre {
  margin: 1.6em 0;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: #1f2430;
  overflow-x: auto;
  line-height: 1.7;
}

.prose pre code {
  padding: 0;
  background: none;
  color: #d6deeb;
  font-size: 13px;
}

.prose img { margin: 1.6em auto; border-radius: var(--radius-sm); }

.prose hr {
  height: 1px;
  margin: 2.4em 0;
  border: 0;
  background: var(--line);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 12.5px;
  color: var(--text-2);
  transition: background-color .2s ease, color .2s ease;
}

.chip:hover { background: var(--accent-soft); color: var(--accent-hover); }
.chip.big { padding: 6px 15px; font-size: 13px; }
.chip i { font-style: normal; font-size: 11px; color: var(--muted); }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 4px;
}

.pn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: box-shadow .25s ease, transform .25s ease;
}

.pn:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.pn.next { justify-content: flex-end; text-align: right; }

.pn span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  overflow: hidden;
}

.pn i {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}

.pn .ic { color: var(--muted); flex: 0 0 auto; }
.pn .ic svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- 索引列表 / 归档 */

.index-list li { border-bottom: 1px dashed var(--line-dash); }
.index-list li:last-child { border-bottom: 0; }

.index-list a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
  font-size: 14.5px;
  transition: color .2s ease;
}

.index-list a:hover { color: var(--accent); }

.index-list time {
  flex: 0 0 auto;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.index-list .c-name { flex: 1 1 auto; min-width: 0; }
.index-list .c-count, .index-list em {
  font-style: normal;
  font-size: 12.5px;
  color: var(--muted);
  flex: 0 0 auto;
}

.archive-year + .archive-year { margin-top: 34px; }

.archive-year h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 600;
}

.archive-year .count {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.archive-year ul li { border-bottom: 1px dashed var(--line-dash); }
.archive-year ul li:last-child { border-bottom: 0; }

.archive-year a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 11px 0;
  font-size: 14.5px;
  transition: color .2s ease;
}

.archive-year a:hover { color: var(--accent); }

.archive-year time {
  flex: 0 0 46px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- 404 */

.notfound { text-align: center; padding: 70px 40px; }

.notfound .code {
  margin: 0;
  font-size: 76px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--accent);
  opacity: .25;
}

.notfound h1 { margin: 18px 0 0; font-size: 22px; font-weight: 600; }
.notfound .lead { margin-bottom: 26px; }

.btn-github.inline {
  display: inline-flex;
  width: auto;
  margin: 0 auto;
  padding: 0 26px;
}

/* ---------------------------------------------------------------- 页脚 */

.site-footer {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 34px 24px 8px;
  text-align: center;
  font-size: 12.5px;
  line-height: 2;
  color: var(--muted);
}

.site-footer p { margin: 0; }

.site-footer a {
  color: var(--muted);
  transition: color .2s ease;
}

.site-footer a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- 主题按钮 */

.theme-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--text-2);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: color .2s ease, transform .2s ease;
}

.theme-toggle:hover { color: var(--accent); transform: rotate(12deg); }
.theme-toggle svg { width: 18px; height: 18px; }

.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------------------------------------------------------------- 响应式 */

@media (max-width: 1180px) {
  :root { --side-w: 300px; }
  .post-card { padding: 26px 28px 28px; }
  .article { padding: 34px 34px 38px; }
}

@media (max-width: 1024px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px 18px 64px;
    gap: 18px;
  }
  .sidebar { gap: 16px; }
  .profile { padding: 28px 24px 22px; }
  .avatar { width: 96px; height: 96px; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .page { padding: 14px 12px 60px; }
  .post-card { padding: 22px 20px 24px; border-radius: 10px; }
  .post-card h2 { font-size: 20px; }
  .post-excerpt { font-size: 13.5px; line-height: 1.95; -webkit-line-clamp: 4; }
  .article { padding: 26px 20px 30px; }
  .article-head h1 { font-size: 23px; }
  .prose { font-size: 15px; line-height: 1.95; }
  .post-nav { grid-template-columns: 1fr; }
  .pn.next { text-align: left; justify-content: flex-start; }
  .theme-toggle { right: 14px; bottom: 14px; width: 36px; height: 36px; }
}
