/* ===== 琢玉集完整样式系统 ===== */
/* 整合原始设计优雅细节 + 人文内容样式 */
/* 配色：温润青玉（米白背景 #FAF8F5 + 青玉强调色 #4A7C6F） */
/* 字体：霞鹜文楷（标题）+ 思源宋体（正文） */

/* ===== 引入字体 ===== */
@import url('https://cdn.jsdelivr.net/npm/lxgw-wenkai-webfont@1.1.0/style.css');
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

/* ===== CSS 变量系统 ===== */
:root {
    /* 配色方案：温润青玉 */
    --color-bg: #FAF8F5;           /* 米白背景 */
    --color-bg-card: #FFFFFF;      /* 卡片背景 */
    --color-text: #2C2C2C;         /* 墨玉主文字 */
    --color-text-secondary: #666666; /* 青灰次文字 */
    --color-text-muted: #999999;   /* 浅灰辅助文字 */
    --color-primary: #4A7C6F;      /* 青玉强调色 */
    --color-primary-light: #E8F0ED; /* 浅青玉 */
    --color-border: #E5E5E5;       /* 淡墨边框 */
    --color-border-light: #F0F0F0; /* 更浅边框 */
    
    /* 字体 */
    --font-title: 'LXGW WenKai', '霞鹜文楷', serif;
    --font-body: 'Noto Serif SC', '思源宋体', Georgia, serif;
    --font-sans: 'Noto Sans SC', '思源黑体', sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;
    
    /* 间距 */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* 最大宽度 */
    --max-width: 720px;
    --max-width-wide: 1200px;
    
    /* 过渡 */
    --transition: all 0.2s ease;
}

/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
    color: var(--color-primary);
}

/* ===== 导航栏样式 ===== */
/* Typecho 默认主题的导航栏选择器可能不同，需要根据实际情况调整 */
#header,
.header,
nav {
    position: sticky;
    top: 0;
    background: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border-light);
    z-index: 100;
}

#header a,
.header a,
nav a {
    position: relative;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

#header a:hover,
.header a:hover,
nav a:hover {
    color: var(--color-text);
}

#header a::after,
.header a::after,
nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.2s ease;
}

#header a:hover::after,
.header a:hover::after,
nav a:hover::after {
    width: 100%;
}

/* ===== 主内容区 ===== */
#content,
.content,
.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing-2xl) var(--spacing-xl);
}

/* ===== 文章标题 ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    color: var(--color-text);
    line-height: 1.4;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: var(--spacing-lg);
    letter-spacing: 0.05em;
}

h2 {
    font-size: 1.6rem;
    margin-top: var(--spacing-2xl);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
}

h3 {
    font-size: 1.3rem;
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
}

/* ===== 文章元信息 ===== */
.post-meta,
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xl);
}

/* ===== 文章内容 ===== */
.post-content,
.article-content,
.entry-content {
    font-size: 1.05rem;
    line-height: 1.9;
}

.post-content p,
.article-content p,
.entry-content p {
    margin-bottom: var(--spacing-lg);
}

.post-content a,
.article-content a,
.entry-content a {
    color: var(--color-primary);
    border-bottom: 1px solid transparent;
}

.post-content a:hover,
.article-content a:hover,
.entry-content a:hover {
    border-bottom-color: var(--color-primary);
}

/* ===== 引用块 ===== */
blockquote {
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: var(--color-primary-light);
    border-left: 4px solid var(--color-primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--color-text-secondary);
}

/* ===== 代码块 ===== */
code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 2px 6px;
    background: var(--color-primary-light);
    border-radius: var(--radius-sm);
    color: var(--color-primary);
}

pre {
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-lg);
    background: #282c34;
    border-radius: var(--radius-md);
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
    color: #abb2bf;
    font-size: 0.9rem;
}

/* ===== 列表 ===== */
ul, ol {
    margin: var(--spacing-lg) 0;
    padding-left: var(--spacing-xl);
}

li {
    margin-bottom: var(--spacing-sm);
}

/* ===== 图片 ===== */
img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: var(--spacing-xl) 0;
    box-shadow: var(--shadow-md);
}

/* ===== 分隔线 ===== */
hr {
    border: none;
    border-top: 1px solid var(--color-border-light);
    margin: var(--spacing-2xl) 0;
}

/* ===== 表格 ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-xl) 0;
}

th, td {
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
    text-align: left;
}

th {
    background: var(--color-primary-light);
    font-weight: 600;
}

/* ===== 文章卡片 ===== */
.post-card,
.article-item {
    padding: var(--spacing-xl) 0;
    border-bottom: 1px solid var(--color-border-light);
    transition: var(--transition);
}

.post-card:hover,
.article-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ===== 标签 ===== */
.tag,
.tags a {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    margin-right: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

.tag:hover,
.tags a:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ===== 按钮 ===== */
button,
.btn,
.button {
    padding: var(--spacing-md) var(--spacing-2xl);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

button:hover,
.btn:hover,
.button:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ===== 页脚 ===== */
#footer,
.footer {
    background: var(--color-bg-card);
    border-top: 1px solid var(--color-border-light);
    padding: var(--spacing-2xl) var(--spacing-xl);
    margin-top: var(--spacing-3xl);
    text-align: center;
}

#footer a,
.footer a {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin: 0 var(--spacing-md);
}

#footer a:hover,
.footer a:hover {
    color: var(--color-primary);
}

/* ===== 人文内容样式 ===== */

/* 古籍原文样式 */
.classic-text {
    position: relative;
    padding: 1.5em 2em;
    margin: 1.5em 0;
    background: var(--color-bg);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1.1em;
    line-height: 2;
    letter-spacing: 0.05em;
    color: var(--color-text);
}

.classic-text::before {
    content: "原文";
    position: absolute;
    top: -0.8em;
    left: 1em;
    padding: 0.2em 0.8em;
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-title);
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 3px;
}

/* 今译样式 */
.modern-translation {
    position: relative;
    padding: 1.2em 1.8em 1.2em 2.5em;
    margin: 1.5em 0;
    background: var(--color-bg);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1em;
    line-height: 1.8;
    color: var(--color-text-secondary);
}

.modern-translation::before {
    content: "今译";
    position: absolute;
    top: -0.8em;
    left: 1em;
    padding: 0.2em 0.8em;
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-title);
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 3px;
}

/* 现代解说样式 */
.modern-commentary {
    padding: 1em 0;
    margin: 1em 0;
    font-family: var(--font-body);
    line-height: 1.8;
    color: var(--color-text);
}

.modern-commentary p {
    margin-bottom: 1em;
    text-indent: 2em;
}

.modern-commentary ul,
.modern-commentary ol {
    margin: 1em 0;
    padding-left: 2em;
}

.modern-commentary li {
    margin-bottom: 0.5em;
}

.modern-commentary strong {
    color: var(--color-primary);
    font-weight: 600;
}

/* 古籍注释样式 */
.ancient-commentary {
    background: var(--color-bg);
    border-left: 4px solid var(--color-primary);
    padding: 1.5em;
    font-style: italic;
    color: var(--color-primary);
    margin: 1.5em 0;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
}

/* 引用来源样式 */
.source {
    text-align: right;
    font-size: 0.9em;
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 0.5em;
    font-family: var(--font-body);
}

.source::before {
    content: "—— ";
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    :root {
        --spacing-xl: 1.5rem;
        --spacing-2xl: 2rem;
        --spacing-3xl: 3rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    #content,
    .content,
    .main {
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .post-content,
    .article-content,
    .entry-content {
        font-size: 1rem;
    }
    
    .classic-text,
    .modern-translation {
        padding: 1em 1.2em;
        font-size: 0.95em;
    }
    
    .classic-text::before,
    .modern-translation::before {
        font-size: 0.7em;
        top: -0.7em;
        left: 0.8em;
    }
    
    .modern-commentary {
        font-size: 0.95em;
    }
    
    .modern-commentary p {
        text-indent: 1.5em;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    #header a::after,
    .header a::after,
    nav a::after {
        display: none;
    }
}

/* ===== 打印样式 ===== */
@media print {
    body {
        background: #fff;
        color: #000;
    }
    
    #header,
    .header,
    nav,
    #footer,
    .footer {
        display: none;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .classic-text,
    .modern-translation,
    .ancient-commentary {
        border-left: 2px solid #000;
        background: #f5f5f5;
    }
}
/* ===== 琢玉集增强样式 - 主题栏设计 ===== */

/* ===== 主题栏背景 - 人文与AI融合 ===== */
#header {
    position: relative;
    background: linear-gradient(135deg, 
        rgba(74, 124, 111, 0.03) 0%, 
        rgba(250, 248, 245, 0.95) 50%,
        rgba(74, 124, 111, 0.02) 100%);
    /* 淡雅的山水渐变背景 */
}

/* 添加山水与电路纹路的装饰层 */
#header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        /* 山水轮廓 - 远山 */
        radial-gradient(ellipse 800px 200px at 20% 80%, rgba(74, 124, 111, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse 600px 150px at 80% 70%, rgba(74, 124, 111, 0.03) 0%, transparent 50%),
        /* 电路纹路 - 数据流 */
        linear-gradient(90deg, 
            transparent 0%, 
            rgba(74, 124, 111, 0.02) 20%, 
            transparent 40%,
            rgba(74, 124, 111, 0.015) 60%,
            transparent 80%),
        /* 神经网络节点 */
        radial-gradient(circle 3px at 15% 30%, rgba(74, 124, 111, 0.06) 0%, transparent 100%),
        radial-gradient(circle 2px at 35% 50%, rgba(74, 124, 111, 0.05) 0%, transparent 100%),
        radial-gradient(circle 3px at 65% 25%, rgba(74, 124, 111, 0.06) 0%, transparent 100%),
        radial-gradient(circle 2px at 85% 45%, rgba(74, 124, 111, 0.05) 0%, transparent 100%),
        radial-gradient(circle 2px at 50% 65%, rgba(74, 124, 111, 0.04) 0%, transparent 100%);
    opacity: 0.8;
    pointer-events: none;
    z-index: 0;
}

/* 确保内容在背景之上 */
#header .container {
    position: relative;
    z-index: 1;
}

/* ===== 站点名称 - 放大标题 + 人文AI融合背景 ===== */
.site-name {
    padding: 3.5rem 2rem 2.5rem 2rem;
    background-image: url('images/header-background.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}

#logo {
    font-family: 'Noto Serif SC', '思源宋体', 'SimSun', '宋体', serif !important;
    font-size: 3.5rem !important;
    font-weight: 700 !important;
    color: var(--color-text) !important;
    letter-spacing: 0.15em !important;
    text-shadow: 0 2px 8px rgba(74, 124, 111, 0.1);
    transition: all 0.3s ease;
    display: inline-block;
    line-height: 1.2 !important;
}

#logo:hover {
    color: var(--color-primary);
    transform: translateY(-2px);
    text-shadow: 0 4px 12px rgba(74, 124, 111, 0.15);
}

.site-name .description {
    font-family: 'Noto Serif SC', '思源宋体', 'SimSun', '宋体', serif;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-top: 0.5rem;
    letter-spacing: 0.05em;
    opacity: 0.85;
    display: block;
}

/* ===== 侧边栏搜索框样式 - 简洁版 ===== */
/* ===== 侧边栏标题样式 ===== */
.widget-title {
    font-family: 'LXGW WenKai', '霞鹜文楷', serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}

/* ===== 评论区域标题样式 ===== */
#comments h4,
#response {
    font-family: 'LXGW WenKai', '霞鹜文楷', serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}

.widget form#search {
    position: relative;
    margin-top: 0;
}

.widget form#search .text {
    width: 100%;
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    background: #fff;
    color: var(--color-text);
    transition: all 0.2s ease;
    margin-bottom: 0;
}

.widget form#search .text:focus {
    outline: none;
    border-color: var(--color-text-muted);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.widget form#search .submit {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: transparent;
    color: var(--color-text-muted);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget form#search .submit:hover {
    color: var(--color-text);
}

.widget form#search .submit::before {
    content: '🔍';
    font-size: 1rem;
}

/* ===== 导航栏搜索框 ===== */
#nav-menu {
    padding: 0.6rem 0;
    margin-top: 0;
    border-top: 1px solid var(--color-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

#nav-menu > a {
    display: inline-block;
    padding: 0.5rem 0;
    margin-right: 2rem;
    margin-left: 0;
    font-family: 'LXGW WenKai', '霞鹜文楷', serif;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.05em;
    position: relative;
    transition: all 0.2s ease;
}

#nav-menu > a:last-of-type {
    margin-right: 0;
}

#nav-menu > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

#nav-menu > a:hover {
    color: var(--color-text);
}

#nav-menu > a:hover::after {
    width: 60%;
}

#nav-menu > a.current {
    color: var(--color-primary);
    font-weight: 600;
}

#nav-menu > a.current::after {
    width: 60%;
}

#nav-search {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: auto;
}

#nav-search .nav-search-input {
    width: 200px;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    background: #fff;
    color: var(--color-text);
    transition: all 0.2s ease;
}

#nav-search .nav-search-input:focus {
    outline: none;
    border-color: var(--color-text-muted);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

#nav-search .nav-search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    background: transparent;
    color: var(--color-text-muted);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

#nav-search .nav-search-btn:hover {
    color: var(--color-text);
}

#nav-menu a {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    margin-right: 2rem;
    font-family: 'LXGW WenKai', '霞鹜文楷', serif;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.05em;
    position: relative;
    transition: all 0.2s ease;
}

#nav-menu a:last-child {
    margin-right: 0;
}

#nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

#nav-menu a:hover {
    color: var(--color-text);
}

#nav-menu a:hover::after {
    width: 60%;
}

#nav-menu a.current {
    color: var(--color-primary);
    font-weight: 600;
}

#nav-menu a.current::after {
    width: 60%;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1200px) {
    .site-search {
        position: static;
        transform: none;
        width: 100%;
        max-width: 320px;
        margin: 1.5rem 0;
        right: auto;
        top: auto;
    }
}

@media (max-width: 768px) {
    #logo {
        font-size: 2.8rem !important;
    }
    
    .site-name .description {
        font-size: 1rem;
    }
    
    #nav-menu a {
        margin-right: 1.5rem;
        font-size: 1rem;
        padding: 0.4rem 1rem;
    }
    
    .site-search {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    #logo {
        font-size: 2.2rem !important;
    }
    
    #nav-menu a {
        margin-right: 1rem;
        font-size: 0.95rem;
    }
    
    #nav-menu a::after {
        display: none;
    }
}

/* ===== 侧栏选项卡切换器 ===== */
.sidebar-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: 0.5rem;
}

.sidebar-tab {
    flex: 1;
    padding: 0.6rem 1rem;
    background: transparent;
    border: none;
    font-family: 'LXGW WenKai', '霞鹜文楷', serif;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: var(--radius-sm);
    position: relative;
}

.sidebar-tab:hover {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.sidebar-tab.active {
    color: var(--color-primary);
    background: var(--color-primary-light);
    font-weight: 600;
}

.sidebar-tab.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
}

/* ===== 侧栏内容区域 ===== */
.sidebar-content {
    display: none;
}

.sidebar-content.active {
    display: block;
}

/* ===== 文章目录样式 ===== */
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 0.3rem;
}

.toc-list a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    padding: 0.3rem 0;
    transition: color 0.2s ease;
}

.toc-list a:hover {
    color: var(--color-primary);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .sidebar-tabs {
        gap: 0.3rem;
    }
    
    .sidebar-tab {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
}
