:root {
    --bg-color: #f4ecd8;        /* 页面背景 */
    --text-color: #5b4636;      /* 正文文字 */
    --link-color: #7d5e2e;      /* 超链接 */
    --link-hover: #a67c52;      /* 悬停链接 */
    --small-color: #8c7b69;     /* 小字信息 */
    --border-color: #dcd0b6;    /* 分隔线 */
    --item-bg: #f9f5e3;         /* 新闻块背景 */
    --hover-bg: #f0e6c8;        /* hover 背景 */
    --title-news: #ffd9a6;      /* 新闻标题行背景 */
    --title-shit: #ffbfa3;      /* 搬屎标题行背景 */
    --title-note: #c4e0a4;      /* 随手记标题行背景 */
    --bg-gradient-start: #fbf7ee;
    --bg-gradient-end: #efe6d2;
    --container-bg: rgba(255,255,255,0.92);
}

/* 主题变量覆盖 */
body.theme-warm {
    --bg-gradient-start: #fff6f0;
    --bg-gradient-end: #f3e6d8;
    --item-bg: #fff8f2;
    --text-color: #5b4636;
    --link-color: #b35a2a;
    --small-color: #947a5f;
    --container-bg: rgba(255,247,238,0.92);
}

body.theme-dark {
    --bg-gradient-start: #222425;
    --bg-gradient-end: #2b2d2f;
    --item-bg: rgba(20,20,20,0.7);
    --text-color: #e7e3dd;
    --link-color: #f2c97d;
    --small-color: #bdb6ad;
    --container-bg: rgba(12,12,12,0.84);
}

/* 全局 */
body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    /* 渐变 + 细微纹理（轻量，重复） */
    background-image: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%),
                      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><circle cx='3' cy='3' r='1' fill='%23000000' fill-opacity='0.03'/></svg>");
    background-repeat: repeat, repeat;
    background-size: auto, 40px 40px;
    margin: 20px auto;
}

/* 容器 */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 18px 20px;
    position: relative;
    /* 半透明底+阴影，让内容浮于背景之上 */
    background: var(--container-bg);
    box-shadow: 0 6px 22px rgba(91,70,54,0.06);
    border-radius: 12px;
}

/* 主题切换（页头内） */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.site-header .left {
    flex: 0 0 auto;
}
.site-header h1 {
    margin: 0;
    font-size: 22px;
    text-align: center;
    flex: 1 1 auto;
    color: var(--text-color);
}
.site-header .theme-switcher {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    align-items: center;
}
.site-header .rss-link { color: var(--link-color); text-decoration: none; }

.theme-btn {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: var(--link-color);
}
.theme-btn.active {
    background: var(--link-color);
    color: #fff;
    border-color: var(--link-color);
}

/* 列表 */
ul { list-style: none; padding-left: 0; }

li {
    margin-bottom: 20px;
    border: none; /* 去掉硬线 */
    border-radius: 12px;
    background-color: var(--item-bg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    padding: 0;
    /* 使用阴影来分离模块（低开销） */
    box-shadow: 0 6px 18px rgba(91,70,54,0.04);
}
li:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(91,70,54,0.06);
}

/* 列表项头部 */
li .item-header {
    padding: 16px;
}

li .item-header h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.4;
}

li .item-header h3 a {
    color: var(--text-color);
}

li .item-header h3 a:hover {
    color: var(--link-color);
}

/* 列表项元信息 */
.item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--small-color);
}

.kind-badge {
    font-weight: 600;
    color: var(--text-color);
}

.time {
    font-size: 12px;
}

/* 来源信息 */
.source-info {
    padding: 0 16px;
    margin: 0 !important;
    font-size: 14px;
    color: var(--small-color);
}

.source-info a {
    color: var(--link-color);
}

/* 列表项内容 */
.item-content {
    padding: 12px 16px;
    margin: 0 !important;
    font-size: 15px;
    line-height: 1.6;
}

.read-more {
    color: var(--link-color);
    font-weight: 600;
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

/* 链接 */
a { color: var(--link-color); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

/* 小字信息 */
small { color: var(--small-color); }

/* 段落 */
p { margin: 5px 0 0 0; }

/* 首页阅读全文提示 */
li p a { font-weight: bold; font-size: 13px; }

/* 分页 */
.pagination { margin: 20px 0; text-align: center; }
.pagination a {
    display: inline-block;
    margin: 0 5px;
    padding: 2px 8px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--link-color);
    text-decoration: none;
    font-size: 13px;
}
.pagination a:hover { background-color: var(--border-color); }
.pagination span { margin: 0 5px; font-size: 13px; color: var(--small-color); }

/* 类型筛选加粗高亮 */
p a[style*="font-weight:bold"] {
    text-decoration: underline;
    color: var(--text-color);
}

/* 筛选栏 */
.filter-bar {
    background-color: var(--item-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-bar span {
    font-weight: 600;
    color: var(--text-color);
}

.filter-bar a {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: white;
    color: var(--link-color);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.filter-bar a:hover {
    background-color: var(--border-color);
    color: var(--text-color);
}

.filter-bar a.active {
    background-color: var(--link-color);
    color: white;
    border-color: var(--link-color);
}

/* ===== 类型说明（kind-intro） ===== */
.kind-intro {
    margin: -10px 0 16px 0;   /* 贴近筛选栏，但不挤 */
    padding: 0 6px;
    text-align: center;
}

.kind-intro p {
    margin: 0 auto;
    max-width: 720px;         /* 防止大屏太散 */
    font-size: 13px;
    line-height: 1.6;
    color: var(--small-color);
    letter-spacing: 0.2px;
}

/* 详情页排版 */
.detail-header {
    background-color: var(--item-bg);
    border: none;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 26px rgba(91,70,54,0.04);
}

.detail-header h1 {
    margin: 0 0 12px 0;
    font-size: 28px;
    line-height: 1.4;
    word-wrap: break-word;
}

.detail-meta {
    color: var(--small-color);
    font-size: 14px;
    line-height: 1.6;
}

.detail-meta a {
    color: var(--link-color);
}

.detail-content {
    background-color: var(--item-bg);
    border: none;
    border-radius: 12px;
    padding: 20px;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-shadow: 0 10px 26px rgba(91,70,54,0.04);
}

.detail-content p {
    margin: 12px 0;
    font-size: 16px;
}

.detail-content p:first-child {
    margin-top: 0;
}

.detail-content a {
    color: var(--link-color);
    text-decoration: underline;
}

/* ===== 站长短评（克制风格） ===== */
.editor-comment {
    margin-top: 24px;
    padding: 14px 18px;
    border-left: 4px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
}

.editor-comment-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--small-color);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.editor-comment-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-color);
}


/* ===== Markdown 内容样式 ===== */

/* 标题 */
.detail-content h1,
.detail-content h2,
.detail-content h3,
.detail-content h4,
.detail-content h5,
.detail-content h6 {
    margin: 18px 0 10px 0;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-color);
}

.detail-content h1 { font-size: 24px; margin-top: 20px; }
.detail-content h2 { font-size: 20px; margin-top: 18px; }
.detail-content h3 { font-size: 18px; margin-top: 16px; }
.detail-content h4 { font-size: 16px; }
.detail-content h5 { font-size: 15px; }
.detail-content h6 { font-size: 14px; }

/* 列表 */
.detail-content ul,
.detail-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.detail-content li {
    margin: 6px 0;
    font-size: 16px;
    line-height: 1.6;
}

.detail-content ul li {
    list-style-type: disc;
}

.detail-content ol li {
    list-style-type: decimal;
}

/* 嵌套列表 */
.detail-content ul ul,
.detail-content ol ol,
.detail-content ul ol,
.detail-content ol ul {
    margin: 6px 0;
    padding-left: 24px;
}

/* 加粗和斜体 */
.detail-content strong,
.detail-content b {
    font-weight: 700;
    color: var(--text-color);
}

.detail-content em,
.detail-content i {
    font-style: italic;
    color: var(--text-color);
}

/* 代码块 */
.detail-content pre {
    background-color: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    margin: 12px 0;
    font-family: "Courier New", monospace;
    font-size: 14px;
    line-height: 1.5;
}

.detail-content code {
    background-color: var(--hover-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "Courier New", monospace;
    font-size: 14px;
    word-break: break-word;
}

.detail-content pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

/* 引用块 */
.detail-content blockquote {
    border-left: 4px solid var(--border-color);
    padding-left: 16px;
    margin: 12px 0;
    color: var(--small-color);
    font-style: italic;
}

.detail-content blockquote p {
    margin: 6px 0;
}

/* 水平线 */
.detail-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
}

/* 表格 */
.detail-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
    font-size: 15px;
}

.detail-content th,
.detail-content td {
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    text-align: left;
}

.detail-content th {
    background-color: var(--hover-bg);
    font-weight: 700;
    color: var(--text-color);
}

.detail-content tr:nth-child(even) {
    background-color: var(--hover-bg);
}

/* 图片 */
.detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 12px 0;
    display: block;
}

/* 任务列表 */
.detail-content input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.detail-content li:has(> input[type="checkbox"]) {
    list-style-type: none;
    padding-left: 0;
    margin-left: 0;
}

.detail-back {
    margin-bottom: 15px;
}

.detail-back a {
    font-size: 16px;
    padding: 8px 12px;
    background-color: var(--item-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: inline-block;
    transition: background 0.2s ease;
}

.detail-back a:hover {
    background-color: var(--hover-bg);
}

/* 移动端自适应 */
@media screen and (max-width: 768px) {
    /* 基础字体 */
    body {
        font-size: 16px;
        line-height: 1.8;
        margin: 15px auto;
    }
    
    h1 { font-size: 24px; margin: 15px 0 10px 0; }
    h2 { font-size: 20px; margin: 12px 0 8px 0; }
    
    /* 容器和布局 */
    .container {
        padding: 0 12px;
        max-width: 100%;
    }
    
    /* 列表项 */
    li {
        margin-bottom: 16px;
    }
    
    li .item-header {
        padding: 14px;
    }
    
    li .item-header h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .item-meta {
        gap: 8px;
        font-size: 12px;
    }
    
    .source-info {
        padding: 0 14px;
        font-size: 13px;
    }
    
    .item-content {
        padding: 10px 14px;
        font-size: 15px;
    }
    
    .read-more {
        font-size: 14px;
    }
    
    /* 筛选栏 */
    .filter-bar {
        padding: 10px 12px;
        gap: 8px;
        margin-bottom: 16px;
    }
    
    .filter-bar span {
        font-size: 14px;
    }
    
    .filter-bar a {
        padding: 6px 12px;
        font-size: 13px;
    }
/* ===== 类型说明（kind-intro）移动端 ===== */
    .kind-intro {
        margin: -6px 0 14px 0;
        padding: 0 4px;
    }

    .kind-intro p {
        max-width: 100%;
        font-size: 14px;
        line-height: 1.7;
    }

    
    /* 主题切换条 */
    .theme-switcher {
        font-size: 13px;
        padding: 6px 8px;
        top: 5px;
        right: 5px;
    }
    
    .theme-switcher a {
        margin-left: 8px;
    }
    
    /* 分页 */
    .pagination a {
        margin: 0 3px;
        padding: 4px 10px;
        font-size: 14px;
    }
    
    .pagination span {
        font-size: 14px;
    }
    
    /* 详情页 Markdown 样式移动端自适应 */
    .detail-content {
        padding: 16px 12px;
    }
    
    .detail-content h1 { font-size: 20px; margin-top: 16px; }
    .detail-content h2 { font-size: 18px; margin-top: 14px; }
    .detail-content h3 { font-size: 16px; margin-top: 12px; }
    .detail-content h4 { font-size: 15px; }
    .detail-content h5 { font-size: 14px; }
    .detail-content h6 { font-size: 13px; }
    
    .detail-content p {
        font-size: 15px;
        margin: 10px 0;
    }
    
    .detail-content ul,
    .detail-content ol {
        padding-left: 20px;
        margin: 10px 0;
    }
    
    .detail-content li {
        margin: 5px 0;
        font-size: 15px;
    }
    
    .detail-content pre {
        padding: 10px;
        font-size: 13px;
        margin: 10px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .detail-content code {
        font-size: 13px;
    }
    
    .detail-content blockquote {
        padding-left: 12px;
        margin: 10px 0;
    }
    
    .detail-content table {
        font-size: 13px;
        margin: 10px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .detail-content th,
    .detail-content td {
        padding: 8px 10px;
    }
    
    .detail-header {
        padding: 16px 12px;
    }
    
    .detail-header h1 {
        font-size: 22px;
        margin-bottom: 10px;
    }
    
    .detail-meta {
        font-size: 13px;
    }
    .editor-comment {
        padding: 12px 14px;
        margin-top: 20px;
    }

    .editor-comment-body {
        font-size: 14px;
    }
}
