@import url('https://fonts.googleapis.com/css2?family=Karla:wght@400;700&family=Newsreader:wght@400;600&display=swap');

:root {
  --bg: #ffffff;
  --text: #444444;
  --muted: #a0a0a0;
  --accent: #e78170;
  --accent-strong: #da6356;
  --nav-bg: #2a2a2a;
  --border: #d9d9d9;
  --soft: #f6f6f6;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --nav-width: 170px;
  --cover-width: 25%;
  --font-sans: "Karla", "Hiragino Sans GB", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Newsreader", "Noto Serif", "Georgia", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  overflow-x: hidden;
}

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

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

#wrapper {
  min-height: 100vh;
}

#nav {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--nav-width);
  background: var(--nav-bg);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  padding-top: 20px;
}

#nav .nav-menu {
  width: 100%;
}

#nav .nav-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 18px;
  color: #ffffff;
  transition: background 0.2s ease, color 0.2s ease;
}

#nav .nav-menu a .icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
}

#nav .nav-menu a svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

#nav .nav-menu a.current,
#nav .nav-menu a:hover {
  background: var(--accent);
  color: #ffffff;
}

#nav .nav-menu a.current {
  pointer-events: none;
}

#nav .nav-menu a.site-name {
  display: none;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav-user {
  position: fixed;
  top: 10px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 1400;
}

.nav-user button {
  border: 1px solid var(--border);
  background: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.nav-user svg {
  width: 16px;
  height: 16px;
  fill: #666;
}

.nav-user .mode-moon {
  display: none;
}

#cover {
  position: fixed;
  left: var(--nav-width);
  top: 0;
  width: var(--cover-width);
  height: 100vh;
  min-width: 280px;
  max-width: 420px;
  background: var(--soft);
  overflow: hidden;
  z-index: 1;
}

#cover .cover-img {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: saturate(0.9);
}

#cover .cover-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.4));
}

#cover .cover-info {
  position: absolute;
  bottom: 60px;
  left: 30px;
  color: #fff;
  z-index: 2;
}

#cover .cover-info h3 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: 1px;
}

#cover .cover-info p {
  margin: 0;
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

#body {
  margin-left: calc(var(--nav-width) + var(--cover-width));
  width: 58.3333%;
  max-width: 1000px;
  position: relative;
  z-index: 5;
  background: #fff;
  min-height: 100vh;
}

.main {
  padding-left: 42px;
}

.main-inner {
  padding-top: 70px;
  padding-left: 0;
}

.page-title {
  position: fixed;
  top: 0;
  left: calc(var(--nav-width) + var(--cover-width));
  right: 0;
  height: 46px;
  border-bottom: 2px solid var(--border);
  background: #fff;
  z-index: 10;
}

.page-title ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 18px;
  display: flex;
  align-items: center;
  height: 100%;
  gap: 4px;
}

.page-title li a {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 14px;
  color: #999;
  transition: background 0.2s ease, color 0.2s ease;
}

.page-title li a:hover {
  background: #f0f0f0;
  color: #555;
}

.page-title li.active {
  border-bottom: 2px solid #555;
  margin-bottom: -2px;
}

.page-title li.page-search {
  margin-left: auto;
}

#search {
  position: relative;
}

#search .text {
  height: 30px;
  padding: 0 34px 0 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  outline: none;
}

#search .submit {
  position: absolute;
  top: 0;
  right: 0;
  border: 0;
  background: transparent;
  width: 32px;
  height: 30px;
  cursor: pointer;
}

#search .submit svg {
  width: 14px;
  height: 14px;
  fill: #888;
}

.section-head h1 {
  font-family: var(--font-serif);
  font-size: 28px;
  margin: 0 0 6px;
}

.section-head p {
  margin: 0 0 20px;
  color: var(--muted);
}

.post {
  padding: 18px 15px 18px 0;
  border-bottom: 1px dashed var(--border);
  animation: fadeUp 0.6s ease both;
}

.post:last-child {
  border-bottom: none;
}

.post-title {
  font-weight: 700;
  color: var(--accent);
  font-size: 18px;
}

.post-title:hover {
  color: var(--accent-strong);
}

.post-header {
  margin-bottom: 6px;
}

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

.post-meta em {
  color: #666;
  margin: 0 6px;
}

.post-desc {
  color: #666;
  font-size: 15px;
}

.post-single .post-title {
  font-size: 28px;
}

.post-content {
  margin-top: 20px;
  font-size: 16px;
  color: #555;
}

.post-content h2,
.post-content h3 {
  font-family: var(--font-serif);
}

.post-content img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.post-tags {
  text-align: center;
  margin-top: 30px;
}

.post-tags a {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 14px;
  background: #eee;
  color: #666;
  margin: 0 4px;
  font-size: 12px;
}

.post-tags a:hover {
  background: var(--accent);
  color: #fff;
}

.page-navigator {
  list-style: none;
  margin: 20px 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.page-navigator li a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 14px;
  background: #f2f2f2;
}

.page-navigator li.current a {
  background: #e4e4e4;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}

.tag-list a {
  padding: 4px 10px;
  background: #eee;
  border-radius: 14px;
  font-size: 13px;
}

.footer {
  padding: 10px 0 12px calc(var(--nav-width) + var(--cover-width));
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: #aaa;
}

.footer-inner {
  padding-left: 20px;
}

.footer a {
  color: #aaa;
}

.fixed-btn {
  position: fixed;
  right: 12px;
  bottom: 18px;
  border: 1px solid #eee;
  border-radius: 50%;
  background: #fff;
  display: none;
}

.fixed-btn a {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

.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;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.night-mode {
  --bg: #3f3f3f;
  --text: #c7c7c7;
  --muted: #b1b1b1;
  --border: #2f2f2f;
  background: #3f3f3f;
}

body.night-mode #body,
body.night-mode .page-title {
  background: #3f3f3f;
}

body.night-mode .post-desc,
body.night-mode .post-content {
  color: #b1b1b1;
}

body.night-mode .nav-user button {
  background: #3a3a3a;
  border-color: #2f2f2f;
}

body.night-mode .nav-user svg {
  fill: #c7c7c7;
}

body.night-mode .page-title li a:hover {
  background: #2f2f2f;
  color: #c7c7c7;
}

body.night-mode .post-tags a {
  background: #2f2f2f;
  color: #c7c7c7;
}

@media (max-width: 1588px) {
  :root {
    --nav-width: 55px;
  }
  #nav .nav-menu a.site-name {
    display: flex;
  }
  #nav .nav-menu a .title {
    display: none;
  }
  .main {
    padding-left: 20px;
  }
}

@media (max-width: 1000px) {
  #body {
    width: 70%;
  }
  .page-title {
    right: 0;
  }
  #search {
    width: 160px;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 46px;
  }
  :root {
    --cover-width: 0%;
  }
  #nav {
    height: auto;
    width: 100%;
    position: fixed;
    padding-top: 0;
  }
  #nav .nav-menu {
    display: flex;
    overflow-x: auto;
    background: var(--nav-bg);
  }
  #nav .nav-menu a {
    flex: 0 0 auto;
  }
  #cover {
    display: none;
  }
  #body {
    width: 100%;
    margin-left: 0;
  }
  .page-title {
    left: 0;
    top: 46px;
  }
  .main {
    padding-left: 10px;
  }
  .nav-user {
    top: 52px;
  }
}

@media (max-width: 480px) {
  .page-title li.page-search {
    display: none;
  }
  .post {
    padding: 16px 6px;
  }
}
