/**
 * TextPress - 公共内容样式
 * 所有主题共享，主题开发者无需重复编写
 * 通过 blog_head() 自动引入
 */

/* 文章内容基础样式 */
.post-body {
    font-size: 1.05rem;
    line-height: 1.9;
}

.post-body p {
    margin-bottom: 1.5em;
}

/* 标题 */
.post-body h1, .post-body h2, .post-body h3, 
.post-body h4, .post-body h5, .post-body h6 {
    margin: 2em 0 1em;
    font-weight: 700;
    line-height: 1.4;
}
.post-body h1 { font-size: 2rem; }
.post-body h2 { font-size: 1.6rem; padding-bottom: 0.5em; border-bottom: 2px solid #e2e8f0; }
.post-body h3 { font-size: 1.3rem; }
.post-body h4 { font-size: 1.1rem; }

/* 链接 */
.post-body a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}
.post-body a:hover {
    border-bottom-color: #667eea;
}

/* 图片 */
.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5em 0;
}
.post-body figure {
    margin: 2em 0;
}
.post-body figcaption {
    text-align: center;
    color: #718096;
    font-size: 0.9rem;
    margin-top: 0.5em;
}

/* 列表 */
.post-body ul, .post-body ol {
    margin: 1.5em 0;
    padding-left: 2em;
}
.post-body li {
    margin-bottom: 0.5em;
}
.post-body ul li { list-style-type: disc; }
.post-body ol li { list-style-type: decimal; }
.post-body ul ul, .post-body ol ol { margin: 0.5em 0; }

/* 引用 */
.post-body blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em;
    background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%);
    border-left: 4px solid #667eea;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}
.post-body blockquote p:last-child {
    margin-bottom: 0;
}

/* 行内代码 */
.post-body code {
    background: #f1f5f9;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: #e53e3e;
}

/* 代码块 */
.post-body pre {
    margin: 1.5em 0;
    padding: 1.2em 1.5em;
    background: #1e293b;
    border-radius: 8px;
    overflow-x: auto;
}
.post-body pre code {
    background: transparent;
    padding: 0;
    color: #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 表格 */
.post-body table {
    width: 100%;
    margin: 1.5em 0;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.post-body th, .post-body td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.post-body th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}
.post-body tr:nth-child(even) {
    background: #f8fafc;
}
.post-body tr:hover {
    background: #edf2f7;
}

/* 分割线 */
.post-body hr {
    margin: 2em 0;
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

/* 视频/iframe */
.post-body iframe, .post-body video {
    max-width: 100%;
    margin: 1.5em 0;
    border-radius: 8px;
}

/* 高亮标记 */
.post-body mark {
    background: linear-gradient(120deg, rgba(102,126,234,0.3) 0%, rgba(118,75,162,0.3) 100%);
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

/* 删除线 */
.post-body del {
    color: #a0aec0;
}

/* 下划线 */
.post-body u {
    text-decoration-color: #667eea;
}

/* 提示框 */
.post-body .tip,
.post-body .notice-tip {
    padding: 1em 1.2em;
    margin: 1.5em 0;
    border-radius: 8px;
    background: #c6f6d5;
    border-left: 4px solid #48bb78;
}
.post-body .warning,
.post-body .notice-warning {
    padding: 1em 1.2em;
    margin: 1.5em 0;
    border-radius: 8px;
    background: #feebc8;
    border-left: 4px solid #ed8936;
}
.post-body .info,
.post-body .notice-info {
    padding: 1em 1.2em;
    margin: 1.5em 0;
    border-radius: 8px;
    background: #bee3f8;
    border-left: 4px solid #4299e1;
}
.post-body .danger,
.post-body .notice-danger {
    padding: 1em 1.2em;
    margin: 1.5em 0;
    border-radius: 8px;
    background: #fed7d7;
    border-left: 4px solid #e53e3e;
}

/* 任务列表 */
.post-body ul[data-checked] {
    list-style: none;
    padding-left: 0;
}
.post-body ul[data-checked] li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* 响应式 */
@media (max-width: 768px) {
    .post-body {
        font-size: 1rem;
    }
    .post-body h1 { font-size: 1.6rem; }
    .post-body h2 { font-size: 1.4rem; }
    .post-body h3 { font-size: 1.2rem; }
    .post-body pre {
        padding: 1em;
        font-size: 0.85rem;
    }
}


/* 小工具公共样式 */
.widget {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.widget-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.widget-title i {
    color: #667eea;
}
.widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.widget-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.widget-list li:last-child {
    border-bottom: none;
}
.widget-list a {
    color: #4a5568;
    text-decoration: none;
    transition: color 0.2s;
}
.widget-list a:hover {
    color: #667eea;
}
.widget-count, .widget-date {
    font-size: 0.8rem;
    color: #a0aec0;
}

/* 搜索小工具 */
.widget-search form {
    display: flex;
    gap: 8px;
}
.widget-search-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}
.widget-search-input:focus {
    outline: none;
    border-color: #667eea;
}
.widget-search-btn {
    padding: 10px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* 标签云 */
.widget-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.widget-tag-cloud .tag {
    padding: 5px 12px;
    background: #f1f5f9;
    color: #4a5568;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
}
.widget-tag-cloud .tag:hover {
    background: #667eea;
    color: white;
}

/* 关于我小工具 */
.widget-about-content {
    text-align: center;
}
.widget-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 15px;
    object-fit: cover;
}
.widget-name {
    font-size: 1.1rem;
    color: #2d3748;
    margin: 0 0 10px;
}
.widget-bio {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}
