/* ── tenglog — solazy.me style body + TENG sidebar on RIGHT ── */
@import url('https://fonts.googleapis.com/css2?family=Bungee+Shade&family=Bree+Serif&display=swap');

:root {
  --bg: #fff;
  --bg2: #fafafa;
  --text: #000;
  --text2: rgba(0,0,0,.55);
  --text3: rgba(0,0,0,.25);
  --link: #000;
  --border: rgba(0,0,0,.08);
  --accent: #f2020e;
  --max-w: 1200px;
  --side-w: 300px;
  --main-w: 820px;
}

.dark {
  --bg: #131517;
  --bg2: #1e2023;
  --text: #ddd;
  --text2: rgba(255,255,255,.45);
  --text3: rgba(255,255,255,.18);
  --link: #ddd;
  --border: rgba(255,255,255,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Prevent scrollbar-induced layout shifts */
html { overflow-y: scroll; }

body {
  font-family: 'Bree Serif', 'Georgia', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', serif;
  font-size: 1.1em;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none;  }


/* ── Layout: main(left) + side(right) ── */
.body {
  display: flex;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 40px 40px 90px;
  min-height: 100vh;
  gap: 20px;
}

.main {
  flex: 1;
  max-width: var(--main-w);
  padding-right: 60px;
  padding-top: 80px;
  position: relative;
}

.main-inner {
  position: relative;
  max-width: var(--main-w);
  padding-left: 10px;
}


/* ── Right Sidebar (TENG) ── */
.side {
  flex: 0 0 var(--side-w);
  padding-right: 40px;
  padding-top: 80px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  /* Prevent flicker on scroll */
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}
.side::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 80px;
  width: 2px;
  height: 80px;
  background: #f2020e;
}

.side_title {
  font-family: 'Bungee Shade', cursive !important;
  font-size: 36px !important;
  margin-bottom: 8px;
  color: var(--text);
}
.side_title a { color: inherit; text-decoration: none; background: none !important; }

.side_subtitle {
  font-size: 20px;
  font-weight: 300;
  color: var(--text2);
  margin-bottom: 28px;
  padding-bottom: 20px;
}


.side_links {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}
.side_links li { margin: .4em 0; }
.side_links a {
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  color: var(--text);
  transition: color .2s;
  background: none !important;
}

.side .inner {
  padding: 0 40px 40px;
}

.side_social {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}
.side_social a {
  display: inline-flex;
  align-items: center;
  color: var(--text2);
  text-decoration: none;
  
  background: none !important;
}
.side_social a svg { width: 18px; height: 18px; }

/* ── Article List (solazy.me style) ── */
.article-list {
  list-style: none;
  padding: 0;
}
.article-list li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
  line-height: 1.5;
}
.article-list time {
  font-style: italic;
  font-size: .85em;
  color: var(--text3);
  white-space: nowrap;
  min-width: 90px;
}
.article-list .title-link {
  font-size: 1em;
  font-weight: 400;
  background: none !important;
  color: var(--text);
}
.article-list .title-link:hover { background: #000 !important; color: #fff !important; }
.article-list .title-link:hover {
  background: #000 !important;
  color: #fff !important;
}

/* ── Article Detail Page (solazy.me style) ── */
.article-header { margin-bottom: 30px; }
.article-header h1 {
  font-family: 'Bree Serif', serif;
  font-size: 1.6em;
  font-weight: 400;
  color: var(--text);
  margin: 8px 0 12px;
  line-height: 1.3;
}
.article-header time {
  font-style: italic;
  font-size: .9em;
  color: var(--text3);
}

.article-content {
  font-family: 'Bree Serif', 'Georgia', 'PingFang SC', serif;
  font-size: 1em;
  line-height: 1.7;
  color: var(--text);
}
.article-content p { margin-bottom: 1.2em; }
.article-content h1, .article-content h2, .article-content h3 { font-family: 'Bree Serif', serif; font-weight: 400; margin-top: 1.6em; margin-bottom: .6em; }
.article-content h2 { font-size: 1.3em; }
.article-content h3 { font-size: 1.1em; }
.article-content blockquote {
  border-left: 3px solid var(--text);
  padding-left: 1em;
  margin-left: 0;
  color: var(--text2);
  margin-bottom: 1.2em;
}
.article-content pre {
  background: var(--bg2);
  padding: 14px 18px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: .9em;
  margin-bottom: 1.2em;
}
.article-content code { background: var(--bg2); padding: 2px 5px; border-radius: 3px; font-size: .9em; }
.article-content pre code { background: none; padding: 0; }
.article-content img { max-width: 100%; border-radius: 6px; margin: 1em auto; display: block; }
.article-content ul, .article-content ol { padding-left: 1.5em; margin-bottom: 1.2em; }
.article-content li { margin-bottom: .4em; }
.article-content hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

/* ── Tags (under article) ── */
.article-tags { margin: 2em 0 1.5em; display: flex; gap: 8px; flex-wrap: wrap; }
.article-tags a {
  font-size: 13px;
  color: var(--text2);
  text-decoration: none;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  
  background: none !important;
}
.article-tags a:hover { background: none !important; }

/* ── Back Link ── */
.back-link {
  display: inline-block;
  margin-top: 2em;
  font-size: .95em;
  font-weight: 600;
  color: var(--text);
  background: none !important;
  border-bottom: 2px solid transparent;
  
}
.back-link:hover { border-color: var(--text); background: none !important; }

/* ── Footer ── */
.site-foot {
  margin-top: 40px;
  padding-top: 12px;
  border-top: 2px solid var(--text);
  font-size: .85em;
  color: var(--text2);
}

/* ── Theme Toggle ── */
.theme-toggle { position: fixed; top: 20px; right: 20px; z-index: 9; }
.theme-toggle input { display: none; }
.theme-toggle label {
  display: block;
  width: 40px;
  height: 22px;
  border-radius: 12px;
  background: rgba(128,128,128,.2);
  cursor: pointer;
  position: relative;
}
.theme-toggle .handle {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}
.dark .theme-toggle .handle { transform: translateX(18px); }
.theme-toggle svg { position: absolute; top: 5px; width: 12px; height: 12px; }
.theme-toggle .sun { left: 5px; fill: none; stroke: #eab308; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .moon { right: 5px; fill: #64748b; stroke: none; }
.dark .theme-toggle .sun { stroke: #64748b; }
.dark .theme-toggle .moon { fill: #eab308; }

/* ── Loading / Empty ── */
.loading { text-align: center; padding: 60px 20px; color: var(--text2); }
.empty { text-align: center; padding: 60px 20px; color: var(--text2); }
.empty a { color: var(--link); text-decoration: underline; }

/* ── Responsive ── */


/* ── Button (admin) ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; font-family: inherit; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-outline { background: none; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg2); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }


/* ── Responsive: Tablet (matching tengblog.com) ── */
@media (max-width: 1100px) {
  .body { display: block; }
  .side { width: 100%; flex: none; position: static; border-bottom: 1px solid var(--border); border-right: none; text-align: center; padding: 0; }
  .side::after { display: none; }
  .side_title { font-size: 28px !important; margin-top: 0; }
  .side_subtitle { font-size: 16px; }
  .side_links { margin-top: 20px; }
  .side_links li { display: inline-block; margin: .4em; }
  .side_social { justify-content: center; margin-top: 12px; }
  .main { padding: 40px 20px 0; }
  .main-inner { max-width: 680px; margin: 0 auto; }
  .main-inner::before { display: none; }
  .article-list li { margin-bottom: 14px; }
  .site-foot { margin-top: 30px; }
}

/* ── Responsive: Mobile ── */
@media (max-width: 680px) {
  body { font-size: 1em; }
  .side_title { font-size: 24px !important; }
  .side_links a { font-size: 13px; }
  .side_social a svg { width: 16px; height: 16px; }
  .main { padding: 24px 16px 0; }
  .article-list li { flex-direction: column; gap: 2px; margin-bottom: 16px; }
  .article-list time { font-size: .75em; min-width: auto; }
  .article-list .title-link { font-size: .95em; }
  .article-header h1 { font-size: 1.3em; }
  .article-content { font-size: .95em; }
  .site-foot { text-align: center; font-size: .8em; }
}

/* ── Markdown Tables ── */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95em;
  line-height: 1.6;
}

.article-content th,
.article-content td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.article-content th {
  font-weight: 600;
  background: var(--bg2);
  border-bottom: 2px solid var(--border);
}

.article-content tr:hover {
  background: var(--bg2);
}

/* ── Markdown Code Blocks ── */
.article-content pre {
  background: var(--bg2);
  border-radius: 6px;
  padding: 16px;
  margin: 1.5em 0;
  overflow-x: auto;
  font-size: 0.9em;
  line-height: 1.6;
}

.article-content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.article-content code {
  background: var(--bg2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
}

/* ── Markdown Blockquotes ── */
.article-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5em 0;
  padding: 10px 20px;
  color: var(--text2);
  background: var(--bg2);
  border-radius: 0 6px 6px 0;
}

.article-content blockquote p {
  margin: 0;
}

/* ── Markdown Lists ── */
.article-content ul,
.article-content ol {
  margin: 1em 0;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 6px;
  line-height: 1.6;
}

/* ── Markdown Horizontal Rules ── */
.article-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

/* ── Markdown Images ── */
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1em 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ── Markdown Links ── */
.article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(242,2,14,0.3);
  text-underline-offset: 3px;
}

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