
/* ===== Nav Logo ===== */
.nav-logo {
    text-decoration: none;
    transition: opacity 0.2s;
}
.nav-logo:hover {
    opacity: 0.8;
}
.nav-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: 0.08em;
    transition: color 0.2s;
}
.nav-logo:hover .nav-logo-text {
    color: #2563eb;
}

/* ===== Nav Search Box (no layering bug) ===== */
.nav-search-form {
    display: flex;
    align-items: center;
}
.nav-search-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    overflow: hidden;
    background: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.nav-search-wrap:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.12);
    background: #fff;
}
.nav-search-input {
    padding: 4px 12px;
    font-size: 0.8125rem;
    outline: none;
    width: 9rem;
    background: transparent;
    color: #374151;
    border: none;
}
.nav-search-input::placeholder {
    color: #9ca3af;
}
.nav-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    background: transparent;
    color: #6b7280;
    border: none;
    cursor: pointer;
    border-left: 1px solid #e5e7eb;
    transition: color 0.15s, background 0.15s;
}
.nav-search-btn:hover {
    color: #2563eb;
    background: #eff6ff;
}

/* ===== Nav Link Active State ===== */
.nav-link.nav-active {
    color: #2563eb;
    font-weight: 500;
}

/* ===== jQuery-pjax Page Transitions ===== */
#pjax-container {
    animation: pjaxFadeIn 0.25s ease;
}
@keyframes pjaxFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Typecho-Three-Theme - Main Styles */
/* Author: RAO | https://qi.loc.cc/ */

/* ===== Global Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
    background-color: #f3f4f6;
    color: #374151;
    line-height: 1.6;
}

/* ===== Navigation ===== */
#site-header {
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.95);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #3b82f6;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ===== Post Content Styles ===== */
.post-content {
    font-size: 0.9375rem;
    line-height: 1.8;
    color: #374151;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    font-weight: 700;
    margin: 1.5em 0 0.75em;
    color: #1f2937;
    line-height: 1.4;
}

.post-content h1 { font-size: 1.75rem; border-bottom: 2px solid #e5e7eb; padding-bottom: 0.5rem; }
.post-content h2 { font-size: 1.5rem; border-bottom: 1px solid #e5e7eb; padding-bottom: 0.4rem; }
.post-content h3 { font-size: 1.25rem; }
.post-content h4 { font-size: 1.125rem; }
.post-content h5 { font-size: 1rem; }
.post-content h6 { font-size: 0.875rem; }

.post-content p {
    margin: 0 0 1rem;
}

.post-content a {
    color: #3b82f6;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.post-content a:hover {
    color: #1d4ed8;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1rem 0;
    display: block;
}

.post-content blockquote {
    border-left: 4px solid #3b82f6;
    padding: 0.75rem 1rem;
    margin: 1.25rem 0;
    background: #eff6ff;
    color: #4b5563;
    border-radius: 0 4px 4px 0;
    font-style: italic;
}

.post-content blockquote p {
    margin: 0;
}

.post-content code {
    background: #f1f5f9;
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-family: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
    font-size: 0.875em;
    color: #e11d48;
}

.post-content pre {
    background: #1e293b;
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.25rem 0;
    line-height: 1.6;
}

.post-content pre code {
    background: transparent;
    color: #e2e8f0;
    padding: 0;
    font-size: 0.875rem;
}

.post-content ul,
.post-content ol {
    margin: 0.75rem 0 1rem 1.5rem;
    padding: 0;
}

.post-content ul { list-style-type: disc; }
.post-content ol { list-style-type: decimal; }

.post-content li {
    margin: 0.3rem 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.875rem;
}

.post-content table th,
.post-content table td {
    border: 1px solid #e5e7eb;
    padding: 0.6rem 0.9rem;
    text-align: left;
}

.post-content table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.post-content table tr:hover {
    background: #f9fafb;
}

.post-content hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2rem 0;
}

/* ===== Tags in post ===== */
.post-content .tag,
.post-tags a {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: #eff6ff;
    color: #3b82f6;
    border-radius: 4px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: background 0.2s;
}

.post-tags a:hover {
    background: #dbeafe;
}

/* ===== Comment Styles ===== */
.comment-item .comment-text p {
    margin: 0 0 0.5rem;
}

.comment-item .comment-text p:last-child {
    margin-bottom: 0;
}

/* ===== Gravatar ===== */
.comment-item img[src*="gravatar"],
.comment-item img[class*="avatar"] {
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

/* ===== Line Clamp Utilities ===== */
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.line-clamp-5 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
}

/* ===== Sidebar ===== */
aside .bg-white {
    border: 1px solid #f0f0f0;
}

/* ===== Back to Top ===== */
#back-to-top {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#back-to-top:hover {
    transform: translateY(-2px);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .post-content h1 { font-size: 1.4rem; }
    .post-content h2 { font-size: 1.25rem; }
    .post-content h3 { font-size: 1.1rem; }
}

/* ===== Prev/Next Article ===== */
.prev-next-nav a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.prev-next-nav a:hover {
    color: #1d4ed8;
}

/* ===== Article Card Hover ===== */
article.bg-white {
    border: 1px solid #f0f0f0;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

article.bg-white:hover {
    transform: translateY(-1px);
}

/* ===== Footer ===== */
footer a {
    transition: color 0.2s;
}

/* ===== Search Highlight ===== */
.search-term {
    background: #fef3c7;
    padding: 0 2px;
    border-radius: 2px;
}

/* ===== Pagination =====
 * Typecho pageNav outputs:
 * <ol class="page-navigator">
 *   <li class="prev"><a href="">‹</a></li>
 *   <li class="current"><a href="">1</a></li>
 *   <li><a href="">2</a></li>
 *   <li class="extend"><span>...</span></li>
 *   <li class="next"><a href="">›</a></li>
 * </ol>
 */

.ttt-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Reset ol default styles */
.ttt-pagination ol.page-navigator {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Every <li> as a block */
.ttt-pagination ol.page-navigator li {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* All <a> and <span> inside li */
.ttt-pagination ol.page-navigator li a,
.ttt-pagination ol.page-navigator li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.6rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 0.8125rem;
    color: #4b5563;
    text-decoration: none;
    background: #ffffff;
    transition: all 0.2s ease;
    line-height: 1;
    white-space: nowrap;
}

/* Hover */
.ttt-pagination ol.page-navigator li a:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

/* Current active page */
.ttt-pagination ol.page-navigator li.current a {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
    font-weight: 600;
}

/* Ellipsis */
.ttt-pagination ol.page-navigator li.extend a,
.ttt-pagination ol.page-navigator li.extend span {
    border-color: transparent;
    background: transparent;
    color: #9ca3af;
    cursor: default;
    pointer-events: none;
    min-width: 1.5rem;
}

/* Prev / Next arrows */
.ttt-pagination ol.page-navigator li.prev a,
.ttt-pagination ol.page-navigator li.next a {
    color: #6b7280;
}

/* Disabled prev/next (first or last page) */
.ttt-pagination ol.page-navigator li.prev span,
.ttt-pagination ol.page-navigator li.next span {
    color: #d1d5db;
    cursor: not-allowed;
    pointer-events: none;
    background: #f9fafb;
}

/* ===== Comment Section ===== */
.comment-list {
    display: block;
}

/* 顶层评论条目 */
.comment {
    display: flex;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid #f0f2f5;
    position: relative;
    transition: background 0.2s;
}

.comment:last-child {
    border-bottom: none;
}

/* 博主评论 */
.comment.comment-by-author {
    background: linear-gradient(135deg, rgba(59,130,246,0.05) 0%, transparent 60%);
    border-radius: 10px;
    padding: 16px 14px;
    border-bottom: none;
    margin-bottom: 2px;
}

.comment.comment-by-author + .comment {
    border-top: 1px solid #f0f2f5;
}

/* 头像 */
.comment-avatar {
    flex-shrink: 0;
    position: relative;
}

.comment-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e8edf2;
    display: block;
    background: #f3f4f6;
    transition: border-color 0.2s, transform 0.2s;
}

.comment-avatar img:hover {
    border-color: #93c5fd;
    transform: scale(1.05);
}

.comment.comment-by-author .comment-avatar img {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

/* 评论主体 */
.comment-body {
    flex: 1;
    min-width: 0;
}

/* 评论头部：作者 + 徽章 + 日期 */
.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 4px 8px;
}

/* 作者名 */
.comment-author {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.comment-author a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.15s;
}

.comment-author a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* 作者徽章 */
.comment-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 20px;
    line-height: 1.6;
    vertical-align: middle;
    margin-left: 4px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.badge-pending {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border-color: #fde68a;
}

/* 日期 */
.comment-date {
    font-size: 0.7rem;
    color: #b0b8c4;
    white-space: nowrap;
    margin-left: auto;
    letter-spacing: 0.01em;
}

/* 评论正文 */
.comment-content {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.75;
    word-break: break-word;
}

.comment-content p {
    margin: 0 0 0.4em;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.comment-content a {
    color: #3b82f6;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.comment-content a:hover {
    color: #1d4ed8;
}

.comment-content code {
    font-size: 0.82em;
    background: #f1f5f9;
    color: #e11d48;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    border: 1px solid #e2e8f0;
}

.comment-content pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    font-size: 0.8rem;
    margin: 10px 0;
    line-height: 1.6;
}

/* 回复按钮 */
.comment-actions {
    margin-top: 8px;
}

.comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    color: #b0b8c4;
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid transparent;
    transition: all 0.18s ease;
    cursor: pointer;
    line-height: 1.4;
}

.comment-reply-link::before {
    content: '↩';
    font-size: 0.8em;
    opacity: 0.8;
}

.comment-reply-link:hover {
    color: #3b82f6;
    background: #eff6ff;
    border-color: #bfdbfe;
}

/* 嵌套子评论 */
.comment-children {
    margin-top: 12px;
    padding-left: 16px;
    border-left: 2px solid #e8edf2;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.comment-child {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px dashed #f0f2f5;
}

.comment-child:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.comment-child .comment-avatar img {
    width: 34px;
    height: 34px;
    border-width: 1.5px;
}

.comment-child .comment-author {
    font-size: 0.82rem;
}

.comment-child .comment-content {
    font-size: 0.82rem;
    color: #4b5563;
}

/* 深层嵌套递进缩进 */
.comment-level-2 .comment-children,
.comment-level-3 .comment-children {
    padding-left: 12px;
    border-left-color: #f0f2f5;
}

/* 悬停高亮 */
.comment:hover > .comment-body .comment-date,
.comment-child:hover .comment-date {
    color: #9ca3af;
}

/* 评论条目淡入动画 */
.comment-list > .comment {
    animation: commentFadeIn 0.3s ease both;
}

@keyframes commentFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 旧版兼容类名 */
.comment-item { display: flex; gap: 14px; }
.comment-item .comment-text p { margin: 0 0 0.4rem; }
.comment-item .comment-text p:last-child { margin-bottom: 0; }
.comment-item img[src*="gravatar"],
.comment-item img[class*="avatar"] {
    border-radius: 50%;
    width: 44px;
    height: 44px;
}

/* 评论表单 */
.comment-form-wrapper h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}
