/*
Theme Name: TwentySix
Theme URI: https://typecho.org
Author: TwentySix
Author URI: https://typecho.org
Description: 2026 风格的现代 Typecho 主题：响应式、暗色模式、可配置主题色。
Version: 1.0.0
License: MIT
*/

/* ========== 设计令牌（2026 风格） ========== */
:root {
    --bg: #f4f5f8;
    --surface: #ffffff;
    --surface-2: #eef0f5;
    --text: #17181d;
    --muted: #6b7280;
    --border: #e6e8ef;
    --radius: 18px;
    --radius-sm: 10px;
    --shadow: 0 6px 28px rgba(23, 24, 29, .07);
    --shadow-hover: 0 12px 40px rgba(23, 24, 29, .12);
    --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

/* 主题色（可在后台切换，默认靛蓝） */
:root, html[data-primary="indigo"]  { --primary: #4f46e5; --primary-soft: rgba(79, 70, 229, .1); }
html[data-primary="emerald"] { --primary: #059669; --primary-soft: rgba(5, 150, 105, .1); }
html[data-primary="rose"]    { --primary: #e11d48; --primary-soft: rgba(225, 29, 72, .1); }
html[data-primary="amber"]   { --primary: #d97706; --primary-soft: rgba(217, 119, 6, .1); }

/* 暗色模式 */
html[data-theme="dark"] {
    --bg: #0e1015;
    --surface: #161923;
    --surface-2: #1e2230;
    --text: #e9ebf2;
    --muted: #98a0ae;
    --border: #262b3a;
    --shadow: 0 6px 28px rgba(0, 0, 0, .35);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, .5);
}

/* ========== 基础 ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    transition: background .3s, color .3s;
}
a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.dot { color: var(--muted); margin: 0 .35em; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* ========== 卡片 ========== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform .25s, box-shadow .25s, background .3s, border-color .3s;
}

/* ========== 头部 ========== */
.site-header {
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { font-size: 1.2rem; font-weight: 800; letter-spacing: .02em; }
.logo::first-letter { color: var(--primary); }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a { padding: 8px 14px; border-radius: 999px; font-size: .95rem; color: var(--muted); }
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle, .nav-toggle {
    width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--muted); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: color .2s, border-color .2s;
}
.theme-toggle:hover, .nav-toggle:hover { color: var(--primary); border-color: var(--primary); }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="dark"]  .icon-moon { display: none; }
.nav-toggle { display: none; flex-direction: column; }
.nav-toggle span { display: block; width: 16px; height: 2px; background: currentColor; margin: 2px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ========== 布局 ========== */
#main { display: flex; gap: 28px; padding: 40px 20px 64px; }
.content-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.sidebar { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: 22px; }

/* ========== Hero ========== */
.hero {
    padding: 56px 40px;
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #a855f7));
    border: none;
    color: #fff;
    position: relative; overflow: hidden;
}
.hero::after {
    content: ""; position: absolute; right: -60px; top: -60px;
    width: 220px; height: 220px; border-radius: 50%;
    background: rgba(255, 255, 255, .14);
}
.hero::before {
    content: ""; position: absolute; right: 90px; bottom: -80px;
    width: 160px; height: 160px; border-radius: 50%;
    background: rgba(255, 255, 255, .1);
}
.hero-title { font-size: 2rem; font-weight: 800; letter-spacing: .01em; position: relative; z-index: 1; }
.hero-desc { margin-top: 10px; opacity: .92; max-width: 560px; position: relative; z-index: 1; }

/* ========== 文章卡片 ========== */
.post-card { padding: 30px 34px; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.post-title { font-size: 1.35rem; font-weight: 700; line-height: 1.4; }
.post-card:hover .post-title { color: var(--primary); }
.post-meta { margin-top: 10px; font-size: .85rem; color: var(--muted); }
.post-excerpt { margin-top: 14px; color: var(--muted); }
.post-more { margin-top: 16px; }
.btn-link { font-weight: 600; color: var(--primary); }

/* ========== 归档头 ========== */
.archive-header { padding: 28px 34px; }
.archive-header h1 { font-size: 1.4rem; }
.archive-desc { margin-top: 8px; color: var(--muted); }

/* ========== 文章详情 ========== */
.post-full { padding: 44px 52px; }
.post-full-title { font-size: 2rem; font-weight: 800; line-height: 1.35; }
.post-cover { margin-top: 24px; border-radius: var(--radius); }
.post-content { margin-top: 28px; }
.post-content h2, .post-content h3, .post-content h4 { margin: 1.6em 0 .6em; line-height: 1.4; }
.post-content p { margin: 1em 0; }
.post-content a { color: var(--primary); border-bottom: 1px dashed color-mix(in srgb, var(--primary) 45%, transparent); }
.post-content blockquote {
    margin: 1.2em 0; padding: 14px 20px;
    border-left: 3px solid var(--primary);
    background: var(--primary-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--muted);
}
.post-content pre {
    background: var(--surface-2); padding: 18px 20px; border-radius: var(--radius-sm);
    overflow-x: auto; font-family: var(--mono); font-size: .88rem; line-height: 1.6;
}
.post-content code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.post-content pre code { background: none; padding: 0; }
.post-content ul, .post-content ol { margin: 1em 0; padding-left: 1.6em; }
.post-content img { margin: 1em 0; }
.post-content table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 8px 12px; }
.post-content th { background: var(--surface-2); }
.post-nav {
    margin-top: 36px; padding-top: 24px; border-top: 1px dashed var(--border);
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    color: var(--muted); font-size: .92rem;
}
.post-nav .next { margin-left: auto; text-align: right; }

/* ========== 分页 ========== */
.pagination ul { list-style: none; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pagination li a, .pagination li.current {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 12px;
    border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
    font-size: .9rem; color: var(--muted);
}
.pagination li.current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pagination li a:hover { color: var(--primary); border-color: var(--primary); }

/* ========== 侧边栏 ========== */
.widget { padding: 22px 24px; }
.widget-title { font-size: 1rem; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.widget-title::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--primary); }
.widget ul { list-style: none; }
.widget ul li { padding: 6px 0; font-size: .92rem; display: flex; justify-content: space-between; gap: 10px; }
.widget ul li a { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget ul li a:hover { color: var(--primary); }
.widget .count { color: var(--muted); font-size: .8rem; flex-shrink: 0; }
.search-form { display: flex; gap: 8px; }
.search-form input {
    flex: 1; min-width: 0; height: 40px; padding: 0 14px;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface-2); color: var(--text); font-size: .9rem; outline: none;
}
.search-form input:focus { border-color: var(--primary); }
.search-form button {
    width: 40px; height: 40px; border-radius: 10px; border: none;
    background: var(--primary); color: #fff; font-size: 1.1rem; cursor: pointer;
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud .tag { color: var(--muted); }
.tag-cloud .tag:hover { color: var(--primary); }

/* ========== 评论 ========== */
.comments-area { padding: 30px 34px; }
.comment-list { list-style: none; }
.comment-body { padding: 18px 0; border-bottom: 1px dashed var(--border); }
.comment-body:last-child { border-bottom: none; }
.comment-row { display: flex; gap: 14px; }
.comment-avatar img { width: 40px; height: 40px; border-radius: 50%; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.comment-author { font-weight: 600; font-size: .95rem; }
.author-badge {
    font-size: .7rem; padding: 1px 8px; border-radius: 999px;
    background: var(--primary-soft); color: var(--primary); font-weight: 600;
}
.comment-time { font-size: .78rem; color: var(--muted); }
.comment-content { margin-top: 6px; font-size: .95rem; }
.comment-content p { margin: .4em 0; }
.comment-reply { margin-top: 6px; }
.comment-reply a { font-size: .82rem; color: var(--muted); }
.comment-children { margin-left: 54px; }
.comment-children .comment-body { border-bottom: none; padding: 14px 0 0; }
.comment-page { margin-top: 16px; text-align: center; }
.comment-page a { color: var(--muted); margin: 0 6px; }
.respond { margin-top: 26px; }
.respond-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.respond input, .respond textarea {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface-2); color: var(--text); font-size: .92rem; outline: none;
    font-family: var(--font);
}
.respond input:focus, .respond textarea:focus { border-color: var(--primary); }
.respond textarea { resize: vertical; }
.respond-actions { margin-top: 12px; display: flex; align-items: center; gap: 14px; }
.respond-actions .cancel-comment-reply { font-size: .85rem; color: var(--muted); }
.comments-closed { color: var(--muted); }

/* ========== 按钮 / 空状态 / 404 ========== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 22px; border-radius: 12px; border: none;
    background: var(--primary); color: #fff; font-size: .95rem; font-weight: 600;
    cursor: pointer; transition: opacity .2s, transform .2s;
}
.btn:hover { opacity: .88; color: #fff; transform: translateY(-1px); }
.empty-card { padding: 48px 34px; text-align: center; color: var(--muted); }
.not-found .nf-code { font-size: 4rem; font-weight: 800; background: linear-gradient(135deg, var(--primary), #a855f7); -webkit-background-clip: text; background-clip: text; color: transparent; }
.not-found p { margin: 12px 0 22px; }

/* ========== 页脚 ========== */
.site-footer { border-top: 1px solid var(--border); padding: 26px 0; color: var(--muted); font-size: .88rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ========== 响应式 ========== */
@media (max-width: 960px) {
    .nav-toggle { display: inline-flex; }
    .site-nav {
        display: none; position: absolute; top: 64px; left: 0; right: 0;
        flex-direction: column; gap: 2px; padding: 12px 16px 16px;
        background: var(--surface); border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }
    .site-nav.open { display: flex; }
    #main { flex-direction: column; }
    .sidebar { width: 100%; }
    .post-full { padding: 30px 24px; }
    .respond-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .post-card, .archive-header, .comments-area { padding: 22px 20px; }
    .hero { padding: 36px 24px; }
    .hero-title { font-size: 1.5rem; }
    .post-full-title { font-size: 1.5rem; }
    .footer-inner { flex-direction: column; }
}

/* ========== 无障碍 ========== */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* 用户自定义 CSS（后台注入，由 header 之外的 hook 输出） */
