/* ============================================================
   糖柚博客 - 全站样式
   主题：肾移植术后知识分享
   ============================================================ */

:root {
  --orange: #f0872b;
  --orange-dark: #d96f16;
  --orange-light: #fff2e6;
  --green: #2fa36b;
  --green-dark: #248456;
  --green-light: #e8f7ef;
  --ink: #2b2f33;
  --ink-soft: #5c6369;
  --ink-muted: #92999f;
  --line: #e9ecef;
  --bg: #f7f8fa;
  --card: #ffffff;
  --shadow: 0 4px 20px rgba(30, 40, 50, 0.06);
  --shadow-hover: 0 10px 32px rgba(30, 40, 50, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

.container {
  width: min(100% - 40px, var(--maxw));
  margin: 0 auto;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--orange), #ffb257);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(240, 135, 43, 0.3);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--ink);
}

.brand-name span {
  color: var(--orange);
}

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

.nav a {
  font-size: 15px;
  color: var(--ink-soft);
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

.nav a:hover,
.nav a.active {
  color: var(--orange);
}

.nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  background: var(--orange);
  border-radius: 2px;
}

/* ---------- Hero 区 ---------- */
.hero {
  background: linear-gradient(135deg, #fff6ec 0%, #eaf7f0 100%);
  border-bottom: 1px solid var(--line);
  padding: 60px 0 52px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-size: 13px;
  color: var(--green-dark);
  background: var(--green-light);
  border: 1px solid #cbead9;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 18px;
  font-weight: 600;
}

.hero h1 {
  font-size: 38px;
  line-height: 1.3;
  font-weight: 800;
  margin-bottom: 14px;
}

.hero h1 em {
  font-style: normal;
  color: var(--orange);
}

.hero p {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 620px;
  margin: 0 auto;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 32px;
}

.hero-stats div {
  text-align: center;
}

.hero-stats strong {
  display: block;
  font-size: 26px;
  color: var(--orange);
  font-weight: 800;
}

.hero-stats span {
  font-size: 13px;
  color: var(--ink-muted);
}

/* ---------- 主体布局 ---------- */
.main-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  padding: 44px 0 60px;
  align-items: start;
}

.section-title {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 20px;
  background: var(--orange);
  border-radius: 2px;
}

/* ---------- 文章卡片 ---------- */
.post-list {
  display: grid;
  gap: 22px;
}

.post-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 240px 1fr;
  transition: transform 0.25s, box-shadow 0.25s;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

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

.post-thumb {
  height: 100%;
  min-height: 168px;
  overflow: hidden;
  position: relative;
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.post-card:hover .post-thumb img {
  transform: scale(1.05);
}

.post-body {
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.post-tag {
  color: var(--green-dark);
  background: var(--green-light);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 12px;
}

.post-body h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 10px;
}

.post-body h2 a:hover {
  color: var(--orange);
}

.post-body p {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-more {
  margin-top: 14px;
  color: var(--orange);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.post-more:hover {
  gap: 9px;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  display: grid;
  gap: 22px;
}

.widget {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.widget h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.cat-list {
  list-style: none;
  display: grid;
  gap: 4px;
}

.cat-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 14px;
  transition: background 0.2s, color 0.2s;
}

.cat-list a:hover {
  background: var(--orange-light);
  color: var(--orange-dark);
}

.cat-list span {
  font-size: 12px;
  color: var(--ink-muted);
  background: var(--bg);
  padding: 1px 8px;
  border-radius: 10px;
}

.about-widget {
  text-align: center;
}

.about-widget .logo-circle {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), #ffb257);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(240, 135, 43, 0.3);
}

.about-widget p {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.8;
}

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

.tag-cloud a {
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--bg);
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  transition: all 0.2s;
}

.tag-cloud a:hover {
  color: var(--orange);
  border-color: var(--orange);
  background: var(--orange-light);
}

/* ---------- 文章详情页 ---------- */
.crumb {
  font-size: 13px;
  color: var(--ink-muted);
  padding: 24px 0 0;
}

.crumb a:hover {
  color: var(--orange);
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  padding: 24px 0 60px;
  align-items: start;
}

.article-main {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 48px;
}

.article-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  margin-bottom: 30px;
}

.article-head h1 {
  font-size: 30px;
  line-height: 1.4;
  font-weight: 800;
  margin: 14px 0 16px;
}

.article-cover {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 30px;
}

.article-content {
  font-size: 16px;
  color: #3a4046;
  line-height: 2;
}

.article-content h2 {
  font-size: 21px;
  font-weight: 700;
  margin: 36px 0 14px;
  padding-left: 14px;
  border-left: 4px solid var(--orange);
  color: var(--ink);
}

.article-content h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 26px 0 10px;
  color: var(--green-dark);
}

.article-content p {
  margin-bottom: 18px;
}

.article-content ul,
.article-content ol {
  margin: 0 0 20px 24px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content strong {
  color: var(--orange-dark);
  font-weight: 700;
}

.tip-box {
  background: var(--green-light);
  border: 1px solid #cbead9;
  border-left: 4px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 28px 0;
  font-size: 14px;
  color: var(--green-dark);
  line-height: 1.8;
}

.tip-box strong {
  color: var(--green-dark);
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.article-nav a {
  color: var(--orange);
  max-width: 45%;
}

.article-nav a:hover {
  text-decoration: underline;
}

.related {
  margin-top: 40px;
}

.related-list {
  display: grid;
  gap: 14px;
}

.related-item {
  display: flex;
  gap: 14px;
  align-items: center;
}

.related-item img {
  width: 84px;
  height: 62px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.related-item a {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.related-item a:hover {
  color: var(--orange);
}

/* ---------- 关于页 ---------- */
.about-hero {
  text-align: center;
  padding: 20px 0 10px;
}

.about-hero .logo-circle {
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), #ffb257);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(240, 135, 43, 0.35);
}

.about-hero h1 {
  font-size: 30px;
  margin-bottom: 6px;
}

.about-hero .sub {
  color: var(--orange);
  font-weight: 600;
  margin-bottom: 26px;
}

.about-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 48px;
  font-size: 16px;
  color: #3a4046;
  line-height: 2;
}

.about-card h2 {
  font-size: 21px;
  margin: 30px 0 14px;
  padding-left: 14px;
  border-left: 4px solid var(--orange);
}

.about-card h2:first-child {
  margin-top: 0;
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: #2c3136;
  color: #c9ced3;
  padding: 44px 0 26px;
  font-size: 14px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.footer-brand .brand-name {
  color: #fff;
}

.footer-brand .brand-name span {
  color: var(--orange);
}

.footer-brand p {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.9;
  max-width: 320px;
  color: #9aa1a8;
}

.footer-links h4 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 14px;
}

.footer-links a {
  display: block;
  font-size: 13px;
  color: #9aa1a8;
  margin-bottom: 8px;
}

.footer-links a:hover {
  color: var(--orange);
}

.footer-bottom {
  text-align: center;
  padding-top: 22px;
  font-size: 13px;
  color: #8b9299;
  line-height: 2;
}

.beian {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9aa1a8;
  transition: color 0.2s;
}

.beian:hover {
  color: var(--orange);
}

.beian img {
  width: 16px;
  height: 16px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .main-wrap,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero h1 {
    font-size: 30px;
  }

  .article-main {
    padding: 28px 24px;
  }

  .article-head h1 {
    font-size: 25px;
  }
}

@media (max-width: 600px) {
  .container {
    width: min(100% - 28px, var(--maxw));
  }

  .nav {
    gap: 16px;
  }

  .nav a {
    font-size: 13px;
  }

  .brand-name {
    font-size: 19px;
  }

  .hero {
    padding: 42px 0 38px;
  }

  .hero h1 {
    font-size: 25px;
  }

  .hero-stats {
    gap: 28px;
  }

  .post-card {
    grid-template-columns: 1fr;
  }

  .post-thumb {
    height: 180px;
    min-height: 0;
  }

  .post-body {
    padding: 20px;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .article-main,
  .about-card {
    padding: 24px 18px;
  }

  .article-content {
    font-size: 15px;
  }

  .article-cover {
    height: 200px;
  }

  .footer-top {
    flex-direction: column;
  }

  .article-nav {
    flex-direction: column;
  }

  .article-nav a {
    max-width: 100%;
  }
}
