:root {
/*  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-hover: #f1f3f5;
  --bg-card: #ffffff;
  --bg: #fafafa;

  --text-primary: #1a1a2e;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;

  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: rgba(99,102,241,0.12);

  --border: #e9ecef;
  --radius: 12px;
  --radius-sm: 8px;

  --shadow: 0 2px 16px rgba(0,0,0,0.05);
  --shadow-lg: 0 6px 24px rgba(0,0,0,0.08);
  --shadow-hover: 0 10px 36px rgba(0,0,0,0.12);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);*/
}
[data-theme="dark"] {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-hover: #252545;
  --bg-card: #161629;
  --bg: #121222;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-light: rgba(99,102,241,0.15);
  --border: #2d2d44;
}

/* ========== 面包屑 ========== */
.crumb {
    max-width: 1100px;
    margin: 0 auto 24px;
    padding: 0 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.crumb a {
    color: var(--text-secondary);
    transition: var(--transition);
    text-decoration: none;
}
.crumb a:hover {
    color: var(--accent);
}
.crumb i {
    font-size: 0.9rem;
    opacity: 0.4;
}
.crumb span {
    color: var(--text-primary);
    font-weight: 600;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== 文章头部 ========== */
.article-head {
    margin-bottom: 36px;
}
.article-cat {
    margin-bottom: 18px;
}
.article-cat a {
    display: inline-block;
    padding: 6px 18px;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: var(--transition);
    text-decoration: none;
}
.article-cat a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(99,102,241,0.25);
    background: var(--accent-hover);
}
.article-title {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}
.article-info {
    display: flex;
    align-items: center;
    gap: 14px;
}
.article-info img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--border);
    padding: 2px;
    background: var(--bg-card);
    transition: var(--transition);
}
.article-info img:hover {
    transform: scale(1.05);
}
.info-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.info-author {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}
.info-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.info-date i {
    color: var(--accent);
    font-size: 0.85rem;
}

/* 封面图 */
.article-hero,
.post-hero {
    width: 100%;
    max-height: 240px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}
.article-hero img,
.post-hero img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.7s ease;
}
.article-hero:hover img,
.post-hero:hover img {
    transform: scale(1.03);
}

/* 文章正文容器 */
.post-content {
    font-size: 1.02rem;
    line-height: 1.88;
    color: var(--text-primary);
    overflow-x: hidden;
    min-width: 0;
    word-wrap: break-word;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 2.2em;
    margin-bottom: 0.9em;
    font-weight: 600;
    color: var(--text-primary);
    scroll-margin-top: 80px;
}

.post-content h2 {
    font-size: 1.48rem;
    padding-bottom: 0.4em;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.post-content h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 64px;
    height: 3px;
    background: var(--accent);
    border-radius: 3px;
}

.post-content h3 {
    font-size: 1.28rem;
    color: var(--accent);
}

.post-content h4 {
    font-size: 1.12rem;
    color: var(--text-secondary);
}

.post-content p {
    margin-bottom: 1.7em;
}

/* 图片样式 */
.post-content img {
    border-radius: var(--radius-sm);
    margin: 2.2em auto;
    box-shadow: var(--shadow);
    transition: var(--transition);
    max-width: 100%;
    display: block;
}
.post-content img:hover {
    box-shadow: var(--shadow-hover);
}

/* 引用块 */
.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 1.4em 1.8em;
    margin: 2em 0;
    background: var(--bg-secondary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-style: italic;
    position: relative;
}
.post-content blockquote::before {
    content: '"';
    position: absolute;
    top: 12px;
    left: 18px;
    font-size: 3.5rem;
    opacity: 0.12;
    color: var(--accent);
    pointer-events: none;
}

/* ========== 代码块样式 ========== */
.code-block {
  position: relative;
  margin: 1.8em 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-secondary);
  transition: var(--transition);
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.code-header::before {
    content: '● ● ●';
    position: absolute;
    top: 12px;
    left: 90px;
    color: var(--accent);
    letter-spacing: 6px;
    font-size: 0.7rem;
    z-index: 99;
}
.code-lang {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
}
.copy-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition);
}
.copy-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}
.copy-btn.copied {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.code-block pre {
  margin: 0;
  padding: 16px 14px;
  overflow-x: auto;
  background: transparent;
  font-size: 0.88rem;
  line-height: 1.75;
}
.code-block pre code {
  background: transparent;
  padding: 0;
  font-family: "SF Mono","Fira Code","JetBrains Mono",Consolas,monospace;
}

/* 行内代码 */
code:not(pre code) {
  background: var(--accent-light);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent);
  font-family: "SF Mono","Fira Code","JetBrains Mono",Consolas,monospace;
}

/* 列表 */
.post-content ul,
.post-content ol {
    margin: 1.4em 0;
    padding-left: 2em;
}
.post-content ul {
    list-style: none;
    padding-left: 0;
}
.post-content ul li {
    position: relative;
    padding-left: 1.6em;
    margin-bottom: 0.7em;
}
.post-content ul li::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    position: absolute;
    left: 0;
    top: 0.65em;
    opacity: 0.65;
}
.post-content ol li::marker {
    color: var(--accent);
    font-weight: 700;
}

/* 超链接 */
.post-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-light);
    transition: var(--transition);
}
.post-content a:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    padding: 0 4px;
    margin: 0 -4px;
    border-radius: 4px;
}

/* 分割线 */
.post-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 3.4em 0;
    position: relative;
}
.post-content hr::after {
    content: "···";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-primary);
    color: var(--text-muted);
    letter-spacing: 8px;
    padding: 0 24px;
}

/* 表格 */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2.2em 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.post-content th {
    background: var(--accent);
    color: #fff;
    padding: 14px 18px;
    text-align: left;
}
.post-content td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}
.post-content tr:nth-child(even) td {
    background: var(--bg-secondary);
}

/* 强调文字 */
.post-content strong {
    color: var(--accent);
    font-weight: 700;
}
.post-content em {
    color: var(--text-secondary);
}
.post-content del {
    opacity: 0.55;
}

/* 底部标签与上下篇 */
.post-footer {
    margin-top: 80px;
    padding-top: 44px;
    border-top: 1px solid var(--border);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 36px;
}

.tag {
    padding: 8px 18px;
    background: var(--bg-secondary);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: var(--transition);
}
.tag:hover {
    background: var(--accent);
    color: #ffffff;
}

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.post-nav-item {
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.post-nav-item:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.post-nav-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.post-nav-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.98rem;
}

/* 移动端适配 */
@media (max-width: 640px) {
    .article-title {
        font-size: 1.8rem;
    }
    .post-content {
        font-size: 0.96rem;
    }
    .post-nav {
        grid-template-columns: 1fr;
    }
}
