/* ==========================================================================
   杭天综合圈子（DYou Circle）主样式（原创）
   ========================================================================== */

:root {
    --ht-primary: #4f6ef7;
    --ht-primary-dark: #3b56d4;
    --ht-bg: #f5f6f8;
    --ht-bg-card: #ffffff;
    --ht-text: #2b2f36;
    --ht-text-muted: #8a919f;
    --ht-border: #e8eaef;
    --ht-radius: 12px;
    --ht-shadow: 0 2px 12px rgba(20, 30, 60, 0.06);
    --ht-header-h: 60px;
    --ht-container: 1200px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--ht-text);
    background: var(--ht-bg);
}

a { color: var(--ht-primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--ht-primary-dark); }

img { max-width: 100%; height: auto; }

/* ---------- 布局容器 ---------- */
.ht-container {
    max-width: var(--ht-container);
    margin: 0 auto;
    padding: 0 16px;
}

.ht-layout {
    display: flex;
    gap: 24px;
    padding-top: 24px;
    padding-bottom: 40px;
    align-items: flex-start;
}

.ht-main-col { flex: 1 1 auto; min-width: 0; }
.ht-sidebar { flex: 0 0 300px; width: 300px; }

/* ---------- 头部 ---------- */
.ht-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--ht-border);
}

.ht-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--ht-header-h);
}

.ht-logo { display: flex; align-items: center; }
.ht-logo img { max-height: 40px; width: auto; }
.ht-logo-text { font-size: 20px; font-weight: 700; color: var(--ht-text); }

.ht-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}
.ht-nav-list > li > a {
    display: block;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--ht-text);
    font-weight: 500;
}
.ht-nav-list > li > a:hover { background: #f0f2f8; color: var(--ht-primary); }
.ht-nav-list > li.current-menu-item > a { color: var(--ht-primary); }

.ht-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
}
.ht-nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ht-text);
    border-radius: 2px;
}

/* ---------- 文章卡片 ---------- */
.ht-post-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.ht-post-card {
    background: var(--ht-bg-card);
    border-radius: var(--ht-radius);
    overflow: hidden;
    box-shadow: var(--ht-shadow);
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.ht-post-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(20,30,60,.1); }

.ht-post-list .ht-post-list-style .ht-post-card.ht-post-list { flex-direction: row; }

.ht-card-thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #eef0f5; }
.ht-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ht-thumb-fallback {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; padding: 16px; text-align: center;
    color: var(--ht-text-muted); font-size: 13px; background: linear-gradient(135deg,#eef0f5,#e3e7f0);
}

.ht-card-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.ht-card-title { margin: 0 0 8px; font-size: 18px; line-height: 1.4; }
.ht-card-title a { color: var(--ht-text); }
.ht-card-title a:hover { color: var(--ht-primary); }
.ht-card-excerpt { color: var(--ht-text-muted); font-size: 14px; margin-bottom: 12px; flex: 1; }

.ht-post-meta {
    display: flex; gap: 14px; color: var(--ht-text-muted); font-size: 13px;
    padding-top: 10px; border-top: 1px dashed var(--ht-border);
}

/* ---------- 文章详情 ---------- */
.ht-single, .ht-page {
    background: var(--ht-bg-card);
    border-radius: var(--ht-radius);
    box-shadow: var(--ht-shadow);
    padding: 28px;
}
.ht-single-title, .ht-page-title { margin: 0 0 12px; font-size: 26px; line-height: 1.4; }
.ht-single-thumb { margin: 16px 0; border-radius: var(--ht-radius); overflow: hidden; }
.ht-single-content { font-size: 16px; }
.ht-single-content h2 { font-size: 22px; margin: 1.4em 0 .6em; }
.ht-single-content h3 { font-size: 19px; margin: 1.3em 0 .5em; }
.ht-single-content img { border-radius: 8px; }
.ht-single-content blockquote {
    margin: 1em 0; padding: 10px 16px; border-left: 4px solid var(--ht-primary);
    background: #f6f8ff; color: #555; border-radius: 0 8px 8px 0;
}
.ht-single-content pre {
    background: #1e2430; color: #e6e9ef; padding: 16px; border-radius: 8px;
    overflow: auto; font-size: 14px;
}
.ht-single-content code { background: #eef0f5; padding: 2px 6px; border-radius: 4px; font-size: 14px; }
.ht-single-content pre code { background: none; padding: 0; }

.ht-single-footer { margin-top: 24px; }
.ht-tags { margin-bottom: 8px; font-size: 14px; }
.ht-tags a { display: inline-block; margin: 0 6px 6px 0; padding: 3px 10px; background: #f0f2f8; border-radius: 20px; color: #555; font-size: 13px; }
.ht-tags a:hover { background: var(--ht-primary); color: #fff; }

.ht-page-links { margin-top: 20px; font-size: 15px; }
.ht-page-links a { margin: 0 4px; padding: 4px 10px; border: 1px solid var(--ht-border); border-radius: 6px; }

.ht-post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; }
.ht-post-nav a { display: block; background: var(--ht-bg-card); border-radius: 10px; padding: 12px 16px; box-shadow: var(--ht-shadow); color: var(--ht-text); }
.ht-post-nav a:hover { color: var(--ht-primary); }

/* ---------- 归档头 ---------- */
.ht-archive-header {
    background: var(--ht-bg-card); border-radius: var(--ht-radius);
    box-shadow: var(--ht-shadow); padding: 22px 24px; margin-bottom: 20px;
}
.ht-archive-title { margin: 0 0 6px; font-size: 22px; }
.ht-archive-desc { color: var(--ht-text-muted); font-size: 14px; }
.ht-author-header { display: flex; align-items: center; gap: 16px; }
.ht-author-avatar img { border-radius: 50%; }

/* ---------- 分页 ---------- */
.ht-pagination { margin-top: 28px; text-align: center; }
.ht-pagination .page-numbers {
    display: inline-block; margin: 0 4px; padding: 7px 14px;
    background: var(--ht-bg-card); border-radius: 8px; box-shadow: var(--ht-shadow);
    color: var(--ht-text); font-size: 14px;
}
.ht-pagination .page-numbers.current { background: var(--ht-primary); color: #fff; }
.ht-pagination .page-numbers:hover:not(.current) { color: var(--ht-primary); }

/* ---------- 侧边栏 ---------- */
.ht-widget {
    background: var(--ht-bg-card); border-radius: var(--ht-radius);
    box-shadow: var(--ht-shadow); padding: 18px 20px; margin-bottom: 20px;
}
.ht-widget-title { margin: 0 0 12px; font-size: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--ht-border); }
.ht-widget ul { list-style: none; margin: 0; padding: 0; }
.ht-widget li { padding: 6px 0; border-bottom: 1px dashed var(--ht-border); }
.ht-widget li:last-child { border-bottom: 0; }

/* ---------- 页脚 ---------- */
.ht-footer {
    background: #1e2430; color: #aab2c0; padding: 32px 0; margin-top: 20px;
}
.ht-footer-nav { margin-bottom: 14px; }
.ht-footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 18px; }
.ht-footer-menu a { color: #c3cad6; font-size: 14px; }
.ht-footer-menu a:hover { color: #fff; }
.ht-footer-text { font-size: 13px; }

/* ---------- 搜索 ---------- */
.ht-search-form { display: flex; }
.ht-search-input { flex: 1; padding: 8px 12px; border: 1px solid var(--ht-border); border-radius: 8px 0 0 8px; outline: none; }
.ht-search-input:focus { border-color: var(--ht-primary); }
.ht-search-submit { padding: 8px 16px; background: var(--ht-primary); color: #fff; border: 0; border-radius: 0 8px 8px 0; cursor: pointer; }

/* ---------- 空状态 / 404 ---------- */
.ht-empty { background: var(--ht-bg-card); border-radius: var(--ht-radius); box-shadow: var(--ht-shadow); padding: 60px 20px; text-align: center; color: var(--ht-text-muted); }
.ht-404 { text-align: center; padding: 80px 20px; }
.ht-404-code { font-size: 96px; margin: 0; color: var(--ht-primary); font-weight: 800; }
.ht-404-text { color: var(--ht-text-muted); margin: 8px 0 24px; }
.ht-404-home { display: inline-block; padding: 10px 24px; background: var(--ht-primary); color: #fff; border-radius: 8px; }

/* ---------- 评论 ---------- */
.ht-comments { margin-top: 24px; }
.ht-comments-title { font-size: 18px; }
.ht-comment-list { list-style: none; margin: 0; padding: 0; }
.ht-comment-list .comment { padding: 14px 0; border-bottom: 1px dashed var(--ht-border); }
.ht-comment-list .children { list-style: none; margin: 12px 0 0 48px; padding: 0; }
.comment-body { display: flex; gap: 12px; }
.comment-body .avatar { border-radius: 50%; }
.comment-meta { font-size: 13px; color: var(--ht-text-muted); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--ht-border); border-radius: 8px; font: inherit;
}
.comment-form textarea { min-height: 110px; }
.comment-form .submit { background: var(--ht-primary); color: #fff; border: 0; padding: 10px 24px; border-radius: 8px; cursor: pointer; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .ht-layout { flex-direction: column; }
    .ht-sidebar { flex: 1 1 auto; width: 100%; }

    .ht-nav-toggle { display: flex; }
    .ht-nav {
        display: none;
        position: absolute; top: var(--ht-header-h); left: 0; right: 0;
        background: #fff; border-bottom: 1px solid var(--ht-border); padding: 8px 16px 16px;
    }
    .ht-nav.ht-nav-open { display: block; }
    .ht-nav-list { flex-direction: column; }
}

@media (max-width: 560px) {
    .ht-post-list { grid-template-columns: 1fr; }
    .ht-single, .ht-page { padding: 18px; }
}
