:root {
  --bg: #f2f3f5;
  --card: #f7f8fa;
  --paper: #fff;
  --text: #1d2129;
  --muted: #4e5969;
  --faint: #86909c;
  --line: #e5e6eb;
  --blue: #2f63ff;
  --pink: #ff6b81;
  --rail: 220px;
  --side: 352px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  --radius: 4px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/24px "Varela Round", "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { max-width: 100%; }

.app {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr) var(--side);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg);
}
.rail a, .rail .rail-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  color: #4e5969;
  font-size: 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.rail a:hover, .rail .rail-btn:hover, .rail a.active {
  background: #e8eaed;
  color: var(--text);
}
.rail svg { width: 16px; height: 16px; flex: none; opacity: 0.85; }
.rail .grow { flex: 1; }

.topbar {
  position: fixed;
  top: 10px;
  left: calc(var(--rail) + 24px);
  right: calc(var(--side) + 24px);
  z-index: 30;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.search {
  pointer-events: auto;
  width: min(420px, 100%);
  height: 36px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  padding: 0 16px;
  color: var(--text);
  outline: none;
}
.search::placeholder { color: #c0c4cc; }

.main {
  min-width: 0;
  padding: 56px 18px 48px;
}

.profile { position: relative; margin-bottom: 18px; }
.banner {
  height: 280px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #1b3b4a center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  font-size: 22px;
  letter-spacing: 2px;
}
.banner b { color: var(--pink); font-weight: 700; }
.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 4px;
  background: #fff;
  vertical-align: -2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.who {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 0 20px;
  margin-top: -42px;
  position: relative;
  z-index: 2;
}
.avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #2b2f36 center/cover no-repeat;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  flex: none;
}
.who-txt { padding-bottom: 6px; }
.who h1 { margin: 0; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.follow {
  height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}
.meta { margin: 4px 0 0; color: var(--faint); font-size: 13px; }
.meta a { color: var(--blue); }

.tabs {
  display: flex;
  gap: 22px;
  padding: 14px 20px 10px;
  color: var(--muted);
  font-size: 14px;
}
.tabs a:hover { color: var(--blue); }

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 210px;
  display: flex;
  flex-direction: column;
}
.card h3 {
  margin: 0;
  padding: 20px 20px 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 50px;
}
.card h3 .pin { color: var(--blue); margin-right: 4px; }
.card .desc {
  padding: 0 20px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .desc b { font-weight: 600; color: var(--muted); }
.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px 12px;
  color: var(--faint);
  font-size: 13px;
}
.actions span { display: inline-flex; align-items: center; gap: 4px; }
.actions svg { width: 13px; height: 13px; }
.actions .read {
  margin-left: auto;
  height: 27px;
  padding: 0 12px;
  border: 1px solid var(--blue);
  background: transparent;
  color: var(--blue);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
}
.actions .read:hover { background: var(--blue); color: #fff; }

.post {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px 40px;
}
.post h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.35; }
.post .post-meta { color: var(--faint); font-size: 13px; margin-bottom: 24px; }
.post-body { font-size: 15px; line-height: 1.85; color: #3d3d3d; }
.post-body h2 { font-size: 18px; margin: 28px 0 10px; }
.post-body p, .post-body li { margin: 0 0 12px; }
.post-body a { color: var(--blue); }
.post-body pre {
  background: #f3f3f3;
  padding: 14px 16px;
  border-radius: 4px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.6;
}
.post-body code { font-family: Consolas, Menlo, Monaco, monospace; }
.post-body p code, .post-body li code {
  background: #f3f3f3;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 13px;
}
.back {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--blue);
  font-size: 13px;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

.pager {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}
.pager a, .pager span {
  min-width: 36px;
  height: 32px;
  display: grid;
  place-items: center;
  margin: 0 4px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 13px;
}
.pager a:hover { background: #e8eaed; }
.pager .on { color: var(--blue); font-weight: 700; }

.foot {
  margin-top: 36px;
  text-align: center;
  color: var(--faint);
  font-size: 12px;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--card);
  border-radius: 0 var(--radius) 0 0;
  padding: 16px 18px 32px;
  scrollbar-width: none;
}
.side::-webkit-scrollbar { display: none; }

.cal-art {
  height: 92px;
  border-radius: 8px;
  background: linear-gradient(#dff3ff, #b7e4c7);
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
}
.cal-art .hill { position: absolute; bottom: 0; left: 0; right: 0; height: 28px; background: #7dcea0; border-radius: 40% 40% 0 0; }
.cal-art .tree { position: absolute; bottom: 18px; width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 28px solid #1e8449; }
.cal-art .cabin { position: absolute; bottom: 22px; right: 36px; width: 34px; height: 22px; background: #c0392b; }
.cal-art .cabin:after { content: ""; position: absolute; top: -12px; left: -4px; border-left: 21px solid transparent; border-right: 21px solid transparent; border-bottom: 14px solid #922b21; }
.cal-cap { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.cal-cap b { display: block; color: var(--text); font-weight: 600; }

.cal { width: 100%; border-collapse: collapse; font-size: 13px; text-align: center; color: var(--muted); }
.cal th { font-weight: 500; padding: 6px 0; }
.cal td { padding: 5px 0; }
.cal .today {
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
}
.cal-nav { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); margin: 4px 0 8px; }
.cal-nav button { border: 0; background: none; cursor: pointer; color: inherit; }

.box { margin-top: 22px; }
.box h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.box a {
  display: block;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.box a:hover { color: var(--blue); }

.hidden { display: none !important; }

@media (max-width: 1280px) {
  :root { --rail: 72px; --side: 300px; }
  .rail a span:last-child, .rail .rail-btn span:last-child { display: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { display: block; }
  .rail, .side { display: none; }
  .topbar { left: 12px; right: 12px; }
  .cards { grid-template-columns: 1fr; }
}
